tizen 2.3 release tizen_2.3 submit/tizen_2.3/20150202.065526 tizen_2.3_release
authorjk7744.park <jk7744.park@samsung.com>
Sun, 1 Feb 2015 05:03:46 +0000 (14:03 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Sun, 1 Feb 2015 05:03:46 +0000 (14:03 +0900)
187 files changed:
CMakeLists.txt
LICENSE [new file with mode: 0755]
LICENSE.Flora [deleted file]
NOTICE
binary_xmlresource/autopopup_configure_bin_parser.cpp
binary_xmlresource/binary_xmlresource.cpp
binary_xmlresource/default_configure_bin_parser.cpp
binary_xmlresource/file_storage.cpp
binary_xmlresource/include/_auto_metadata.h
binary_xmlresource/include/autopopup_configure_bin_parser.h
binary_xmlresource/include/binary_xmlresource.h
binary_xmlresource/include/default_configure_bin_parser.h
binary_xmlresource/include/file_storage.h
binary_xmlresource/include/file_storage_impl.h
binary_xmlresource/include/input_mode_configure_bin_parser.h
binary_xmlresource/include/interface/imetadata_provider.h
binary_xmlresource/include/interface/iparserinfo_provider.h
binary_xmlresource/include/interface/istring_collector.h
binary_xmlresource/include/interface/istring_provider.h
binary_xmlresource/include/key_coordinate_frame_bin_parser.h
binary_xmlresource/include/label_properties_bin_parser.h
binary_xmlresource/include/layout_bin_parser.h
binary_xmlresource/include/magnifier_configure_bin_parser.h
binary_xmlresource/include/metadata.h
binary_xmlresource/include/metadata_bin_parser.h
binary_xmlresource/include/metadata_provider.h
binary_xmlresource/include/modifier_decoration_bin_parser.h
binary_xmlresource/include/nine_patch_file_list_bin_parser.h
binary_xmlresource/include/parserinfo_provider.h
binary_xmlresource/include/string_bin_parser.h
binary_xmlresource/include/string_collector.h
binary_xmlresource/include/string_provider.h
binary_xmlresource/input_mode_configure_bin_parser.cpp
binary_xmlresource/key_coordinate_frame_bin_parser.cpp
binary_xmlresource/label_properties_bin_parser.cpp
binary_xmlresource/layout_bin_parser.cpp
binary_xmlresource/magnifier_configure_bin_parser.cpp
binary_xmlresource/metadata_bin_parser.cpp
binary_xmlresource/modifier_decoration_bin_parser.cpp
binary_xmlresource/nine_patch_file_list_bin_parser.cpp
binary_xmlresource/string_bin_parser.cpp
packaging/libscl-ui.spec
res/put_record.h
res/sclresource.cpp
res/sclresource.h
res/sclresourcekeys.h
res/simple_debug.cpp
res/simple_debug.h
res/simple_debug_test.cpp
scl/gwes/efl/sclanimator-efl.cpp [new file with mode: 0644]
scl/gwes/efl/sclanimator-efl.h [new file with mode: 0644]
scl/gwes/efl/sclevents-efl.cpp [changed mode: 0644->0755]
scl/gwes/efl/sclevents-efl.h
scl/gwes/efl/sclgraphics-efl.cpp
scl/gwes/efl/sclgraphics-efl.h
scl/gwes/efl/sclwindows-efl.cpp
scl/gwes/efl/sclwindows-efl.h
scl/gwes/gtk/sclevents-gtk.cpp
scl/gwes/gtk/sclevents-gtk.h
scl/gwes/gtk/sclgraphics-cairo.cpp
scl/gwes/gtk/sclgraphics-cairo.h
scl/gwes/gtk/sclgraphics-gtk.cpp
scl/gwes/gtk/sclgraphics-gtk.h
scl/gwes/gtk/sclwindows-gtk.cpp
scl/gwes/gtk/sclwindows-gtk.h
scl/gwes/win32/sclevents-win32.cpp
scl/gwes/win32/sclevents-win32.h
scl/gwes/win32/sclgraphics-win32.cpp
scl/gwes/win32/sclgraphics-win32.h
scl/gwes/win32/sclwindows-win32.cpp
scl/gwes/win32/sclwindows-win32.h
scl/include/scl.h
scl/include/sclactionstate.h
scl/include/sclanimator.h [new file with mode: 0644]
scl/include/sclconfig.h
scl/include/sclcontext.h
scl/include/sclcontroller.h
scl/include/scldebug.h
scl/include/scleffect.h
scl/include/sclerroradjustment.h
scl/include/scleventcallback.h
scl/include/scleventhandler.h
scl/include/sclevents.h
scl/include/sclfeedback.h
scl/include/sclfontproxy.h
scl/include/sclgraphics.h
scl/include/sclgwes.h
scl/include/sclheaders.h
scl/include/sclimageproxy.h
scl/include/sclintl.h
scl/include/sclkeydefines.h
scl/include/sclkeyfocushandler.h [new file with mode: 0644]
scl/include/sclresourcecache.h
scl/include/sclstructs.h
scl/include/scltypes.h
scl/include/sclui.h
scl/include/scluibuilder.h
scl/include/scluiimpl.h
scl/include/sclutils.h
scl/include/sclversion.h
scl/include/sclwindows.h
scl/sclactionstate.cpp
scl/sclanimator.cpp [new file with mode: 0644]
scl/sclcontext.cpp
scl/sclcontroller.cpp
scl/scldebug.cpp
scl/scleffect.cpp
scl/sclerroradjustment.cpp
scl/scleventhandler.cpp
scl/sclevents.cpp
scl/sclfeedback.cpp
scl/sclfontproxy.cpp
scl/sclgraphics.cpp
scl/sclgwes.cpp
scl/sclimageproxy.cpp
scl/sclkeyfocushandler.cpp [new file with mode: 0644]
scl/sclresourcecache.cpp
scl/sclui.cpp
scl/scluibuilder.cpp
scl/scluiimpl.cpp
scl/sclutils.cpp
scl/sclwindows.cpp
scl/utils/linux/sclutils-linux.cpp
scl/utils/win32/sclutils-win32.cpp
sclres/sclres.cpp
sclres/sclres.h
sclres/sclres_manager.cpp
sclres/sclres_manager.h
sclres/sclres_type.h
xml2binary/CMakeLists.txt
xml2binary/encode_autopopup_configure.cpp
xml2binary/encode_default_configure.cpp
xml2binary/encode_input_mode_configure.cpp
xml2binary/encode_key_coordinate_frame.cpp
xml2binary/encode_label_properties_frame.cpp
xml2binary/encode_layout.cpp
xml2binary/encode_magnifier_configure.cpp
xml2binary/encode_metadata.cpp
xml2binary/encode_modifier_decoration.cpp
xml2binary/encode_nine_patch.cpp
xml2binary/include/_auto_metadata.h
xml2binary/include/encode_autopopup_configure.h
xml2binary/include/encode_default_configure.h
xml2binary/include/encode_input_mode_configure.h
xml2binary/include/encode_key_coordinate_frame.h
xml2binary/include/encode_label_properties_frame.h
xml2binary/include/encode_layout.h
xml2binary/include/encode_magnifier_configure.h
xml2binary/include/encode_metadata.h
xml2binary/include/encode_modifier_decoration.h
xml2binary/include/encode_nine_patch.h
xml2binary/include/imetadata_encoder.h
xml2binary/include/imetadata_helper.h
xml2binary/include/imetadata_parser.h
xml2binary/include/istring_encoder.h
xml2binary/include/metadata.h
xml2binary/include/metadata_handler.h
xml2binary/include/resource_storage.h
xml2binary/include/resource_storage_impl.h
xml2binary/include/string_encoder.h
xml2binary/include/xml2dat.h
xml2binary/metadata_handler.cpp
xml2binary/xml2dat.cpp
xmlresource/autopopup_configure_parser.cpp
xmlresource/default_configure_parser.cpp
xmlresource/include/autopopup_configure_parser.h
xmlresource/include/default_configure_parser.h
xmlresource/include/input_mode_configure_parser.h
xmlresource/include/label_properties_parser.h
xmlresource/include/layout_parser.h
xmlresource/include/layout_parser_helper.h
xmlresource/include/magnifier_configure_parser.h
xmlresource/include/main_entry_parser.h
xmlresource/include/modifier_decoration_parser.h
xmlresource/include/nine_patch_file_list_parser.h
xmlresource/include/xml_parser_utils.h
xmlresource/include/xmlresource.h
xmlresource/input_mode_configure_parser.cpp
xmlresource/label_properties_parser.cpp
xmlresource/layout_parser.cpp
xmlresource/layout_parser_helper.cpp
xmlresource/magnifier_configure_parser.cpp
xmlresource/main_entry_parser.cpp
xmlresource/modifier_decoration_parser.cpp
xmlresource/nine_patch_file_list_parser.cpp
xmlresource/xml_parser_utils.cpp
xmlresource/xmlresource.cpp

index c29241e..2c6989a 100644 (file)
@@ -40,6 +40,7 @@ SET(SRCS
     scl/gwes/win32/sclgraphics-win32.cpp
     scl/gwes/efl/sclwindows-efl.cpp
     scl/gwes/efl/sclgraphics-efl.cpp
+    scl/gwes/efl/sclanimator-efl.cpp
     scl/gwes/efl/sclevents-efl.cpp
     scl/gwes/win32/sclevents-win32.cpp
     scl/sclfeedback.cpp
@@ -55,6 +56,8 @@ SET(SRCS
     scl/sclcontext.cpp
     scl/sclactionstate.cpp
     scl/sclresourcecache.cpp
+    scl/sclkeyfocushandler.cpp
+    scl/sclanimator.cpp
     res/sclresource.cpp
     res/simple_debug.cpp
 )
diff --git a/LICENSE b/LICENSE
new file mode 100755 (executable)
index 0000000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/LICENSE.Flora b/LICENSE.Flora
deleted file mode 100644 (file)
index 571fe79..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-Flora License
-
-Version 1.1, April, 2013
-
-http://floralicense.org/license/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction,
-and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by
-the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and
-all other entities that control, are controlled by, or are
-under common control with that entity. For the purposes of
-this definition, "control" means (i) the power, direct or indirect,
-to cause the direction or management of such entity,
-whether by contract or otherwise, or (ii) ownership of fifty percent (50%)
-or more of the outstanding shares, or (iii) beneficial ownership of
-such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity
-exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications,
-including but not limited to software source code, documentation source,
-and configuration files.
-
-"Object" form shall mean any form resulting from mechanical
-transformation or translation of a Source form, including but
-not limited to compiled object code, generated documentation,
-and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form,
-made available under the License, as indicated by a copyright notice
-that is included in or attached to the work (an example is provided
-in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form,
-that is based on (or derived from) the Work and for which the editorial
-revisions, annotations, elaborations, or other modifications represent,
-as a whole, an original work of authorship. For the purposes of this License,
-Derivative Works shall not include works that remain separable from,
-or merely link (or bind by name) to the interfaces of, the Work and
-Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original
-version of the Work and any modifications or additions to that Work or
-Derivative Works thereof, that is intentionally submitted to Licensor
-for inclusion in the Work by the copyright owner or by an individual or
-Legal Entity authorized to submit on behalf of the copyright owner.
-For the purposes of this definition, "submitted" means any form of
-electronic, verbal, or written communication sent to the Licensor or
-its representatives, including but not limited to communication on
-electronic mailing lists, source code control systems, and issue
-tracking systems that are managed by, or on behalf of, the Licensor
-for the purpose of discussing and improving the Work, but excluding
-communication that is conspicuously marked or otherwise designated
-in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity
-on behalf of whom a Contribution has been received by Licensor and
-subsequently incorporated within the Work.
-
-"Tizen Certified Platform" shall mean a software platform that complies
-with the standards set forth in the Tizen Compliance Specification
-and passes the Tizen Compliance Tests as defined from time to time
-by the Tizen Technical Steering Group and certified by the Tizen
-Association or its designated agent.
-
-2. Grant of Copyright License.  Subject to the terms and conditions of
-this License, each Contributor hereby grants to You a perpetual,
-worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the
-Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License.  Subject to the terms and conditions of
-this License, each Contributor hereby grants to You a perpetual,
-worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-(except as stated in this section) patent license to make, have made,
-use, offer to sell, sell, import, and otherwise transfer the Work
-solely as incorporated into a Tizen Certified Platform, where such
-license applies only to those patent claims licensable by such
-Contributor that are necessarily infringed by their Contribution(s)
-alone or by combination of their Contribution(s) with the Work solely
-as incorporated into a Tizen Certified Platform to which such
-Contribution(s) was submitted. If You institute patent litigation
-against any entity (including a cross-claim or counterclaim
-in a lawsuit) alleging that the Work or a Contribution incorporated
-within the Work constitutes direct or contributory patent infringement,
-then any patent licenses granted to You under this License for that
-Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.  You may reproduce and distribute copies of the
-Work or Derivative Works thereof pursuant to the copyright license
-above, in any medium, with or without modifications, and in Source or
-Object form, provided that You meet the following conditions:
-
-  1. You must give any other recipients of the Work or Derivative Works
-     a copy of this License; and
-  2. You must cause any modified files to carry prominent notices stating
-     that You changed the files; and
-  3. You must retain, in the Source form of any Derivative Works that
-     You distribute, all copyright, patent, trademark, and attribution
-     notices from the Source form of the Work, excluding those notices
-     that do not pertain to any part of the Derivative Works; and
-  4. If the Work includes a "NOTICE" text file as part of its distribution,
-     then any Derivative Works that You distribute must include a readable
-     copy of the attribution notices contained within such NOTICE file,
-     excluding those notices that do not pertain to any part of
-     the Derivative Works, in at least one of the following places:
-     within a NOTICE text file distributed as part of the Derivative Works;
-     within the Source form or documentation, if provided along with the
-     Derivative Works; or, within a display generated by the Derivative Works,
-     if and wherever such third-party notices normally appear.
-     The contents of the NOTICE file are for informational purposes only
-     and do not modify the License. You may add Your own attribution notices 
-     within Derivative Works that You distribute, alongside or as an addendum 
-     to the NOTICE text from the Work, provided that such additional attribution 
-     notices cannot be construed as modifying the License. You may add Your own
-     copyright statement to Your modifications and may provide additional or
-     different license terms and conditions for use, reproduction, or
-     distribution of Your modifications, or for any such Derivative Works
-     as a whole, provided Your use, reproduction, and distribution of
-     the Work otherwise complies with the conditions stated in this License
-     and your own copyright statement or terms and conditions do not conflict
-     the conditions stated in the License including section 3.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
-any Contribution intentionally submitted for inclusion in the Work
-by You to the Licensor shall be under the terms and conditions of
-this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify
-the terms of any separate license agreement you may have executed
-with Licensor regarding such Contributions.
-
-6. Trademarks.  This License does not grant permission to use the trade
-names, trademarks, service marks, or product names of the Licensor,
-except as required for reasonable and customary use in describing the
-origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
-agreed to in writing, Licensor provides the Work (and each
-Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-implied, including, without limitation, any warranties or conditions
-of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-PARTICULAR PURPOSE. You are solely responsible for determining the
-appropriateness of using or redistributing the Work and assume any
-risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
-whether in tort (including negligence), contract, or otherwise,
-unless required by applicable law (such as deliberate and grossly
-negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special,
-incidental, or consequential damages of any character arising as a
-result of this License or out of the use or inability to use the
-Work (including but not limited to damages for loss of goodwill,
-work stoppage, computer failure or malfunction, or any and all
-other commercial damages or losses), even if such Contributor
-has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
-the Work or Derivative Works thereof, You may choose to offer,
-and charge a fee for, acceptance of support, warranty, indemnity,
-or other liability obligations and/or rights consistent with this
-License. However, in accepting such obligations, You may act only
-on Your own behalf and on Your sole responsibility, not on behalf
-of any other Contributor, and only if You agree to indemnify,
-defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason
-of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Flora License to your work
-
-To apply the Flora License to your work, attach the following
-boilerplate notice, with the fields enclosed by brackets "[]"
-replaced with your own identifying information. (Don't include
-the brackets!) The text should be enclosed in the appropriate
-comment syntax for the file format. We also recommend that a
-file or class name and description of purpose be included on the
-same "printed page" as the copyright notice for easier
-identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Flora License, Version 1.1 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://floralicense.org/license/
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
diff --git a/NOTICE b/NOTICE
index c2a6caf..1eeae25 100644 (file)
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,3 @@
-Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
-Except as noted, this software is licensed under Flora License, Version 1.1.
-Please, see the LICENSE.Flora file for Flora License, Version 1.1 terms and conditions.
-
-
+Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE file for Apache License terms and conditions.
index df8b8ee..23dc660 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -43,10 +43,10 @@ BinAutoPopupConfigParser::decode_color(SclColor& color, int width) {
     color.a = m_storage.get<sint_t>(width);
 }
 
-void BinAutoPopupConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
-    m_storage.set_str_provider(parser_info_provider);
+void BinAutoPopupConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+    m_storage.set_str_provider(provider);
     m_storage.get_storage(storage, offset, size);
-    this->parser_info_provider = parser_info_provider;
+    this->parser_info_provider = provider;
 
     parsing_autopopup_configure();
 }
index eac0e00..1e63b6d 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -82,12 +82,12 @@ void BinResource::init(const char *entry_filepath) {
     }
 
     for ( int i = ALLDATA; i < MAX_DATATYPE; ++i) {
-        info[i].offset = offset_table[i];
-        info[i].size = size_table[i];
+        m_info[i].offset = offset_table[i];
+        m_info[i].size = size_table[i];
     }
 
-    String_Bin_Parser stringBinParser(storageAllData, info[STRING].offset, info[STRING].size);
-    Metadata_Bin_Parser metadataBinParser(storageAllData, info[METADATA].offset, info[METADATA].size);
+    String_Bin_Parser stringBinParser(storageAllData, m_info[STRING].offset, m_info[STRING].size);
+    Metadata_Bin_Parser metadataBinParser(storageAllData, m_info[METADATA].offset, m_info[METADATA].size);
 
     String_Provider stringProvider(&stringBinParser);
     Metadata_Provider metadataProvider(&metadataBinParser);
@@ -95,42 +95,42 @@ void BinResource::init(const char *entry_filepath) {
 
     if (m_input_mode_configure_parser == NULL) {
         m_input_mode_configure_parser = BinInputModeConfigParser::get_instance();
-        m_input_mode_configure_parser->init(storageAllData, info[INPUT_MODE_CONFIGURE].offset, info[INPUT_MODE_CONFIGURE].size, &parser_info_provider);
+        m_input_mode_configure_parser->init(storageAllData, m_info[INPUT_MODE_CONFIGURE].offset, m_info[INPUT_MODE_CONFIGURE].size, &parser_info_provider);
     }
     if (m_default_configure_parser == NULL) {
         m_default_configure_parser = BinDefaultConfigParser::get_instance();
-        m_default_configure_parser->init(storageAllData, info[DEFAULT_CONFIGURE].offset, info[DEFAULT_CONFIGURE].size, &parser_info_provider);
+        m_default_configure_parser->init(storageAllData, m_info[DEFAULT_CONFIGURE].offset, m_info[DEFAULT_CONFIGURE].size, &parser_info_provider);
     }
    if (m_key_coordinate_frame_parser == NULL) {
         m_key_coordinate_frame_parser = BinKeyCoordFrameParser::get_instance();
-        m_key_coordinate_frame_parser->init(storageAllData, info[KEY_COORDINATE_FRAME].offset, info[KEY_COORDINATE_FRAME].size, &parser_info_provider);
+        m_key_coordinate_frame_parser->init(storageAllData, m_info[KEY_COORDINATE_FRAME].offset, m_info[KEY_COORDINATE_FRAME].size, &parser_info_provider);
     }
 
    if (m_layout_parser == NULL) {
         m_layout_parser = BinLayoutParser::get_instance();
-        m_layout_parser->init(storageAllData, info[LAYOUT].offset, info[LAYOUT].size, &parser_info_provider);
+        m_layout_parser->init(storageAllData, m_info[LAYOUT].offset, m_info[LAYOUT].size, &parser_info_provider);
     }
     if (m_modifier_decoration_parser == NULL) {
         m_modifier_decoration_parser = BinModifierDecorationParser::get_instance();
-        m_modifier_decoration_parser->init(storageAllData, info[MODIFIER_DECORATION].offset, info[MODIFIER_DECORATION].size, &parser_info_provider);
+        m_modifier_decoration_parser->init(storageAllData, m_info[MODIFIER_DECORATION].offset, m_info[MODIFIER_DECORATION].size, &parser_info_provider);
     }
     if (m_label_properties_parser == NULL) {
         m_label_properties_parser = BinLabelPropertyParser::get_instance();
-        m_label_properties_parser->init(storageAllData, info[LABEL_PROPERTIES_FRAME].offset, info[LABEL_PROPERTIES_FRAME].size, &parser_info_provider);
+        m_label_properties_parser->init(storageAllData, m_info[LABEL_PROPERTIES_FRAME].offset, m_info[LABEL_PROPERTIES_FRAME].size, &parser_info_provider);
     }
 
     if (m_autopopup_configure_parser == NULL) {
         m_autopopup_configure_parser = BinAutoPopupConfigParser::get_instance();
-        m_autopopup_configure_parser->init(storageAllData, info[AUTOPOPUP_CONFIGURE].offset, info[AUTOPOPUP_CONFIGURE].size, &parser_info_provider);
+        m_autopopup_configure_parser->init(storageAllData, m_info[AUTOPOPUP_CONFIGURE].offset, m_info[AUTOPOPUP_CONFIGURE].size, &parser_info_provider);
     }
     if (m_magnifier_configure_parser == NULL) {
         m_magnifier_configure_parser = BinMagnifierConfigParser::get_instance();
-        m_magnifier_configure_parser->init(storageAllData, info[MAGNIFIER_CONFIGURE].offset, info[MAGNIFIER_CONFIGURE].size, &parser_info_provider);
+        m_magnifier_configure_parser->init(storageAllData, m_info[MAGNIFIER_CONFIGURE].offset, m_info[MAGNIFIER_CONFIGURE].size, &parser_info_provider);
     }
 
     if (m_nine_patch_file_list_parser == NULL) {
         m_nine_patch_file_list_parser = BinNinePatchFileParser::get_instance();
-        m_nine_patch_file_list_parser->init(storageAllData, info[NINE_PATCH].offset, info[NINE_PATCH].size, &parser_info_provider);
+        m_nine_patch_file_list_parser->init(storageAllData, m_info[NINE_PATCH].offset, m_info[NINE_PATCH].size, &parser_info_provider);
     }
 
     SCLLOG_TIME_END("Parsing binary XML files");
index 18446d6..e819107 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -32,10 +32,10 @@ BinDefaultConfigParser* BinDefaultConfigParser::get_instance() {
     return &instance;
 }
 
-void BinDefaultConfigParser::init(const FileStorage& storage, int offset, int size,  IParserInfo_Provider* parser_info_provider) {
-    m_storage.set_str_provider(parser_info_provider);
+void BinDefaultConfigParser::init(const FileStorage& storage, int offset, int size,  IParserInfo_Provider* provider) {
+    m_storage.set_str_provider(provider);
     m_storage.get_storage(storage, offset, size);
-    this->parser_info_provider = parser_info_provider;
+    this->parser_info_provider = provider;
     parsing_default_configure();
 }
 void
index d5302ab..2c840c3 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 #include "file_storage_impl.h"
 
 FileStorage::FileStorage(const IString_Provider* string_provider):
-    m_string_provider(string_provider),
     m_storage(NULL),
+    m_offset(0),
     m_size(0),
-    m_offset(0) {
+    m_string_provider(string_provider) {
     }
 
 FileStorage::~FileStorage() {
@@ -34,7 +34,7 @@ FileStorage::~FileStorage() {
 }
 
 int FileStorage::
-offset() const {
+get_offset() const {
     return m_offset;
 }
 void FileStorage::
@@ -174,13 +174,13 @@ int FileStorage::
     return m_size;
 }
 int FileStorage::
-size()const{
+get_size() const{
     return m_size;
 }
 int FileStorage::
 get_storage(const FileStorage& storage, int offset, int block_size) {
     if (offset < 0 || block_size <= 0) return -1;
-    if (storage.size() < offset + block_size) return -1;
+    if (storage.get_size() < offset + block_size) return -1;
 
     if (m_storage != NULL) {
         delete[] m_storage;
index ada6c84..0441ba5 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -244,58 +244,60 @@ void set_layout_width(T& md_helper,
 }
 
 template <class T>
-void set_key_coordinate_record_width(Tmd_helper,
+void set_key_coordinate_record_width(T *md_helper,
        Key_coordinate_record_width & record_width) {
-       md_helper.set_current_metadata_record("key_coordinate_record");
-       memset(&record_width, 0x00, sizeof(Key_coordinate_record_width));
+       if (md_helper) {
+               md_helper->set_current_metadata_record("key_coordinate_record");
+               memset(&record_width, 0x00, sizeof(Key_coordinate_record_width));
 
-       record_width.x = md_helper.get_width("x");
-       record_width.y = md_helper.get_width("y");
-       record_width.width = md_helper.get_width("width");
-       record_width.height = md_helper.get_width("height");
-       record_width.add_hit_left = md_helper.get_width("add_hit_left");
-       record_width.add_hit_right = md_helper.get_width("add_hit_right");
-       record_width.add_hit_top = md_helper.get_width("add_hit_top");
-       record_width.add_hit_bottom = md_helper.get_width("add_hit_bottom");
-       record_width.popup_relative_x = md_helper.get_width("popup_relative_x");
-       record_width.popup_relative_y = md_helper.get_width("popup_relative_y");
-       record_width.extract_offset_x = md_helper.get_width("extract_offset_x");
-       record_width.extract_offset_y = md_helper.get_width("extract_offset_y");
-       record_width.sub_layout = md_helper.get_width("sub_layout");
-       record_width.magnifier_offset_x = md_helper.get_width("magnifier_offset_x");
-       record_width.magnifier_offset_y = md_helper.get_width("magnifier_offset_y");
-       record_width.custom_id = md_helper.get_width("custom_id");
-       record_width.button_type = md_helper.get_width("button_type");
-       record_width.key_type = md_helper.get_width("key_type");
-       record_width.popup_type = md_helper.get_width("popup_type");
-       record_width.use_magnifier = md_helper.get_width("use_magnifier");
-       record_width.use_long_key_magnifier = md_helper.get_width("use_long_key_magnifier");
-       record_width.popup_input_mode = md_helper.get_width("popup_input_mode");
-       record_width.sound_style = md_helper.get_width("sound_style");
-       record_width.vibe_style = md_helper.get_width("vibe_style");
-       record_width.is_side_button = md_helper.get_width("is_side_button");
-       record_width.label_count = md_helper.get_width("label_count");
-       record_width.label = md_helper.get_width("label");
-       record_width.label_type = md_helper.get_width("label_type");
-       record_width.image_label_path = md_helper.get_width("image_label_path");
-       record_width.image_label_type = md_helper.get_width("image_label_type");
-       record_width.bg_image_path = md_helper.get_width("bg_image_path");
-       record_width.key_value_count = md_helper.get_width("key_value_count");
-       record_width.key_value = md_helper.get_width("key_value");
-       record_width.key_event = md_helper.get_width("key_event");
-       record_width.long_key_type = md_helper.get_width("long_key_type");
-       record_width.long_key_value = md_helper.get_width("long_key_value");
-       record_width.long_key_event = md_helper.get_width("long_key_event");
-       record_width.use_repeat_key = md_helper.get_width("use_repeat_key");
-       record_width.autopopup_key_labels = md_helper.get_width("autopopup_key_labels");
-       record_width.autopopup_key_values = md_helper.get_width("autopopup_key_values");
-       record_width.autopopup_key_events = md_helper.get_width("autopopup_key_events");
-       record_width.dont_close_popup = md_helper.get_width("dont_close_popup");
-       record_width.extra_option = md_helper.get_width("extra_option");
-       record_width.multitouch_type = md_helper.get_width("multitouch_type");
-       record_width.modifier_decorator = md_helper.get_width("modifier_decorator");
-       record_width.magnifier_label = md_helper.get_width("magnifier_label");
-       record_width.hint_string = md_helper.get_width("hint_string");
+               record_width.x = md_helper->get_width("x");
+               record_width.y = md_helper->get_width("y");
+               record_width.width = md_helper->get_width("width");
+               record_width.height = md_helper->get_width("height");
+               record_width.add_hit_left = md_helper->get_width("add_hit_left");
+               record_width.add_hit_right = md_helper->get_width("add_hit_right");
+               record_width.add_hit_top = md_helper->get_width("add_hit_top");
+               record_width.add_hit_bottom = md_helper->get_width("add_hit_bottom");
+               record_width.popup_relative_x = md_helper->get_width("popup_relative_x");
+               record_width.popup_relative_y = md_helper->get_width("popup_relative_y");
+               record_width.extract_offset_x = md_helper->get_width("extract_offset_x");
+               record_width.extract_offset_y = md_helper->get_width("extract_offset_y");
+               record_width.sub_layout = md_helper->get_width("sub_layout");
+               record_width.magnifier_offset_x = md_helper->get_width("magnifier_offset_x");
+               record_width.magnifier_offset_y = md_helper->get_width("magnifier_offset_y");
+               record_width.custom_id = md_helper->get_width("custom_id");
+               record_width.button_type = md_helper->get_width("button_type");
+               record_width.key_type = md_helper->get_width("key_type");
+               record_width.popup_type = md_helper->get_width("popup_type");
+               record_width.use_magnifier = md_helper->get_width("use_magnifier");
+               record_width.use_long_key_magnifier = md_helper->get_width("use_long_key_magnifier");
+               record_width.popup_input_mode = md_helper->get_width("popup_input_mode");
+               record_width.sound_style = md_helper->get_width("sound_style");
+               record_width.vibe_style = md_helper->get_width("vibe_style");
+               record_width.is_side_button = md_helper->get_width("is_side_button");
+               record_width.label_count = md_helper->get_width("label_count");
+               record_width.label = md_helper->get_width("label");
+               record_width.label_type = md_helper->get_width("label_type");
+               record_width.image_label_path = md_helper->get_width("image_label_path");
+               record_width.image_label_type = md_helper->get_width("image_label_type");
+               record_width.bg_image_path = md_helper->get_width("bg_image_path");
+               record_width.key_value_count = md_helper->get_width("key_value_count");
+               record_width.key_value = md_helper->get_width("key_value");
+               record_width.key_event = md_helper->get_width("key_event");
+               record_width.long_key_type = md_helper->get_width("long_key_type");
+               record_width.long_key_value = md_helper->get_width("long_key_value");
+               record_width.long_key_event = md_helper->get_width("long_key_event");
+               record_width.use_repeat_key = md_helper->get_width("use_repeat_key");
+               record_width.autopopup_key_labels = md_helper->get_width("autopopup_key_labels");
+               record_width.autopopup_key_values = md_helper->get_width("autopopup_key_values");
+               record_width.autopopup_key_events = md_helper->get_width("autopopup_key_events");
+               record_width.dont_close_popup = md_helper->get_width("dont_close_popup");
+               record_width.extra_option = md_helper->get_width("extra_option");
+               record_width.multitouch_type = md_helper->get_width("multitouch_type");
+               record_width.modifier_decorator = md_helper->get_width("modifier_decorator");
+               record_width.magnifier_label = md_helper->get_width("magnifier_label");
+               record_width.hint_string = md_helper->get_width("hint_string");
+       }
 }
 
 template <class T>
index 6156e14..a904708 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index ed7b3f5..354fc1c 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -30,7 +30,7 @@
 #include "magnifier_configure_bin_parser.h"
 #include "nine_patch_file_list_bin_parser.h"
 #include "sclres.h"
-struct info_t{
+struct resource_info_t{
     int offset;
     int size;
 };
@@ -82,12 +82,12 @@ class BinResource: public sclres::SclRes{
     int get_modifier_decoration_id(const char *name);
     bool get_nine_patch_info(const char *filename, SclNinePatchInfo *info);
 
-    const char* name() {
+    const char* get_name() {
         return "binary_xmlparser";
     }
 
     void destroy();
-    struct info_t info[MAX_DATATYPE];
+    struct resource_info_t m_info[MAX_DATATYPE];
     private:
     BinResource();
 
index 48f5138..79944dc 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index f818bef..56a5a60 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -45,7 +45,7 @@ class FileStorage{
         FileStorage(const IString_Provider* string_provider = NULL);
     ~FileStorage();
 
-    int offset() const;
+    int get_offset() const;
     void set_str_provider(const IString_Provider*);
     template <typename T>
     T get(int width);
@@ -63,7 +63,7 @@ class FileStorage{
     int get_storage(const FileStorage&, int offset, int block_size);
 
     void advance(int bytes);
-    int size()const;
+    int get_size() const;
 
     private:
     /** brief unify get_xx method name
index 237d260..ff4641c 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index c237579..1c49988 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -29,7 +29,7 @@ class BinInputModeConfigParser {
     public:
         ~BinInputModeConfigParser();
         static BinInputModeConfigParser *get_instance();
-        void init(const FileStorage&, int, int, IParserInfo_Provider* parser_info_provider);
+        void init(const FileStorage&, int, int, IParserInfo_Provider* provider);
         PSclInputModeConfigure get_input_mode_configure_table();
         int get_inputmode_id(const char *name);
         const char* get_inputmode_name(int id);
index 39f1fd2..038f58e 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 1edadbb..a7136f2 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 16a0295..7c3ae39 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 3071342..f1ebae1 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index d457d36..2204995 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 23b40f2..c9e4eac 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index abc4eb2..4903b8a 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index a88b9d3..db14108 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 88d3622..b5318af 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index ee35180..99f6565 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 1567d30..5416e6c 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -42,18 +42,18 @@ class Metadata_Provider:public IMetadata_Provider{
             assert(record_name != NULL);
             if ( current_record_name == NULL ||0 != strcmp(current_record_name, record_name)) {
                 current_record_name = record_name;
-                curRecordIndex = find_metadata_record_index(record_name);
+                curRecordIndex = (int)find_metadata_record_index(record_name);
                 if (curRecordIndex == -1) {
                     printf("Can not find %s metadata record.\n", record_name);
                 }
             }
         }
     private:
-       const int find_metadata_record_index(const char* name)const{
+       size_t find_metadata_record_index(const char* name)const{
             if (name == NULL) return -1;
 
             const MetaData* metadata = m_metadataParser->get_metadata();
-            for ( int i = 0; i < metadata->m_vec_metadata_record.size(); ++i) {
+            for ( size_t i = 0; i < metadata->m_vec_metadata_record.size(); ++i) {
                 const MetaData_Record& metadata_record = metadata->m_vec_metadata_record.at(i);
 
                 if (0 == strcmp(metadata_record.m_name, name)) {
index 1d2784e..318c169 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index e26143b..433ab26 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index e0cda5e..ad4280a 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index b9234a8..1b7197e 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 49fb563..b581b10 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 52f99d4..5cd6151 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 class String_Provider: public IString_Provider{
     public:
         String_Provider(const String_Bin_Parser* sp): m_sp(sp) {}
-        const char* get_string_by_id(const int id)const{
+        const char* get_string_by_id(int id)const{
             if (m_sp == NULL) return NULL;
 
             const std::vector<const char*>& string_depository = m_sp->get_string_depository();
-            if (id >= 0 && id < string_depository.size())
+            if (id >= 0 && id < (int)string_depository.size())
                 return string_depository.at(id);
 
             return NULL;
index 4f4ac68..34b2206 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -35,10 +35,10 @@ BinInputModeConfigParser::get_instance() {
 }
 
 void
-BinInputModeConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
+BinInputModeConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
     m_storage.set_str_provider(parser_info_provider);
     m_storage.get_storage(storage, offset, size);
-    this->parser_info_provider = parser_info_provider;
+    this->parser_info_provider = provider;
     parsing_input_mode_configure_table();
 }
 
index 369b413..72ce7f2 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -54,7 +54,6 @@ BinKeyCoordFrameParser::
 load(int layout_id)
 {
     BinResource *bin_xmlres = BinResource::get_instance();
-    int layout_data_offset = bin_xmlres->info[LAYOUT].offset;
 
     char path[_POSIX_PATH_MAX] = {0};
 
@@ -64,18 +63,18 @@ load(int layout_id)
     FileStorage alldata;
     alldata.loadFile(path);
 
-    String_Bin_Parser stringBinParser(alldata, bin_xmlres->info[STRING].offset, bin_xmlres->info[STRING].size);
-    Metadata_Bin_Parser metadataBinParser(alldata, bin_xmlres->info[METADATA].offset, bin_xmlres->info[METADATA].size);
+    String_Bin_Parser stringBinParser(alldata, bin_xmlres->m_info[STRING].offset, bin_xmlres->m_info[STRING].size);
+    Metadata_Bin_Parser metadataBinParser(alldata, bin_xmlres->m_info[METADATA].offset, bin_xmlres->m_info[METADATA].size);
 
     String_Provider stringProvider(&stringBinParser);
     Metadata_Provider metadataProvider(&metadataBinParser);
-    ParserInfo_Provider parser_info_provider(&metadataProvider, &stringProvider);
-    storage.set_str_provider(&parser_info_provider);
-    this->parser_info_provider = &parser_info_provider;
+    ParserInfo_Provider provider(&metadataProvider, &stringProvider);
+    storage.set_str_provider(&provider);
+    this->parser_info_provider = &provider;
     storage.get_storage(
         alldata,
-        bin_xmlres->info[KEY_COORDINATE_FRAME].offset,
-        bin_xmlres->info[KEY_COORDINATE_FRAME].size);
+        bin_xmlres->m_info[KEY_COORDINATE_FRAME].offset,
+        bin_xmlres->m_info[KEY_COORDINATE_FRAME].size);
 
     // 4 byte (range[0-4,294,967,295))
     const int DATA_SIZE_BYTES = 4;
@@ -147,10 +146,10 @@ unload()
     }
 }
 void
-BinKeyCoordFrameParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
+BinKeyCoordFrameParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
     m_storage.set_str_provider(parser_info_provider);
     m_storage.get_storage(storage, offset, size);
-    this->parser_info_provider = parser_info_provider;
+    this->parser_info_provider = provider;
 }
 
 PSclLayoutKeyCoordinatePointerTable
@@ -160,8 +159,6 @@ BinKeyCoordFrameParser::get_key_coordinate_pointer_frame() {
 
 void
 BinKeyCoordFrameParser::decode_key_coordinate_record(FileStorage& storage, const PSclLayoutKeyCoordinate cur, const Key_coordinate_record_width& record_width) {
-    int width = 0;
-
     cur->valid = (sclboolean)true;
     //x
     cur->x = storage.get<sint_t>(record_width.x);
index f862d7a..6a00d1b 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -32,10 +32,10 @@ BinLabelPropertyParser* BinLabelPropertyParser::get_instance() {
     static BinLabelPropertyParser instance;
     return &instance;
 }
-void BinLabelPropertyParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
+void BinLabelPropertyParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
     m_storage.set_str_provider(parser_info_provider);
     m_storage.get_storage(storage, offset, size);
-    this->parser_info_provider = parser_info_provider;
+    this->parser_info_provider = provider;
     parsing_label_properties_frame();
 }
 const int
index 4d56e28..8129b13 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -39,10 +39,10 @@ get_instance() {
     return &instance;
 }
 void BinLayoutParser::
-init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
-    m_storage.set_str_provider(parser_info_provider);
+init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+    m_storage.set_str_provider(provider);
     m_storage.get_storage(storage, offset, size);
-    this->parser_info_provider = parser_info_provider;
+    this->parser_info_provider = provider;
     parsing_layout_table();
 
 }
@@ -99,7 +99,7 @@ parsing_layout_table() {
     m_layout_size = m_storage.get<sint_t>(REC_NUM_BYTES);
 
     // layout_rec_data_size
-    int layout_rec_data_size = m_storage.get<sint_t>(LAYOUT_REC_DATA_SIZE_BYTES);
+    m_storage.advance(LAYOUT_REC_DATA_SIZE_BYTES);
 
     for (int i = 0; i < m_layout_size; ++i) {
         SclLayout& cur = m_layout_table[i];
index 0fdf352..5881159 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -33,10 +33,10 @@ BinMagnifierConfigParser* BinMagnifierConfigParser::get_instance() {
     return &instance;
 }
 
-void BinMagnifierConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
-    m_storage.set_str_provider(parser_info_provider);
+void BinMagnifierConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+    m_storage.set_str_provider(provider);
     m_storage.get_storage(storage, offset, size);
-    this->parser_info_provider = parser_info_provider;
+    this->parser_info_provider = provider;
     parsing_magnifier_configure();
 }
 
index a82cc03..a1117f2 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 09d7ae5..98825da 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -32,10 +32,10 @@ BinModifierDecorationParser::get_instance() {
     return &instance;
 }
 void
-BinModifierDecorationParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
-    m_storage.set_str_provider(parser_info_provider);
+BinModifierDecorationParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+    m_storage.set_str_provider(provider);
     m_storage.get_storage(storage, offset, size);
-    this->parser_info_provider = parser_info_provider;
+    this->parser_info_provider = provider;
 
     parsing_modifier_decoration_table();
 }
index 273af59..0cd7125 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -32,10 +32,10 @@ BinNinePatchFileParser* BinNinePatchFileParser::get_instance() {
     static BinNinePatchFileParser instance;
     return &instance;
 }
-void BinNinePatchFileParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
-    m_storage.set_str_provider(parser_info_provider);
+void BinNinePatchFileParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+    m_storage.set_str_provider(provider);
     m_storage.get_storage(storage, offset, size);
-    this->parser_info_provider = parser_info_provider;
+    this->parser_info_provider = provider;
 
     parsing_nine_patch_file_list();
 }
index d23de20..7edb2a9 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 9d62967..189a6f5 100644 (file)
@@ -3,10 +3,10 @@
 
 Name:       libscl-ui
 Summary:    A library for developing XML-based software keyboards
-Version:    0.4.4
+Version:    0.4.7
 Release:    1
-Group:      TO BE / FILLED IN
-License:    TO BE / FILLED IN
+Group:      System Environment/Libraries
+License:    Apache License, Version 2.0
 Source0:    libscl-ui-%{version}.tar.gz
 BuildRequires:  gettext-tools
 BuildRequires:  cmake
@@ -37,13 +37,19 @@ A devel pacakge of libscl-ui library that helps developing S/W Keyboard
 
 
 %build
+export CFLAGS+=" -DTIZEN_DEBUG_ENABLE"
+export CXXFLAGS+=" -DTIZEN_DEBUG_ENABLE"
+export FFLAGS+=" -DTIZEN_DEBUG_ENABLE"
+
+rm -rf CMakeFiles
+rm -rf CMakeCache.txt
 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
 make %{?jobs:-j%jobs}
 
 %install
 rm -rf %{buildroot}
 mkdir -p %{buildroot}/usr/share/license
-cp LICENSE.Flora %{buildroot}/usr/share/license/%{name}
+cp LICENSE %{buildroot}/usr/share/license/%{name}
 
 %make_install
 
index a632dd6..9e9b52c 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 6f39bc1..06c2b25 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 7610b50..09d7eff 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 92807d3..064cfd5 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 74c3cbf..99af34e 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index b75d6de..f4aa268 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index f61a244..9c662c9 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
diff --git a/scl/gwes/efl/sclanimator-efl.cpp b/scl/gwes/efl/sclanimator-efl.cpp
new file mode 100644 (file)
index 0000000..3440587
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "sclanimator-efl.h"
+#include "scldebug.h"
+
+#include <Ecore.h>
+#include <Elementary.h>
+
+#include "sclutils.h"
+#include "sclwindows.h"
+
+using namespace scl;
+
+/**
+ * Constructor
+ */
+CSCLAnimatorImplEfl::CSCLAnimatorImplEfl()
+{
+    SCL_DEBUG();
+
+    m_highlight_ui_object = NULL;
+    m_highlight_ui_object_alternate = NULL;
+}
+
+/**
+ * De-constructor
+ */
+CSCLAnimatorImplEfl::~CSCLAnimatorImplEfl()
+{
+    SCL_DEBUG();
+}
+
+void CSCLAnimatorImplEfl::init()
+{
+
+}
+
+void CSCLAnimatorImplEfl::fini()
+{
+    if (m_highlight_ui_object) {
+        evas_object_del(m_highlight_ui_object);
+        m_highlight_ui_object = NULL;
+    }
+    if (m_highlight_ui_object_alternate) {
+        evas_object_del(m_highlight_ui_object_alternate);
+        m_highlight_ui_object_alternate = NULL;
+    }
+}
+
+
+sclboolean
+CSCLAnimatorImplEfl::check_animation_supported()
+{
+    /* EFL Backend finished implementing animation support */
+    return TRUE;
+}
+
+void
+CSCLAnimatorImplEfl::animator_timer(SclAnimationState *state)
+{
+    CSCLUtils *utils = CSCLUtils::get_instance();
+    CSCLWindows *windows = CSCLWindows::get_instance();
+
+    if (state && windows && utils) {
+        switch (state->desc.type) {
+            case ANIMATION_TYPE_HIGHLIGHT_UI: {
+                if (state->active) {
+                    SclRectangle rect = state->rect_cur;
+                    if (m_highlight_ui_object == NULL) {
+                        Evas_Object *window_object = static_cast<Evas_Object*>(windows->get_base_window());
+                        Evas *evas = evas_object_evas_get(window_object);
+                        m_highlight_ui_object = evas_object_image_add(evas);
+                        sclchar composed_path[_POSIX_PATH_MAX] = {0,};
+                        utils->get_composed_path(composed_path, IMG_PATH_PREFIX, SCL_HIGHLIGHT_UI_IMAGE);
+                        evas_object_image_file_set(m_highlight_ui_object, composed_path, NULL);
+                    }
+                    evas_object_move(m_highlight_ui_object, rect.x, rect.y);
+                    evas_object_image_fill_set(m_highlight_ui_object, 0, 0, rect.width, rect.height);
+                    evas_object_resize(m_highlight_ui_object, rect.width, rect.height);
+                    evas_object_raise(m_highlight_ui_object);
+                    evas_object_show(m_highlight_ui_object);
+
+                    sclboolean circular = FALSE;
+                    if (state->desc.circular) {
+                        if (m_highlight_ui_object_alternate == NULL) {
+                            Evas_Object *window_object = static_cast<Evas_Object*>(windows->get_base_window());
+                            Evas *evas = evas_object_evas_get(window_object);
+                            m_highlight_ui_object_alternate = evas_object_image_add(evas);
+                            sclchar composed_path[_POSIX_PATH_MAX] = {0,};
+                            utils->get_composed_path(composed_path, IMG_PATH_PREFIX, SCL_HIGHLIGHT_UI_IMAGE);
+                            evas_object_image_file_set(m_highlight_ui_object_alternate, composed_path, NULL);
+                        }
+                        SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+                        if (window_context) {
+                            if (rect.x < 0) {
+                                evas_object_move(m_highlight_ui_object_alternate,
+                                    window_context->geometry.width + rect.x, rect.y);
+                                evas_object_image_fill_set(m_highlight_ui_object_alternate,
+                                    0, 0, rect.width, rect.height);
+                                evas_object_resize(m_highlight_ui_object_alternate,
+                                    rect.width, rect.height);
+                                evas_object_raise(m_highlight_ui_object_alternate);
+                                evas_object_show(m_highlight_ui_object_alternate);
+                                circular = TRUE;
+                            } else if (rect.x + rect.width > window_context->geometry.width) {
+                                evas_object_move(m_highlight_ui_object_alternate,
+                                    -(window_context->geometry.width - rect.x), rect.y);
+                                evas_object_image_fill_set(m_highlight_ui_object_alternate,
+                                    0, 0, rect.width, rect.height);
+                                evas_object_resize(m_highlight_ui_object_alternate,
+                                    rect.width, rect.height);
+                                evas_object_raise(m_highlight_ui_object_alternate);
+                                evas_object_show(m_highlight_ui_object_alternate);
+                                circular = TRUE;
+                            }
+                        }
+                    }
+                    if (!circular) {
+                        if (m_highlight_ui_object_alternate) {
+                            evas_object_hide(m_highlight_ui_object_alternate);
+                        }
+                    } else {
+                        if (m_highlight_ui_object_alternate) {
+                            sclint window_layer = 29000;
+                            if (!windows->is_base_window(state->desc.window_from) ||
+                                !windows->is_base_window(state->desc.window_to)) {
+                                    window_layer = 29010;
+                            }
+                            evas_object_layer_set(m_highlight_ui_object_alternate, window_layer + 1);
+                        }
+                    }
+
+                    sclint window_layer = 29000;
+                    if (!windows->is_base_window(state->desc.window_from) ||
+                        !windows->is_base_window(state->desc.window_to)) {
+                            window_layer = 29010;
+                    }
+                    evas_object_layer_set(m_highlight_ui_object, window_layer + 1);
+                } else {
+                    evas_object_hide(m_highlight_ui_object);
+                }
+            }
+            break;
+            default:
+            break;
+        }
+    }
+}
\ No newline at end of file
diff --git a/scl/gwes/efl/sclanimator-efl.h b/scl/gwes/efl/sclanimator-efl.h
new file mode 100644 (file)
index 0000000..1325c83
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "sclanimator.h"
+
+#ifndef __SCL_ANIMATOR_EFL_H__
+#define __SCL_ANIMATOR_EFL_H__
+
+#include <Evas.h>
+
+namespace scl
+{
+class CSCLAnimatorImplEfl : public CSCLAnimatorImpl
+{
+public :
+    CSCLAnimatorImplEfl();
+    ~CSCLAnimatorImplEfl();
+
+    void init();
+    void fini();
+
+    sclboolean check_animation_supported();
+    void animator_timer(SclAnimationState *state);
+
+private:
+    Evas_Object *m_highlight_ui_object;
+    Evas_Object *m_highlight_ui_object_alternate;
+};
+} /* End of scl namespace */
+#endif //__SCL_ANIMATOR_EFL_H__
old mode 100644 (file)
new mode 100755 (executable)
index 307bb44..10e24a2
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 
 #include <Elementary.h>
 #include <Ecore_X.h>
+#include <dlog.h>
+#include <utilX.h>
+
+#include "sclkeyfocushandler.h"
 
 using namespace scl;
 
+#ifdef USING_KEY_GRAB
+#define HANDLE_KEY_EVENTS
+#endif
+
 #define E_PROP_TOUCH_INPUT "X_TouchInput"
 
 sclboolean mouse_pressed = FALSE; /* Checks whether mouse is pressed or not */
@@ -43,6 +51,10 @@ Eina_Bool mouse_release (void *data, int type, void *event_info);
 
 Eina_Bool client_message_cb(void *data, int type, void *event);
 
+#ifdef HANDLE_KEY_EVENTS
+Eina_Bool key_pressed(void *data, int type, void *event_info);
+#endif
+
 /**
  * Constructor
  */
@@ -55,6 +67,7 @@ CSCLEventsImplEfl::CSCLEventsImplEfl()
     m_mouse_up_handler = NULL;
 
     m_xclient_msg_handler = NULL;
+    m_key_pressed_handler = NULL;
 }
 
 /**
@@ -75,6 +88,9 @@ void CSCLEventsImplEfl::init()
     m_mouse_up_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, mouse_release, NULL);
 
     m_xclient_msg_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, client_message_cb, NULL);
+#ifdef HANDLE_KEY_EVENTS
+    m_key_pressed_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, key_pressed, NULL);
+#endif
 }
 
 void CSCLEventsImplEfl::fini()
@@ -87,6 +103,11 @@ void CSCLEventsImplEfl::fini()
     m_mouse_up_handler = NULL;
     if (m_xclient_msg_handler) ecore_event_handler_del(m_xclient_msg_handler);
     m_xclient_msg_handler = NULL;
+#ifdef HANDLE_KEY_EVENTS
+    if (m_key_pressed_handler) ecore_event_handler_del(m_key_pressed_handler);
+#endif
+    m_key_pressed_handler = NULL;
+
 }
 
 sclboolean get_window_rect(const sclwindow window, SclRectangle *rect)
@@ -97,42 +118,42 @@ sclboolean get_window_rect(const sclwindow window, SclRectangle *rect)
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLContext *context = CSCLContext::get_instance();
     if (windows && context && utils && rect) {
-        SclWindowContext *winctx = windows->get_window_context(window);
+        SclWindowContext *window_context = windows->get_window_context(window);
         sclint scr_w, scr_h;
         /* get window size */
         utils->get_screen_resolution(&scr_w, &scr_h);
-        if (winctx) {
+        if (window_context) {
             switch (context->get_rotation()) {
                 case ROTATION_90_CW:
                     {
-                        rect->height = winctx->geometry.width;
-                        rect->width = winctx->geometry.height;
-                        rect->y = scr_w - rect->height - winctx->geometry.x;
-                        rect->x = winctx->geometry.y;
+                        rect->height = window_context->geometry.width;
+                        rect->width = window_context->geometry.height;
+                        rect->y = scr_w - rect->height - window_context->geometry.x;
+                        rect->x = window_context->geometry.y;
                     }
                     break;
                 case ROTATION_180:
                     {
-                        rect->width = winctx->geometry.width;
-                        rect->height = winctx->geometry.height;
-                        rect->x = scr_w - winctx->geometry.x - rect->width;
-                        rect->y = scr_h - winctx->geometry.y - rect->height;
+                        rect->width = window_context->geometry.width;
+                        rect->height = window_context->geometry.height;
+                        rect->x = scr_w - window_context->geometry.x - rect->width;
+                        rect->y = scr_h - window_context->geometry.y - rect->height;
                     }
                     break;
                 case ROTATION_90_CCW:
                     {
-                        rect->height = winctx->geometry.width;
-                        rect->width = winctx->geometry.height;
-                        rect->y = winctx->geometry.x;
-                        rect->x= scr_h - winctx->geometry.y - rect->width;
+                        rect->height = window_context->geometry.width;
+                        rect->width = window_context->geometry.height;
+                        rect->y = window_context->geometry.x;
+                        rect->x= scr_h - window_context->geometry.y - rect->width;
                     }
                     break;
                 default:
                     {
-                        rect->x = winctx->geometry.x;
-                        rect->y = winctx->geometry.y;
-                        rect->width = winctx->geometry.width;
-                        rect->height = winctx->geometry.height;
+                        rect->x = window_context->geometry.x;
+                        rect->y = window_context->geometry.y;
+                        rect->width = window_context->geometry.width;
+                        rect->height = window_context->geometry.height;
                     }
                     break;
             }
@@ -144,8 +165,8 @@ sclboolean get_window_rect(const sclwindow window, SclRectangle *rect)
     return ret;
 }
 
-/**  Here x and y contains "actual" x and y position relative to portrait root window, 
-     and winctx->width,height contains the window's orientation dependant width and height */
+/**  Here x and y contains "actual" x and y position relative to portrait root window,
+     and window_context->width,height contains the window's orientation dependant width and height */
 SclPoint get_rotated_local_coords(sclint x, sclint y, SCLRotation rotation, SclRectangle *rect) {
     SclPoint ret = {0, 0};
 
@@ -185,8 +206,8 @@ Eina_Bool mouse_press(void *data, int type, void *event_info)
 {
     SCL_DEBUG();
 
-    //Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down*)event_info;
-    //LOGD("mouse_press : %d %d\n", ev->output.x, ev->output.y);
+    Evas_Event_Mouse_Down *ev1 = (Evas_Event_Mouse_Down*)event_info;
+    LOGD("mouse_press : %d %d\n", ev1->output.x, ev1->output.y);
 
     CSCLController *controller = CSCLController::get_instance();
     CSCLWindows *windows = CSCLWindows::get_instance();
@@ -201,8 +222,16 @@ Eina_Bool mouse_press(void *data, int type, void *event_info)
         sclboolean processed = FALSE;
         sclwindow window = SCLWINDOW_INVALID;
 
+        Ecore_X_Window inputWindow = 0;
+        Ecore_X_Atom inputAtom = ecore_x_atom_get ("DeviceMgr Input Window");
+        ecore_x_window_prop_xid_get (ecore_x_window_root_first_get(),
+            inputAtom, ECORE_X_ATOM_WINDOW, &inputWindow, 1);
+        if (inputWindow == 0) {
+            utils->log("Error : input window NULL!");
+        }
+
         unsigned int touch_input = 0;
-        int res = ecore_x_window_prop_card32_get(ecore_x_window_root_first_get(),
+        int res = ecore_x_window_prop_card32_get(inputWindow,
             ecore_x_atom_get(E_PROP_TOUCH_INPUT), &touch_input, 1);
 
         utils->log("E_PROP_TOUCH_INPUT : %d %d\n", res, touch_input);
@@ -215,7 +244,6 @@ Eina_Bool mouse_press(void *data, int type, void *event_info)
             }
         }
 
-        sclwindow evwin = (sclwindow)(ev->window);
         sclboolean is_scl_window = FALSE;
         if (elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window())) == ev->window) {
             is_scl_window = TRUE;
@@ -224,9 +252,9 @@ Eina_Bool mouse_press(void *data, int type, void *event_info)
         } else {
             do {
                 window = windows->get_nth_window_in_Z_order_list(index);
-                SclWindowContext *winctx = windows->get_window_context(window);
-                if (winctx) {
-                    if (winctx->is_virtual) {
+                SclWindowContext *window_context = windows->get_window_context(window);
+                if (window_context) {
+                    if (window_context->is_virtual) {
                         is_scl_window  = TRUE;
                     } else if (elm_win_xwindow_get(static_cast<Evas_Object*>(window)) == ev->window) {
                         is_scl_window = TRUE;
@@ -238,15 +266,15 @@ Eina_Bool mouse_press(void *data, int type, void *event_info)
         }
         if (!is_scl_window) return TRUE;
 
-        SclRectangle rect = {0};
+        SclRectangle rect = {0,0,0,0};
         do {
             window = windows->get_nth_window_in_Z_order_list(index);
             if (window) {
                 // Update the position of the target window
                 //windows->get_window_context(window, TRUE);
-                SclWindowContext *winctx = windows->get_window_context(window);
-                if (winctx) {
-                    windows->get_window_rect(window, &(winctx->geometry));
+                SclWindowContext *window_context = windows->get_window_context(window);
+                if (window_context) {
+                    windows->get_window_rect(window, &(window_context->geometry));
                     if (get_window_rect(window, &rect)) {
                         int adjustx = ev->root.x;
                         int adjusty = ev->root.y;
@@ -258,8 +286,7 @@ Eina_Bool mouse_press(void *data, int type, void *event_info)
                         }
                         if (default_configure) {
                             SCLDisplayMode display_mode = context->get_display_mode();
-                            CSCLErrorAdjustment *adjustment = CSCLErrorAdjustment::get_instance();
-                            if (adjustment && scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
+                            if (scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
                                 adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &adjustx, &adjusty);
                             }
                         }
@@ -329,19 +356,20 @@ Eina_Bool mouse_release (void *data, int type, void *event_info)
 
     //Evas_Event_Mouse_Up *ev = (Evas_Event_Mouse_Up*)event_info;
     Ecore_Event_Mouse_Button *ev = (Ecore_Event_Mouse_Button*)event_info;
-    //LOGD("mouse_release : %d %d, %d %d\n", ev->root.x, ev->root.y, ev->x, ev->y);
 
     //if (!mouse_pressed) return FALSE;
 
     if (controller && windows && context && ev) {
+        LOGD("mouse_release : %d %d, %d %d\n", ev->root.x, ev->root.y, ev->x, ev->y);
+
         sclbyte index = 0;
         sclboolean processed = FALSE;
         sclwindow window = SCLWINDOW_INVALID;
         SclRectangle rect;
         sclboolean dimwinevent = FALSE;
-        SclWindowContext *dimctx = windows->get_window_context(windows->get_dim_window());
-        if (dimctx) {
-            if (!(dimctx->is_virtual)) {
+        SclWindowContext *dim_window_context = windows->get_window_context(windows->get_dim_window());
+        if (dim_window_context) {
+            if (!(dim_window_context->is_virtual)) {
                 if (elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_dim_window())) == ev->window) {
                     dimwinevent = TRUE;
                 }
@@ -353,9 +381,9 @@ Eina_Bool mouse_release (void *data, int type, void *event_info)
             do {
                 window = windows->get_nth_window_in_Z_order_list(index);
                 if (window) {
-                    SclWindowContext *winctx = windows->get_window_context(window);
-                    if (winctx) {
-                        windows->get_window_rect(window, &(winctx->geometry));
+                    SclWindowContext *window_context = windows->get_window_context(window);
+                    if (window_context) {
+                        windows->get_window_rect(window, &(window_context->geometry));
                         if (get_window_rect(window, &rect)) {
                             int adjustx = ev->root.x;
                             int adjusty = ev->root.y;
@@ -425,6 +453,96 @@ Eina_Bool mouse_release (void *data, int type, void *event_info)
     //controller->mouse_release((sclwindow)data, (int)ev->x, (int)ev->y);
 }
 
+#ifdef HANDLE_KEY_EVENTS
+Eina_Bool key_pressed(void *data, int type, void *event_info)
+{
+    LOGD("=-=-=-=- key_pressed \n");
+    CSCLController *controller = CSCLController::get_instance();
+    Ecore_Event_Key *ev = (Ecore_Event_Key *)event_info;
+    const char *ckey_val = ev->key;
+    LOGD("=-=-=-=- ev->key(char) = %c \n",ev->key);
+    LOGD("=-=-=-=- ev->key(string) = %s \n",ev->key);
+    LOGD("=-=-=-=- ev->keyname(char) = %c \n",ev->keyname);
+    LOGD("=-=-=-=- ev->keyname(string) = %s \n",ev->keyname);
+    LOGD("=-=-=-=- ev->string(char) = %c \n",ev->string);
+    LOGD("=-=-=-=- ev->string(string) = %s \n",ev->string);
+
+    CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+    SclButtonContext *prev_button_context = NULL;
+    const SclLayoutKeyCoordinate *prevcoordinate = NULL;
+    SclButtonContext *button_context = NULL;
+    const SclLayoutKeyCoordinate *coordinate = NULL;
+
+    CSCLWindows *windows = CSCLWindows::get_instance();
+    sclwindow window = windows->get_base_window();
+    CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
+
+    sclbyte current_key_index = focus_handler->get_current_key_index();
+    sclbyte key_index = current_key_index;
+
+    if (strcmp(ev->keyname, "Right") == 0) {
+        key_index = focus_handler->get_next_key_index(NAVIGATE_RIGHT);
+    } else if (strcmp(ev->keyname, "Left") == 0) {
+        key_index = focus_handler->get_next_key_index(NAVIGATE_LEFT);
+    } else if (strcmp(ev->keyname, "Up") == 0) {
+        key_index = focus_handler->get_next_key_index(NAVIGATE_UP);
+    } else if (strcmp(ev->keyname, "Down") == 0) {
+        key_index = focus_handler->get_next_key_index(NAVIGATE_DOWN);
+    } else if ((strcmp(ev->keyname, "Return") == 0)||(strcmp(ev->keyname, "Enter") == 0)) {
+        button_context = cache->get_cur_button_context(window, current_key_index);
+        coordinate = cache->get_cur_layout_key_coordinate(window, current_key_index);
+        button_context->state = BUTTON_STATE_NORMAL;
+        controller->mouse_press(window, coordinate->x, coordinate->y, TRUE);
+        controller->mouse_release(window, coordinate->x, coordinate->y, TRUE);
+        if (KEY_TYPE_MODECHANGE != coordinate->key_type) {
+            button_context->state = BUTTON_STATE_PRESSED;
+            windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
+        } else {
+            focus_handler->init_key_index();
+        }
+        return TRUE;
+    }
+
+    if (current_key_index != key_index) {
+        button_context = cache->get_cur_button_context(window, key_index);
+        prev_button_context = cache->get_cur_button_context(window, current_key_index);
+        prevcoordinate = cache->get_cur_layout_key_coordinate(window, current_key_index);
+        coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
+        prev_button_context->state = BUTTON_STATE_NORMAL;
+        button_context->state = BUTTON_STATE_PRESSED;
+        sclshort x,y,width,height;
+        if (prevcoordinate->x < coordinate->x) {
+            x = prevcoordinate->x;
+        } else {
+            x = coordinate->x;
+        }
+
+        if (prevcoordinate->y < coordinate->y) {
+            y = prevcoordinate->y;
+        } else {
+            y = coordinate->y;
+        }
+
+        if (prevcoordinate->x + prevcoordinate->width > coordinate->x + coordinate->width) {
+            width = prevcoordinate->x + prevcoordinate->width - x;
+        } else {
+            width = coordinate->x + coordinate->width - x;
+        }
+
+        if (prevcoordinate->y + prevcoordinate->height > coordinate->y + coordinate->height) {
+            height = prevcoordinate->y + prevcoordinate->height - y;
+        } else {
+            height = coordinate->y + coordinate->height - y;
+        }
+        windows->update_window(window, x, y, width, height);
+
+    } else {
+    }
+
+    return TRUE;
+}
+#endif /*HANDLE_KEY_EVENTS*/
+
 //int mouse_move (void *data, Evas *e, Evas_Object *object, void *event_info)
 Eina_Bool mouse_move (void *data, int type, void *event_info)
 {
@@ -437,7 +555,6 @@ Eina_Bool mouse_move (void *data, int type, void *event_info)
 
     //Evas_Event_Mouse_Move *ev = (Evas_Event_Mouse_Move*)event_info;
     Ecore_Event_Mouse_Move *ev = (Ecore_Event_Mouse_Move*)event_info;
-    //LOGD("mouse_move : %d %d, %d %d\n", ev->root.x, ev->root.y, ev->x, ev->y);
 
     //if (!mouse_pressed) return FALSE;
 
@@ -447,6 +564,8 @@ Eina_Bool mouse_move (void *data, int type, void *event_info)
         sclwindow window = SCLWINDOW_INVALID;
         SclRectangle rect;
 
+        LOGD("mouse_move : %d %d, %d %d\n", ev->root.x, ev->root.y, ev->x, ev->y);
+
         if (context->get_cur_pressed_window(ev->multi.device) != SCLWINDOW_INVALID &&
             get_window_rect(context->get_cur_pressed_window(ev->multi.device), &rect)) {
             sclint winwidth = rect.width;
@@ -463,9 +582,9 @@ Eina_Bool mouse_move (void *data, int type, void *event_info)
             do {
                 window = windows->get_nth_window_in_Z_order_list(index);
                 if (window) {
-                    SclWindowContext *winctx = windows->get_window_context(window);
-                    if (winctx) {
-                        windows->get_window_rect(window, &(winctx->geometry));
+                    SclWindowContext *window_context = windows->get_window_context(window);
+                    if (window_context) {
+                        windows->get_window_rect(window, &(window_context->geometry));
                         if (get_window_rect(window, &rect)) {
                             int adjustx = ev->root.x;
                             int adjusty = ev->root.y;
@@ -539,12 +658,12 @@ Eina_Bool mouse_move (void *data, int type, void *event_info)
 
 /**
  * Regists a event callback func to given window.
- * In this function, it should call serveral event functions of CSCLController class whenever an event has occured
+ * In this function, it should call several event functions of CSCLController class whenever an event has occurred
  * The below list shows what event function should be called.
  * - mouse_press (when the user presses mouse button)
  * - mouse_release (when the user releases mouse button)
  * - mouse_move (when the user drags mouse button)
- * - show_base_layout (when the expost event has occured)
+ * - show_base_layout (when the expost event has occurred)
  */
 void
 CSCLEventsImplEfl::connect_window_events(const sclwindow wnd, const sclint evt)
@@ -592,11 +711,18 @@ client_message_cb(void *data, int type, void *event)
 Eina_Bool timer_event(void *data)
 {
     SCL_DEBUG();
-    scl32 sendData = (scl32)data;
-    CSCLController *controller;
-    controller = CSCLController::get_instance();
-    if (controller) {
-        return controller->timer_event(sendData);
+    CSCLUtils *utils = CSCLUtils::get_instance();
+    CSCLController *controller = CSCLController::get_instance();
+
+    scl32 sendData = static_cast<scl32>(reinterpret_cast<uintptr_t>(data) & 0xffffffff);
+
+    if (controller && utils) {
+        scl16 id = SCL_LOWORD(sendData); /* Timer ID */
+        Eina_Bool ret = controller->timer_event(sendData);
+        if (!ret) {
+            utils->log("Returning Timer : %d %d\n", id, ret);
+        }
+        return ret;
     }
     return TRUE;
 }
@@ -612,6 +738,10 @@ CSCLEventsImplEfl::create_timer(const scl16 id, const scl32 interval, scl16 valu
     sclint data = SCL_MAKELONG(id, value);
     Ecore_Timer *pTimer = ecore_timer_add((double)interval / 1000.0, timer_event, (void*)data);
     if (pTimer) {
+        CSCLUtils *utils = CSCLUtils::get_instance();
+        if (utils) {
+            utils->log("Created Timer : %d %p\n", id, pTimer);
+        }
         if (addToMap) {
             idMap[id] = pTimer;
         }
@@ -629,6 +759,10 @@ CSCLEventsImplEfl::destroy_timer(const scl32 id)
         std::map<int, Ecore_Timer*>::iterator idx = idMap.find(id);
         //if ((*idx).first == id) {
         if (idx != idMap.end()) {
+            CSCLUtils *utils = CSCLUtils::get_instance();
+            if (utils) {
+                utils->log("Destoyed Timer : %d %p\n", (*idx).first, (*idx).second);
+            }
             ecore_timer_del((*idx).second);
             idMap.erase((*idx).first);
             //break;
@@ -645,6 +779,11 @@ CSCLEventsImplEfl::destroy_all_timer()
     SCL_DEBUG();
     for ( std::map<int, Ecore_Timer*>::iterator idx = idMap.begin(); idx != idMap.end(); ++idx) {
         ecore_timer_del((*idx).second);
+
+        CSCLUtils *utils = CSCLUtils::get_instance();
+        if (utils) {
+            utils->log("Destroyed Timer : %d %p\n", (*idx).first, (*idx).second);
+        }
     }
     idMap.clear();
 }
@@ -653,7 +792,7 @@ void
 CSCLEventsImplEfl::generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y)
 {
     CSCLWindows *windows = CSCLWindows::get_instance();
-    SclWindowContext *winctx = NULL;
+    SclWindowContext *window_context = NULL;
 
     static const sclint MAX_DEVICES = 100;
     static sclboolean pressed[MAX_DEVICES] = { FALSE };
@@ -667,11 +806,11 @@ CSCLEventsImplEfl::generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y)
                         pressed[loop] = TRUE;
                         Ecore_Event_Mouse_Button evt;
                         evt.window = elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window()));
-                        //winctx = windows->get_window_context(windows->get_base_window(), FALSE);
-                        winctx = windows->get_window_context(windows->get_base_window());
-                        if (winctx) {
-                            evt.root.x = x + winctx->geometry.x;
-                            evt.root.y = y + winctx->geometry.y;
+                        //window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+                        window_context = windows->get_window_context(windows->get_base_window());
+                        if (window_context) {
+                            evt.root.x = x + window_context->geometry.x;
+                            evt.root.y = y + window_context->geometry.y;
                             evt.multi.device = loop;
                             mouse_press(NULL, 0, &evt);
                         }
@@ -688,11 +827,11 @@ CSCLEventsImplEfl::generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y)
                         pressed[loop] = FALSE;
                         Ecore_Event_Mouse_Button evt;
                         evt.window = elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window()));
-                        //winctx = windows->get_window_context(windows->get_base_window(), FALSE);
-                        winctx = windows->get_window_context(windows->get_base_window());
-                        if (winctx) {
-                            evt.root.x = x + winctx->geometry.x;
-                            evt.root.y = y + winctx->geometry.y;
+                        //window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+                        window_context = windows->get_window_context(windows->get_base_window());
+                        if (window_context) {
+                            evt.root.x = x + window_context->geometry.x;
+                            evt.root.y = y + window_context->geometry.y;
                             evt.multi.device = loop;
                             mouse_release(NULL, 0, &evt);
                         }
@@ -708,11 +847,11 @@ CSCLEventsImplEfl::generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y)
                     if (pressed[loop] == TRUE) {
                         Ecore_Event_Mouse_Move evt;
                         evt.window = elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window()));
-                        //winctx = windows->get_window_context(windows->get_base_window(), FALSE);
-                        winctx = windows->get_window_context(windows->get_base_window());
-                        if (winctx) {
-                            evt.root.x = x + winctx->geometry.x;
-                            evt.root.y = y + winctx->geometry.y;
+                        //window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+                        window_context = windows->get_window_context(windows->get_base_window());
+                        if (window_context) {
+                            evt.root.x = x + window_context->geometry.x;
+                            evt.root.y = y + window_context->geometry.y;
                             evt.multi.device = loop;
                             mouse_move(NULL, 0, &evt);
                         }
@@ -721,6 +860,8 @@ CSCLEventsImplEfl::generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y)
                 }
             }
             break;
+            default:
+            break;
         }
     }
 }
index 5447fcc..081c1ab 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -50,6 +50,7 @@ private:
     Ecore_Event_Handler *m_mouse_move_handler;
     Ecore_Event_Handler *m_mouse_up_handler;
     Ecore_Event_Handler *m_xclient_msg_handler;
+    Ecore_Event_Handler *m_key_pressed_handler;
 };
 } /* End of scl namespace */
 #endif
index c2acdcf..e60d220 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -73,12 +73,15 @@ CSCLGraphicsImplEfl::~CSCLGraphicsImplEfl()
 
 void CSCLGraphicsImplEfl::init()
 {
-
+    m_highlight_ui_object = NULL;
 }
 
 void CSCLGraphicsImplEfl::fini()
 {
-
+    if (m_highlight_ui_object) {
+        evas_object_del(m_highlight_ui_object);
+        m_highlight_ui_object = NULL;
+    }
 }
 
 Evas_Object* extract_partimage_from_fullimage(
@@ -143,16 +146,23 @@ CSCLGraphicsImplEfl::draw_image(sclwindow window, const scldrawctx draw_ctx, scl
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
-    SclWindowContext *winctx = NULL;
-    SclWindowContext *targetctx = NULL;
+    SclWindowContext *window_context = NULL;
+    SclWindowContext *target_window_context = NULL;
     if (windows && window) {
-        //winctx = windows->get_window_context(window, FALSE);
-        winctx = windows->get_window_context(window);
-        //targetctx = windows->get_window_context(draw_ctx, FALSE);
-        targetctx = windows->get_window_context(draw_ctx);
+        //window_context = windows->get_window_context(window, FALSE);
+        window_context = windows->get_window_context(window);
+        //target_window_context = windows->get_window_context(draw_ctx, FALSE);
+        target_window_context = windows->get_window_context(draw_ctx);
     }
 
-    if (winctx && targetctx && image_path && utils && cache && windows) {
+    if (window_context && target_window_context && image_path && utils && cache && windows) {
+        sclboolean is_highlight_ui = FALSE;
+        sclchar buf[_POSIX_PATH_MAX] = {0};
+        utils->get_decomposed_path(buf, IMG_PATH_PREFIX, image_path);
+        if (strcmp(buf, SCL_HIGHLIGHT_UI_IMAGE) == 0) {
+            is_highlight_ui = TRUE;
+        }
+
         if (strlen(image_path) > 0) {
 #ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
             if (window == windows->get_magnifier_window()) {
@@ -209,127 +219,144 @@ CSCLGraphicsImplEfl::draw_image(sclwindow window, const scldrawctx draw_ctx, scl
             }
             if (!bFound) {
 #endif
-            EFLObject *object = new EFLObject;
             EFLObject *clip_object = NULL;
-            if (object) {
-                Evas_Object *window_object = (Evas_Object*)window;
-                if (winctx->is_virtual) {
-                    window_object = static_cast<Evas_Object*>(windows->get_base_window());
-                }
 
-                Evas *evas = evas_object_evas_get(window_object);
-                Evas_Object *image_object = evas_object_image_add(evas);
-                object->extracted = FALSE;
+            Evas_Object *window_object = (Evas_Object*)window;
+            if (window_context->is_virtual) {
+                window_object = static_cast<Evas_Object*>(windows->get_base_window());
+            }
 
-                if (image_object) {
-                    int image_width = 0;
-                    int image_height = 0;
-                    evas_object_image_file_set(image_object, image_path, NULL);
-                    evas_object_image_size_get(image_object, &image_width, &image_height);
-                    if (cachedinfo) {
-                        evas_object_image_border_set(image_object,
-                                cachedinfo->nine_patch_left,
-                                cachedinfo->nine_patch_right,
-                                cachedinfo->nine_patch_top,
-                                cachedinfo->nine_patch_bottom);
-                    } else {
-                        const SclNinePatchInfo *nine_patch_info = utils->get_nine_patch_info(image_path);
-                        if (nine_patch_info) {
+            Evas *evas = evas_object_evas_get(window_object);
+            Evas_Object *image_object = NULL;
+            if (is_highlight_ui && m_highlight_ui_object) {
+                image_object = m_highlight_ui_object;
+                evas_object_move(image_object, dest_x, dest_y);
+                evas_object_raise(image_object);
+                evas_object_show(image_object);
+            } else {
+                EFLObject *object = new EFLObject;
+                if (object) {
+                    image_object = evas_object_image_add(evas);
+                    object->extracted = FALSE;
+
+                    if (image_object) {
+                        int image_width = 0;
+                        int image_height = 0;
+                        evas_object_image_file_set(image_object, image_path, NULL);
+                        evas_object_image_size_get(image_object, &image_width, &image_height);
+                        if (cachedinfo) {
                             evas_object_image_border_set(image_object,
-                                    nine_patch_info->left, nine_patch_info->right, nine_patch_info->top, nine_patch_info->bottom);
-                        }
-                    }
-                    const SclLayout *layout = cache->get_cur_layout(window);
-                    if (layout) {
-                        if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
-                            image_width = utils->get_scaled_x(image_width);
-                            image_height = utils->get_scaled_y(image_height);
+                                    cachedinfo->nine_patch_left,
+                                    cachedinfo->nine_patch_right,
+                                    cachedinfo->nine_patch_top,
+                                    cachedinfo->nine_patch_bottom);
                         } else {
-                            image_width = utils->get_scaled_y(image_width);
-                            image_height = utils->get_scaled_x(image_height);
+                            const SclNinePatchInfo *nine_patch_info = utils->get_nine_patch_info(image_path);
+                            if (nine_patch_info) {
+                                evas_object_image_border_set(image_object,
+                                        nine_patch_info->left, nine_patch_info->right, nine_patch_info->top, nine_patch_info->bottom);
+                            }
                         }
-                    }
-                    if (src_width == -1 && src_height == -1) {
-                        src_width = image_width;
-                        src_height = image_height;
-                    }
-                    if ((src_width > 0 && src_height > 0) && (image_width != dest_width || image_height != dest_height) && extrace_image) {
-#ifdef EXTRACT_PARTIMAGE
-                        Evas_Object *newobj = extract_partimage_from_fullimage(image_object, src_x, src_y, 0, 0, src_width, src_height);
-                        object->extracted = TRUE;
-                        evas_object_del(image_object);
-                        image_object = newobj;
-                        evas_object_move(image_object, dest_x, dest_y);
-                        if (dest_width > 0 && dest_height > 0) {
-                            evas_object_image_fill_set(image_object, 0, 0, dest_width,dest_height);
-                            evas_object_resize(image_object, dest_width, dest_height);
+                        const SclLayout *layout = cache->get_cur_layout(window);
+                        if (layout) {
+                            if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
+                                image_width = utils->get_scaled_x(image_width);
+                                image_height = utils->get_scaled_y(image_height);
+                            } else {
+                                image_width = utils->get_scaled_y(image_width);
+                                image_height = utils->get_scaled_x(image_height);
+                            }
                         }
-#else
-                        //evas_object_move(image_object, src_x - dest_x, src_y - dest_y);
-                        evas_object_move(image_object, dest_x - src_x, dest_y - src_y);
-                        evas_object_image_fill_set(image_object, 0, 0, image_width, image_height);
-                        evas_object_resize(image_object, image_width, image_height);
-
-                        Evas_Object *clipper = evas_object_rectangle_add(evas);
-                        evas_object_color_set(clipper, 255, 255, 255, 255);
-                        //evas_object_color_set(clipper, 0, 0, 0, 0);
-                        evas_object_move(clipper, dest_x, dest_y);
-                        evas_object_resize(clipper, dest_width, dest_height);
-                        evas_object_clip_set(image_object, clipper);
-                        evas_object_show(clipper);
-
-                        clip_object = new EFLObject;
-                        clip_object->object = clipper;
-                        clip_object->type = EFLOBJECT_CLIPOBJECT;
-                        clip_object->position.x = dest_x;
-                        clip_object->position.y = dest_y;
-                        clip_object->position.width = dest_width;
-                        clip_object->position.height = dest_height;
-                        clip_object->etc_info = image_path;
-                        clip_object->extracted = FALSE;
-                        clip_object->data = NULL;
-#endif
-                    } else {
-                        evas_object_move(image_object, dest_x, dest_y);
-                        if (dest_width > 0 && dest_height > 0) {
-                            evas_object_image_fill_set(image_object, 0, 0, dest_width,dest_height);
-                            evas_object_resize(image_object, dest_width, dest_height);
+                        if (src_width == -1 && src_height == -1) {
+                            src_width = image_width;
+                            src_height = image_height;
+                        }
+                        if ((src_width > 0 && src_height > 0) &&
+                            (image_width != dest_width || image_height != dest_height) && extrace_image) {
+    #ifdef EXTRACT_PARTIMAGE
+                            Evas_Object *newobj = extract_partimage_from_fullimage(image_object, src_x, src_y, 0, 0, src_width, src_height);
+                            object->extracted = TRUE;
+                            evas_object_del(image_object);
+                            image_object = newobj;
+                            evas_object_move(image_object, dest_x, dest_y);
+                            if (dest_width > 0 && dest_height > 0) {
+                                evas_object_image_fill_set(image_object, 0, 0, dest_width,dest_height);
+                                evas_object_resize(image_object, dest_width, dest_height);
+                            }
+    #else
+                            //evas_object_move(image_object, src_x - dest_x, src_y - dest_y);
+                            evas_object_move(image_object, dest_x - src_x, dest_y - src_y);
+                            evas_object_image_fill_set(image_object, 0, 0, image_width, image_height);
+                            evas_object_resize(image_object, image_width, image_height);
+
+                            Evas_Object *clipper = evas_object_rectangle_add(evas);
+                            evas_object_color_set(clipper, 255, 255, 255, 255);
+                            //evas_object_color_set(clipper, 0, 0, 0, 0);
+                            evas_object_move(clipper, dest_x, dest_y);
+                            evas_object_resize(clipper, dest_width, dest_height);
+                            evas_object_clip_set(image_object, clipper);
+                            evas_object_show(clipper);
+
+                            clip_object = new EFLObject;
+                            clip_object->object = clipper;
+                            clip_object->type = EFLOBJECT_CLIPOBJECT;
+                            clip_object->position.x = dest_x;
+                            clip_object->position.y = dest_y;
+                            clip_object->position.width = dest_width;
+                            clip_object->position.height = dest_height;
+                            clip_object->etc_info = image_path;
+                            clip_object->extracted = FALSE;
+                            clip_object->data = NULL;
+    #endif
+                        } else {
+                            evas_object_move(image_object, dest_x, dest_y);
+                            if (dest_width > 0 && dest_height > 0) {
+                                evas_object_image_fill_set(image_object, 0, 0, dest_width,dest_height);
+                                evas_object_resize(image_object, dest_width, dest_height);
+                            }
+                        }
+                        evas_object_raise(image_object);
+                        evas_object_show(image_object);
+
+                        //evas_object_event_callback_add((Evas_Object*)image_object, EVAS_CALLBACK_MOUSE_DOWN, mouse_press, window);
+                        /*evas_object_event_callback_add((Evas_Object*)image_object, EVAS_CALLBACK_MOUSE_UP, mouse_release, window);
+                        evas_object_event_callback_add((Evas_Object*)image_object, EVAS_CALLBACK_MOUSE_MOVE, mouse_move, window);*/
+
+                        object->object = image_object;
+                        object->type = EFLOBJECT_IMAGE;
+                        object->position.x = dest_x;
+                        object->position.y = dest_y;
+                        object->position.width = dest_width;
+                        object->position.height = dest_height;
+                        object->etc_info = image_path;
+                        object->data = clip_object;
+
+                        if (is_highlight_ui) {
+                            delete object;
+                        } else {
+                            target_window_context->etc_info =
+                                eina_list_append((Eina_List*)(target_window_context->etc_info), object);
+                            if (clip_object) {
+                                target_window_context->etc_info =
+                                    eina_list_append((Eina_List*)(target_window_context->etc_info), clip_object);
+                            }
                         }
-                    }
-                    evas_object_raise(image_object);
-                    evas_object_show(image_object);
-
-                    //evas_object_event_callback_add((Evas_Object*)image_object, EVAS_CALLBACK_MOUSE_DOWN, mouse_press, window);
-                    /*evas_object_event_callback_add((Evas_Object*)image_object, EVAS_CALLBACK_MOUSE_UP, mouse_release, window);
-                    evas_object_event_callback_add((Evas_Object*)image_object, EVAS_CALLBACK_MOUSE_MOVE, mouse_move, window);*/
-
-                    object->object = image_object;
-                    object->type = EFLOBJECT_IMAGE;
-                    object->position.x = dest_x;
-                    object->position.y = dest_y;
-                    object->position.width = dest_width;
-                    object->position.height = dest_height;
-                    object->etc_info = image_path;
-                    object->data = clip_object;
-
-                    targetctx->etc_info = eina_list_append((Eina_List*)(targetctx->etc_info), object);
-                    if (clip_object) {
-                        targetctx->etc_info = eina_list_append((Eina_List*)(targetctx->etc_info), clip_object);
-                    }
 
-                    /* FIXME : this is for placing the background image at the lowest depth */
-                    sclint window_layer = 29000;
-                    if (!windows->is_base_window(reinterpret_cast<sclwindow>(draw_ctx))) {
-                        window_layer = 29010;
-                    }
-                    //SclRectangle rt;
-                    //windows->get_window_rect(window, &rt);
-                    //if (rt.width == dest_width && rt.height == dest_height) {
-                    if (winctx->geometry.width == dest_width && winctx->geometry.height == dest_height) {
-                        //evas_object_lower(image_object);
-                        evas_object_layer_set(image_object, window_layer + 0);
-                    } else {
-                        evas_object_layer_set(image_object, window_layer + 1);
+                        /* FIXME : this is for placing the background image at the lowest depth */
+                        sclint window_layer = 29000;
+                        if (!windows->is_base_window(reinterpret_cast<sclwindow>(draw_ctx))) {
+                            window_layer = 29010;
+                        }
+                        //SclRectangle rt;
+                        //windows->get_window_rect(window, &rt);
+                        //if (rt.width == dest_width && rt.height == dest_height) {
+                        if (window_context->geometry.width == dest_width &&
+                            window_context->geometry.height == dest_height) {
+                            //evas_object_lower(image_object);
+                            evas_object_layer_set(image_object, window_layer + 0);
+                        } else {
+                            evas_object_layer_set(image_object, window_layer + 1);
+                        }
                     }
                 }
             }
@@ -438,17 +465,17 @@ CSCLGraphicsImplEfl::draw_text(sclwindow window, const scldrawctx draw_ctx, cons
     SCL_DEBUG();
 
     CSCLWindows *windows = CSCLWindows::get_instance();
-    SclWindowContext *winctx = NULL;
-    SclWindowContext *targetctx = NULL;
+    SclWindowContext *window_context = NULL;
+    SclWindowContext *target_window_context = NULL;
 
     if (windows && window) {
-        //winctx = windows->get_window_context(window, FALSE);
-        winctx = windows->get_window_context(window);
-        //targetctx = windows->get_window_context(draw_ctx, FALSE);
-        targetctx = windows->get_window_context(draw_ctx);
+        //window_context = windows->get_window_context(window, FALSE);
+        window_context = windows->get_window_context(window);
+        //target_window_context = windows->get_window_context(draw_ctx, FALSE);
+        target_window_context = windows->get_window_context(draw_ctx);
     }
 
-    if (winctx && targetctx && str && windows) {
+    if (window_context && target_window_context && str && windows) {
         if (strlen(str) > 0) {
 #ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
             if (window == windows->get_magnifier_window()) {
@@ -518,7 +545,7 @@ CSCLGraphicsImplEfl::draw_text(sclwindow window, const scldrawctx draw_ctx, cons
             if (object) {
                 object->extracted = FALSE;
                 Evas_Object *window_object = (Evas_Object*)window;
-                if (winctx->is_virtual) {
+                if (window_context->is_virtual) {
                     window_object = static_cast<Evas_Object*>(windows->get_base_window());
                 }
                 Evas *evas = evas_object_evas_get(window_object);
@@ -607,7 +634,7 @@ CSCLGraphicsImplEfl::draw_text(sclwindow window, const scldrawctx draw_ctx, cons
                     object->position.y = pos_y;
                     object->position.width = width;
                     object->position.height = height;
-                    object->etc_info = (char*)str;
+                    object->etc_info = str;
                     object->data = st;
 
                     sclint calwidth, calheight;
@@ -643,7 +670,7 @@ CSCLGraphicsImplEfl::draw_text(sclwindow window, const scldrawctx draw_ctx, cons
                             color.r, color.g, color.b, color.a, padding_x, padding_x);
                         evas_textblock_style_set(st, strStyle);
                         evas_object_textblock_style_set(text_object, st);
-                        char *markup = evas_textblock_text_utf8_to_markup(text_object, str);
+                        markup = evas_textblock_text_utf8_to_markup(text_object, str);
                         if (markup) {
                             evas_object_textblock_text_markup_set(text_object, markup);
                             free(markup);
@@ -679,7 +706,8 @@ CSCLGraphicsImplEfl::draw_text(sclwindow window, const scldrawctx draw_ctx, cons
                     /*evas_object_event_callback_add((Evas_Object*)text_object, EVAS_CALLBACK_MOUSE_UP, mouse_release, window);
                     evas_object_event_callback_add((Evas_Object*)text_object, EVAS_CALLBACK_MOUSE_MOVE, mouse_move, window);*/
 
-                    targetctx->etc_info = eina_list_append((Eina_List*)(targetctx->etc_info), object);
+                    target_window_context->etc_info =
+                        eina_list_append((Eina_List*)(target_window_context->etc_info), object);
 
                     sclint window_layer = 29000;
                     if (!windows->is_base_window(reinterpret_cast<sclwindow>(draw_ctx))) {
@@ -741,23 +769,23 @@ CSCLGraphicsImplEfl::draw_rectangle(sclwindow window, const scldrawctx draw_ctx,
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
-    SclWindowContext *winctx = NULL;
-    SclWindowContext *targetctx = NULL;
+    SclWindowContext *window_context = NULL;
+    SclWindowContext *target_window_context = NULL;
 
     if (windows && window) {
-        //winctx = windows->get_window_context(window, FALSE);
-        winctx = windows->get_window_context(window);
-        //targetctx = windows->get_window_context(draw_ctx, FALSE);
-        targetctx = windows->get_window_context(draw_ctx);
+        //window_context = windows->get_window_context(window, FALSE);
+        window_context = windows->get_window_context(window);
+        //target_window_context = windows->get_window_context(draw_ctx, FALSE);
+        target_window_context = windows->get_window_context(draw_ctx);
     }
 
-    if (winctx && utils && cache && windows && targetctx) {
+    if (window_context && utils && cache && windows && target_window_context) {
         EFLObject *object = new EFLObject;
         if (object) {
             Evas_Object *window_object = (Evas_Object*)window;
-            if (winctx->is_virtual) {
+            if (window_context->is_virtual) {
                 window_object = static_cast<Evas_Object*>(windows->get_base_window());
-            //    //winctx = windows->get_window_context(windows->get_base_window());
+            //    //window_context = windows->get_window_context(windows->get_base_window());
             }
 
             Evas *evas = evas_object_evas_get(window_object);
@@ -783,7 +811,8 @@ CSCLGraphicsImplEfl::draw_rectangle(sclwindow window, const scldrawctx draw_ctx,
             object->etc_info = NULL;
             object->data = NULL;
 
-            targetctx->etc_info = eina_list_append((Eina_List*)(targetctx->etc_info), object);
+            target_window_context->etc_info =
+                eina_list_append((Eina_List*)(target_window_context->etc_info), object);
 
             sclint window_layer = 29000;
             if (!windows->is_base_window(reinterpret_cast<sclwindow>(draw_ctx))) {
index eb80925..469273b 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -23,6 +23,8 @@
 //#define DO_NOT_MOVE_MAGNIFIER_WINDOW
 //#define FULL_SCREEN_TEST
 
+#include <Evas.h>
+
 /* Still an experimental feature.. Will be refined after being stabilized */
 //#define TEST_NEWBACKEND
 #ifdef TEST_NEWBACKEND
@@ -95,12 +97,14 @@ public :
                    SCLLabelAlignment align, sclint padding_x, sclint padding_y, sclint inner_width, sclint inner_height);
 
     void draw_rectangle(sclwindow window, const scldrawctx draw_ctx, scldouble pos_x, scldouble pos_y,
-                        scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color, sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha);
+                        scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color,
+                        sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha);
     scldrawctx begin_paint(const sclwindow window, const sclboolean force_draw = FALSE);
     void end_paint(const sclwindow window, scldrawctx draw_ctx);
     SclSize get_image_size(sclchar* image_path);
     SclSize get_text_size(const SclFontInfo &fontinfo, const sclchar *str);
 private:
+    Evas_Object *m_highlight_ui_object;
 };
 } /* End of scl namespace */
 #endif
index b6c9c75..54de5ff 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 #include <malloc.h>
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
+#include <X11/Xutil.h>
+#include <utilX.h>
+#include <dlog.h>
+#include "sclkeyfocushandler.h"
 
 using namespace scl;
 
@@ -73,6 +77,25 @@ CSCLWindowsImplEfl::~CSCLWindowsImplEfl()
     SCL_DEBUG();
 }
 
+static Ecore_Event_Handler *_candidate_show_handler         = NULL;
+
+static Eina_Bool x_event_window_show_cb (void *data, int ev_type, void *event)
+{
+    CSCLWindows *windows = CSCLWindows::get_instance();
+    Evas_Object *window = (Evas_Object *)windows->get_base_window();
+    Ecore_X_Event_Window_Show *e = (Ecore_X_Event_Window_Show*)event;
+
+    if(e->win == elm_win_xwindow_get(window)) {
+        LOGD("INSIDE =-=-=-=- x_event_window_show_cb, Trying to Grab Key Board : \n");
+#ifdef USING_KEY_GRAB
+        CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
+        focus_handler->grab_keyboard(windows->get_base_window());
+#endif
+    }
+    return ECORE_CALLBACK_RENEW;
+}
+
+
 void CSCLWindowsImplEfl::init()
 {
 
@@ -87,15 +110,18 @@ void CSCLWindowsImplEfl::fini()
  * Create a content window and binds it into given parent window as a child
  */
 sclwindow
-CSCLWindowsImplEfl::create_base_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplEfl::create_base_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
 {
     SCL_DEBUG();
 
     sclwindow ret = SCLWINDOW_INVALID;
 
-    if (winctx) {
-        winctx->etc_info = NULL;
-        winctx->window = parent;
+    if (window_context) {
+        window_context->etc_info = NULL;
+        window_context->window = parent;
+
+    //Adding window show event handler
+    _candidate_show_handler = ecore_event_handler_add (ECORE_X_EVENT_WINDOW_SHOW, x_event_window_show_cb, NULL);
 
 #ifndef APPLY_WINDOW_MANAGER_CHANGE
         ecore_x_icccm_name_class_set(elm_win_xwindow_get(static_cast<Evas_Object*>(parent)), "Virtual Keyboard", "ISF" );
@@ -108,7 +134,7 @@ CSCLWindowsImplEfl::create_base_window(const sclwindow parent, SclWindowContext
         }
 #endif
 
-        ret = winctx->window;
+        ret = window_context->window;
     }
 
     CSCLUtils *utils = CSCLUtils::get_instance();
@@ -124,14 +150,12 @@ CSCLWindowsImplEfl::create_base_window(const sclwindow parent, SclWindowContext
  * Creates a window
  */
 sclwindow
-CSCLWindowsImplEfl::create_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplEfl::create_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
 {
     SCL_DEBUG();
 
     Evas_Object *win = NULL;
     win = elm_win_add(static_cast<Evas_Object*>(parent), "SCLPopup", ELM_WIN_BASIC);
-    Ecore_X_Display* dpy;
-    dpy = ecore_x_display_get();
 
     elm_win_borderless_set(win, EINA_TRUE);
     elm_win_alpha_set(win, EINA_TRUE);
@@ -157,6 +181,8 @@ CSCLWindowsImplEfl::create_window(const sclwindow parent, SclWindowContext *winc
     ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(win),
         rotation_values_EFL[ROTATION_90_CCW], 0, 0, new_width, new_height);
 
+    int rots[4] = {0, 90, 180, 270};
+    elm_win_wm_rotation_available_rotations_set(win, rots, 4);
 #ifndef FULL_SCREEN_TEST
     //evas_object_resize(win, width, height);
 #endif
@@ -169,17 +195,24 @@ CSCLWindowsImplEfl::create_window(const sclwindow parent, SclWindowContext *winc
 
     set_window_accepts_focus(win, FALSE);
 
-    /*ecore_x_icccm_transient_for_set(elm_win_xwindow_get(static_cast<Evas_Object*>(win)), 
-        elm_win_xwindow_get(static_cast<Evas_Object*>(parent)));*/
+    Ecore_X_Atom ATOM_WINDOW_EFFECT_ENABLE  = 0;
+    unsigned int effect_state = 0; // 0 -> disable effect 1-> enable effect
+
+    CSCLUtils *utils = CSCLUtils::get_instance();
+    ATOM_WINDOW_EFFECT_ENABLE = ecore_x_atom_get("_NET_CM_WINDOW_EFFECT_ENABLE");
+    if (ATOM_WINDOW_EFFECT_ENABLE) {
+        ecore_x_window_prop_card32_set(elm_win_xwindow_get(static_cast<Evas_Object*>(win)), ATOM_WINDOW_EFFECT_ENABLE, &effect_state, 1);
+    } else {
+        if (utils) {
+            utils->log("Could not get _NET_CM_WINDOW_EFFECT_ENABLE ATOM \n");
+        }
+    }
 
-    utilx_set_window_effect_state((Display*)dpy, elm_win_xwindow_get(static_cast<Evas_Object*>(win)), 0);
-    //utilx_set_window_effect_style((Display*)dpy, elm_win_xwindow_get(static_cast<Evas_Object*>(win)), UTILX_EFFECT_TYPE_MAP, UTILX_EFFECT_STYLE_NONE);
 #endif
 
     set_window_rotation(win, context->get_rotation());
 
     //elm_win_override_set(win, EINA_TRUE);
-    CSCLUtils *utils = CSCLUtils::get_instance();
     if (utils) {
         utils->log("WinEfl_createwin %p %p, %d %d\n",
                 win, elm_win_xwindow_get(static_cast<Evas_Object*>(win)), width, height);
@@ -193,31 +226,24 @@ CSCLWindowsImplEfl::create_window(const sclwindow parent, SclWindowContext *winc
 * Creates a window
 */
 sclwindow
-CSCLWindowsImplEfl::create_magnifier_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplEfl::create_magnifier_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
 {
     SCL_DEBUG();
 
     Evas_Object *win = NULL;
-    win = elm_win_add(static_cast<Evas_Object*>(parent), "Magnfier", ELM_WIN_BASIC);
-    Ecore_X_Display* dpy;
-    dpy = ecore_x_display_get();
+    win = elm_win_add(static_cast<Evas_Object*>(parent), "Magnifier", ELM_WIN_BASIC);
 
     elm_win_borderless_set(win, EINA_TRUE);
     elm_win_alpha_set(win, EINA_TRUE);
     elm_win_title_set(win, "Keyboard Magnifier Window");
 
-    /*
-     * FIXME set override to let window manager responds elm_win_raise request
-     */
-    //elm_win_override_set(win, EINA_TRUE);
-
 #ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
     CSCLUtils *utils = CSCLUtils::get_instance();
     CSCLWindows *windows = CSCLWindows::get_instance();
     sclint scrx, scry, winx, winy;
     utils->get_screen_resolution(&scrx, &scry);
-    SclWindowContext *winctx = windows->get_window_context(windows->get_base_window());
-    evas_object_resize(win, scrx, height + winctx->height);
+    SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+    evas_object_resize(win, scrx, height + window_context->height);
 #else
     //evas_object_resize(win, width, height);
 #endif
@@ -242,11 +268,18 @@ CSCLWindowsImplEfl::create_magnifier_window(const sclwindow parent, SclWindowCon
 
     set_window_accepts_focus(win, FALSE);
 
-    /*ecore_x_icccm_transient_for_set(elm_win_xwindow_get(static_cast<Evas_Object*>(win)), 
-        elm_win_xwindow_get(static_cast<Evas_Object*>(parent)));*/
+    Ecore_X_Atom ATOM_WINDOW_EFFECT_ENABLE  = 0;
+    unsigned int effect_state = 0; // 0 -> disable effect 1-> enable effect
 
-    utilx_set_window_effect_state((Display*)dpy, elm_win_xwindow_get(static_cast<Evas_Object*>(win)), 0);
-    //utilx_set_window_effect_style((Display*)dpy, elm_win_xwindow_get(static_cast<Evas_Object*>(win)), UTILX_EFFECT_TYPE_MAP, UTILX_EFFECT_STYLE_NONE);
+    CSCLUtils *utils = CSCLUtils::get_instance();
+    ATOM_WINDOW_EFFECT_ENABLE = ecore_x_atom_get("_NET_CM_WINDOW_EFFECT_ENABLE");
+    if (ATOM_WINDOW_EFFECT_ENABLE) {
+        ecore_x_window_prop_card32_set(elm_win_xwindow_get(static_cast<Evas_Object*>(win)), ATOM_WINDOW_EFFECT_ENABLE, &effect_state, 1);
+    } else {
+        if (utils) {
+            utils->log("Could not get _NET_CM_WINDOW_EFFECT_ENABLE ATOM \n");
+        }
+    }
 #endif
 
     //evas_font_path_prepend(evas_object_evas_get(win), "/usr/share/SLP/fonts");
@@ -259,7 +292,6 @@ CSCLWindowsImplEfl::create_magnifier_window(const sclwindow parent, SclWindowCon
     utilx_set_window_effect_state((Display*)dpy, elm_win_xwindow_get(static_cast<Evas_Object*>(win)), EINA_TRUE);*/
 
     //elm_win_override_set(win, EINA_TRUE);
-    CSCLUtils *utils = CSCLUtils::get_instance();
     if (utils) {
         utils->log("WinEfl_createmagwin %p %p, %d %d\n",
             win, elm_win_xwindow_get(static_cast<Evas_Object*>(win)), width, height);
@@ -272,14 +304,12 @@ CSCLWindowsImplEfl::create_magnifier_window(const sclwindow parent, SclWindowCon
  * Creates the dim window
  */
 sclwindow
-CSCLWindowsImplEfl::create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplEfl::create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
 {
     SCL_DEBUG();
 
     Evas_Object *win = NULL;
     win = elm_win_add(static_cast<Evas_Object*>(parent), "SCLPopup", ELM_WIN_BASIC);
-    Ecore_X_Display* dpy;
-    dpy = ecore_x_display_get();
 
     elm_win_borderless_set(win, EINA_TRUE);
     elm_win_alpha_set(win, EINA_TRUE);
@@ -292,11 +322,18 @@ CSCLWindowsImplEfl::create_dim_window(const sclwindow parent, SclWindowContext *
 
     set_window_accepts_focus(win, FALSE);
 
-    /*ecore_x_icccm_transient_for_set(elm_win_xwindow_get(static_cast<Evas_Object*>(win)), 
-        elm_win_xwindow_get(static_cast<Evas_Object*>(parent)));*/
+    Ecore_X_Atom ATOM_WINDOW_EFFECT_ENABLE  = 0;
+    unsigned int effect_state = 0; // 0 -> disable effect 1-> enable effect
 
-    utilx_set_window_effect_state((Display*)dpy, elm_win_xwindow_get(static_cast<Evas_Object*>(win)), 0);
-    //utilx_set_window_effect_style((Display*)dpy, elm_win_xwindow_get(static_cast<Evas_Object*>(win)), UTILX_EFFECT_TYPE_MAP, UTILX_EFFECT_STYLE_NONE);
+    CSCLUtils *utils = CSCLUtils::get_instance();
+    ATOM_WINDOW_EFFECT_ENABLE = ecore_x_atom_get("_NET_CM_WINDOW_EFFECT_ENABLE");
+    if (ATOM_WINDOW_EFFECT_ENABLE) {
+        ecore_x_window_prop_card32_set(elm_win_xwindow_get(static_cast<Evas_Object*>(win)), ATOM_WINDOW_EFFECT_ENABLE, &effect_state, 1);
+    } else {
+        if (utils) {
+            utils->log("Could not get _NET_CM_WINDOW_EFFECT_ENABLE ATOM \n");
+        }
+    }
 #endif
 
     const char *szProfile[] = {"mobile", ""};
@@ -313,10 +350,8 @@ CSCLWindowsImplEfl::create_dim_window(const sclwindow parent, SclWindowContext *
     evas_object_color_set(bg, color.r, color.g, color.b, color.a);
     evas_object_show(bg);*/
 
-    //elm_win_override_set(win, EINA_TRUE);
     hide_window(win);
 
-    CSCLUtils *utils = CSCLUtils::get_instance();
     if (utils) {
         utils->log("WinEfl_createdimwin %p %p, %d %d\n",
             win, elm_win_xwindow_get(static_cast<Evas_Object*>(win)), width, height);
@@ -335,11 +370,18 @@ CSCLWindowsImplEfl::set_parent(const sclwindow parent, const sclwindow window)
     SCL_DEBUG();
 
     if (parent && window) {
-        ecore_x_icccm_transient_for_set(elm_win_xwindow_get(static_cast<Evas_Object*>(window)), 
+        ecore_x_icccm_transient_for_set(elm_win_xwindow_get(static_cast<Evas_Object*>(window)),
                 elm_win_xwindow_get(static_cast<Evas_Object*>(parent)));
     }
 }
 
+Eina_Bool destroy_later(void *data)
+{
+    evas_object_hide((Evas_Object*)data);
+    evas_object_del((Evas_Object*)data);
+    return ECORE_CALLBACK_CANCEL;
+}
+
 /**
  * Destroys the given window
  */
@@ -351,71 +393,79 @@ CSCLWindowsImplEfl::destroy_window(sclwindow window)
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
 
-    SclWindowContext *winctx = NULL;
-    if (windows && window) {
-        winctx = windows->get_window_context(window);
-    }
-
-    if (windows && utils && winctx) {
-        if (winctx->etc_info) {
-            Eina_List *list = (Eina_List*)(winctx->etc_info);
-            Eina_List *iter = NULL;
-            Eina_List *iter_next = NULL;
-            void *data = NULL;
+    SclWindowContext *window_context = NULL;
+    if (windows && window && utils) {
+        window_context = windows->get_window_context(window);
+        if (window_context) {
+            utils->log("WinEfl_destroywin %p %p (basewin %p mag %p)\n", window,
+                (!(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
+                windows->get_base_window(), windows->get_magnifier_window());
+            if (window_context->etc_info) {
+                Eina_List *list = (Eina_List*)(window_context->etc_info);
+                Eina_List *iter = NULL;
+                Eina_List *iter_next = NULL;
+                void *data = NULL;
 
-            EINA_LIST_FOREACH_SAFE(list, iter, iter_next, data) {
-                if (data) {
-                    EFLObject *object = (EFLObject*)(data);
-                    if (object) {
-                        Evas_Object* eo = object->object;
-                        if (object->extracted) {
-                            //evas_object_image_data_set(eo, NULL);
-                            void *data = evas_object_image_data_get(eo, 1);
-                            if (data) {
-                                free(data);
+                EINA_LIST_FOREACH_SAFE(list, iter, iter_next, data) {
+                    if (data) {
+                        EFLObject *object = (EFLObject*)(data);
+                        if (object) {
+                            Evas_Object* eo = object->object;
+                            if (object->extracted) {
+                                //evas_object_image_data_set(eo, NULL);
+                                void *image_data = evas_object_image_data_get(eo, 1);
+                                if (image_data) {
+                                    free(image_data);
+                                }
                             }
-                        }
-                        if (eo) {
-                            evas_object_del(eo);
-                            object->object = NULL;
-                        }
-                        if (object->type == EFLOBJECT_TEXTBLOCK) {
-                            Evas_Textblock_Style *st = (Evas_Textblock_Style*)(object->data);
-                            if (st) {
-                                evas_textblock_style_free(st);
+                            if (eo) {
+                                evas_object_del(eo);
+                                object->object = NULL;
                             }
+                            if (object->type == EFLOBJECT_TEXTBLOCK) {
+                                Evas_Textblock_Style *st = (Evas_Textblock_Style*)(object->data);
+                                if (st) {
+                                    evas_textblock_style_free(st);
+                                }
 #ifdef TEST_NEWBACKEND
-                            for(sclint loop = 0;loop < g_TextCache.size();loop++) {
-                                if (g_TextCache[loop].text == object->object) {
-                                    g_TextCache[loop].used = FALSE;
+                                for(sclint loop = 0;loop < g_TextCache.size();loop++) {
+                                    if (g_TextCache[loop].text == object->object) {
+                                        g_TextCache[loop].used = FALSE;
+                                    }
                                 }
-                            }
 #endif
-                        } else if (object->type == EFLOBJECT_IMAGE) {
+                            } else if (object->type == EFLOBJECT_IMAGE) {
 #ifdef TEST_NEWBACKEND
-                            for(sclint loop = 0;loop < g_ImageCache.size();loop++) {
-                                if (g_ImageCache[loop].image == object->object) {
-                                    g_ImageCache[loop].used = FALSE;
+                                for(sclint loop = 0;loop < g_ImageCache.size();loop++) {
+                                    if (g_ImageCache[loop].image == object->object) {
+                                        g_ImageCache[loop].used = FALSE;
+                                    }
                                 }
-                            }
 #endif
+                            }
+                            delete object;
                         }
-                        delete object;
                     }
+                    list = eina_list_remove_list(list, iter);
                 }
-                list = eina_list_remove_list(list, iter);
+                window_context->etc_info = NULL;
             }
-            winctx->etc_info = NULL;
-        }
 
-        if (!(winctx->is_virtual)) {
-            Evas_Object *win = (Evas_Object*)window;
-            evas_object_hide(win);
-            evas_object_del(win);
+            if (!(window_context->is_virtual)) {
+                /* FIXME : A workaround for the bug that event on a window being hidden is delivered to
+                    e17, instead of the window itself or the window right below - Should report to WM */
+                if (window == windows->get_nth_popup_window(SCL_WINDOW_Z_TOP)) {
+                    ecore_timer_add(0.1f, destroy_later, (void*)window);
+                } else {
+                    Evas_Object *win = (Evas_Object*)window;
+                    evas_object_hide(win);
+                    evas_object_del(win);
+                }
+            }
+            utils->log("WinEfl_destroywin %p %p (basewin %p mag %p)\n", window,
+                (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
+                windows->get_base_window(), windows->get_magnifier_window());
         }
-        utils->log("WinEfl_destroywin %p %p (basewin %p mag %p)\n",
-            window, elm_win_xwindow_get(static_cast<Evas_Object*>(window)),
-            windows->get_base_window(), windows->get_magnifier_window());
     }
 
     return TRUE;
@@ -432,10 +482,10 @@ CSCLWindowsImplEfl::show_window(const sclwindow window, sclboolean queue)
     CSCLContext *context = CSCLContext::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
     if (windows && context && window) {
-        SclWindowContext *winctx = windows->get_window_context(window);
+        SclWindowContext *window_context = windows->get_window_context(window);
         if (!(context->get_hidden_state())) {
-            if (winctx) {
-                if (!(winctx->is_virtual)) {
+            if (window_context) {
+                if (!(window_context->is_virtual)) {
                     evas_object_show((Evas_Object*)window);
                 }
 #ifdef APPLY_WINDOW_MANAGER_CHANGE
@@ -481,13 +531,16 @@ CSCLWindowsImplEfl::show_window(const sclwindow window, sclboolean queue)
              *
              * N_SE-52548: ...and modified if() for other popup windows as well...
              */
-            ecore_x_icccm_transient_for_set
-                (elm_win_xwindow_get(static_cast<Evas_Object*>(window)), app_window);
-            elm_win_raise((Evas_Object *)window);
+            if (window_context && !(window_context->is_virtual)) {
+                ecore_x_icccm_transient_for_set
+                    (elm_win_xwindow_get(static_cast<Evas_Object*>(window)), app_window);
+                elm_win_raise((Evas_Object *)window);
+            }
         }
 #endif
         utils->log("WinEfl_showwin %p %p (basewin %p mag %p)\n",
-            window, elm_win_xwindow_get(static_cast<Evas_Object*>(window)),
+            window,
+            (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
             windows->get_base_window(), windows->get_magnifier_window());
     }
 }
@@ -501,19 +554,32 @@ CSCLWindowsImplEfl::hide_window(const sclwindow window,  sclboolean fForce)
     SCL_DEBUG();
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
-    SclWindowContext *winctx = NULL;
+    SclWindowContext *window_context = NULL;
 
     if (windows && window) {
-        winctx = windows->get_window_context(window);
-        if (winctx) {
-            if (!(winctx->is_virtual)) {
+#ifdef USING_KEY_GRAB
+    if (window == windows->get_base_window()) {
+        CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
+        focus_handler->ungrab_keyboard(window);
+    }
+#endif
+
+        window_context = windows->get_window_context(window);
+        if (window_context) {
+            if (!(window_context->is_virtual)) {
                 Evas_Object *win = (Evas_Object*)window;
 #ifdef APPLY_WINDOW_MANAGER_CHANGE
                 if (windows->is_base_window(window)) {
                     elm_win_keyboard_mode_set(win, ELM_WIN_KEYBOARD_OFF);
                 } else {
 #endif
-                    evas_object_hide(win);
+                    /* FIXME : A workaround for the bug that event on a window being hidden is delivered to
+                        e17, instead of the window itself or the window right below - Should report to WM */
+                    if (window == windows->get_nth_popup_window(SCL_WINDOW_Z_TOP)) {
+                        evas_object_move(win, -10000, -10000);
+                    } else {
+                        evas_object_hide(win);
+                    }
 #ifdef APPLY_WINDOW_MANAGER_CHANGE
                 }
 #endif
@@ -523,12 +589,11 @@ CSCLWindowsImplEfl::hide_window(const sclwindow window,  sclboolean fForce)
 
     if (windows && utils && window) {
         // Memory optimization */
-        //if (window == windows->get_magnifier_window() || TRUE) {
         if (window == windows->get_magnifier_window() || window == windows->get_dim_window()) {
-            if (winctx) {
-                if (winctx->etc_info) {
+            if (window_context) {
+                if (window_context->etc_info) {
 
-                    Eina_List *list = (Eina_List*)(winctx->etc_info);
+                    Eina_List *list = (Eina_List*)(window_context->etc_info);
                     Eina_List *iter = NULL;
                     Eina_List *iter_next = NULL;
                     void *data = NULL;
@@ -544,9 +609,9 @@ CSCLWindowsImplEfl::hide_window(const sclwindow window,  sclboolean fForce)
                                 if (bShouldRemove) {
                                     Evas_Object* eo = object->object;
                                     if (object->extracted) {
-                                        void *data = evas_object_image_data_get(eo, 1);
-                                        if (data) {
-                                            free(data);
+                                        void *image_data = evas_object_image_data_get(eo, 1);
+                                        if (image_data) {
+                                            free(image_data);
                                         }
                                     }
                                     if (eo) {
@@ -581,7 +646,7 @@ CSCLWindowsImplEfl::hide_window(const sclwindow window,  sclboolean fForce)
                             iIndex++;
                         }
                     }
-                    winctx->etc_info = list;
+                    window_context->etc_info = list;
 #endif
                 }
             }
@@ -593,7 +658,8 @@ CSCLWindowsImplEfl::hide_window(const sclwindow window,  sclboolean fForce)
             malloc_trim(0);
         }
         utils->log("WinEfl_hidewin %p %p (basewin %p mag %p)\n",
-            window, elm_win_xwindow_get(static_cast<Evas_Object*>(window)),
+            window,
+            (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
             windows->get_base_window(), windows->get_magnifier_window());
     }
 }
@@ -611,13 +677,12 @@ CSCLWindowsImplEfl::move_window(const sclwindow window, scl16 x, scl16 y)
     CSCLWindows *windows = CSCLWindows::get_instance();
 
     if (utils && context && windows && window) {
-        //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
-        SclWindowContext *winctx = windows->get_window_context(window);
+        SclWindowContext *window_context = windows->get_window_context(window);
         unsigned short win_width = 0;
         unsigned short win_height = 0;
-        if (winctx) {
-            win_width = winctx->geometry.width;
-            win_height = winctx->geometry.height;
+        if (window_context) {
+            win_width = window_context->geometry.width;
+            win_height = window_context->geometry.height;
         }
 
         scl16 rotatex = x;
@@ -631,16 +696,16 @@ CSCLWindowsImplEfl::move_window(const sclwindow window, scl16 x, scl16 y)
 
 #ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
         if (window == windows->get_magnifier_window()) {
-            SclWindowContext *basewinctx = windows->get_window_context(windows->get_base_window(), FALSE);
+            SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window(), FALSE);
             rotatex = orgx = 0;
             if (context->get_rotation_degree() == 90 || context->get_rotation_degree() == 270) {
-                rotatey = orgy = scr_w - basewinctx->height - win_height;
-                win_width = basewinctx->width;
-                win_height = basewinctx->height + win_height;
+                rotatey = orgy = scr_w - base_window_context->height - win_height;
+                win_width = base_window_context->width;
+                win_height = base_window_context->height + win_height;
             } else {
-                rotatey = orgy = scr_h - basewinctx->height - win_height;
-                win_width = basewinctx->width;
-                win_height = basewinctx->height + win_height;
+                rotatey = orgy = scr_h - base_window_context->height - win_height;
+                win_width = base_window_context->width;
+                win_height = base_window_context->height + win_height;
             }
             magnifierx = x;
             magnifiery = y - orgy;
@@ -663,11 +728,13 @@ CSCLWindowsImplEfl::move_window(const sclwindow window, scl16 x, scl16 y)
                 rotatey = orgx;
             }
             break;
+            case ROTATION_0: break;
+            default: break;
         }
 
     #ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
         if (window == windows->get_magnifier_window()) {
-            if (rotatex == winctx->x && rotatey == winctx->y) return;
+            if (rotatex == window_context->x && rotatey == windonw_context->y) return;
         }
     #endif
 
@@ -682,7 +749,8 @@ CSCLWindowsImplEfl::move_window(const sclwindow window, scl16 x, scl16 y)
         //evas_render_idle_flush(evas);
 
         utils->log("WinEfl_movewin %p %p %d %d %d %d (basewin %p mag %p)\n",
-            window, elm_win_xwindow_get(static_cast<Evas_Object*>(window)),
+            window,
+            (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
             x, y, rotatex, rotatey,
             windows->get_base_window(), windows->get_magnifier_window());
     }
@@ -701,15 +769,15 @@ CSCLWindowsImplEfl::resize_window(const sclwindow window, scl16 width, scl16 hei
 
 #ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
     if (window == windows->get_magnifier_window()) {
-        SclWindowContext *winctx = windows->get_window_context(windows->get_base_window());
-        if (winctx->width != width || winctx->height != height) {
+        SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+        if (window_context->width != width || window_context->height != height) {
             CSCLUtils *utils = CSCLUtils::get_instance();
             sclint scrx, scry, winx, winy;
             utils->get_screen_resolution(&scrx, &scry);
             if (context->get_rotation_degree() == 90 || context->get_rotation_degree() == 270) {
-                evas_object_resize((Evas_Object*)window, scry, height + winctx->height);
+                evas_object_resize((Evas_Object*)window, scry, height + window_context->height);
             } else {
-                evas_object_resize((Evas_Object*)window, scrx, height + winctx->height);
+                evas_object_resize((Evas_Object*)window, scrx, height + window_context->height);
             }
         }
         return;
@@ -719,8 +787,10 @@ CSCLWindowsImplEfl::resize_window(const sclwindow window, scl16 width, scl16 hei
     Evas_Object *win = (Evas_Object*)window;
 #ifndef FULL_SCREEN_TEST
     if (windows && utils && window) {
+        SclWindowContext *window_context = windows->get_window_context(window);
         utils->log("WinEfl_resizewin %p %p %d %d (basewin %p mag %p)\n",
-            window, elm_win_xwindow_get(static_cast<Evas_Object*>(window)), width, height,
+            window,
+            (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
             windows->get_base_window(), windows->get_magnifier_window());
     }
 #endif
@@ -787,23 +857,23 @@ CSCLWindowsImplEfl::update_window(const sclwindow window, scl16 x, scl16 y, scl1
 
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
-    SclWindowContext *winctx = NULL;
+    SclWindowContext *window_context = NULL;
 
     if (windows && window) {
-        //winctx = windows->get_window_context(window, FALSE);
-        winctx = windows->get_window_context(window);
+        //window_context = windows->get_window_context(window, FALSE);
+        window_context = windows->get_window_context(window);
     }
-    if (windows && utils && winctx) {
-        if (winctx->is_virtual) {
-            SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
-            if (basectx) {
-                updatearea.x += (winctx->geometry.x - basectx->geometry.x);
-                updatearea.y += (winctx->geometry.y - basectx->geometry.y);
+    if (windows && utils && window_context) {
+        if (window_context->is_virtual) {
+            SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+            if (base_window_context) {
+                updatearea.x += (window_context->geometry.x - base_window_context->geometry.x);
+                updatearea.y += (window_context->geometry.y - base_window_context->geometry.y);
             }
         }
-        if (winctx->etc_info) {
+        if (window_context->etc_info) {
 
-            Eina_List *list = (Eina_List*)(winctx->etc_info);
+            Eina_List *list = (Eina_List*)(window_context->etc_info);
             Eina_List *iter = NULL;
             Eina_List *iter_next = NULL;
             void *data = NULL;
@@ -832,16 +902,16 @@ CSCLWindowsImplEfl::update_window(const sclwindow window, scl16 x, scl16 y, scl1
                             //if (object->type == EFLOBJECT_IMAGE) {
                             SCL_DEBUG_ELAPASED_TIME_START();
                             if (TRUE) {
-                                if (winctx->width != object->position.width || winctx->height != object->position.height ||
+                                if (window_context->width != object->position.width || window_context->height != object->position.height ||
                                     object->type == EFLOBJECT_TEXTBLOCK || window == windows->get_magnifier_window()) {
                                     evas_object_hide(object->object);
                                 }
                             } else {
 #else
                             if (object->extracted) {
-                                void *data = evas_object_image_data_get(eo, 1);
-                                if (data) {
-                                    free(data);
+                                void *image_data = evas_object_image_data_get(eo, 1);
+                                if (image_data) {
+                                    free(image_data);
                                 }
                             }
                             if (eo) {
@@ -887,11 +957,11 @@ CSCLWindowsImplEfl::update_window(const sclwindow window, scl16 x, scl16 y, scl1
                     iIndex++;
                 }
             }
-            winctx->etc_info = list;
+            window_context->etc_info = list;
 
-            /*while ((Eina_List*)(winctx->etc_info))
+            /*while ((Eina_List*)(window_context->etc_info))
             {
-                EFLObject *object = (EFLObject*)eina_list_data_get((Eina_List*)(winctx->etc_info));
+                EFLObject *object = (EFLObject*)eina_list_data_get((Eina_List*)(window_context->etc_info));
                 if (object) {
                     Evas_Object* eo = object->object;
                     if (eo) {
@@ -899,10 +969,10 @@ CSCLWindowsImplEfl::update_window(const sclwindow window, scl16 x, scl16 y, scl1
                         object->object = NULL;
                     }
                 }
-                winctx->etc_info = eina_list_remove_list((Eina_List*)(winctx->etc_info), (Eina_List*)(winctx->etc_info));
+                window_context->etc_info = eina_list_remove_list((Eina_List*)(window_context->etc_info), (Eina_List*)(winctx->etc_info));
                 delete object;
             }
-            winctx->etc_info = NULL;*/
+            window_context->etc_info = NULL;*/
         }
         CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
         builder->show_layout(window, x, y, width, height);
@@ -992,14 +1062,14 @@ CSCLWindowsImplEfl::set_window_rotation(const sclwindow window, SCLRotation rota
     SCL_DEBUG();
 
     CSCLWindows *windows = CSCLWindows::get_instance();
-    SclWindowContext *winctx = NULL;
+    SclWindowContext *window_context = NULL;
 
     if (windows && window) {
-        //winctx = windows->get_window_context(window, FALSE);
-        winctx = windows->get_window_context(window);
+        //window_context = windows->get_window_context(window, FALSE);
+        window_context = windows->get_window_context(window);
 
-        if (winctx) {
-            if (winctx->is_virtual) {
+        if (window_context) {
+            if (window_context->is_virtual) {
                 return;
             }
         }
@@ -1022,8 +1092,8 @@ CSCLWindowsImplEfl::set_window_rotation(const sclwindow window, SCLRotation rota
         hint.flags |= USPosition;
 
         XSetWMNormalHints(dpy, win, &hint);
-        /*if (winctx) {
-          windows->resize_window(winctx->window, winctx->width, winctx->height);
+        /*if (window_context) {
+          windows->resize_window(window_context->window, window_context->width, winctx->height);
           }*/
     }
 }
@@ -1058,13 +1128,11 @@ void release_all(Evas_Object *win)
     //LOGD("HIDE_WINDOW : %p\n", window);
 
     CSCLWindows *windows = CSCLWindows::get_instance();
-    //if (window == windows->get_magnifier_window()) {
-        //SclWindowContext *winctx = windows->get_window_context(win, FALSE);
-    SclWindowContext *winctx = windows->get_window_context(win);
-        if (winctx && win) {
-            if (winctx->etc_info) {
+    SclWindowContext *window_context = windows->get_window_context(win);
+        if (window_context && win) {
+            if (window_context->etc_info) {
 
-                Eina_List *list = (Eina_List*)(winctx->etc_info);
+                Eina_List *list = (Eina_List*)(window_context->etc_info);
                 Eina_List *iter = NULL;
                 Eina_List *iter_next = NULL;
                 void *data = NULL;
@@ -1080,9 +1148,9 @@ void release_all(Evas_Object *win)
                             if (bShouldRemove) {
                                 Evas_Object* eo = object->object;
                                 if (object->extracted) {
-                                    void *data = evas_object_image_data_get(eo, 1);
-                                    if (data) {
-                                        free(data);
+                                    void *image_data = evas_object_image_data_get(eo, 1);
+                                    if (image_data) {
+                                        free(image_data);
                                     }
                                 }
                                 if (eo) {
@@ -1117,7 +1185,7 @@ void release_all(Evas_Object *win)
                         iIndex++;
                     }
                 }
-                winctx->etc_info = list;
+                window_context->etc_info = list;
 #endif
             }
         }
index 1af8be2..4ddd7d9 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -36,7 +36,7 @@ typedef struct {
     EFLOBJECT_TYPE type;
     SclRectangle position;
     Evas_Object *object;
-    char *etc_info;
+    const char *etc_info;
     sclboolean extracted;
     void *data;
 } EFLObject;
@@ -49,10 +49,10 @@ public :
     void init();
     void fini();
 
-    sclwindow create_base_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
-    sclwindow create_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
-    sclwindow create_magnifier_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
-    sclwindow create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
+    sclwindow create_base_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
+    sclwindow create_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
+    sclwindow create_magnifier_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
+    sclwindow create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
     bool destroy_window(sclwindow window);
     void show_window(const sclwindow window, sclboolean queue);
     void hide_window(const sclwindow window,  sclboolean fForce = FALSE);
index 60408f7..277e965 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -86,10 +86,10 @@ mouse_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
     GtkWidget* magnifier = static_cast<GtkWidget*>(windows->get_magnifier_window());
     gdk_window_raise(magnifier->window);
     if (widget == windows->get_magnifier_window()) {
-        SclWindowContext *magctx = windows->get_window_context(widget, FALSE);
-        if (magctx) {
-            magpressposx = magctx->x;
-            magpressposy = magctx->y;
+        SclWindowContext *magnifier_window_context = windows->get_window_context(widget, FALSE);
+        if (magnifier_window_context) {
+            magpressposx = magnifier_window_context->x;
+            magpressposy = magnifier_window_context->y;
         }
         /* First convert the local coordinate to global coordinate */
         sclwindow window = SCLWINDOW_INVALID;
@@ -347,7 +347,7 @@ mouse_move(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
  * - show_base_layout (when the expost event has occured)
  */
 void
-CSCLEventsImplGtk::connect_window_events(const sclwindow wnd, const sclint evt)
+CSCLEventsImplGtk::connect_window_events(const sclwindow window, const sclint event)
 {
     SCL_DEBUG();
     /* pre-condition */
@@ -380,7 +380,7 @@ gboolean
 timer_event(gpointer data)
 {
     SCL_DEBUG();
-    scl32 sendData = (scl32)data;
+       scl32 sendData = static_cast<scl32>(reinterpret_cast<uintptr_t>(data) & 0xffffffff);
     CSCLController *controller;
     controller = CSCLController::get_instance();
     if (controller) {
@@ -394,13 +394,13 @@ timer_event(gpointer data)
  * In this function, it should call timer_event of CSCLController class
  */
 void
-CSCLEventsImplGtk::create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean addToMap)
+CSCLEventsImplGtk::create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean add_to_map)
 {
     SCL_DEBUG();
     sclint data = SCL_MAKELONG(id, value);
     gint timerId = gtk_timeout_add (static_cast<guint32>(interval), timer_event, (gpointer)data);
-    if (addToMap) {
-        idMap[id] = timerId;
+    if (add_to_map) {
+        id_map[id] = timerId;
     }
 }
 
@@ -411,10 +411,10 @@ void
 CSCLEventsImplGtk::destroy_timer(const scl32 id)
 {
     SCL_DEBUG();
-    for ( std::map<int, int>::iterator idx = idMap.begin(); idx != idMap.end(); ++idx) {
+    for ( std::map<int, int>::iterator idx = id_map.begin(); idx != id_map.end(); ++idx) {
         if ((*idx).first == id) {
             gtk_timeout_remove ((*idx).second);
-            idMap.erase((*idx).first);
+            id_map.erase((*idx).first);
             break;
         }
     }
@@ -427,9 +427,9 @@ void
 CSCLEventsImplGtk::destroy_all_timer()
 {
     SCL_DEBUG();
-    for ( std::map<int, int>::iterator idx = idMap.begin(); idx != idMap.end(); ++idx) {
+    for ( std::map<int, int>::iterator idx = id_map.begin(); idx != id_map.end(); ++idx) {
         gtk_timeout_remove ((*idx).second);
     }
-    idMap.clear();
+    id_map.clear();
 }
 
index 04fa844..cce2fd6 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -32,13 +32,13 @@ public :
     ~CSCLEventsImplGtk();
 
     /* Implementation about interface functions */
-    void connect_window_events(const sclwindow wnd, const sclint evt);
-    void create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean addToMap);
+    void connect_window_events(const sclwindow window, const sclint event);
+    void create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean add_to_map);
     void destroy_timer(const scl32 id);
     void destroy_all_timer();
 
 private:
-    std::map<int, int> idMap;
+    std::map<int, int> id_map;
 };
 } /* End of scl namespace */
 #endif __SCL_EVENTS_GTK_H__
index bf2e418..962582e 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -47,16 +47,16 @@ CSCLGraphicsImplCairo::~CSCLGraphicsImplCairo()
  * Draws the given text on cairo-surface
  */
 void
-CSCLGraphicsImplCairo::draw_text(sclwindow window, const scldrawctx drawCtx, const SclFontInfo& fontinfo, const SclColor& color,
+CSCLGraphicsImplCairo::draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& fontinfo, const SclColor& color,
                                  const sclchar *str, sclint posx, sclint posy, sclint width, sclint height,
                                  SCLLabelAlignment align, sclbyte padding)
 {
     SCL_DEBUG();
     /* pre-condition */
     scl_assert_return(str);
-    scl_assert_return(drawCtx);
+    scl_assert_return(draw_ctx);
 
-    cairo_t* cr = static_cast<cairo_t*>(drawCtx);
+    cairo_t* cr = static_cast<cairo_t*>(draw_ctx);
     cairo_identity_matrix(cr);
     cairo_set_source_rgba(cr, color.r / 256.0, color.g / 256.0, color.b / 256.0, 1.0);
     cairo_select_font_face(cr, fontinfo.fontname,
@@ -95,15 +95,15 @@ CSCLGraphicsImplCairo::draw_text(sclwindow window, const scldrawctx drawCtx, con
  * Draws the given image on cairo-surface
  */
 void
-CSCLGraphicsImplCairo::draw_image(sclwindow window, const scldrawctx drawCtx, sclchar* imgPath, sclint destX, sclint destY,
+CSCLGraphicsImplCairo::draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* imgPath, sclint destX, sclint destY,
                                   sclint destWidth, sclint destHeight, sclint srcX, sclint srcY, sclint srcWidth, sclint srcHeight)
 {
     SCL_DEBUG();
     /* pre-condition */
     scl_assert_return(imgPath);
-    scl_assert_return(drawCtx);
+    scl_assert_return(draw_ctx);
 
-    cairo_t* cr = static_cast<cairo_t*>(drawCtx);
+    cairo_t* cr = static_cast<cairo_t*>(draw_ctx);
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLImageProxy *proxy = CSCLImageProxy::get_instance();
 
@@ -142,14 +142,14 @@ CSCLGraphicsImplCairo::draw_image(sclwindow window, const scldrawctx drawCtx, sc
  * Draws a rectangle on cairo-surface
  */
 void
-CSCLGraphicsImplCairo::draw_rectangle(sclwindow window, const scldrawctx drawCtx, scldouble posx, scldouble posy,
+CSCLGraphicsImplCairo::draw_rectangle(sclwindow window, const scldrawctx draw_ctx, scldouble posx, scldouble posy,
                                       scldouble width, scldouble height, const scldouble lineWidth, const SclColor& lineColor, sclboolean fill, const SclColor& fillColor, scldouble radius, sclfloat alpha)
 {
     SCL_DEBUG();
     /* pre-condition */
-    scl_assert_return(drawCtx);
+    scl_assert_return(draw_ctx);
 
-    cairo_t* cr = static_cast<cairo_t*>(drawCtx);
+    cairo_t* cr = static_cast<cairo_t*>(draw_ctx);
     cairo_identity_matrix(cr);
 
     /* a custom shape that could be wrapped in a function */
@@ -294,9 +294,9 @@ CSCLGraphicsImplCairo::begin_paint(const sclwindow window, const sclboolean forc
  * Notices that drawing tasks have done.
  */
 void
-CSCLGraphicsImplCairo::end_paint(const sclwindow window, scldrawctx drawCtx)
+CSCLGraphicsImplCairo::end_paint(const sclwindow window, scldrawctx draw_ctx)
 {
-    cairo_destroy(static_cast<cairo_t*>(drawCtx));
+    cairo_destroy(static_cast<cairo_t*>(draw_ctx));
 }
 
 sclfont
index 790eb49..5db38c3 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -29,20 +29,22 @@ public :
     CSCLGraphicsImplCairo();
     ~CSCLGraphicsImplCairo();
 
-    void draw_image(sclwindow window, const scldrawctx drawCtx, sclchar* imgPath, sclint destX, sclint destY,
-                                  sclint destWidth, sclint destHeight, sclint srcX, sclint srcY, sclint srcWidth, sclint srcHeight);
-    void draw_text(sclwindow window, const scldrawctx drawCtx, const SclFontInfo& fontinfo, const SclColor& color,
-                   const sclchar *str, sclint posx, sclint posy, sclint width, sclint height,
+    void draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* image_path,
+                    sclint dest_x, sclint dest_y, sclint dest_width, sclint dest_height,
+                    sclint src_x, sclint src_y, sclint src_width, sclint src_height);
+    void draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& font_info, const SclColor& color,
+                   const sclchar *str, sclint pos_x, sclint pos_y, sclint width, sclint height,
                    SCLLabelAlignment align, sclbyte padding);
-    sclimage load_image(const sclchar* imgPath);
-    void unload_image(sclimage imgData);
-    scldrawctx begin_paint(const sclwindow window, const sclboolean forcedraw = FALSE);
-    void end_paint(const sclwindow window, scldrawctx drawCtx);
+    sclimage load_image(const sclchar* image_path);
+    void unload_image(sclimage image_data);
+    scldrawctx begin_paint(const sclwindow window, const sclboolean force_draw = FALSE);
+    void end_paint(const sclwindow window, scldrawctx draw_ctx);
     sclfont create_font(const SclFontInfo& info);
     void destroy_font(sclfont font);
-    void draw_rectangle(sclwindow window, const scldrawctx drawCtx, scldouble posx, scldouble posy,
-                        scldouble width, scldouble height, const scldouble lineWidth, const SclColor& lineColor, sclboolean fill, const SclColor& fillColor, scldouble radius, sclfloat alpha);
-    SclSize get_image_size(sclchar* imgPath);
+    void draw_rectangle(sclwindow window, const scldrawctx draw_ctx, scldouble pos_x, scldouble pos_y,
+                        scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color,
+                        sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha);
+    SclSize get_image_size(sclchar* image_path);
 private:
 };
 } /* End of scl namespace */
index 28e57bd..8dbea28 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -42,8 +42,10 @@ CSCLGraphicsImplGtk::~CSCLGraphicsImplGtk()
 
 
 void
-CSCLGraphicsImplGtk::draw_image(sclwindow window, const scldrawctx drawCtx, sclchar* imgPath, SclImageCachedInfo *cachedinfo, sclint destX, sclint destY,
-                                sclint destWidth, sclint destHeight, sclint srcX, sclint srcY, sclint srcWidth, sclint srcHeight)
+CSCLGraphicsImplGtk::draw_image(sclwindow window, const scldrawctx draw_ctx,
+                                sclchar* image_path, SclImageCachedInfo *cachedinfo,
+                                sclint dest_x, sclint dest_y, sclint dest_width, sclint dest_height,
+                                sclint src_x, sclint src_y, sclint src_width, sclint src_height)
 {
     SCL_DEBUG();
     //printf("\n %d destX, %d destY,\n %d destWidth, %d destHeight, %d srcX, %d srcY,\n %d srcWidth, %d srcHeight\n", destX, destY, destWidth, destHeight,  srcX,  srcWidth,  srcHeight);
@@ -126,7 +128,7 @@ load_pixmap(const gchar *filename)
 }
 
 sclimage
-CSCLGraphicsImplGtk::load_image(const sclchar *imgPath)
+CSCLGraphicsImplGtk::load_image(const sclchar* image_path)
 {
     SCL_DEBUG();
     GdkPixmap* imgData = NULL;
@@ -137,7 +139,7 @@ CSCLGraphicsImplGtk::load_image(const sclchar *imgPath)
 }
 
 void
-CSCLGraphicsImplGtk::unload_image(sclimage imgData)
+CSCLGraphicsImplGtk::unload_image(sclimage image_data)
 {
     SCL_DEBUG();
     /* pre-condition */
@@ -151,7 +153,7 @@ CSCLGraphicsImplGtk::unload_image(sclimage imgData)
  * This func should be called before using a drawing primitive at first.
  */
 scldrawctx
-CSCLGraphicsImplGtk::begin_paint(const sclwindow window, const sclboolean forcedraw /* = FALSE */)
+CSCLGraphicsImplGtk::begin_paint(const sclwindow window, const sclboolean force_draw /* = FALSE */)
 {
     SCL_DEBUG();
     /* pre-condition */
@@ -171,9 +173,9 @@ CSCLGraphicsImplGtk::begin_paint(const sclwindow window, const sclboolean forced
  * Notices that drawing tasks have done.
  */
 void
-CSCLGraphicsImplGtk::end_paint(const sclwindow window, scldrawctx drawCtx)
+CSCLGraphicsImplGtk::end_paint(const sclwindow window, scldrawctx draw_ctx)
 {
-    cairo_destroy(static_cast<cairo_t*>(drawCtx));
+    cairo_destroy(static_cast<cairo_t*>(draw_ctx));
 }
 
 sclfont
@@ -191,16 +193,17 @@ CSCLGraphicsImplGtk::destroy_font(sclfont font)
  * Draws the given text on cairo-surface
  */
 void
-CSCLGraphicsImplGtk::draw_text(sclwindow window, const scldrawctx drawCtx, const SclFontInfo& fontinfo, const SclColor& color,
-                               const sclchar *str, SclTextCachedInfo *cachedinfo, sclint posx, sclint posy, sclint width, sclint height,
+CSCLGraphicsImplGtk::draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& font_info,
+                               const SclColor& color, const sclchar *str, SclTextCachedInfo *cachedinfo,
+                               sclint pos_x, sclint pos_y, sclint width, sclint height,
                                SCLLabelAlignment align, sclbyte padding)
 {
     SCL_DEBUG();
     /* pre-condition */
     scl_assert_return(str);
-    scl_assert_return(drawCtx);
+    scl_assert_return(draw_ctx);
 
-    cairo_t* cr = static_cast<cairo_t*>(drawCtx);
+    cairo_t* cr = static_cast<cairo_t*>(draw_ctx);
     cairo_identity_matrix(cr);
     cairo_set_source_rgba(cr, color.r / 256.0, color.g / 256.0, color.b / 256.0, 1.0);
     cairo_select_font_face(cr, fontinfo.fontname,
@@ -249,14 +252,16 @@ CSCLGraphicsImplGtk::draw_text(sclwindow window, const scldrawctx drawCtx, const
  * Draws a rectangle on cairo-surface
  */
 void
-CSCLGraphicsImplGtk::draw_rectangle(sclwindow window, const scldrawctx drawCtx, scldouble posx, scldouble posy,
-                                    scldouble width, scldouble height, const scldouble lineWidth, const SclColor& lineColor, sclboolean fill, const SclColor& fillColor, scldouble radius, sclfloat alpha)
+CSCLGraphicsImplGtk::draw_rectangle(sclwindow window, const scldrawctx draw_ctx,
+                                    scldouble pos_x, scldouble pos_y, scldouble width, scldouble height,
+                                    const scldouble line_width, const SclColor& line_color, sclboolean fill,
+                                    const SclColor& fill_color, scldouble radius, sclfloat alpha)
 {
     SCL_DEBUG();
     /* pre-condition */
-    scl_assert_return(drawCtx);
+    scl_assert_return(draw_ctx);
 
-    cairo_t* cr = static_cast<cairo_t*>(drawCtx);
+    cairo_t* cr = static_cast<cairo_t*>(draw_ctx);
     cairo_identity_matrix(cr);
 
     /* a custom shape that could be wrapped in a function */
@@ -316,7 +321,7 @@ CSCLGraphicsImplGtk::draw_rectangle(sclwindow window, const scldrawctx drawCtx,
 }
 
 SclSize
-CSCLGraphicsImplGtk::get_image_size(sclchar* imgPath)
+CSCLGraphicsImplGtk::get_image_size(sclchar* image_path)
 {
     SCL_DEBUG();
     SclSize ret = { 0, 0 };
index 5581e4a..aba59b5 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -29,22 +29,24 @@ public :
     CSCLGraphicsImplGtk();
     ~CSCLGraphicsImplGtk();
 
-    void draw_image(sclwindow window, const scldrawctx drawCtx, sclchar* imgPath, SclImageCachedInfo *cachedinfo, sclint destX, sclint destY,
-                                  sclint destWidth, sclint destHeight, sclint srcX, sclint srcY, sclint srcWidth, sclint srcHeight);
-    sclimage load_image(const sclchar* imgPath);
-    void unload_image(sclimage imgData);
+    void draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* image_path,
+                    SclImageCachedInfo *cachedinfo, sclint dest_x, sclint dest_y, sclint dest_width, sclint dest_height,
+                    sclint src_x, sclint src_y, sclint src_width, sclint src_height);
+    sclimage load_image(const sclchar* image_path);
+    void unload_image(sclimage image_data);
 
     sclfont create_font(const SclFontInfo& info);
     void destroy_font(sclfont font);
-    void draw_text(sclwindow window, const scldrawctx drawCtx, const SclFontInfo& fontinfo, const SclColor& color,
-                   const sclchar *str, SclTextCachedInfo *cachedinfo, sclint posx, sclint posy, sclint width, sclint height,
+    void draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& font_info, const SclColor& color,
+                   const sclchar *str, SclTextCachedInfo *cachedinfo, sclint pos_x, sclint pos_y, sclint width, sclint height,
                    SCLLabelAlignment align, sclbyte padding);
 
-    void draw_rectangle(sclwindow window, const scldrawctx drawCtx, scldouble posx, scldouble posy,
-                        scldouble width, scldouble height, const scldouble lineWidth, const SclColor& lineColor, sclboolean fill, const SclColor& fillColor, scldouble radius, sclfloat alpha);
-    scldrawctx begin_paint(const sclwindow window, const sclboolean forcedraw = FALSE);
-    void end_paint(const sclwindow window, scldrawctx drawCtx);
-    SclSize get_image_size(sclchar* imgPath);
+    void draw_rectangle(sclwindow window, const scldrawctx draw_ctx, scldouble pos_x, scldouble pos_y,
+                        scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color,
+                        sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha);
+    scldrawctx begin_paint(const sclwindow window, const sclboolean force_draw = FALSE);
+    void end_paint(const sclwindow window, scldrawctx draw_ctx);
+    SclSize get_image_size(sclchar* image_path);
     SclSize get_text_size(const SclFontInfo &fontinfo, const sclchar *str);
 private:
 };
index 328f553..d6ad2cc 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -74,7 +74,7 @@ make_transparent_window (GtkWidget *window)
  * Create a content window and binds it into given parent window as a child
  */
 sclwindow
-CSCLWindowsImplGtk::create_base_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplGtk::create_base_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
 {
     SCL_DEBUG();
 
@@ -82,16 +82,16 @@ CSCLWindowsImplGtk::create_base_window(const sclwindow parent, SclWindowContext
 
     /* pre-condition */
     scl_assert(parent != NULL);
-    scl_assert(winctx != NULL);
-    scl_assert(winctx->etc_info == NULL);
+    scl_assert(window_context != NULL);
+    scl_assert(window_context->etc_info == NULL);
 
-    if (winctx->window == NULL) {
+    if (window_context->window == NULL) {
         window = (GtkWidget*)parent;
 
         if (GTK_WIDGET_TOPLEVEL(window)) {
             window = (GtkWidget*)parent;
-            winctx->etc_info = NULL;
-            winctx->window = window;
+            window_context->etc_info = NULL;
+            window_context->window = window;
             //gtk_window_set_keep_above(GTK_WINDOW(window), TRUE);
             make_transparent_window(window);
         } else {
@@ -102,30 +102,30 @@ CSCLWindowsImplGtk::create_base_window(const sclwindow parent, SclWindowContext
             gtk_box_pack_start(GTK_BOX(window), drawarea, TRUE, TRUE, 0);
             gtk_widget_show (drawarea);
             gtk_widget_show (window);
-            winctx->etc_info = static_cast<void*>(drawarea);
-            winctx->window = drawarea;
+            window_context->etc_info = static_cast<void*>(drawarea);
+            window_context->window = drawarea;
             make_transparent_window(drawarea);
         }
     }
     /* post-condition */
-    return winctx->window;
+    return window_context->window;
 }
 
 /**
  * Creates a window
  */
 sclwindow
-CSCLWindowsImplGtk::create_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplGtk::create_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
 {
     SCL_DEBUG();
     /* pre-condition */
     scl_assert(parent);
-    scl_assert(winctx);
-    scl_assert(winctx->etc_info == NULL);
+    scl_assert(window_context);
+    scl_assert(window_context->etc_info == NULL);
 
     GtkWidget* window = NULL;
 
-    if (winctx->window == NULL) {
+    if (window_context->window == NULL) {
         window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
         gtk_window_set_type_hint(GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_UTILITY);
 #ifdef NO_SOCKETPLUG
@@ -146,8 +146,8 @@ CSCLWindowsImplGtk::create_window(const sclwindow parent, SclWindowContext *winc
         gtk_widget_set_app_paintable(window, TRUE);
 #endif
         //gtk_effect_set_enable (GTK_WIDGET(window), FALSE);
-        winctx->etc_info = NULL;
-        winctx->window = window;
+        window_context->etc_info = NULL;
+        window_context->window = window;
 
 
         /* Window rotation*/
@@ -167,16 +167,16 @@ CSCLWindowsImplGtk::create_window(const sclwindow parent, SclWindowContext *winc
  * Creates the dim window
  */
 sclwindow
-CSCLWindowsImplGtk::create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplGtk::create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
 {
     SCL_DEBUG();
     /* pre-condition */
     scl_assert(parent);
-    scl_assert(winctx);
-    scl_assert(winctx->etc_info == NULL);
+    scl_assert(window_context);
+    scl_assert(window_context->etc_info == NULL);
     GtkWidget* window = NULL;
 
-    if (winctx->window == NULL) {
+    if (window_context->window == NULL) {
         window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
         gtk_window_set_type_hint(GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_UTILITY);
 #ifdef NO_SOCKETPLUG
@@ -195,8 +195,8 @@ CSCLWindowsImplGtk::create_dim_window(const sclwindow parent, SclWindowContext *
         gtk_window_set_opacity(GTK_WINDOW(window), 0.5);
         gtk_widget_realize(window);
         //gtk_effect_set_enable (GTK_WIDGET(window), FALSE);
-        winctx->etc_info = NULL;
-        winctx->window = window;
+        window_context->etc_info = NULL;
+        window_context->window = window;
     }
 
     return window;
@@ -207,7 +207,7 @@ CSCLWindowsImplGtk::create_dim_window(const sclwindow parent, SclWindowContext *
  * Caution: Currently, If we use transient_for them the ISE will occure some crash. It needs to check X11
  */
 void
-CSCLWindowsImplGtk::set_parent(const sclwindow parentWindow, const sclwindow window)
+CSCLWindowsImplGtk::set_parent(const sclwindow parent_window, const sclwindow window)
 {
     SCL_DEBUG();
     scl_assert_return(window);
@@ -283,13 +283,13 @@ CSCLWindowsImplGtk::show_window(const sclwindow window, sclboolean queue)
  * Hides the given window
  */
 void
-CSCLWindowsImplGtk::hide_window(const sclwindow window,  sclboolean fForce)
+CSCLWindowsImplGtk::hide_window(const sclwindow window,  sclboolean force)
 {
     SCL_DEBUG();
     scl_assert_return(window);
     GtkWidget* widget = static_cast<GtkWidget*>(window);
     CSCLWindows *windows = CSCLWindows::get_instance();
-    if (windows->get_magnifier_window() == window && fForce == FALSE) {
+    if (windows->get_magnifier_window() == window && force == FALSE) {
         /* Fix me : The below is a temporary code for magnifier speed enhancement */
 #ifdef NO_SOCKETPLUG
         gint root_x, root_y;
@@ -447,7 +447,7 @@ CSCLWindowsImplGtk::set_window_rotation(const sclwindow window, sclint degree) {
  * Shows a message box
  */
 void
-CSCLWindowsImplGtk::show_message_box(const sclwindow parent, scl8 msgType, sclchar* title, sclchar* msg) {
+CSCLWindowsImplGtk::show_message_box(const sclwindow parent, scl8 msg_type, sclchar* title, sclchar* msg) {
     SCL_DEBUG();
     scl_assert_return(strlen(msg) > 0);
 
@@ -488,8 +488,8 @@ CSCLWindowsImplGtk::show_message_box(const sclwindow parent, scl8 msgType, sclch
 
 
 void
-CSCLWindowsImplGtk::set_keep_above(const sclwindow window, sclboolean keepabove) {
+CSCLWindowsImplGtk::set_keep_above(const sclwindow window, sclboolean keep_above) {
     SCL_DEBUG();
 
-    gtk_window_set_keep_above(GTK_WINDOW(window), keepabove);
+    gtk_window_set_keep_above(GTK_WINDOW(window), keep_above);
 }
index 04268a7..1e669b9 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -29,21 +29,21 @@ public :
     CSCLWindowsImplGtk();
     ~CSCLWindowsImplGtk();
 
-    sclwindow create_base_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
-    sclwindow create_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
-    sclwindow create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
+    sclwindow create_base_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
+    sclwindow create_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
+    sclwindow create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
     bool destroy_window(sclwindow window);
     void show_window(const sclwindow window, sclboolean queue);
-    void hide_window(const sclwindow window,  sclboolean fForce = FALSE);
+    void hide_window(const sclwindow window,  sclboolean force = FALSE);
     void move_window(const sclwindow window, scl16 x, scl16 y);
     void resize_window(const sclwindow window, scl16 width, scl16 height);
     void move_resize_window(const sclwindow window, scl16 x, scl16 y, scl16 width, scl16 height);
     void update_window(const sclwindow window, scl16 x = 0, scl16 y = 0, scl16 width = 0, scl16 height = 0);
     void set_window_rotation(const sclwindow window, sclint degree);
-    void show_message_box(const sclwindow parent, scl8 msgType, sclchar* title, sclchar* msg);
+    void show_message_box(const sclwindow parent, scl8 msg_type, sclchar* title, sclchar* msg);
     sclboolean get_window_rect(const sclwindow window, SclRectangle *rect);
-    void set_parent(const sclwindow parentWindow, const sclwindow window);
-    void set_keep_above(const sclwindow window, sclboolean keepabove);
+    void set_parent(const sclwindow parent_window, const sclwindow window);
+    void set_keep_above(const sclwindow window, sclboolean keep_above);
 };
 } /* End of scl namespace */
 #endif __SCL_WINDOWS_GTK_H__
index 044c9f7..036ffe9 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index a36d34c..987cef2 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 78f4929..bd2c9db 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 941176c..d5e68d7 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index ea9e0f6..f5202af 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index ea9e0f6..f5202af 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 8790edc..dce9cd9 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index dd0a07c..7d41cee 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
diff --git a/scl/include/sclanimator.h b/scl/include/sclanimator.h
new file mode 100644 (file)
index 0000000..323ed74
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "scltypes.h"
+#include "sclconfig.h"
+#include "sclstructs.h"
+
+#include <map>
+
+#ifndef __SCL_ANIMATOR_H__
+#define __SCL_ANIMATOR_H__
+
+#ifdef __cplusplus
+//SCL_BEGIN_DECLS
+#endif
+
+namespace scl
+{
+
+/* Currently this SCL Animation class is not designed for specific animtions, not for general use.
+   Should refine later to provide general animation behavior */
+typedef enum {
+    ANIMATION_TYPE_NONE,
+    ANIMATION_TYPE_HIGHLIGHT_UI,
+
+    ANIMATION_TYPE_MAX
+}SCLAnimationType;
+
+typedef struct {
+    SCLAnimationType type;
+    sclint length;
+
+    sclwindow window_from;
+    sclwindow window_to;
+
+    SclRectangle rect_from;
+    SclRectangle rect_to;
+
+    sclboolean circular;
+}SclAnimationDesc;
+
+typedef struct {
+    sclboolean active;
+
+    SclAnimationDesc desc;
+    sclint step;
+
+    SclRectangle rect_cur;
+}SclAnimationState;
+
+
+class CSCLAnimatorImpl
+{
+    virtual void init() = 0;
+    virtual void fini() = 0;
+
+    /* By default, animation is not supported */
+    virtual sclboolean check_animation_supported() { return FALSE; }
+    virtual void animator_timer(SclAnimationState *state) = 0;
+
+    friend class CSCLAnimator;
+private:
+
+};
+
+class CSCLAnimator
+{
+private:
+    CSCLAnimator();
+public :
+    ~CSCLAnimator();
+
+    static CSCLAnimator* get_instance();
+
+    void init();
+    void fini();
+
+    /* Some backends may not provide animation feature */
+    sclboolean check_animation_supported();
+
+    sclint create_animator(SclAnimationDesc *desc);
+    sclboolean destroy_animator(sclint id);
+
+    sclint find_animator_by_type(SCLAnimationType type);
+
+    SclAnimationState* get_animation_state(sclint id);
+
+    sclboolean start_animator(sclint id);
+    sclboolean stop_animator(sclint id);
+
+    sclboolean animator_timer();
+
+protected :
+    CSCLAnimatorImpl* get_scl_animator_impl();
+
+    sclboolean animator_timer_highlight_ui(SclAnimationState *state);
+private :
+    CSCLAnimatorImpl* m_impl;
+
+    std::map<sclint, SclAnimationState> m_animators;
+};
+
+
+} /* End of scl namespace */
+
+#ifdef __cplusplus
+//SCL_END_DECLS
+#endif
+
+#endif //__SCL_ANIMATOR_H__
index 1d71025..4756b85 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -62,6 +62,7 @@ typedef enum _SCLButtonType {
     BUTTON_TYPE_ROTATION,                      /**< Rotation key */
     BUTTON_TYPE_DIRECTION,                     /**< Direction decided by whole mouse movement from inital point */
     BUTTON_TYPE_RELATIVE_DIRECTION,    /**< Direction decided by recent mouse movement */
+    BUTTON_TYPE_TOGGLE,                                /** A button that has toggled state */
     BUTTON_TYPE_UIITEM,                                /** Not a button, just for displaying image */
     MAX_BUTTON_TYPE                                    /* maximum number of Key type */
 }SCLButtonType;
@@ -104,7 +105,7 @@ typedef enum _SCLKeyModifier {
     KEY_MODIFIER_LONGKEY,                                              /**< longkey event */
     KEY_MODIFIER_MULTITAP_START,                               /**< multitap started */
     KEY_MODIFIER_MULTITAP_REPEAT,                              /**< multitap repeated */
-    
+
     KEY_MODIFIER_DIRECTION_LEFT,                               /**< drag left */
     KEY_MODIFIER_DIRECTION_RIGHT,                              /**< drag right */
     KEY_MODIFIER_DIRECTION_UP,                                 /**< drag up */
@@ -141,6 +142,8 @@ typedef enum _SCLKeyModifier {
     KEY_MODIFIER_DIRECTION_CURVE_RIGHT_UP,             /**< drag right up */
     KEY_MODIFIER_DIRECTION_CURVE_RIGHT_DOWN,   /**< drage right down */
 
+    KEY_MODIFIER_TOGGLED,                                              /**< toggled state */
+
     KEY_MODIFIER_MAX                   /* maximum number of Key type */
 }SCLKeyModifier;
 
@@ -219,6 +222,7 @@ typedef enum _SCLButtonState {
     BUTTON_STATE_NORMAL = 0,   /**< normal state */
     BUTTON_STATE_PRESSED,              /**< pressed state */
     BUTTON_STATE_DISABLED,             /**< disabled state */
+    BUTTON_STATE_TOGGLED,              /**< toggled state */
     //BUTTON_STATE_HIGHLIGHT,  /**< highlighed state */
     //BUTTON_STATE_LONGKEY,            /**< londkey state */
     SCL_BUTTON_STATE_MAX               /* maximum number of button state */
@@ -277,6 +281,7 @@ typedef enum _SCLTimer {
     SCL_TIMER_USERAREA,
     SCL_TIMER_BUTTON_DELAY,
     SCL_TIMER_POPUP_TIMEOUT,
+    SCL_TIMER_ANIMATION,
     SCL_TIMER_AUTOTEST,
 }SCLTimer;
 
@@ -320,11 +325,26 @@ typedef enum _SCLWindowDecorator {
     MAX_WND_DECORATOR,
 }SCLWindowDecorator;
 
+/**@brief  Highligh moving direction */
+typedef enum _SCLHighlightNavigationDirection {
+    HIGHLIGHT_NAVIGATE_NONE,
+    HIGHLIGHT_NAVIGATE_LEFT,
+    HIGHLIGHT_NAVIGATE_RIGHT,
+    HIGHLIGHT_NAVIGATE_UP,
+    HIGHLIGHT_NAVIGATE_DOWN,
+    HIGHLIGHT_NAVIGATE_MAX
+}SCLHighlightNavigationDirection;
+
 /**@brief  SCL Notification to ISEs */
 typedef enum _SCLUINotiType {
-    SCL_UINOTITYPE_POPUP_TIMEOUT, // The layout of popup window will be passed as etc_info data
+    SCL_UINOTITYPE_POPUP_OPENING,
+    SCL_UINOTITYPE_POPUP_OPENED,
+    SCL_UINOTITYPE_POPUP_CLOSING,
+    SCL_UINOTITYPE_POPUP_CLOSED,
     SCL_UINOTITYPE_GESTURE_FLICK,
     SCL_UINOTITYPE_SHIFT_STATE_CHANGE,
+    SCL_UINOTITYPE_INPUT_MODE_CHANGE,
+    SCL_UINOTITYPE_HIGHLIGHT_NAVIGATE,
     MAX_NOTITYPE,
 }SCLUINotiType;
 
@@ -371,6 +391,11 @@ typedef enum _SCLParserType {
     SCL_PARSER_TYPE_BINARY_XML,
 } SCLParserType;
 
+/* Starting Coordinates Options */
+typedef enum _SCLStartingCoordinatesOption {
+    SCL_STARTING_COORDINATES_OPTION_ALL,                       /* Draw everything relative to the starting coordinate */
+    SCL_STARTING_COORDINATES_OPTION_BUTTONS_ONLY,      /* Affect starting coordinates only to the buttons */
+} SCLStartingCoordinatesOption;
 
 /* SCL predefined Identifiers */
 #define SCL_SHIFT_STATE_OFF_HINT_STRING "Shift Off"
@@ -425,6 +450,12 @@ typedef enum _SCLParserType {
 
 #define SCL_AUTO_DETECT_PORTRAIT_LANDSCAPE TRUE
 
+/* FIXME : This should be configurable also */
+#define SCL_HIGHLIGHT_UI_IMAGE "B09_icon_cue.png"
+
+#define SCL_ANIMATION_TIMER_INTERVAL (1000 / 30) // 30 frames per second
+#define SCL_ANIMATION_TIME 300 // Animation for 300 ms
+
 typedef enum _SCLDebugMode {
     DEBUGMODE_DISABLED,
     DEBUGMODE_DISPLAY_INTERNAL,
index 498fdeb..f9c8d34 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -39,8 +39,8 @@ typedef struct { // A context information dependant on each multitouch events
     SclPoint cur_pressed_point;
     struct timeval cur_pressed_time;
 
-    sclwindow cur_move_window;
-    SclPoint cur_move_point;
+    sclwindow cur_moving_window;
+    SclPoint cur_moving_point;
 
     SCLDragState cur_drag_state;
     SCLKeyModifier cur_key_modifier;
@@ -51,7 +51,7 @@ typedef struct { // A context information dependant on each multitouch events
     scl8 prev_pressed_key;
     sclwindow prev_pressed_window;
 
-    SclPoint prev_move_point;
+    SclPoint prev_moving_point;
     SCLDragState prev_drag_state;
 
     scl16 event_id;
@@ -120,6 +120,9 @@ public:
     SCLShiftState get_shift_state() const;
     void set_shift_state(SCLShiftState val);
 
+    sclboolean get_caps_lock_mode() const;
+    void set_caps_lock_mode(sclboolean val);
+
     SCLShiftMultitouchState get_shift_multi_touch_state() const;
     void set_shift_multi_touch_state(SCLShiftMultitouchState val);
 
@@ -168,6 +171,18 @@ public:
     sclboolean get_shift_multi_touch_enabled() {
         return m_shift_multi_touch_enabled;
     }
+    void set_highlight_ui_enabled(sclboolean enabled) {
+        m_highlight_ui_enabled = enabled;
+    }
+    sclboolean get_highlight_ui_enabled() {
+        return m_highlight_ui_enabled;
+    }
+    void set_highlight_ui_animation_enabled(sclboolean enabled) {
+        m_highlight_ui_animation_enabled = enabled;
+    }
+    sclboolean get_highlight_ui_animation_enabled() {
+        return m_highlight_ui_animation_enabled;
+    }
 
     scl8 get_last_pressed_key() {
         return m_last_pressed_key;
@@ -213,7 +228,7 @@ public:
         return m_cur_highlighted_window;
     }
 
-    void create_multi_touch_context(scltouchdevice touch_id, sclboolean isSubEvent = FALSE);
+    void create_multi_touch_context(scltouchdevice touch_id, sclboolean is_sub_event = FALSE);
     void destroy_multi_touch_context(scltouchdevice touch_id);
     MultiTouchContext* find_multi_touch_context(scltouchdevice touch_id);
 
@@ -231,10 +246,10 @@ public:
     void set_custom_magnifier_label(scltouchdevice touch_id, sclint index, const sclchar* label);
     const sclchar* get_custom_magnifier_label(scltouchdevice touch_id, sclint index);
 
-    SclPoint get_cur_move_point(scltouchdevice touch_id);
-    void set_cur_move_point(scltouchdevice touch_id, sclint x, sclint y);
-    sclwindow get_cur_move_window(scltouchdevice touch_id);
-    void set_cur_move_window(scltouchdevice touch_id, sclwindow window);
+    SclPoint get_cur_moving_point(scltouchdevice touch_id);
+    void set_cur_moving_point(scltouchdevice touch_id, sclint x, sclint y);
+    sclwindow get_cur_moving_window(scltouchdevice touch_id);
+    void set_cur_moving_window(scltouchdevice touch_id, sclwindow window);
     SclPoint get_farthest_move_point(scltouchdevice touch_id);
     void set_farthest_move_point(scltouchdevice touch_id, sclint x, sclint y);
     sclint get_farthest_move_dist(scltouchdevice touch_id);
@@ -249,13 +264,13 @@ public:
     sclwindow get_prev_pressed_window(scltouchdevice touch_id);
     void set_prev_pressed_window(scltouchdevice touch_id, sclwindow window);
 
-    SclPoint get_prev_move_point(scltouchdevice touch_id);
-    void set_prev_move_point(scltouchdevice touch_id, sclint x, sclint y);
+    SclPoint get_prev_moving_point(scltouchdevice touch_id);
+    void set_prev_moving_point(scltouchdevice touch_id, sclint x, sclint y);
     SCLDragState get_prev_drag_state(scltouchdevice touch_id);
     void set_prev_drag_state(scltouchdevice touch_id, SCLDragState state);
 
     sclint get_multi_touch_context_num();
-    sclboolean get_multi_touch_event(sclint seqorder, SclUIEventDesc *desc);
+    sclboolean get_multi_touch_event(sclint order, SclUIEventDesc *desc);
     sclint get_multi_touch_event_order(scltouchdevice touch_id);
 
     sclchar* get_cur_sublayout();
@@ -272,6 +287,7 @@ protected:
 
     sclboolean m_hidden;
     SCLShiftState m_shift_state;
+    sclboolean m_caps_lock_mode;
     SCLShiftMultitouchState m_shift_multi_touch_state;
 
     sclchar m_cur_sub_layout[MAX_SIZE_OF_SUBLAYOUT_STRING];
@@ -282,6 +298,8 @@ protected:
     sclboolean m_sounce_enabled;
     sclboolean m_vibration_enabled;
     sclboolean m_shift_multi_touch_enabled;
+    sclboolean m_highlight_ui_enabled;
+    sclboolean m_highlight_ui_animation_enabled;
 
     sclwindow m_last_pressed_window;
     scl8 m_last_pressed_key;
index ddc7b8e..327960f 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -68,7 +68,7 @@ private:
         scltouchdevice touch_id, sclboolean actual_event = TRUE);
     sclboolean process_button_move_event(sclwindow window, sclint x, sclint y, sclbyte key_index,
         scltouchdevice touch_id, sclboolean actual_event = TRUE);
-    sclboolean process_button_over_event(sclwindow window, sclint x, sclint y, sclbyte keyindex);
+    sclboolean process_button_over_event(sclwindow window, sclint x, sclint y, sclbyte key_index);
     sclboolean process_button_release_event(sclwindow window, sclint x, sclint y, sclbyte key_index,
         scltouchdevice touch_id, sclboolean actual_event = TRUE);
 
@@ -81,7 +81,7 @@ private:
         sclboolean check_farthest,scltouchdevice touch_id, sclbyte extra_option);
 
 public:
-    void handle_engine_signal(SclInternalSignal signal, sclwindow skipwindow = SCLWINDOW_INVALID);
+    void handle_engine_signal(SclInternalSignal signal, sclwindow skip_window = SCLWINDOW_INVALID);
     sclboolean process_input_mode_change(const sclbyte mode);
     sclboolean process_rotation_change(const SCLRotation rotation);
 
index 78e9116..4f61329 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index ea9e0f6..f5202af 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index ffef76b..16a26f2 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 7a031ad..3c9ff0c 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 namespace scl
 {
 
-typedef struct {
+struct SclUIEventDesc {
+    SclUIEventDesc() {
+        key_value = NULL;
+        key_event = 0;
+        key_type = KEY_TYPE_NONE;
+        key_modifier = KEY_MODIFIER_NONE;
+        touch_id = 0;
+        touch_event_order = 0;
+        event_type = EVENT_TYPE_NONE;
+    }
     const sclchar *key_value;
     sclulong key_event;
     SCLKeyType key_type;
@@ -43,7 +52,52 @@ typedef struct {
     SclPoint mouse_farthest_point;
 
     SCLEventType event_type;
-} SclUIEventDesc;
+};
+
+struct SclNotiDesc {
+    SclUIEventDesc *ui_event_desc;
+};
+
+struct SclNotiPopupOpeningDesc : SclNotiDesc {
+    const char *input_mode;
+}; // SCL_UINOTITYPE_POPUP_OPENING
+
+struct SclNotiPopupOpenedDesc : SclNotiDesc {
+    sclwindow window;
+    const char *input_mode;
+}; // SCL_UINOTITYPE_POPUP_OPENED
+
+struct SclNotiPopupClosingDesc : SclNotiDesc {
+    sclwindow window;
+    const char *input_mode;
+    sclboolean timed_out;
+}; // SCL_UINOTITYPE_POPUP_CLOSING
+
+struct SclNotiPopupClosedDesc : SclNotiDesc {
+    sclwindow window;
+    const char *input_mode;
+    sclboolean timed_out;
+}; // SCL_UINOTITYPE_POPUP_CLOSED
+
+struct SclNotiGestureFlickDesc : SclNotiDesc {
+    SCLDragType drag_type;
+}; // SCL_UINOTITYPE_GESTURE_FLICK
+
+struct SclNotiShiftStateChangeDesc : SclNotiDesc {
+    SCLShiftState shift_state;
+}; // SCL_UINOTITYPE_SHIFT_STATE_CHANGE
+
+struct SclNotiInputModeChangeDesc : SclNotiDesc {
+    const char *input_mode;
+}; // SCL_UINOTITYPE_INPUT_MODE_CHANGE
+
+struct SclNotiHighlighNavigateDesc : SclNotiDesc {
+    SCLHighlightNavigationDirection direction;
+    sclwindow window_from;
+    scl8 key_from;
+    sclwindow window_to;
+    scl8 key_to;
+}; // SCL_UINOTITYPE_HIGHLIGHT_NAVIGATE
 
 /**
 * @brief The callback interface to handle SCL events
@@ -54,7 +108,7 @@ typedef struct {
 struct ISCLUIEventCallback {
     virtual SCLEventReturnType on_event_key_clicked(SclUIEventDesc ui_event_desc) { return SCL_EVENT_PASS_ON; }
     virtual SCLEventReturnType on_event_drag_state_changed(SclUIEventDesc ui_event_desc) { return SCL_EVENT_PASS_ON; }
-    virtual SCLEventReturnType on_event_notification(SCLUINotiType noti_type, sclint etc_info) { return SCL_EVENT_PASS_ON; }
+    virtual SCLEventReturnType on_event_notification(SCLUINotiType noti_type, SclNotiDesc *etc_info) { return SCL_EVENT_PASS_ON; }
 };
 
 }
index ce35e79..96a5e96 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -45,7 +45,7 @@ public:
 
     SCLEventReturnType on_event_key_clicked(SclUIEventDesc ui_event_desc);
     SCLEventReturnType on_event_drag_state_changed(SclUIEventDesc ui_event_desc);
-    SCLEventReturnType on_event_notification(SCLUINotiType noti_type, sclint etc_info);
+    SCLEventReturnType on_event_notification(SCLUINotiType noti_type, SclNotiDesc *etc_info);
 
     void pre_process_ui_event(SclUIEventDesc &ui_event_desc);
 
index c945fe8..83acaa4 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -63,6 +63,7 @@ public :
     virtual void destroy_all_timer() = 0;
 
     virtual void generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y) = 0;
+
 };
 
 class CSCLEvents
@@ -79,6 +80,7 @@ public :
     void connect_window_events(sclwindow wnd, const sclint evt);
 
     void create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean addToMap = TRUE) {
+        get_scl_events_impl()->destroy_timer(id);
         get_scl_events_impl()->create_timer(id, interval, value, addToMap);
     }
 
@@ -97,6 +99,8 @@ public :
         get_scl_events_impl()->generate_mouse_event(type, x, y);
     }
 
+    sclboolean process_key_event(const char *key);
+
 protected :
     CSCLEventsImpl* get_scl_events_impl();
 
index 276e530..1bbfccd 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 34784bd..12ca548 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index c29c191..c078c2b 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -52,11 +52,11 @@ typedef struct _SclTextCachedInfo {
     SclSize actual_size;
 }SclTextCachedInfo;
 
-const SclColor SCLCOLOR_WHITE = {255, 255, 255};
-const SclColor SCLCOLOR_GREY = {128, 128, 128};
-const SclColor SCLCOLOR_BLACK = {0, 0, 0};
-const SclColor SCLCOLOR_RED = {255, 0, 0};
-const SclColor SCLCOLOR_BLUE = {0, 0, 255};
+const SclColor SCLCOLOR_WHITE = {255, 255, 255, 255};
+const SclColor SCLCOLOR_GREY = {128, 128, 128, 255};
+const SclColor SCLCOLOR_BLACK = {0, 0, 0, 255};
+const SclColor SCLCOLOR_RED = {255, 0, 0, 255};
+const SclColor SCLCOLOR_BLUE = {0, 0, 255, 255};
 
 /**
  * @brief The base class to work as a soft-based keyboard
index e946eba..345babf 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 02290ee..e9fcbcc 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index aa93bb3..0c3c799 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index ea9e0f6..f5202af 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index c790713..ec7a182 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
diff --git a/scl/include/sclkeyfocushandler.h b/scl/include/sclkeyfocushandler.h
new file mode 100644 (file)
index 0000000..a13acde
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "scltypes.h"
+#include "sclres_type.h"
+#ifndef __SCL_KEY_FOCUS_HANDLER_H__
+#define __SCL_KEY_FOCUS_HANDLER_H__
+
+//#define TARGET_EMULATOR
+//SCL_BEGIN_DECLS
+
+namespace scl
+{
+
+#define NAVI_INFO_MAX_ROWS  20
+#define NAVI_INFO_MAX_COLS  20
+
+typedef struct {
+    scl8 candidate;
+    scl8 candidate_otherside;
+} NEXT_CANDIDATE_INFO;
+
+/*
+typedef struct _SclKeyboardRowInfo {
+    sclbyte start_index;
+    sclbyte size;
+    sclchar *sub_layout;
+    sclshort col_coord[NAVI_INFO_MAX_COLS];
+}SclKeyboardRowInfo;
+
+typedef struct _SclKeyFocusNavigationInfo {
+    sclbyte total_rows;
+    sclshort row_coord;
+    SclKeyboardRowInfo* rows[NAVI_INFO_MAX_ROWS];
+}SclKeyFocusNavigationInfo;
+
+typedef struct _SclPopupRelativeKeyInfo {
+    sclbyte index;
+    sclwindow window;
+}SclPopupRelativeKeyInfo;
+
+typedef struct _SclPopupRowInfo {
+    sclbyte start_index;
+    sclbyte size;
+    sclshort col_coord[NAVI_INFO_MAX_COLS];
+    SclPopupRelativeKeyInfo nexts[NAVI_INFO_MAX_COLS][NAVIGATE_MAX];
+}SclPopupRowInfo;
+
+typedef struct _SclPopupNavigationInfo {
+    sclbyte total_rows;
+    sclshort row_coord;
+    SclPopupRowInfo* rows[NAVI_INFO_MAX_ROWS];
+}SclPopupNavigationInfo;
+*/
+
+/**
+* @brief The class to store key focus navigation information
+*
+* This class implements functions to support key focus navigation on the software keyboard
+* using remote controller input. It generates navigation information for the currently loaded 
+* keyboard layout and provides the index of next key depending upon the navigation direction.
+* The key information can be retrieved from the array of key coordinates from Resource Cache.
+* 
+* Apart from key navigation information, this class also provides functions to grab and ungrab
+* the remote controller keys.
+*
+* The public interface can be divided in three categories :
+* 1. Focus grab/ungrab API : Invoked while showing and hiding the software keyboard
+* - Client class: CSCLWindowsImplEfl
+* 2. Focus navigation info buildig API : Invoked while computing layout of the current keyboard
+* - Client class/function: CSCLResourceCache::recompute_layout
+* 3. Focus navigation API: Invoked while handling remote controller key press events
+* - Client class: CSCLEventsImplEfl
+*/
+class CSCLKeyFocusHandler
+{
+public:
+    ~CSCLKeyFocusHandler();
+
+    static CSCLKeyFocusHandler* get_instance();
+
+#ifdef USING_KEY_GRAB
+    /*Focus grab/ungrab API*/
+    bool grab_keyboard(const sclwindow parent);
+    void ungrab_keyboard(const sclwindow parent);
+#endif
+
+    /*Focus navigation info buildig API*/
+    void reset_key_navigation_info(sclwindow window);
+    void update_key_navigation_info(sclwindow window, scl8 index, SclLayoutKeyCoordinatePointer p_next_key);
+    void finalize_key_navigation_info(sclwindow window);
+
+    void popup_opened(sclwindow window);
+    void popup_closed(sclwindow window);
+
+    /*Focus navigation API*/
+    void init_key_index();
+    scl8 get_current_focus_key(void);
+    sclwindow get_current_focus_window(void);
+    void process_navigation(SCLHighlightNavigationDirection direction);
+
+private:
+    NEXT_CANDIDATE_INFO get_next_candidate_key(SCLHighlightNavigationDirection direction, SclRectangle cur, sclwindow window);
+
+    sclwindow m_focus_window;
+    scl8 m_focus_key;
+
+#ifdef USING_KEY_GRAB
+    bool m_keyboard_grabbed;
+#endif
+    bool sub_layout_match(sclchar *layout1,sclchar *layout2);
+
+    CSCLKeyFocusHandler();
+#ifdef TARGET_EMULATOR
+    sclwindow m_sniffer;
+    void create_sniffer_window(void);
+    void set_window_accepts_focus(const sclwindow window, sclboolean acceptable);
+#endif
+
+};
+
+}
+
+//SCL_END_DECLS
+
+#endif
index 43acceb..c99e71a 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -30,7 +30,7 @@ namespace scl
 typedef struct _SclButtonContext {
     sclboolean used;
     sclbyte multikeyIdx;
-    //sclboolean pressed;
+    sclboolean toggled;
     SCLButtonState state;
 } SclButtonContext;
 /**
@@ -72,7 +72,7 @@ public:
     const sclchar* get_cur_themename();
 
     sclint set_private_key(SclPrivateKeyProperties* properties, sclboolean fRedraw, sclboolean fPendingUpdate);
-    sclint set_private_key(sclchar* custom_id, sclchar* label, sclchar* imagelabel[SCL_BUTTON_STATE_MAX], sclchar* imagebg[SCL_BUTTON_STATE_MAX], sclulong key_event, sclchar *key_value, sclboolean fRedraw, sclboolean fPendingUpdate);
+    sclint set_private_key(const sclchar* custom_id, sclchar* label, sclchar* imagelabel[SCL_BUTTON_STATE_MAX], sclchar* imagebg[SCL_BUTTON_STATE_MAX], sclulong key_event, sclchar *key_value, sclboolean fRedraw, sclboolean fPendingUpdate);
     void unset_private_key(sclshort input_mode_index, sclbyte layout_index, sclbyte key_index);
     void unset_private_key(const sclchar* custom_id);
 
@@ -83,6 +83,12 @@ public:
     void set_string_substitution(const sclchar *original, const sclchar *substitute);
     void unset_string_substitution(const sclchar *original);
     const sclchar* find_substituted_string(const sclchar *original);
+
+    void set_custom_starting_coordinates(sclint x, sclint y);
+    SclPoint get_custom_starting_coordinates();
+
+    void set_custom_starting_coordinates_option(SCLStartingCoordinatesOption option);
+    SCLStartingCoordinatesOption get_custom_starting_coordinates_option();
 private:
     sclboolean resize_resource_elements_by_resolution();
     sclboolean resize_layout_by_resolution(sclbyte layout_index, sclboolean resize_key_only = FALSE);
@@ -110,6 +116,9 @@ protected:
     std::map<std::string, std::string> mStringSubstitutor;
 
     sclchar mCurThemename[_POSIX_PATH_MAX];
+
+    SclPoint mCurStartingCoordinates;
+    SCLStartingCoordinatesOption mCurStartingCoordinatesOption;
 };
 
 }
index 8a57ddc..697b75f 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 140a022..7dccd48 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 3ff6169..0652b93 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -66,7 +66,6 @@ public:
 
     /**
      * @brief This API requests SCL library to hide the S/W keyboard from the screen
-     * @param[in] ctx target SCL context
      */
     void hide();
 
@@ -111,6 +110,21 @@ public:
     const sclchar* get_input_mode();
 
     /**
+     * @brief This API request SCL library to change the given popup window's input mode
+     * @param[in] window the handle for the popup window that we want to change the input mode
+     * @param[in] input_mode the name of the desired input mode
+     * @return non-zero value is returned when successful
+     */
+    sclboolean set_popup_input_mode(sclwindow window, const sclchar *input_mode);
+
+    /**
+     * @brief This API retrieves the current input mode
+     * @param[in] window the handle for the popup window that we want to retrieve the input mode
+     * @return a string pointer that indicates the name of current input mode
+     */
+    const sclchar* get_popup_input_mode(sclwindow window);
+
+    /**
      * @brief This API request SCL library to suspend screen updates
      * @param[in] pend whether to suspend screen updates
      */
@@ -175,6 +189,18 @@ public:
     SCLShiftState get_shift_state();
 
     /**
+     * @brief This API sets the current caps lock mode, which reverses the effect of shift mode
+     * @param[in] mode whether the cap lock mode is enabled or not
+     */
+    void set_caps_lock_mode(sclboolean mode);
+
+    /**
+     * @brief This API retrieves the current caps lock mode
+     * @return current caps lock mode
+     */
+    sclboolean get_caps_lock_mode();
+
+    /**
      * @brief This API notifies the SCL library that the application's focus was moved to another input context
      */
     void notify_app_focus_changed();
@@ -251,6 +277,19 @@ public:
     void set_custom_scale_rate(sclfloat x, sclfloat y);
 
     /**
+     * @brief This API sets the starting coordinates for drawing keyboard's contents
+     * @param[in] x the starting coordinate x
+     * @param[in] y the starting coordinate y
+     */
+    void set_custom_starting_coordinates(sclint x, sclint y);
+
+    /**
+     * @brief This API sets the option for the starting coordinates feature
+     * @param[in] option the starting coordinate option
+     */
+    void set_custom_starting_coordinates_option(SCLStartingCoordinatesOption option);
+
+    /**
      * @brief This API returns the number of current multi touch contexts,
      *        which means how many fingers are currently pressing the touch device
      * @return number of touch contexts
@@ -342,6 +381,18 @@ public:
     void enable_shift_multi_touch(sclboolean enabled);
 
     /**
+     * @brief This API requests SCL library to enable/disable highlight ui
+     * @param[in] enabled indicates whether to show highlight ui
+     */
+    void enable_highlight_ui(sclboolean enabled);
+
+    /**
+     * @brief This API requests SCL library to enable/disable animation effect for highlight ui
+     * @param[in] enabled indicates whether to display animation effect when moving highlight ui
+     */
+    void enable_highlight_ui_animation(sclboolean enabled);
+
+    /**
      * @brief This API requests SCL library to apply the touch offset adjustment
      * @param[in] enabled indicates whether the touch offset adjustment should applied or not
      */
@@ -387,6 +438,11 @@ public:
      */
     sclint get_autocapital_shift_state();
 
+    /**
+     * @brief This API process the key event received from ISF
+     */
+    sclboolean process_key_event(const char *key);
+
 private:
     CSCLUIImpl *m_impl;
 };
index 5c74587..3b41ee4 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -56,12 +56,12 @@ private:
     sclboolean draw_button_bg_by_sw(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state);
     sclboolean draw_window_bg_by_sw(const sclwindow window, const scldrawctx draw_ctx, const SclSize size,
         const scldouble line_width, const SclColor line_color, const SclColor fill_color);
-    sclboolean draw_button_bg_by_img(const sclwindow window, const scldrawctx draw_ctx,const scl16 key_index,
-        const SCLButtonState state, const sclboolean shift);
+    sclboolean draw_button_bg_by_img(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index,
+        SCLButtonState state, SCLShiftState shift);
     sclboolean draw_button_bg_by_layoutimg(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index,
         const SCLButtonState state, const sclboolean shift);
     sclboolean draw_button_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index,
-                                 const SCLButtonState state, const sclboolean shift);
+                                 SCLButtonState state, SCLShiftState shift);
 
     sclboolean draw_magnifier_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 label_index, const sclchar* label);
 
index 18f9717..ee4c00b 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -56,6 +56,8 @@ public:
 
     sclboolean set_input_mode(const sclchar *input_mode);
     const sclchar* get_input_mode();
+    sclboolean set_popup_input_mode(sclwindow window, const sclchar *input_mode);
+    const sclchar* get_popup_input_mode(sclwindow window);
 
     void set_update_pending(sclboolean pend);
 
@@ -72,6 +74,9 @@ public:
     void set_shift_state(SCLShiftState state);
     SCLShiftState get_shift_state();
 
+    void set_caps_lock_mode(sclboolean mode);
+    sclboolean get_caps_lock_mode();
+
     void notify_app_focus_changed();
     void reset_popup_timeout();
     void close_all_popups();
@@ -88,6 +93,9 @@ public:
     sclfloat get_custom_scale_rate_y();
     void set_custom_scale_rate(sclfloat x, sclfloat y);
 
+    void set_custom_starting_coordinates(sclint x, sclint y);
+    void set_custom_starting_coordinates_option(SCLStartingCoordinatesOption option);
+
     sclint get_multi_touch_context_num();
     sclboolean get_multi_touch_event(sclint seqorder, SclUIEventDesc *desc);
 
@@ -105,6 +113,8 @@ public:
     void enable_vibration(sclboolean enabled);
     void enable_tts(sclboolean enabled);
     void enable_shift_multi_touch(sclboolean enabled);
+    void enable_highlight_ui(sclboolean enabled);
+    void enable_highlight_ui_animation(sclboolean enabled);
 
     void enable_touch_offset(sclboolean enabled);
     void disable_input_events(sclboolean disabled);
@@ -115,6 +125,9 @@ public:
     void unset_string_substitution(const sclchar *original);
     sclboolean get_autocapital_shift_state();
     void set_autocapital_shift_state(sclboolean flag);
+
+    sclboolean process_key_event(const char *key);
+
 private:
     sclboolean m_initialized;
     sclboolean m_autocapital_shift_state;
index 54c7241..4e70ebf 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 6712330..ac4de5e 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -18,7 +18,7 @@
 #ifndef __SCL_VERSION_H__
 #define __SCL_VERSION_H__
 
-#define SCL_VERSION "0.4.4-1"
+#define SCL_VERSION "0.4.7-1"
 
 #endif //__SCL_VERSION_H
 
index 6c3c834..2a8e0aa 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -57,7 +57,7 @@ typedef struct _SclWindowContext {
     sclint              timeout;
 
     SclPoint            layout_image_offset;
-    void*               etc_info;
+    const void*         etc_info;
 } SclWindowContext;
 
 /**
@@ -72,10 +72,14 @@ public :
     virtual void init() = 0;
     virtual void fini() = 0;
 
-    virtual sclwindow create_base_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height) = 0;
-    virtual sclwindow create_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height) = 0;
-    virtual sclwindow create_magnifier_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height) = 0;
-    virtual sclwindow create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height) = 0;
+    virtual sclwindow create_base_window(const sclwindow parent,
+        SclWindowContext *window_context, scl16 width, scl16 height) = 0;
+    virtual sclwindow create_window(const sclwindow parent,
+        SclWindowContext *window_context, scl16 width, scl16 height) = 0;
+    virtual sclwindow create_magnifier_window(const sclwindow parent,
+        SclWindowContext *window_context, scl16 width, scl16 height) = 0;
+    virtual sclwindow create_dim_window(const sclwindow parent,
+        SclWindowContext *window_context, scl16 width, scl16 height) = 0;
     virtual bool destroy_window(sclwindow window) = 0;
     virtual void set_parent(const sclwindow parent, const sclwindow window) = 0;
     virtual void show_window(const sclwindow window, sclboolean queue) = 0;
@@ -102,7 +106,9 @@ public :
     void init();
     void fini();
 
-    sclwindow open_popup(const SclWindowOpener opener, const SclRectangle& geometry, sclshort inputmode, sclshort layout, SCLPopupType popup_type, sclboolean is_virtual, sclboolean use_dim_window, sclint img_offset_x = 0, sclint img_offset_y = 0, sclint timeout = 0);
+    sclwindow open_popup(const SclWindowOpener opener, const SclRectangle& geometry,
+        sclshort inputmode, sclshort layout, SCLPopupType popup_type, sclboolean is_virtual,
+        sclboolean use_dim_window, sclint img_offset_x = 0, sclint img_offset_y = 0, sclint timeout = 0);
     bool close_popup(sclwindow window);
     bool close_all_popups(sclwindow skip_window = SCLWINDOW_INVALID);
 
@@ -135,7 +141,7 @@ public :
     sclwindow get_nth_popup_window(sclbyte index);
     sclbyte get_Z_order(sclwindow window);
 
-    sclwindow create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
+    sclwindow create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
     sclwindow get_dim_window();
 
     void set_update_pending(sclboolean pend);
@@ -144,7 +150,9 @@ public :
 protected :
     CSCLWindowsImpl* get_scl_windows_impl();
 
-    sclwindow create_window(const SclWindowOpener opener, const SclRectangle &geometry, sclshort inputmode, sclshort layout, SCLPopupType popup_type, sclboolean is_virtual, sclint img_offset_x = 0, sclint img_offset_y = 0, sclint timeout = 0);
+    sclwindow create_window(const SclWindowOpener opener, const SclRectangle &geometry,
+        sclshort inputmode, sclshort layout, SCLPopupType popup_type, sclboolean is_virtual,
+        sclint img_offset_x = 0, sclint img_offset_y = 0, sclint timeout = 0);
     bool destroy_window(sclwindow window);
 
     void push_window_in_Z_order_list(sclwindow window);
@@ -152,11 +160,11 @@ protected :
 
 private :
     CSCLWindowsImpl* m_impl;
-    SclWindowContext m_base_winctx;
-    SclWindowContext m_popup_winctx[MAX_POPUP_WINDOW];
+    SclWindowContext m_base_window_context;
+    SclWindowContext m_popup_window_context[MAX_POPUP_WINDOW];
 
-    SclWindowContext m_magnifier_winctx;
-    SclWindowContext m_dim_winctx;
+    SclWindowContext m_magnifier_window_context;
+    SclWindowContext m_dim_window_context;
 
     sclboolean m_pending_update;
     sclboolean m_initialized;
index e8621ed..17cbde9 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
diff --git a/scl/sclanimator.cpp b/scl/sclanimator.cpp
new file mode 100644 (file)
index 0000000..9382756
--- /dev/null
@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "sclanimator.h"
+#ifdef  __WIN32__
+#include "sclanimator-win32.h"
+#elif defined(__EFL__)
+#include "sclanimator-efl.h"
+#elif __GTK__
+#include "sclanimator-gtk.h"
+#else
+#include "sclanimator-cairo.h"
+#endif
+#include "scldebug.h"
+
+#include "sclevents.h"
+#include "sclwindows.h"
+
+using namespace scl;
+
+CSCLAnimator::CSCLAnimator()
+{
+    SCL_DEBUG();
+    m_impl = NULL;
+}
+
+CSCLAnimator::~CSCLAnimator()
+{
+    SCL_DEBUG();
+
+    if (m_impl) {
+        delete m_impl;
+        m_impl = NULL;
+    }
+}
+
+void CSCLAnimator::init()
+{
+    CSCLAnimatorImpl *impl = get_scl_animator_impl();
+    if (impl) {
+        impl->init();
+    }
+}
+
+void CSCLAnimator::fini()
+{
+    CSCLAnimatorImpl *impl = get_scl_animator_impl();
+    if (impl) {
+        impl->fini();
+    }
+}
+
+sclboolean CSCLAnimator::check_animation_supported()
+{
+    sclboolean ret = FALSE;
+
+    CSCLAnimatorImpl *impl = get_scl_animator_impl();
+    if (impl) {
+        ret = impl->check_animation_supported();
+    }
+    return ret;
+}
+
+CSCLAnimatorImpl* CSCLAnimator::get_scl_animator_impl()
+{
+    SCL_DEBUG();
+    if (m_impl == 0) {
+#ifdef  __WIN32__
+        m_impl = new CSCLAnimatorImplWin32;
+#elif defined(__EFL__)
+        m_impl = new CSCLAnimatorImplEfl;
+#elif __GTK__
+        m_impl = new CSCLAnimatorImplGtk;
+#else
+        m_impl = new CSCLAnimatorImplCairo;
+#endif
+    }
+    return m_impl;
+}
+
+CSCLAnimator* CSCLAnimator::get_instance()
+{
+    static CSCLAnimator instance;
+    return &instance;
+}
+
+sclint
+CSCLAnimator::create_animator(SclAnimationDesc *desc)
+{
+    static sclint animator_id = 0;
+
+    if (desc) {
+        animator_id++;
+        /* Just in case for overflow */
+        if (animator_id < 0) animator_id = 0;
+
+        SclAnimationState state;
+        state.active = FALSE;
+        state.rect_cur = desc->rect_from;
+        state.step = 0;
+
+        state.desc = *desc;
+
+        destroy_animator(animator_id);
+        m_animators[animator_id] = state;
+    } else {
+        return NOT_USED;
+    }
+
+    return animator_id;
+}
+
+sclboolean
+CSCLAnimator::destroy_animator(sclint id)
+{
+    sclboolean ret = TRUE;
+
+    std::map<sclint, SclAnimationState>::iterator iter;
+    iter = m_animators.find(id);
+    if (iter != m_animators.end()) {
+        SclAnimationState *state = &(iter->second);
+        state->active = FALSE;
+        m_animators.erase(iter->first);
+    } else {
+        ret = FALSE;
+    }
+
+    sclboolean destroy_timer = TRUE;
+    for(iter = m_animators.begin();iter != m_animators.end();std::advance(iter, 1)) {
+        if (iter != m_animators.end()) {
+            SclAnimationState *state = &(iter->second);
+            if (state->active) {
+                destroy_timer = FALSE;
+            }
+        }
+    }
+
+    if (destroy_timer) {
+        CSCLEvents *events = CSCLEvents::get_instance();
+        if (events) {
+            events->destroy_timer(SCL_TIMER_ANIMATION);
+        }
+    }
+
+    return ret;
+}
+
+sclint
+CSCLAnimator::find_animator_by_type(SCLAnimationType type)
+{
+    sclint ret = NOT_USED;
+
+    for(std::map<sclint, SclAnimationState>::iterator iter = m_animators.begin();
+        iter != m_animators.end();std::advance(iter, 1)) {
+            if (iter != m_animators.end()) {
+                SclAnimationState *state = &(iter->second);
+                if (state->desc.type == type) {
+                    ret = iter->first;
+                }
+            }
+    }
+
+    return ret;
+}
+
+
+SclAnimationState*
+CSCLAnimator::get_animation_state(sclint id)
+{
+    SclAnimationState *ret = NULL;
+
+    std::map<sclint, SclAnimationState>::iterator iter = m_animators.find(id);
+    if (iter != m_animators.end()) {
+        ret = &(iter->second);
+    } else {
+        ret = NULL;
+    }
+
+    return ret;
+}
+
+sclboolean
+CSCLAnimator::start_animator(sclint id)
+{
+    sclboolean ret = TRUE;
+
+    std::map<sclint, SclAnimationState>::iterator iter = m_animators.find(id);
+    if (iter != m_animators.end()) {
+        SclAnimationState *state = &(iter->second);
+        state->active = TRUE;
+    } else {
+        ret = FALSE;
+    }
+
+    /*
+    sclboolean start_timer = TRUE;
+    for(std::map<sclint, SclAnimationState>::iterator iter = m_animators.begin();
+        iter != m_animators.end();std::advance(iter, 1)) {
+            if (iter != m_animators.end()) {
+                SclAnimationState *state = &(iter->second);
+                if (state->active) {
+                    start_timer = FALSE;
+                }
+            }
+    }
+
+    if (start_timer) {
+        CSCLEvents *events = CSCLEvents::get_instance();
+        if (events) {
+            events->create_timer(SCL_TIMER_ANIMATION, SCL_ANIMATION_TIMER_INTERVAL, 0);
+        }
+    }
+    */
+    CSCLEvents *events = CSCLEvents::get_instance();
+    if (events) {
+        events->destroy_timer(SCL_TIMER_ANIMATION);
+        events->create_timer(SCL_TIMER_ANIMATION, SCL_ANIMATION_TIMER_INTERVAL, 0);
+    }
+
+    return ret;
+}
+
+sclboolean
+CSCLAnimator::stop_animator(sclint id)
+{
+    sclboolean ret = TRUE;
+
+    std::map<sclint, SclAnimationState>::iterator iter;
+    iter = m_animators.find(id);
+    if (iter != m_animators.end()) {
+        SclAnimationState *state = &(iter->second);
+        state->active = FALSE;
+        m_animators.erase(iter->first);
+    } else {
+        ret = FALSE;
+    }
+
+    sclboolean destroy_timer = TRUE;
+    for(iter = m_animators.begin();iter != m_animators.end();std::advance(iter, 1)) {
+        if (iter != m_animators.end()) {
+            SclAnimationState *state = &(iter->second);
+            if (state->active) {
+                destroy_timer = FALSE;
+            }
+        }
+    }
+
+    if (destroy_timer) {
+        CSCLEvents *events = CSCLEvents::get_instance();
+        if (events) {
+            events->destroy_timer(SCL_TIMER_ANIMATION);
+        }
+    }
+
+    return ret;
+}
+
+sclboolean
+CSCLAnimator::animator_timer_highlight_ui(SclAnimationState *state)
+{
+    sclboolean ret = TRUE;
+
+    CSCLWindows *windows = CSCLWindows::get_instance();
+
+    if (state && windows) {
+        SclRectangle rect_from = state->desc.rect_from;
+        SclRectangle rect_to = state->desc.rect_to;
+
+        sclint delta_x = 0; /* We will calculate the X considering circulation */
+        sclint delta_y = rect_to.y - rect_from.y;
+        sclint delta_width = rect_to.width - rect_from.width;
+        sclint delta_height = rect_to.height - rect_from.height;
+
+        state->rect_cur.y = rect_from.y +
+            ((delta_y) * state->step * SCL_ANIMATION_TIMER_INTERVAL) / state->desc.length;
+        state->rect_cur.width = rect_from.width +
+            ((delta_width) * state->step * SCL_ANIMATION_TIMER_INTERVAL) / state->desc.length;
+        state->rect_cur.height = rect_from.height +
+            ((delta_height) * state->step * SCL_ANIMATION_TIMER_INTERVAL) / state->desc.length;
+
+        if (state->desc.circular) {
+            SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+            if (base_window_context) {
+                if (rect_from.x > rect_to.x) {
+                    delta_x = rect_to.x;
+                    delta_x += (base_window_context->geometry.width - rect_from.x);
+                } else {
+                    delta_x = -(rect_from.x);
+                    delta_x -= (base_window_context->geometry.width - rect_to.x);
+                }
+
+                state->rect_cur.x = rect_from.x +
+                    ((delta_x) * state->step * SCL_ANIMATION_TIMER_INTERVAL) / state->desc.length;
+
+                if (state->rect_cur.x + state->rect_cur.width <= 0) {
+                    /* Make the highlight UI come out from the right side of the window */
+                    state->rect_cur.x += base_window_context->geometry.width;
+                } else if (state->rect_cur.x > base_window_context->geometry.width) {
+                    state->rect_cur.x -= base_window_context->geometry.width;
+                }
+            }
+        } else {
+            delta_x = rect_to.x - rect_from.x;
+
+            state->rect_cur.x = rect_from.x +
+                ((delta_x) * state->step * SCL_ANIMATION_TIMER_INTERVAL) / state->desc.length;
+        }
+    }
+
+    return ret;
+}
+sclboolean
+CSCLAnimator::animator_timer()
+{
+    sclboolean destroy_timer = TRUE;
+    for(std::map<sclint, SclAnimationState>::iterator iter = m_animators.begin();
+        iter != m_animators.end();std::advance(iter, 1)) {
+            if (iter != m_animators.end()) {
+                CSCLWindows *windows = CSCLWindows::get_instance();
+                SclAnimationState *state = &(iter->second);
+                if (state && state->active && windows) {
+                    state->step++;
+                    if (SCL_ANIMATION_TIMER_INTERVAL * state->step >= state->desc.length) {
+                        state->active = FALSE;
+                    } else {
+                        if (state->desc.type == ANIMATION_TYPE_HIGHLIGHT_UI) {
+                            animator_timer_highlight_ui(state);
+                        }
+                    }
+
+                    CSCLAnimatorImpl *impl = get_scl_animator_impl();
+                    if (impl) {
+                        impl->animator_timer(state);
+                    }
+
+                    if (state->active == FALSE) {
+                        windows->update_window(state->desc.window_to,
+                            state->desc.rect_to.x, state->desc.rect_to.y,
+                            state->desc.rect_to.width, state->desc.rect_to.height);
+                    } else {
+                        destroy_timer = FALSE;
+                    }
+                }
+            }
+    }
+    if (destroy_timer) {
+        CSCLEvents *events = CSCLEvents::get_instance();
+        if (events) {
+            events->destroy_timer(SCL_TIMER_ANIMATION);
+        }
+    }
+    return TRUE;
+}
+
index b289183..0c2744a 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -68,6 +68,8 @@ CSCLContext::reset()
     m_sounce_enabled = TRUE;
     m_vibration_enabled = TRUE;
     m_shift_multi_touch_enabled = TRUE;
+    m_highlight_ui_enabled = FALSE;
+    m_highlight_ui_animation_enabled = FALSE;
 
     m_tts_enabled = FALSE;
 
@@ -87,11 +89,11 @@ CSCLContext::get_popup_layout( sclwindow window ) const
 
     sclshort ret = NOT_USED;
     CSCLWindows *windows = CSCLWindows::get_instance();
-    //SclWindowContext *ctx = windows->get_window_context(window, FALSE);
-    SclWindowContext *ctx = windows->get_window_context(window);
+    //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+    SclWindowContext *window_context = windows->get_window_context(window);
 
-    if (ctx) {
-        ret = ctx->layout;
+    if (window_context) {
+        ret = window_context->layout;
     }
 
     return ret;
@@ -103,11 +105,11 @@ CSCLContext::set_popup_layout( sclwindow window, sclshort val )
     SCL_DEBUG();
 
     CSCLWindows *windows = CSCLWindows::get_instance();
-    //SclWindowContext *ctx = windows->get_window_context(window, FALSE);
-    SclWindowContext *ctx = windows->get_window_context(window);
+    //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+    SclWindowContext *window_context = windows->get_window_context(window);
 
-    if (ctx) {
-        ctx->layout = val;
+    if (window_context) {
+        window_context->layout = val;
     }
 }
 
@@ -116,10 +118,10 @@ CSCLContext::set_base_layout( sclshort val )
 {
     SCL_DEBUG();
     CSCLWindows *windows = CSCLWindows::get_instance();
-    //SclWindowContext *ctx = windows->get_window_context(windows->get_base_window(), FALSE);
-    SclWindowContext *ctx = windows->get_window_context(windows->get_base_window());
-    if (ctx) {
-        ctx->layout = val;
+    //SclWindowContext *window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+    SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+    if (window_context) {
+        window_context->layout = val;
     }
 }
 
@@ -130,10 +132,10 @@ CSCLContext::get_base_layout() const
 
     sclshort ret = NOT_USED;
     CSCLWindows *windows = CSCLWindows::get_instance();
-    //SclWindowContext *ctx = windows->get_window_context(windows->get_base_window(), FALSE);
-    SclWindowContext *ctx = windows->get_window_context(windows->get_base_window());
-    if (ctx) {
-        ret = ctx->layout;
+    //SclWindowContext *window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+    SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+    if (window_context) {
+        ret = window_context->layout;
     }
 
     return ret;
@@ -143,9 +145,9 @@ scl16
 CSCLContext::get_cur_pressed_event_id(scltouchdevice touch_id)
 {
     scl16 ret = NOT_USED;
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->event_id;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->event_id;
     }
     return ret;
 }
@@ -153,9 +155,9 @@ CSCLContext::get_cur_pressed_event_id(scltouchdevice touch_id)
 void
 CSCLContext::set_cur_pressed_event_id(scltouchdevice touch_id, scl16 id)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->event_id = id;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        multi_touch_context->event_id = id;
     }
 }
 
@@ -163,9 +165,9 @@ scl8
 CSCLContext::get_cur_pressed_key(scltouchdevice touch_id)
 {
     scl8 ret = NOT_USED;
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->cur_pressed_key;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->cur_pressed_key;
     }
     return ret;
 }
@@ -173,9 +175,9 @@ CSCLContext::get_cur_pressed_key(scltouchdevice touch_id)
 void
 CSCLContext::set_cur_pressed_key(scltouchdevice touch_id, scl8 val)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->cur_pressed_key = val;
+    MultiTouchContext *window_context = find_multi_touch_context(touch_id);
+    if (window_context) {
+        window_context->cur_pressed_key = val;
     }
 }
 
@@ -183,9 +185,9 @@ sclwindow
 CSCLContext::get_cur_pressed_window(scltouchdevice touch_id)
 {
     sclwindow ret = SCLWINDOW_INVALID;
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->cur_pressed_window;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->cur_pressed_window;
     }
     return ret;
 }
@@ -193,9 +195,9 @@ CSCLContext::get_cur_pressed_window(scltouchdevice touch_id)
 void
 CSCLContext::set_cur_pressed_window(scltouchdevice touch_id, sclwindow val)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->cur_pressed_window = val;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        multi_touch_context->cur_pressed_window = val;
     }
 }
 
@@ -203,9 +205,9 @@ SclPoint
 CSCLContext::get_cur_pressed_point(scltouchdevice touch_id)
 {
     SclPoint ret = {0, 0};
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->cur_pressed_point;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->cur_pressed_point;
     }
     return ret;
 }
@@ -213,63 +215,63 @@ CSCLContext::get_cur_pressed_point(scltouchdevice touch_id)
 void
 CSCLContext::set_cur_pressed_point(scltouchdevice touch_id, sclint x, sclint y)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->cur_pressed_point.x = x;
-        ctx->cur_pressed_point.y = y;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        multi_touch_context->cur_pressed_point.x = x;
+        multi_touch_context->cur_pressed_point.y = y;
         set_farthest_move_point(touch_id, x, y); // reset farthest move point
     }
 }
 
 SclPoint
-CSCLContext::get_cur_move_point(scltouchdevice touch_id)
+CSCLContext::get_cur_moving_point(scltouchdevice touch_id)
 {
     SclPoint ret = {0, 0};
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->cur_move_point;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->cur_moving_point;
     }
     return ret;
 }
 
 void
-CSCLContext::set_cur_move_point(scltouchdevice touch_id, sclint x, sclint y)
+CSCLContext::set_cur_moving_point(scltouchdevice touch_id, sclint x, sclint y)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->cur_move_point.x = x;
-        ctx->cur_move_point.y = y;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        multi_touch_context->cur_moving_point.x = x;
+        multi_touch_context->cur_moving_point.y = y;
     }
 }
 
 sclwindow
-CSCLContext::get_cur_move_window(scltouchdevice touch_id)
+CSCLContext::get_cur_moving_window(scltouchdevice touch_id)
 {
     sclwindow ret = SCLWINDOW_INVALID;
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->cur_move_window;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->cur_moving_window;
     }
     return ret;
 }
 
 
 void
-CSCLContext::set_cur_move_window(scltouchdevice touch_id, sclwindow window)
+CSCLContext::set_cur_moving_window(scltouchdevice touch_id, sclwindow window)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->cur_move_window = window;
+    MultiTouchContext *window_context = find_multi_touch_context(touch_id);
+    if (window_context) {
+        window_context->cur_moving_window = window;
     }
 }
 
 struct timeval
 CSCLContext::get_cur_pressed_time(scltouchdevice touch_id)
 {
-    struct timeval ret = {0};
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->cur_pressed_time;
+    struct timeval ret = {0,0};
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->cur_pressed_time;
     }
     return ret;
 }
@@ -277,9 +279,9 @@ CSCLContext::get_cur_pressed_time(scltouchdevice touch_id)
 void
 CSCLContext::set_cur_pressed_time(scltouchdevice touch_id)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        gettimeofday(&(ctx->cur_pressed_time), NULL);
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        gettimeofday(&(multi_touch_context->cur_pressed_time), NULL);
     }
 }
 
@@ -287,9 +289,9 @@ SclPoint
 CSCLContext::get_farthest_move_point(scltouchdevice touch_id)
 {
     SclPoint ret = {0, 0};
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->farthest_move_point;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->farthest_move_point;
     }
     return ret;
 }
@@ -297,15 +299,15 @@ CSCLContext::get_farthest_move_point(scltouchdevice touch_id)
 void
 CSCLContext::set_farthest_move_point(scltouchdevice touch_id, sclint x, sclint y)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
         CSCLUtils *utils = CSCLUtils::get_instance();
-        sclint deltax = ctx->cur_pressed_point.x - x;
-        sclint deltay = ctx->cur_pressed_point.y - y;
-        ctx->farthest_move_dist = utils->get_approximate_distance(x, y, ctx->cur_pressed_point.x, ctx->cur_pressed_point.y);
+        multi_touch_context->farthest_move_dist =
+            utils->get_approximate_distance(x, y,
+            multi_touch_context->cur_pressed_point.x, multi_touch_context->cur_pressed_point.y);
 
-        ctx->farthest_move_point.x = x;
-        ctx->farthest_move_point.y = y;
+        multi_touch_context->farthest_move_point.x = x;
+        multi_touch_context->farthest_move_point.y = y;
     }
 }
 
@@ -313,9 +315,9 @@ sclint
 CSCLContext::get_farthest_move_dist(scltouchdevice touch_id)
 {
     sclint ret = 0;
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->farthest_move_dist;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->farthest_move_dist;
     }
     return ret;
 }
@@ -324,9 +326,9 @@ SCLDragState
 CSCLContext::get_cur_drag_state(scltouchdevice touch_id)
 {
     SCLDragState ret = SCL_DRAG_STATE_NONE;
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->cur_drag_state;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->cur_drag_state;
     }
     return ret;
 }
@@ -334,9 +336,9 @@ CSCLContext::get_cur_drag_state(scltouchdevice touch_id)
 void
 CSCLContext::set_cur_drag_state(scltouchdevice touch_id, SCLDragState state)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->cur_drag_state = state;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        multi_touch_context->cur_drag_state = state;
     }
 }
 
@@ -344,9 +346,9 @@ SCLKeyModifier
 CSCLContext::get_cur_key_modifier(scltouchdevice touch_id)
 {
     SCLKeyModifier ret = KEY_MODIFIER_NONE;
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->cur_key_modifier;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->cur_key_modifier;
     }
     return ret;
 }
@@ -354,9 +356,9 @@ CSCLContext::get_cur_key_modifier(scltouchdevice touch_id)
 void
 CSCLContext::set_cur_key_modifier(scltouchdevice touch_id, SCLKeyModifier modifier)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->cur_key_modifier = modifier;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        multi_touch_context->cur_key_modifier = modifier;
     }
 }
 
@@ -364,9 +366,9 @@ scl8
 CSCLContext::get_prev_pressed_key(scltouchdevice touch_id)
 {
     scl8 ret = NOT_USED;
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->prev_pressed_key;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->prev_pressed_key;
     }
     return ret;
 }
@@ -374,9 +376,9 @@ CSCLContext::get_prev_pressed_key(scltouchdevice touch_id)
 void
 CSCLContext::set_prev_pressed_key(scltouchdevice touch_id, scl8 val)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->prev_pressed_key = val;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        multi_touch_context->prev_pressed_key = val;
     }
 }
 
@@ -384,9 +386,9 @@ sclwindow
 CSCLContext::get_prev_pressed_window(scltouchdevice touch_id)
 {
     sclwindow ret = SCLWINDOW_INVALID;
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->prev_pressed_window;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->prev_pressed_window;
     }
     return ret;
 }
@@ -394,30 +396,30 @@ CSCLContext::get_prev_pressed_window(scltouchdevice touch_id)
 void
 CSCLContext::set_prev_pressed_window(scltouchdevice touch_id, sclwindow val)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->prev_pressed_window = val;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        multi_touch_context->prev_pressed_window = val;
     }
 }
 
 SclPoint
-CSCLContext::get_prev_move_point(scltouchdevice touch_id)
+CSCLContext::get_prev_moving_point(scltouchdevice touch_id)
 {
     SclPoint ret = {0, 0};
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->prev_move_point;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->prev_moving_point;
     }
     return ret;
 }
 
 void
-CSCLContext::set_prev_move_point(scltouchdevice touch_id, sclint x, sclint y)
+CSCLContext::set_prev_moving_point(scltouchdevice touch_id, sclint x, sclint y)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->prev_move_point.x = x;
-        ctx->prev_move_point.y = y;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        multi_touch_context->prev_moving_point.x = x;
+        multi_touch_context->prev_moving_point.y = y;
     }
 }
 
@@ -425,9 +427,9 @@ SCLDragState
 CSCLContext::get_prev_drag_state(scltouchdevice touch_id)
 {
     SCLDragState ret = SCL_DRAG_STATE_NONE;
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ret = ctx->prev_drag_state;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        ret = multi_touch_context->prev_drag_state;
     }
     return ret;
 }
@@ -435,28 +437,28 @@ CSCLContext::get_prev_drag_state(scltouchdevice touch_id)
 void
 CSCLContext::set_prev_drag_state(scltouchdevice touch_id, SCLDragState state)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        ctx->prev_drag_state = state;
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        multi_touch_context->prev_drag_state = state;
     }
 }
 
 void
-CSCLContext::create_multi_touch_context(scltouchdevice touch_id, sclboolean isSubEvent)
-{
-    MultiTouchContext newctx;
-    memset(&newctx, 0x00, sizeof(MultiTouchContext));
-    newctx.used = TRUE;
-    newctx.cur_pressed_key = NOT_USED;
-    newctx.cur_pressed_window = SCLWINDOW_INVALID;
-    newctx.event_id = 0;
-    newctx.prev_pressed_key = NOT_USED;
-    newctx.prev_pressed_window = SCLWINDOW_INVALID;
-    newctx.cur_pressed_point.x = newctx.cur_pressed_point.y = 0;
-    newctx.cur_pressed_time.tv_sec = newctx.cur_pressed_time.tv_usec = 0;
-    newctx.cur_drag_state = SCL_DRAG_STATE_NONE;
-    newctx.is_sub_event = isSubEvent;
-    m_multi_touch_context[touch_id] = newctx;
+CSCLContext::create_multi_touch_context(scltouchdevice touch_id, sclboolean is_sub_event)
+{
+    MultiTouchContext new_multi_touch_context;
+    memset(&new_multi_touch_context, 0x00, sizeof(MultiTouchContext));
+    new_multi_touch_context.used = TRUE;
+    new_multi_touch_context.cur_pressed_key = NOT_USED;
+    new_multi_touch_context.cur_pressed_window = SCLWINDOW_INVALID;
+    new_multi_touch_context.event_id = 0;
+    new_multi_touch_context.prev_pressed_key = NOT_USED;
+    new_multi_touch_context.prev_pressed_window = SCLWINDOW_INVALID;
+    new_multi_touch_context.cur_pressed_point.x = new_multi_touch_context.cur_pressed_point.y = 0;
+    new_multi_touch_context.cur_pressed_time.tv_sec = new_multi_touch_context.cur_pressed_time.tv_usec = 0;
+    new_multi_touch_context.cur_drag_state = SCL_DRAG_STATE_NONE;
+    new_multi_touch_context.is_sub_event = is_sub_event;
+    m_multi_touch_context[touch_id] = new_multi_touch_context;
 
     m_multi_touch_seq.insert(m_multi_touch_seq.end(), touch_id);
 
@@ -472,9 +474,9 @@ CSCLContext::create_multi_touch_context(scltouchdevice touch_id, sclboolean isSu
 void
 CSCLContext::destroy_multi_touch_context(scltouchdevice touch_id)
 {
-    MultiTouchContext *ctx = find_multi_touch_context(touch_id);
-    if (ctx) {
-        memset(ctx, 0x00, sizeof(MultiTouchContext));
+    MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+    if (multi_touch_context) {
+        memset(multi_touch_context, 0x00, sizeof(MultiTouchContext));
         m_multi_touch_context.erase(touch_id);
     }
 
@@ -489,13 +491,15 @@ CSCLContext::destroy_multi_touch_context(scltouchdevice touch_id)
         }
     } while (bFound);
 
+    /*
     CSCLUtils *utils = CSCLUtils::get_instance();
     if (utils) {
-        for(std::list<scltouchdevice>::iterator iter = m_multi_touch_seq.begin();iter != m_multi_touch_seq.end();std::advance(iter, 1)) {
+        for(iter = m_multi_touch_seq.begin();iter != m_multi_touch_seq.end();std::advance(iter, 1)) {
             utils->log("LIST : %d\n", *iter);
         }
         utils->log("\n");
     }
+    */
 }
 
 MultiTouchContext*
@@ -517,47 +521,48 @@ CSCLContext::get_multi_touch_context_num()
 }
 
 sclboolean
-CSCLContext::get_multi_touch_event(sclint seqorder, SclUIEventDesc *desc)
+CSCLContext::get_multi_touch_event(sclint order, SclUIEventDesc *desc)
 {
     sclboolean ret = FALSE;
-    sclint iSeqIndex = 0;
+    sclint index = 0;
 
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
 
     for(std::list<scltouchdevice>::iterator list_iter = m_multi_touch_seq.begin();
         !ret && list_iter != m_multi_touch_seq.end();std::advance(list_iter, 1)) {
-            if (iSeqIndex == seqorder) {
-                MultiTouchContext *pContext = find_multi_touch_context(*list_iter);
-                if (pContext) {
+            if (index == order) {
+                MultiTouchContext *multi_touch_context = find_multi_touch_context(*list_iter);
+                if (multi_touch_context) {
                     const SclLayoutKeyCoordinate *coordinate =
-                        cache->get_cur_layout_key_coordinate(pContext->cur_pressed_window, pContext->cur_pressed_key);
+                        cache->get_cur_layout_key_coordinate(multi_touch_context->cur_pressed_window,
+                            multi_touch_context->cur_pressed_key);
 
                     if (coordinate) {
-                        SCLShiftState shiftidx = get_shift_state();
-                        if (shiftidx < 0 || shiftidx >= SCL_SHIFT_STATE_MAX) shiftidx = SCL_SHIFT_STATE_OFF;
-                        desc->key_event = coordinate->key_event[shiftidx][0];
-                        desc->key_value = coordinate->key_value[shiftidx][0];
+                        SCLShiftState shift_index = get_shift_state();
+                        if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
+                        desc->key_event = coordinate->key_event[shift_index][0];
+                        desc->key_value = coordinate->key_value[shift_index][0];
                         desc->key_type = coordinate->key_type;
                     } else {
                         desc->key_event = 0;
                         desc->key_value = NULL;
                         desc->key_type = KEY_TYPE_NONE;
                     }
-                    desc->key_modifier = pContext->cur_key_modifier;
+                    desc->key_modifier = multi_touch_context->cur_key_modifier;
 
                     desc->touch_id = (*list_iter);
-                    desc->mouse_pressed_point = pContext->cur_pressed_point;
-                    desc->mouse_current_point = pContext->cur_move_point;
-                    desc->mouse_farthest_point = pContext->farthest_move_point;
+                    desc->mouse_pressed_point = multi_touch_context->cur_pressed_point;
+                    desc->mouse_current_point = multi_touch_context->cur_moving_point;
+                    desc->mouse_farthest_point = multi_touch_context->farthest_move_point;
 
-                    desc->touch_event_order = iSeqIndex;
+                    desc->touch_event_order = index;
 
                     desc->event_type = EVENT_TYPE_NONE;
 
                     ret = TRUE;
                 }
             }
-            iSeqIndex++;
+            index++;
     }
 
     return ret;
@@ -658,6 +663,16 @@ void CSCLContext::set_shift_state(SCLShiftState val)
     }
 }
 
+sclboolean CSCLContext::get_caps_lock_mode() const
+{
+    return m_caps_lock_mode;
+}
+
+void CSCLContext::set_caps_lock_mode(sclboolean val)
+{
+    m_caps_lock_mode = val;
+}
+
 SCLShiftMultitouchState CSCLContext::get_shift_multi_touch_state() const
 {
     SCLShiftMultitouchState ret = SCL_SHIFT_MULTITOUCH_OFF;
index 87a0316..0effd3d 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -31,6 +31,7 @@
 #include "sclimageproxy.h"
 #include "sclres_manager.h"
 #include "scleventhandler.h"
+#include "sclanimator.h"
 
 //#define DIRECTLY_DRAW_ON_EVENTS
 
@@ -200,7 +201,7 @@ CSCLController::process_input_mode_change(const sclbyte mode)
 
     if (context && windows && cache && utils) {
         if (mode == context->get_input_mode() || mode == (sclbyte)NOT_USED) {
-            /* BtnContext does not get initialized if we don't call here */
+            /* ButtonContext does not get initialized if we don't call here */
             cache->recompute_layout(windows->get_base_window());
             return FALSE;
         }
@@ -215,11 +216,11 @@ CSCLController::process_input_mode_change(const sclbyte mode)
         handle_engine_signal(SCL_SIG_INPMODE_CHANGE, window);
 
 #ifdef TEST_NEWBACKEND
-        SclWindowContext *winctx = windows->get_window_context(window, FALSE);
-        if (winctx) {
-            if (winctx->etc_info) {
+        SclWindowContext *window_context= windows->get_window_context(window, FALSE);
+        if (window_context) {
+            if (window_context->etc_info) {
 
-                Eina_List *list = (Eina_List*)(winctx->etc_info);
+                Eina_List *list = (Eina_List*)(window_context->etc_info);
                 Eina_List *iter = NULL;
                 Eina_List *iter_next = NULL;
                 void *data = NULL;
@@ -259,7 +260,7 @@ CSCLController::process_input_mode_change(const sclbyte mode)
                     }
                     iIndex++;
                 }
-                winctx->etc_info= list;
+                window_context->etc_info= list;
             }
         }
 #endif
@@ -318,18 +319,21 @@ CSCLController::check_magnifier_available(sclwindow window, sclbyte key_index, s
     CSCLContext *context = CSCLContext::get_instance();
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
     const SclLayout *layout = NULL;
-    SclButtonContext *btncontext = NULL;
+    SclButtonContext *button_context = NULL;
     const SclLayoutKeyCoordinate *coordinate = NULL;
 
     if (context && cache) {
         layout = cache->get_cur_layout(window);
-        btncontext = cache->get_cur_button_context(window, key_index);
+        button_context = cache->get_cur_button_context(window, key_index);
         coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
 
-        SCLShiftState shiftidx = context->get_shift_state();
-        if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+        SCLShiftState shift_index = context->get_shift_state();
+        if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
+        if (context->get_caps_lock_mode()) {
+            shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+        }
 
-        if (layout && coordinate && btncontext && context->get_magnifier_enabled() ) {
+        if (layout && coordinate && button_context && context->get_magnifier_enabled() ) {
             if (coordinate->key_type != KEY_TYPE_CONTROL &&
                 coordinate->key_type != KEY_TYPE_MODECHANGE &&
                 coordinate->key_type != KEY_TYPE_NONE) {
@@ -351,13 +355,13 @@ CSCLController::check_magnifier_available(sclwindow window, sclbyte key_index, s
                         }
                     }
                     if (!custom_label) {
-                        //if (coordinate->key_value[shiftidx][btncontext->multikeyIdx] == NULL) {
-                        if (coordinate->label[shiftidx][btncontext->multikeyIdx] == NULL) {
-                            //utils->log("show_magnifier coordinate->key_value[shift][btncontext->multikeyIdx] == NULL \n");
+                        //if (coordinate->key_value[shift_index][button_context->multikeyIdx] == NULL) {
+                        if (coordinate->label[shift_index][button_context->multikeyIdx] == NULL) {
+                            //utils->log("show_magnifier coordinate->key_value[shift][button_context->multikeyIdx] == NULL \n");
                             ret = FALSE;
-                            //} else if (strlen(coordinate->key_value[shiftidx][btncontext->multikeyIdx]) == 0) {
-                        } else if (strlen(coordinate->label[shiftidx][btncontext->multikeyIdx]) == 0) {
-                            //utils->log("show_magnifier coordinate->key_value[shift][btncontext->multikeyIdx]) == 0 \n");
+                            //} else if (strlen(coordinate->key_value[shift_index][button_context->multikeyIdx]) == 0) {
+                        } else if (strlen(coordinate->label[shift_index][button_context->multikeyIdx]) == 0) {
+                            //utils->log("show_magnifier coordinate->key_value[shift][button_context->multikeyIdx]) == 0 \n");
                             ret = FALSE;
                         }
                     }
@@ -394,18 +398,15 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
     assert(sclres_input_mode_configure != NULL);
     assert(sclres_layout != NULL);
 
-    SclButtonContext *btncontext = NULL;
+    SclButtonContext *button_context = NULL;
     const SclLayoutKeyCoordinate *coordinate = NULL;
 
     if (context && cache) {
-        btncontext = cache->get_cur_button_context(window, key_index);
+        button_context = cache->get_cur_button_context(window, key_index);
         coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
     }
 
-    static sclwindow prevwin = SCLWINDOW_INVALID;
-    static sclbyte prevkey = NOT_USED;
-
-    if (context && cache && windows && events && utils && feedback && handler && btncontext && coordinate) {
+    if (context && cache && windows && events && utils && feedback && handler && button_context && coordinate) {
         /* First check if this button is enabled in current active sublayout */
         sclboolean sub_layout_match = TRUE;
         if (coordinate->sub_layout && context->get_cur_sublayout()) {
@@ -438,8 +439,9 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
                     for(loop = 0;loop < multi_touch_context_num;loop++) {
                         SclUIEventDesc desc = multi_touch_events[loop];
                         if (desc.touch_id != touch_id) {
-                            mouse_release(context->get_cur_move_window(desc.touch_id),
-                                context->get_cur_move_point(desc.touch_id).x, context->get_cur_move_point(desc.touch_id).y,
+                            mouse_release(context->get_cur_moving_window(desc.touch_id),
+                                context->get_cur_moving_point(desc.touch_id).x,
+                                context->get_cur_moving_point(desc.touch_id).y,
                                 desc.touch_id, FALSE);
                         }
                     }
@@ -453,7 +455,7 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
             context->set_cur_pressed_key(touch_id, key_index);
             context->set_cur_pressed_window(touch_id, window);
 
-            btncontext->state = BUTTON_STATE_PRESSED;
+            button_context->state = BUTTON_STATE_PRESSED;
 
             redraw = TRUE;
             ret = TRUE;
@@ -466,7 +468,7 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
             /*CSCLGraphics *grps = CSCLGraphics::get_instance();
             CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
             scldrawctx draw_ctx = grps->begin_paint(window, TRUE);
-            builder->draw_button(window, draw_ctx, key_index, btncontext->state, TRUE);
+            builder->draw_button(window, draw_ctx, key_index, button_context->state, TRUE);
             grps->end_paint(window, draw_ctx);*/
 #endif
 
@@ -481,12 +483,15 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
                 events->create_timer(SCL_TIMER_LONGKEY, m_long_key_duration, uniqId);
             }
 
-            SCLShiftState shiftidx = context->get_shift_state();
-            if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+            SCLShiftState shift_index = context->get_shift_state();
+            if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
+            if (context->get_caps_lock_mode()) {
+                shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+            }
 
-            SclUIEventDesc key_event_desc = {0};
-            key_event_desc.key_value = coordinate->key_value[shiftidx][0];
-            key_event_desc.key_event = coordinate->key_event[shiftidx][0];
+            SclUIEventDesc key_event_desc;
+            key_event_desc.key_value = coordinate->key_value[shift_index][0];
+            key_event_desc.key_event = coordinate->key_event[shift_index][0];
             key_event_desc.key_type = coordinate->key_type;
             key_event_desc.key_modifier = KEY_MODIFIER_NONE;
             key_event_desc.event_type = EVENT_TYPE_PRESS;
@@ -527,54 +532,70 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
                     handler->on_event_key_clicked(key_event_desc);
                 }
                 break;
+                case BUTTON_TYPE_UIITEM: break;
+                case MAX_BUTTON_TYPE: break;
+                default: break;
                 }
-
                 switch (coordinate->popup_type) {
                 case POPUP_TYPE_BTN_PRESS_POPUP_DRAG: {
-                    sclint popup_input_mode = sclres_manager->get_inputmode_id(coordinate->popup_input_mode[SCL_DRAG_STATE_NONE]);
-                    SCLDisplayMode display_mode = context->get_display_mode();
-                    /* FIXME */
-                    //if (scl_check_arrindex(popup_input_mode, MAX_INPUT_MODE_POPUP) &&
-                    if (scl_check_arrindex(popup_input_mode, MAX_SCL_INPUT_MODE) &&
-                        scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
-                        sclshort popupLayoutId =
-                            sclres_manager->get_layout_id(sclres_input_mode_configure[popup_input_mode].layouts[display_mode]);
-                        SclRectangle popupRect;
-                        SclRectangle baseWndRect;
-                        SclLayout *layout = NULL;
+                    SclNotiPopupOpeningDesc desc;
+                    desc.ui_event_desc = &key_event_desc;
+                    desc.input_mode = coordinate->popup_input_mode[SCL_DRAG_STATE_NONE];
+                    if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENING, &desc)) {
+                        sclint popup_input_mode = sclres_manager->get_inputmode_id(desc.input_mode);
+                        SCLDisplayMode display_mode = context->get_display_mode();
                         /* FIXME */
-                        //if (scl_check_arrindex(popupLayoutId, MAX_LAYOUT)) {
-                        if (scl_check_arrindex(popupLayoutId, MAX_SCL_LAYOUT)) {
-                            layout = &sclres_layout[popupLayoutId];
-                        }
-                        if (layout) {
-                            windows->get_window_rect(windows->get_base_window(), &baseWndRect);
-                            popupRect.x = coordinate->x + coordinate->popup_relative_x + baseWndRect.x;
-                            popupRect.y = coordinate->y + coordinate->popup_relative_y + baseWndRect.y;
-                            //popupRect.width = utils->get_scale_x(layout->width);
-                            //popupRect.height= utils->get_scale_y(layout->height);
-                            popupRect.width = layout->width;
-                            popupRect.height= layout->height;
-                            windows->close_all_popups();
-                            SclWindowOpener opener;
-                            opener.window = window;
-                            opener.key = key_index;
-                            windows->open_popup(opener,
-                                                popupRect,
-                                                popup_input_mode,
-                                                popupLayoutId,
-                                                coordinate->popup_type,
-                                                sclres_input_mode_configure[popup_input_mode].use_virtual_window,
-                                                sclres_input_mode_configure[popup_input_mode].use_dim_window,
-                                                coordinate->extract_offset_x,
-                                                coordinate->extract_offset_y,
-                                                sclres_input_mode_configure[popup_input_mode].timeout
-                                               );
-                            windows->hide_window(windows->get_magnifier_window());
-                            /* FIXME : The parent key should be turned back to NORMAL state when RELEASED,
-                                in case of POPUP_TYPE_BTN_PRESS_POPUP_DRAG type. Temporariliy setting NORMAL here. */
-                            btncontext->state = BUTTON_STATE_NORMAL;
-                            _play_tts_for_input_mode_name(popup_input_mode);
+                        //if (scl_check_arrindex(popup_input_mode, MAX_INPUT_MODE_POPUP) &&
+                        if (scl_check_arrindex(popup_input_mode, MAX_SCL_INPUT_MODE) &&
+                            scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
+                            sclshort popupLayoutId =
+                                sclres_manager->get_layout_id(sclres_input_mode_configure[popup_input_mode].layouts[display_mode]);
+                            SclRectangle popupRect;
+                            SclRectangle baseWndRect;
+                            SclLayout *layout = NULL;
+                            /* FIXME */
+                            //if (scl_check_arrindex(popupLayoutId, MAX_LAYOUT)) {
+                            if (scl_check_arrindex(popupLayoutId, MAX_SCL_LAYOUT)) {
+                                layout = &sclres_layout[popupLayoutId];
+                            }
+                            if (layout) {
+                                windows->get_window_rect(windows->get_base_window(), &baseWndRect);
+                                popupRect.x = coordinate->x + coordinate->popup_relative_x + baseWndRect.x;
+                                popupRect.y = coordinate->y + coordinate->popup_relative_y + baseWndRect.y;
+                                //popupRect.width = utils->get_scale_x(layout->width);
+                                //popupRect.height= utils->get_scale_y(layout->height);
+                                popupRect.width = layout->width;
+                                popupRect.height= layout->height;
+                                windows->close_all_popups();
+
+                                SclWindowOpener opener;
+                                opener.window = window;
+                                opener.key = key_index;
+
+                                sclwindow popup_window = windows->open_popup(opener,
+                                    popupRect,
+                                    popup_input_mode,
+                                    popupLayoutId,
+                                    coordinate->popup_type,
+                                    sclres_input_mode_configure[popup_input_mode].use_virtual_window,
+                                    sclres_input_mode_configure[popup_input_mode].use_dim_window,
+                                    coordinate->extract_offset_x,
+                                    coordinate->extract_offset_y,
+                                    sclres_input_mode_configure[popup_input_mode].timeout
+                                    );
+
+                                SclNotiPopupOpenedDesc opened_desc;
+                                opened_desc.ui_event_desc = &key_event_desc;
+                                opened_desc.input_mode = desc.input_mode;
+                                opened_desc.window = popup_window;
+                                handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENED, &opened_desc);
+
+                                windows->hide_window(windows->get_magnifier_window());
+                                /* FIXME : The parent key should be turned back to NORMAL state when RELEASED,
+                                    in case of POPUP_TYPE_BTN_PRESS_POPUP_DRAG type. Temporariliy setting NORMAL here. */
+                                button_context->state = BUTTON_STATE_NORMAL;
+                                _play_tts_for_input_mode_name(popup_input_mode);
+                            }
                         }
                     }
                 }
@@ -585,6 +606,8 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
                 case POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE:
                 case POPUP_TYPE_AUTO_POPUP:
                 case POPUP_TYPE_NONE:
+                case MAX_POPUP_TYPE:
+                default:
                     /* Nothing to do in here */
                     break;
                 }
@@ -595,13 +618,12 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
             if (coordinate->use_magnifier) {
                 sclboolean showMagnifier = check_magnifier_available(window, key_index, touch_id);
 
-                SclResParserManager *sclres_manager = SclResParserManager::get_instance();
                 PSclMagnifierWndConfigure magnifier_configure = NULL;
                 if (sclres_manager) {
                     magnifier_configure = sclres_manager->get_magnifier_configure();
                 }
                 if (showMagnifier && magnifier_configure) {
-                    SclPoint pos = {0,};
+                    SclPoint pos = {0,0};
                     /* calculates x position to be set */
                     pos.x = (coordinate->x + (coordinate->width / 2)) -
                         (magnifier_configure->width * utils->get_custom_scale_rate_x() / 2);
@@ -613,10 +635,10 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
                     pos.y = coordinate->y - magnifier_configure->height * utils->get_custom_scale_rate_y();
 
                     /* FIXME : Temporary way of clearing magnifier window */
-                    /*SclWindowContext *winctx = windows->get_window_context(windows->get_magnifier_window(), FALSE);
+                    /*SclWindowContext *window_context = windows->get_window_context(windows->get_magnifier_window(), FALSE);
                     sclboolean clearmagwin = FALSE;
-                    if (winctx) {
-                        clearmagwin = !(winctx->hidden);
+                    if (window_context) {
+                        clearmagwin = !(window_context->hidden);
                     }
                     static int clearnum = 0;
                     if (key_index == prevkey && window == prevwin) {
@@ -642,10 +664,10 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
                     */
                     windows->hide_window(windows->get_magnifier_window());
 
-                    SclWindowContext *winctx = windows->get_window_context(window);
-                    if (winctx) {
-                        pos.x += winctx->geometry.x;
-                        pos.y += winctx->geometry.y;
+                    SclWindowContext *window_context = windows->get_window_context(window);
+                    if (window_context) {
+                        pos.x += window_context->geometry.x;
+                        pos.y += window_context->geometry.y;
                     }
 
                     if (pos.x < 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x()) {
@@ -683,20 +705,17 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
                     windows->hide_window(windows->get_magnifier_window());
                 }
             }
-
-            prevwin = window;
-            prevkey = key_index;
         } else {
             /* COMMENTED OUT FOR TESTING MULTITOUCH!! */
             ///* In case the current button is not the given key index */
-            //if (btncontext->state == BUTTON_STATE_PRESSED) {
+            //if (button_context->state == BUTTON_STATE_PRESSED) {
             //    /* Even if the press event occured outside of this button's physical area, reset its context */
-            //    btncontext->state = BUTTON_STATE_NORMAL;
+            //    button_context->state = BUTTON_STATE_NORMAL;
             //    redraw = TRUE;
             //}
             /* BUTTON_TYPE_MULTITAP type button should restore its multikey index when another button is clicked */
             if (coordinate->button_type & BUTTON_TYPE_MULTITAP) {
-                btncontext->multikeyIdx = 0;
+                button_context->multikeyIdx = 0;
             }
         }
 
@@ -705,10 +724,9 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
 #ifdef DIRECTLY_DRAW_ON_EVENTS
             CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
             if (builder) {
-                builder->draw_button(window, NULL, key_index, btncontext->state, TRUE);
+                builder->draw_button(window, NULL, key_index, button_context->state, TRUE);
             }
 #else
-            CSCLWindows *windows = CSCLWindows::get_instance();
             if (windows) {
                 windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
             }
@@ -765,9 +783,9 @@ CSCLController::process_button_long_pressed_event(sclwindow window, sclbyte key_
                                 cache->get_cur_layout_key_coordinate(cur_pressed_window, cur_pressed_key);
                             if (cur_pressed_coordinate) {
                                 if (cur_pressed_coordinate->multitouch_type == SCL_MULTI_TOUCH_TYPE_SETTLE_PREVIOUS) {
-                                    mouse_release(context->get_cur_move_window(desc.touch_id),
-                                        context->get_cur_move_point(desc.touch_id).x,
-                                        context->get_cur_move_point(desc.touch_id).y,
+                                    mouse_release(context->get_cur_moving_window(desc.touch_id),
+                                        context->get_cur_moving_point(desc.touch_id).x,
+                                        context->get_cur_moving_point(desc.touch_id).y,
                                         desc.touch_id, FALSE);
                                 }
                             }
@@ -784,14 +802,17 @@ CSCLController::process_button_long_pressed_event(sclwindow window, sclbyte key_
             if (coordinate->popup_type == POPUP_TYPE_BTN_LONGPRESS_POPUP ||
                 coordinate->popup_type == POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE ) {
 
-                    SclUIEventDesc key_event_desc = {0};
+                    SclUIEventDesc key_event_desc;
                     key_event_desc.key_type = coordinate->long_key_type;
                     if (coordinate->long_key_value == NULL && coordinate->long_key_event == 0) {
-                        SCLShiftState shiftidx = context->get_shift_state();
-                        if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+                        SCLShiftState shift_index = context->get_shift_state();
+                        if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
+                        if (context->get_caps_lock_mode()) {
+                            shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+                        }
 
-                        key_event_desc.key_value = coordinate->key_value[shiftidx][0];
-                        key_event_desc.key_event = coordinate->key_event[shiftidx][0];
+                        key_event_desc.key_value = coordinate->key_value[shift_index][0];
+                        key_event_desc.key_event = coordinate->key_event[shift_index][0];
                     } else {
                         key_event_desc.key_value = coordinate->long_key_value;
                         key_event_desc.key_event = coordinate->long_key_event;
@@ -801,7 +822,7 @@ CSCLController::process_button_long_pressed_event(sclwindow window, sclbyte key_
                     key_event_desc.event_type = EVENT_TYPE_LONGPRESS;
                     key_event_desc.touch_id = touch_id;
                     key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                    key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+                    key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
                     key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
 
                     key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
@@ -815,52 +836,63 @@ CSCLController::process_button_long_pressed_event(sclwindow window, sclbyte key_
                         windows->get_window_rect(windows->get_base_window(), &baseWndRect);
                         popupRect.x = coordinate->x + coordinate->popup_relative_x + baseWndRect.x;
                         popupRect.y = coordinate->y + coordinate->popup_relative_y + baseWndRect.y;
-                        sclint popup_input_mode = sclres_manager->get_inputmode_id(coordinate->popup_input_mode[SCL_DRAG_STATE_NONE]);
-                        SCLDisplayMode display_mode = context->get_display_mode();
-                        /* FIXME */
-                        //if (scl_check_arrindex(popup_input_mode, MAX_INPUT_MODE_POPUP) &&
-                        if (scl_check_arrindex(popup_input_mode, MAX_SCL_INPUT_MODE) &&
-                            scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
-                            SclLayout *layout = NULL;
-                            sclshort popupLayoutId =
-                                sclres_manager->get_layout_id(sclres_input_mode_configure[popup_input_mode].layouts[display_mode]);
-                            /* FIXME */
-                            //if (scl_check_arrindex(popupLayoutId, MAX_LAYOUT)) {
-                            if (scl_check_arrindex(popupLayoutId, MAX_SCL_LAYOUT)) {
-                                layout = &sclres_layout[popupLayoutId];
-                            }
-                            if (layout) {
-                                //popupRect.width = utils->get_scale_x(layout->width);
-                                //popupRect.height= utils->get_scale_y(layout->height);
-                                popupRect.width = layout->width;
-                                popupRect.height= layout->height;
 
-                                SclWindowOpener opener;
-                                opener.window = window;
-                                opener.key = key_index;
-                                windows->open_popup(
-                                    opener,
-                                    popupRect,
-                                    popup_input_mode,
-                                    popupLayoutId,
-                                    coordinate->popup_type,
-                                    sclres_input_mode_configure[popup_input_mode].use_virtual_window,
-                                    sclres_input_mode_configure[popup_input_mode].use_dim_window,
-                                    coordinate->extract_offset_x,
-                                    coordinate->extract_offset_y,
-                                    sclres_input_mode_configure[popup_input_mode].timeout
-                                    );
-                                windows->hide_window(windows->get_magnifier_window());
-                                _play_tts_for_input_mode_name(popup_input_mode);
-                                ret = TRUE;
+                        SclNotiPopupOpeningDesc desc;
+                        desc.ui_event_desc = &key_event_desc;
+                        desc.input_mode = coordinate->popup_input_mode[SCL_DRAG_STATE_NONE];
+                        if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENING, &desc)) {
+                            sclint popup_input_mode = sclres_manager->get_inputmode_id(desc.input_mode);
+                            SCLDisplayMode display_mode = context->get_display_mode();
+                            /* FIXME */
+                            //if (scl_check_arrindex(popup_input_mode, MAX_INPUT_MODE_POPUP) &&
+                            if (scl_check_arrindex(popup_input_mode, MAX_SCL_INPUT_MODE) &&
+                                scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
+                                SclLayout *layout = NULL;
+                                sclshort popupLayoutId =
+                                    sclres_manager->get_layout_id(sclres_input_mode_configure[popup_input_mode].layouts[display_mode]);
+                                /* FIXME */
+                                //if (scl_check_arrindex(popupLayoutId, MAX_LAYOUT)) {
+                                if (scl_check_arrindex(popupLayoutId, MAX_SCL_LAYOUT)) {
+                                    layout = &sclres_layout[popupLayoutId];
+                                }
+                                if (layout) {
+                                    //popupRect.width = utils->get_scale_x(layout->width);
+                                    //popupRect.height= utils->get_scale_y(layout->height);
+                                    popupRect.width = layout->width;
+                                    popupRect.height= layout->height;
+
+                                    SclWindowOpener opener;
+                                    opener.window = window;
+                                    opener.key = key_index;
+
+                                    sclwindow popup_window = windows->open_popup(
+                                        opener,
+                                        popupRect,
+                                        popup_input_mode,
+                                        popupLayoutId,
+                                        coordinate->popup_type,
+                                        sclres_input_mode_configure[popup_input_mode].use_virtual_window,
+                                        sclres_input_mode_configure[popup_input_mode].use_dim_window,
+                                        coordinate->extract_offset_x,
+                                        coordinate->extract_offset_y,
+                                        sclres_input_mode_configure[popup_input_mode].timeout
+                                        );
+
+                                    SclNotiPopupOpenedDesc opened_desc;
+                                    opened_desc.ui_event_desc = &key_event_desc;
+                                    opened_desc.input_mode = desc.input_mode;
+                                    opened_desc.window = popup_window;
+                                    handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENED, &opened_desc);
+
+                                    windows->hide_window(windows->get_magnifier_window());
+                                    _play_tts_for_input_mode_name(popup_input_mode);
+                                    ret = TRUE;
+                                }
                             }
                         }
                     }
             } else if (coordinate->long_key_value) {
                 if (strlen(coordinate->long_key_value) > 0) {
-                    SclPoint ptMoving = context->get_cur_move_point(touch_id);
-                    /*if (ptMoving.x >= coordinate->x && ptMoving.x <= coordinate->x + coordinate->width &&
-                        ptMoving.y >= coordinate->y && ptMoving.y <= coordinate->y + coordinate->height) {*/
                         if (windows->is_base_window(window)) {
                             state->set_cur_action_state(ACTION_STATE_BASE_LONGKEY);
                         } else {
@@ -868,34 +900,25 @@ CSCLController::process_button_long_pressed_event(sclwindow window, sclbyte key_
                         }
                         ret = TRUE;
 
-                        SclResParserManager *sclres_manager = SclResParserManager::get_instance();
                         PSclMagnifierWndConfigure magnifier_configure = NULL;
                         if (sclres_manager) {
                             magnifier_configure = sclres_manager->get_magnifier_configure();
                         }
                         if (coordinate->use_long_key_magnifier && magnifier_configure) {
                             CSCLUtils *utils = CSCLUtils::get_instance();
-                            SclPoint pos = {0,};
+                            SclPoint pos = {0,0};
 
                             const SclLayout* layout = cache->get_cur_layout(window);
                             if (layout) {
-                                sclfloat scale_rate_x, scale_rate_y;
-                                if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
-                                    scale_rate_x = utils->get_scale_rate_x();
-                                    scale_rate_y = utils->get_scale_rate_y();
-                                } else {
-                                    scale_rate_x = utils->get_scale_rate_y();
-                                    scale_rate_y = utils->get_scale_rate_x();
-                                }
                                 sclint scnWidth, scnHeight;
                                 utils->get_screen_resolution(&scnWidth, &scnHeight);
 
-                                //SclWindowContext *winctx = windows->get_window_context(window, TRUE);
-                                SclWindowContext *winctx = windows->get_window_context(window);
-                                if (winctx) {
-                                    pos.x = winctx->geometry.x + (coordinate->x + (coordinate->width / 2)) -
+                                //SclWindowContext *window_context = windows->get_window_context(window, TRUE);
+                                SclWindowContext *window_context = windows->get_window_context(window);
+                                if (window_context) {
+                                    pos.x = window_context->geometry.x + (coordinate->x + (coordinate->width / 2)) -
                                         (magnifier_configure->width * utils->get_custom_scale_rate_x() / 2);
-                                    pos.y = winctx->geometry.y + coordinate->y -
+                                    pos.y = window_context->geometry.y + coordinate->y -
                                         magnifier_configure->height * utils->get_custom_scale_rate_y();
                                 }
                                 if (pos.x < 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x()) {
@@ -917,7 +940,7 @@ CSCLController::process_button_long_pressed_event(sclwindow window, sclbyte key_
                             }
                         }
 
-                        SclUIEventDesc key_event_desc = {0};
+                        SclUIEventDesc key_event_desc;
                         key_event_desc.key_type = coordinate->long_key_type;
                         key_event_desc.key_value = coordinate->long_key_value;
                         key_event_desc.key_event = coordinate->long_key_event;
@@ -926,7 +949,7 @@ CSCLController::process_button_long_pressed_event(sclwindow window, sclbyte key_
                         key_event_desc.event_type = EVENT_TYPE_LONGPRESS;
                         key_event_desc.touch_id = touch_id;
                         key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                        key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+                        key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
                         key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
 
                         key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
@@ -957,8 +980,11 @@ CSCLController::process_button_repeat_pressed_event(sclwindow window, sclbyte ke
     if (context && cache && windows && handler) {
         const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
 
-        SCLShiftState shiftidx = context->get_shift_state();
-        if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+        SCLShiftState shift_index = context->get_shift_state();
+        if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
+        if (context->get_caps_lock_mode()) {
+            shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+        }
 
         if (coordinate) {
             switch (coordinate->button_type) {
@@ -971,7 +997,7 @@ CSCLController::process_button_repeat_pressed_event(sclwindow window, sclbyte ke
                     //if (coordinate->key_type != KEY_TYPE_MODECHANGE && coordinate->key_type != KEY_TYPE_COMPOSITION) {
                     //if (coordinate->key_type != KEY_TYPE_MODECHANGE || coordinate->key_event[0][0] == MVK_BackSpace) {
                     if (coordinate->key_type != KEY_TYPE_MODECHANGE) {
-                        sclulong repeatKeyEvent = coordinate->key_event[shiftidx][0];
+                        sclulong repeatKeyEvent = coordinate->key_event[shift_index][0];
 
                         /* In case of Delete key, Change from Char deletion to Word deletion
                            when the input accelation speed is reached to Max */
@@ -990,8 +1016,8 @@ CSCLController::process_button_repeat_pressed_event(sclwindow window, sclbyte ke
                             }
                         }
 
-                        SclUIEventDesc key_event_desc = {0};
-                        key_event_desc.key_value = coordinate->key_value[shiftidx][0];
+                        SclUIEventDesc key_event_desc;
+                        key_event_desc.key_value = coordinate->key_value[shift_index][0];
                         key_event_desc.key_event = repeatKeyEvent;
                         key_event_desc.key_type = coordinate->key_type;
                         key_event_desc.key_modifier = KEY_MODIFIER_NONE;
@@ -999,7 +1025,7 @@ CSCLController::process_button_repeat_pressed_event(sclwindow window, sclbyte ke
                         key_event_desc.event_type = EVENT_TYPE_REPEAT;
                         key_event_desc.touch_id = touch_id;
                         key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                        key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+                        key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
                         key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
 
                         key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
@@ -1008,6 +1034,9 @@ CSCLController::process_button_repeat_pressed_event(sclwindow window, sclbyte ke
                     }
                 }
                 break;
+                case BUTTON_TYPE_UIITEM: break;
+                case MAX_BUTTON_TYPE: break;
+                default: break;
             }
         }
     }
@@ -1032,16 +1061,16 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
     CSCLEventHandler *handler = CSCLEventHandler::get_instance();
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
 
-    SclButtonContext *btncontext = NULL;
+    SclButtonContext *button_context = NULL;
 
     const SclLayoutKeyCoordinate *coordinate = NULL;
 
     if (cache) {
         coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
-        btncontext = cache->get_cur_button_context(window, key_index);
+        button_context = cache->get_cur_button_context(window, key_index);
     }
 
-    if (btncontext && coordinate && feedback && utils && context && handler && cache && events && windows) {
+    if (button_context && coordinate && feedback && utils && context && handler && cache && events && windows) {
         /* If this key is the key previously pressed, add threshold value for avoiding unintended moving */
         sclint thresholdX = 0;
         sclint thresholdY = 0;
@@ -1064,8 +1093,11 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
                 subLayoutMatch ) {
             ret = TRUE;
 
-            SCLShiftState shiftidx = context->get_shift_state();
-            if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+            SCLShiftState shift_index = context->get_shift_state();
+            if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
+            if (context->get_caps_lock_mode()) {
+                shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+            }
 
             const SclLayout* layout = cache->get_cur_layout(windows->get_base_window());
 
@@ -1085,15 +1117,6 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
 
                 if (check_event_transition_enabled(pressed_coordinate, coordinate)) {
                     if (layout) {
-                        sclfloat scale_rate_x, scale_rate_y;
-                        if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
-                            scale_rate_x = utils->get_scale_rate_x();
-                            scale_rate_y = utils->get_scale_rate_y();
-                        } else {
-                            scale_rate_x = utils->get_scale_rate_y();
-                            scale_rate_y = utils->get_scale_rate_x();
-                        }
-
                         const scl16 uniqId = utils->get_unique_id();
                         context->set_cur_pressed_event_id(touch_id, uniqId);
                         /* Special routine for autopopup */
@@ -1115,7 +1138,7 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
                             magnifier_configure = sclres_manager->get_magnifier_configure();
                         }
                         if (showMagnifier && magnifier_configure) {
-                            SclPoint pos = {0,};
+                            SclPoint pos = {0,0};
                             /* calculates x position to be set */
                             pos.x = (coordinate->x + (coordinate->width / 2)) -
                                 (magnifier_configure->width * utils->get_custom_scale_rate_x() / 2);
@@ -1147,7 +1170,7 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
                         /* for feedback */
                         feedback->button_moved(window, key_index);
 
-                        btncontext->state = BUTTON_STATE_PRESSED;
+                        button_context->state = BUTTON_STATE_PRESSED;
                         if (pressed_context) {
                             /* But, if this button should be in pressed state in other multitouch id, do not initialize it */
                             sclboolean found = FALSE;
@@ -1155,10 +1178,11 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
                                 SclUIEventDesc desc;
                                 context->get_multi_touch_event(loop, &desc);
                                 if (desc.touch_id != touch_id) {
-                                    MultiTouchContext *mulctx = context->find_multi_touch_context(desc.touch_id);
-                                    if (mulctx) {
-                                        if (mulctx->cur_pressed_window == pressed_window &&
-                                            mulctx->cur_pressed_key == pressed_key) {
+                                    MultiTouchContext *multi_touch_context =
+                                        context->find_multi_touch_context(desc.touch_id);
+                                    if (multi_touch_context) {
+                                        if (multi_touch_context->cur_pressed_window == pressed_window &&
+                                            multi_touch_context->cur_pressed_key == pressed_key) {
                                             found = TRUE;
                                         }
                                     }
@@ -1189,37 +1213,26 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
 
                         switch (coordinate->button_type) {
                         case BUTTON_TYPE_DRAG: {
-                            SclUIEventDesc key_event_desc = {0};
-                            key_event_desc.key_value = coordinate->key_value[shiftidx][0];
-                            key_event_desc.key_event = coordinate->key_event[shiftidx][0];
+                            SclUIEventDesc key_event_desc;
+                            key_event_desc.key_value = coordinate->key_value[shift_index][0];
+                            key_event_desc.key_event = coordinate->key_event[shift_index][0];
                             key_event_desc.key_type = coordinate->key_type;
                             key_event_desc.key_modifier = KEY_MODIFIER_NONE;
 
                             key_event_desc.event_type = EVENT_TYPE_MOVE;
                             key_event_desc.touch_id = touch_id;
                             key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                            key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+                            key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
                             key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
 
                             key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
 
-                            SclResParserManager *sclres_manager = SclResParserManager::get_instance();
-                            PSclMagnifierWndConfigure magnifier_configure = NULL;
                             if (sclres_manager) {
                                 magnifier_configure = sclres_manager->get_magnifier_configure();
                             }
                             sclboolean processed = handler->on_event_drag_state_changed(key_event_desc);
                             if (processed && context->get_magnifier_enabled() && magnifier_configure) {
-                                SclPoint zoomwinpos = {0,};
-                                const SclLayout *layout = cache->get_cur_layout(windows->get_base_window());
-                                sclfloat scale_rate_x, scale_rate_y;
-                                if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
-                                    scale_rate_x = utils->get_scale_rate_x();
-                                    scale_rate_y = utils->get_scale_rate_y();
-                                } else {
-                                    scale_rate_x = utils->get_scale_rate_y();
-                                    scale_rate_y = utils->get_scale_rate_x();
-                                }
+                                SclPoint zoomwinpos = {0,0};
                                 /* calculates x position to be set */
                                 zoomwinpos.x = (coordinate->x + (coordinate->width / 2)) -
                                     (magnifier_configure->width * utils->get_custom_scale_rate_x() / 2);
@@ -1230,10 +1243,10 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
 
                                 zoomwinpos.y = coordinate->y -
                                     magnifier_configure->height * utils->get_custom_scale_rate_y();
-                                SclWindowContext *winctx = windows->get_window_context(window);
-                                if (winctx) {
-                                    zoomwinpos.x += winctx->geometry.x;
-                                    zoomwinpos.y += winctx->geometry.y;
+                                SclWindowContext *window_context = windows->get_window_context(window);
+                                if (window_context) {
+                                    zoomwinpos.x += window_context->geometry.x;
+                                    zoomwinpos.y += window_context->geometry.y;
                                 }
                                 if (zoomwinpos.x < 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x()) {
                                     zoomwinpos.x = 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x();
@@ -1255,24 +1268,35 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
                             handler->on_event_key_clicked(key_event_desc);
                             if (!(windows->is_base_window(window))) {
                                 /* When press event occured in popup window, reset POPUP_TIMEOUT timer */
-                                //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
-                                SclWindowContext *winctx = windows->get_window_context(window);
-                                if (winctx) {
-                                    if (winctx->timeout > 0) {
+                                //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+                                SclWindowContext *window_context = windows->get_window_context(window);
+                                if (window_context) {
+                                    if (window_context->timeout > 0) {
                                         events->destroy_timer(SCL_TIMER_POPUP_TIMEOUT);
-                                        events->create_timer(SCL_TIMER_POPUP_TIMEOUT, winctx->timeout, 0, TRUE);
+                                        events->create_timer(SCL_TIMER_POPUP_TIMEOUT, window_context->timeout, 0, TRUE);
                                     }
                                 }
                             }
                         }
                         break;
+                        case BUTTON_TYPE_NORMAL: break;
+                        case BUTTON_TYPE_GRAB: break;
+                        case BUTTON_TYPE_SELFISH: break;
+                        case BUTTON_TYPE_MULTITAP: break;
+                        case BUTTON_TYPE_ROTATION: break;
+                        case BUTTON_TYPE_DIRECTION: break;
+                        case BUTTON_TYPE_RELATIVE_DIRECTION: break;
+                        case BUTTON_TYPE_UIITEM: break;
+                        case MAX_BUTTON_TYPE: break;
+                        default:
+                            break;
                         }
 
 #ifdef DIRECTLY_DRAW_ON_EVENTS
                         CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
                         if (builder) {
-                            if (btncontext) {
-                                builder->draw_button(window, NULL, key_index, btncontext->state);
+                            if (button_context) {
+                                builder->draw_button(window, NULL, key_index, button_context->state);
                             }
                             if (pressedContext) {
                                 builder->draw_button(pressed_window, NULL, pressed_key, pressedContext->state, TRUE);
@@ -1281,8 +1305,6 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
 #else
                         windows->update_window(window,
                                 coordinate->x, coordinate->y, coordinate->width, coordinate->height);
-                        const SclLayoutKeyCoordinate *pressed_coordinate =
-                            cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
                         if (pressed_coordinate) {
                             windows->update_window(pressed_window, pressed_coordinate->x, pressed_coordinate->y,
                                     pressed_coordinate->width, pressed_coordinate->height);
@@ -1326,7 +1348,7 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
 }
 
 sclboolean
-CSCLController::process_button_over_event(sclwindow window, sclint x, sclint y, sclbyte keyindex)
+CSCLController::process_button_over_event(sclwindow window, sclint x, sclint y, sclbyte key_index)
 {
     SCL_DEBUG();
 
@@ -1339,15 +1361,15 @@ CSCLController::process_button_over_event(sclwindow window, sclint x, sclint y,
     CSCLFeedback *feedback = CSCLFeedback::get_instance();
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
 
-    SclButtonContext *btncontext = NULL;
+    SclButtonContext *button_context = NULL;
 
     const SclLayoutKeyCoordinate *coordinate = NULL;
     if(cache) {
-        coordinate = cache->get_cur_layout_key_coordinate(window, keyindex);
-        btncontext = cache->get_cur_button_context(window, keyindex);
+        coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
+        button_context = cache->get_cur_button_context(window, key_index);
     }
 
-    if(btncontext && coordinate && feedback && utils && context && cache && events && windows) {
+    if(button_context && coordinate && feedback && utils && context && cache && events && windows) {
        /* If this key is the key previously pressed, add threshold value for avoiding unintended moving */
         sclboolean subLayoutMatch = TRUE;
         if (coordinate->sub_layout && context->get_cur_sublayout()) {
@@ -1362,39 +1384,32 @@ CSCLController::process_button_over_event(sclwindow window, sclint x, sclint y,
                 subLayoutMatch ) {
             ret = TRUE;
 
-            SCLShiftState shiftidx = context->get_shift_state();
-            if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+            SCLShiftState shift_index = context->get_shift_state();
+            if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
+            if (context->get_caps_lock_mode()) {
+                shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+            }
 
             const SclLayout* layout = cache->get_cur_layout(windows->get_base_window());
 
             sclwindow highlighted_window = context->get_cur_highlighted_window();
             scl8 highlighted_key = context->get_cur_highlighted_key();
-            SclButtonContext *cur_context = cache->get_cur_button_context(window, keyindex);
+            SclButtonContext *cur_context = cache->get_cur_button_context(window, key_index);
 
             if(cur_context == NULL) {
                 return FALSE;
             }
-            if (keyindex != highlighted_key || window != highlighted_window ) {
-                printf("%d != %d || %p != %p\n", keyindex, highlighted_key, window, highlighted_window);
+            if (key_index != highlighted_key || window != highlighted_window ) {
+                printf("%d != %d || %p != %p\n", key_index, highlighted_key, window, highlighted_window);
                 if(layout) {
-                    SclPoint pos = {0,};
-                    sclfloat scale_rate_x, scale_rate_y;
-                    if(layout->display_mode == DISPLAYMODE_PORTRAIT) {
-                        scale_rate_x = utils->get_scale_rate_x();
-                        scale_rate_y = utils->get_scale_rate_y();
-                    } else {
-                        scale_rate_x = utils->get_scale_rate_y();
-                        scale_rate_y = utils->get_scale_rate_x();
-                    }
-
                     if (coordinate->key_type != KEY_TYPE_NONE) {
                         if (context->get_tts_enabled()) {
-                            const sclchar *targetstr = coordinate->hint_string[shiftidx][btncontext->multikeyIdx];
+                            const sclchar *targetstr = coordinate->hint_string[shift_index][button_context->multikeyIdx];
                             if (targetstr == NULL) {
-                                targetstr = coordinate->label[shiftidx][0];
+                                targetstr = coordinate->label[shift_index][0];
                             }
                             if (targetstr == NULL) {
-                                targetstr = coordinate->key_value[shiftidx][btncontext->multikeyIdx];
+                                targetstr = coordinate->key_value[shift_index][button_context->multikeyIdx];
                             }
                             /*if(state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY ||
                                 state->get_cur_action_state() == ACTION_STATE_POPUP_LONGKEY ) {
@@ -1407,7 +1422,7 @@ CSCLController::process_button_over_event(sclwindow window, sclint x, sclint y,
                 }
 
                 context->set_cur_highlighted_window(window);
-                context->set_cur_highlighted_key(keyindex);
+                context->set_cur_highlighted_key(key_index);
             }
         }
     }
@@ -1446,7 +1461,7 @@ CSCLController::get_drag_key_modifier(sclint deltax, sclint deltay, sclfloat dis
                     { 5 * (M_PI / 8),  7 * (M_PI / 8), KEY_MODIFIER_DIRECTION_DOWN_LEFT},
                     { 7 * (M_PI / 8),  8 * (M_PI / 8), KEY_MODIFIER_DIRECTION_LEFT},
                 };
-                for (sclint loop = 0;loop < sizeof(info) / sizeof(DIRECTIONINFO);loop++) {
+                for (size_t loop = 0; loop < sizeof(info) / sizeof(DIRECTIONINFO); loop++) {
                     if (theta >= info[loop].lowerbound && theta <= info[loop].upperbound) {
                         key_modifier = info[loop].modifier;
                     }
@@ -1483,7 +1498,7 @@ CSCLController::get_drag_key_modifier(sclint deltax, sclint deltay, sclfloat dis
                     { 1 * (M_PI / 4),  3 * (M_PI / 4), KEY_MODIFIER_DIRECTION_DOWN},
                     { 3 * (M_PI / 4),  4 * (M_PI / 4), KEY_MODIFIER_DIRECTION_LEFT},
                 };
-                for (sclint loop = 0;loop < sizeof(info) / sizeof(DIRECTIONINFO);loop++) {
+                for (size_t loop = 0; loop < sizeof(info) / sizeof(DIRECTIONINFO); loop++) {
                     if (theta >= info[loop].lowerbound && theta <= info[loop].upperbound) {
                         key_modifier = info[loop].modifier;
                     }
@@ -1536,17 +1551,17 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
     PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
     assert(sclres_layout != NULL);
     assert(sclres_input_mode_configure != NULL);
-    SclButtonContext *btncontext = NULL;
+    SclButtonContext *button_context = NULL;
     const SclLayoutKeyCoordinate *coordinate = NULL;
 
     if (cache) {
-        btncontext = cache->get_cur_button_context(window, key_index);
+        button_context = cache->get_cur_button_context(window, key_index);
         coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
     }
 
     const SclLayoutKeyCoordinate *targetCoordinate = NULL;
 
-    if (utils && feedback && windows && context && state && handler && cache && btncontext && coordinate) {
+    if (utils && feedback && windows && context && state && handler && cache && button_context && coordinate) {
         scl8 savedInputMode = context->get_input_mode();
 
         sclwindow pressed_window = context->get_cur_pressed_window(touch_id);
@@ -1574,8 +1589,9 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
                              cache->get_cur_layout_key_coordinate(cur_pressed_window, cur_pressed_key);
                          if (cur_pressed_coordinate) {
                              if (cur_pressed_coordinate->multitouch_type == SCL_MULTI_TOUCH_TYPE_SETTLE_PREVIOUS) {
-                                 mouse_release(context->get_cur_move_window(desc.touch_id),
-                                     context->get_cur_move_point(desc.touch_id).x, context->get_cur_move_point(desc.touch_id).y,
+                                 mouse_release(context->get_cur_moving_window(desc.touch_id),
+                                     context->get_cur_moving_point(desc.touch_id).x,
+                                     context->get_cur_moving_point(desc.touch_id).y,
                                      desc.touch_id, FALSE);
                              }
                          }
@@ -1608,8 +1624,8 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
 
                     /* If the buttontype is RELATIVE_DIRECTION, get the distance from last move point */
                     if (coordinate->button_type == BUTTON_TYPE_RELATIVE_DIRECTION) {
-                        startx = context->get_prev_move_point(touch_id).x;
-                        starty = context->get_prev_move_point(touch_id).y;
+                        startx = context->get_prev_moving_point(touch_id).x;
+                        starty = context->get_prev_moving_point(touch_id).y;
                     } else {
                         startx = context->get_cur_pressed_point(touch_id).x;
                         starty = context->get_cur_pressed_point(touch_id).y;
@@ -1707,16 +1723,19 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
             /* An event occured? */
             if (fireEvt) {
                 if (targetCoordinate) {
-                    SCLShiftState shiftidx = context->get_shift_state();
-                    if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+                    SCLShiftState shift_index = context->get_shift_state();
+                    if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
+                    if (context->get_caps_lock_mode()) {
+                        shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+                    }
 
-                    SclUIEventDesc key_event_desc = {0};
+                    SclUIEventDesc key_event_desc;
                     key_event_desc.key_type = targetCoordinate->key_type;
 
                     key_event_desc.event_type = EVENT_TYPE_RELEASE;
                     key_event_desc.touch_id = touch_id;
                     key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                    key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+                    key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
                     key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
 
                     key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
@@ -1730,8 +1749,8 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
                         SclButtonContext *pressed_context = cache->get_cur_button_context(pressed_window, pressed_key);
                         if (pressed_context) {
                             if (!(targetCoordinate->use_repeat_key) && pressed_context->state == BUTTON_STATE_PRESSED) {
-                                key_event_desc.key_value = targetCoordinate->key_value[shiftidx][0];
-                                key_event_desc.key_event = targetCoordinate->key_event[shiftidx][0];
+                                key_event_desc.key_value = targetCoordinate->key_value[shift_index][0];
+                                key_event_desc.key_event = targetCoordinate->key_event[shift_index][0];
                                 key_event_desc.key_modifier = key_modifier;
                                 handler->on_event_key_clicked(key_event_desc);
                             }
@@ -1749,21 +1768,21 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
                         } else {
                             key_modifier = KEY_MODIFIER_NONE;
                         }
-                        if (btncontext->multikeyIdx < MAX_SIZE_OF_MULTITAP_CHAR) {
-                            key_event_desc.key_value = coordinate->key_value[shiftidx][btncontext->multikeyIdx];
-                            key_event_desc.key_event = coordinate->key_event[shiftidx][btncontext->multikeyIdx];
+                        if (button_context->multikeyIdx < MAX_SIZE_OF_MULTITAP_CHAR) {
+                            key_event_desc.key_value = coordinate->key_value[shift_index][button_context->multikeyIdx];
+                            key_event_desc.key_event = coordinate->key_event[shift_index][button_context->multikeyIdx];
                             key_event_desc.key_modifier = key_modifier;
                             handler->on_event_key_clicked(key_event_desc);
                         }
                         /* Check if the multikey index is in valid range, and increase by one */
-                        if (btncontext->multikeyIdx >= MAX_SIZE_OF_MULTITAP_CHAR - 1) {
-                            btncontext->multikeyIdx = 0;
+                        if (button_context->multikeyIdx >= MAX_SIZE_OF_MULTITAP_CHAR - 1) {
+                            button_context->multikeyIdx = 0;
                         } else {
-                            sclbyte orgindex = btncontext->multikeyIdx;
-                            btncontext->multikeyIdx = 0;
-                            if (targetCoordinate->key_value[shiftidx][orgindex + 1]) {
-                                if (strlen(targetCoordinate->key_value[shiftidx][orgindex + 1]) > 0) {
-                                    btncontext->multikeyIdx = orgindex + 1;
+                            sclbyte orgindex = button_context->multikeyIdx;
+                            button_context->multikeyIdx = 0;
+                            if (targetCoordinate->key_value[shift_index][orgindex + 1]) {
+                                if (strlen(targetCoordinate->key_value[shift_index][orgindex + 1]) > 0) {
+                                    button_context->multikeyIdx = orgindex + 1;
                                 }
                             }
                         }
@@ -1772,79 +1791,114 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
                     case BUTTON_TYPE_DRAG : {
                     }
                     break;
+                    case BUTTON_TYPE_TOGGLE : {
+                        SclButtonContext *pressed_context = cache->get_cur_button_context(pressed_window, pressed_key);
+                        if (pressed_context) {
+                            if (!(targetCoordinate->use_repeat_key) && pressed_context->state == BUTTON_STATE_PRESSED) {
+                                key_event_desc.key_value = targetCoordinate->key_value[shift_index][0];
+                                key_event_desc.key_event = targetCoordinate->key_event[shift_index][0];
+                                if (pressed_context->toggled) {
+                                    key_event_desc.key_modifier = KEY_MODIFIER_NONE;
+                                } else {
+                                    key_event_desc.key_modifier = KEY_MODIFIER_TOGGLED;
+                                }
+                                if (SCL_EVENT_PASS_ON == handler->on_event_key_clicked(key_event_desc)) {
+                                    pressed_context->toggled = !(pressed_context->toggled);
+                                }
+                            }
+                        }
                     }
+                    case BUTTON_TYPE_UIITEM: break;
+                    case MAX_BUTTON_TYPE: break;
+                    default: break;
 
+                    }
                     switch (coordinate->popup_type) {
                     case POPUP_TYPE_BTN_RELEASE_POPUP:
                     case POPUP_TYPE_BTN_RELEASE_POPUP_ONCE: {
                         SCLDragState dragstate = context->get_cur_drag_state(touch_id);
                         sclint popup_input_mode = NOT_USED;
+
+                        SclNotiPopupOpeningDesc desc;
+                        desc.ui_event_desc = &key_event_desc;
+
                         if (scl_check_arrindex(dragstate, SCL_DRAG_STATE_MAX)) {
+                            desc.input_mode = coordinate->popup_input_mode[dragstate];
                             popup_input_mode = sclres_manager->get_inputmode_id(coordinate->popup_input_mode[dragstate]);
                             /* FIXME */
                             //if (!scl_check_arrindex(popup_input_mode, MAX_INPUT_MODE_POPUP)) {
                             if (!scl_check_arrindex(popup_input_mode, MAX_SCL_INPUT_MODE)) {
-                                popup_input_mode =
-                                    sclres_manager->get_inputmode_id(coordinate->popup_input_mode[SCL_DRAG_STATE_NONE]);
+                                desc.input_mode = coordinate->popup_input_mode[SCL_DRAG_STATE_NONE];
                             }
                         }
-                        SCLDisplayMode display_mode = context->get_display_mode();
-                        /* FIXME */
-                        //if (scl_check_arrindex(popup_input_mode, MAX_INPUT_MODE_POPUP) &&
-                        if (scl_check_arrindex(popup_input_mode, MAX_SCL_INPUT_MODE) &&
-                            scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
-                            sclshort popupLayoutId =
-                                sclres_manager->get_layout_id(sclres_input_mode_configure[popup_input_mode].layouts[display_mode]);
-                            if (popupLayoutId == NOT_USED){
-                                // deal with NOT_USED
-                                printf("popupLayoutID is not used.\n");
-                            }
-                            SclLayout *layout = NULL;
+                        if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENING, &desc)) {
+                            popup_input_mode = sclres_manager->get_inputmode_id(desc.input_mode);
+                            SCLDisplayMode display_mode = context->get_display_mode();
                             /* FIXME */
-                            //if (scl_check_arrindex(popupLayoutId, MAX_LAYOUT)) {
-                            if (scl_check_arrindex(popupLayoutId, MAX_SCL_LAYOUT)) {
-                                layout = &sclres_layout[popupLayoutId];
-                            }
-                            if (layout) {
-                                SclRectangle popupRect;
-                                SclRectangle baseWndRect;
-                                windows->get_window_rect(windows->get_base_window(), &baseWndRect);
-                                popupRect.x = coordinate->x + coordinate->popup_relative_x + baseWndRect.x;
-                                popupRect.y = coordinate->y + coordinate->popup_relative_y + baseWndRect.y;
-
-                                //popupRect.width = utils->get_scale_x(layout->width);
-                                //popupRect.height= utils->get_scale_y(layout->height);
-                                popupRect.width = layout->width;
-                                popupRect.height= layout->height;
-
-                                /* Let's make sure this popup window does not go beyond the screen area */
-                                sclint scr_w, scr_h;
-                                utils->get_screen_resolution(&scr_w, &scr_h);
-
-                                if (popupRect.x + popupRect.width > scr_w) {
-                                    popupRect.x = scr_w - popupRect.width;
+                            //if (scl_check_arrindex(popup_input_mode, MAX_INPUT_MODE_POPUP) &&
+                            if (scl_check_arrindex(popup_input_mode, MAX_SCL_INPUT_MODE) &&
+                                scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
+                                sclshort popupLayoutId =
+                                    sclres_manager->get_layout_id(sclres_input_mode_configure[popup_input_mode].layouts[display_mode]);
+                                if (popupLayoutId == NOT_USED){
+                                    // deal with NOT_USED
+                                    printf("popupLayoutID is not used.\n");
                                 }
-                                if (popupRect.y + popupRect.height > scr_h) {
-                                    popupRect.y = scr_h - popupRect.height;
+                                SclLayout *layout = NULL;
+                                /* FIXME */
+                                //if (scl_check_arrindex(popupLayoutId, MAX_LAYOUT)) {
+                                if (scl_check_arrindex(popupLayoutId, MAX_SCL_LAYOUT)) {
+                                    layout = &sclres_layout[popupLayoutId];
                                 }
+                                if (layout) {
+                                    SclRectangle popupRect;
+                                    SclRectangle baseWndRect;
+                                    windows->get_window_rect(windows->get_base_window(), &baseWndRect);
+                                    popupRect.x = coordinate->x + coordinate->popup_relative_x + baseWndRect.x;
+                                    popupRect.y = coordinate->y + coordinate->popup_relative_y + baseWndRect.y;
+
+                                    //popupRect.width = utils->get_scale_x(layout->width);
+                                    //popupRect.height= utils->get_scale_y(layout->height);
+                                    popupRect.width = layout->width;
+                                    popupRect.height= layout->height;
+
+                                    /* Let's make sure this popup window does not go beyond the screen area */
+                                    sclint scr_w, scr_h;
+                                    utils->get_screen_resolution(&scr_w, &scr_h);
+
+                                    if (popupRect.x + popupRect.width > scr_w) {
+                                        popupRect.x = scr_w - popupRect.width;
+                                    }
+                                    if (popupRect.y + popupRect.height > scr_h) {
+                                        popupRect.y = scr_h - popupRect.height;
+                                    }
 
-                                SclWindowOpener opener;
-                                opener.window = window;
-                                opener.key = key_index;
-                                windows->open_popup(
-                                    opener,
-                                    popupRect,
-                                    popup_input_mode,
-                                    popupLayoutId,
-                                    coordinate->popup_type,
-                                    sclres_input_mode_configure[popup_input_mode].use_virtual_window,
-                                    sclres_input_mode_configure[popup_input_mode].use_dim_window,
-                                    coordinate->extract_offset_x,
-                                    coordinate->extract_offset_y,
-                                    sclres_input_mode_configure[popup_input_mode].timeout
-                                );
-                                windows->hide_window(windows->get_magnifier_window());
-                                _play_tts_for_input_mode_name(popup_input_mode);
+                                    SclWindowOpener opener;
+                                    opener.window = window;
+                                    opener.key = key_index;
+
+                                    sclwindow popup_window = windows->open_popup(
+                                        opener,
+                                        popupRect,
+                                        popup_input_mode,
+                                        popupLayoutId,
+                                        coordinate->popup_type,
+                                        sclres_input_mode_configure[popup_input_mode].use_virtual_window,
+                                        sclres_input_mode_configure[popup_input_mode].use_dim_window,
+                                        coordinate->extract_offset_x,
+                                        coordinate->extract_offset_y,
+                                        sclres_input_mode_configure[popup_input_mode].timeout
+                                        );
+
+                                    SclNotiPopupOpenedDesc opened_desc;
+                                    opened_desc.ui_event_desc = &key_event_desc;
+                                    opened_desc.input_mode = desc.input_mode;
+                                    opened_desc.window = popup_window;
+                                    handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENED, &opened_desc);
+
+                                    windows->hide_window(windows->get_magnifier_window());
+                                    _play_tts_for_input_mode_name(popup_input_mode);
+                                }
                             }
                         }
                     }
@@ -1854,6 +1908,10 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
                     case POPUP_TYPE_NONE:
                         /* Nothing to do in here */
                         break;
+                    case POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE: break;
+                    case POPUP_TYPE_BTN_LONGPRESS_POPUP: break;
+                    case MAX_POPUP_TYPE: break;
+                    default: break;
                     }
                 }
 
@@ -1862,20 +1920,23 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
             }
         } else {
             if (targetCoordinate) {
-                SCLShiftState shiftidx = context->get_shift_state();
-                if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+                SCLShiftState shift_index = context->get_shift_state();
+                if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
+                if (context->get_caps_lock_mode()) {
+                    shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+                }
 
-                SclUIEventDesc key_event_desc = {0};
+                SclUIEventDesc key_event_desc;
                 key_event_desc.key_type = targetCoordinate->key_type;
 
-                key_event_desc.key_value = targetCoordinate->key_value[shiftidx][btncontext->multikeyIdx];
-                key_event_desc.key_event = targetCoordinate->key_event[shiftidx][btncontext->multikeyIdx];
+                key_event_desc.key_value = targetCoordinate->key_value[shift_index][button_context->multikeyIdx];
+                key_event_desc.key_event = targetCoordinate->key_event[shift_index][button_context->multikeyIdx];
                 key_event_desc.key_modifier = key_modifier;
 
                 key_event_desc.event_type = EVENT_TYPE_RELEASE;
                 key_event_desc.touch_id = touch_id;
                 key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+                key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
                 key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
 
                 key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
@@ -1885,23 +1946,24 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
         }
 
         /* If this button was pressed, initialize the button context regardless of event  */
-        if (btncontext->state == BUTTON_STATE_PRESSED) {
+        if (button_context->state == BUTTON_STATE_PRESSED) {
             /* But, if this button should be in pressed state in other multitouch id, do not initialize */
             sclboolean found = FALSE;
             for(sclint loop = 0;loop < context->get_multi_touch_context_num() && !found;loop++) {
                 SclUIEventDesc desc;
                 context->get_multi_touch_event(loop, &desc);
                 if (desc.touch_id != touch_id) {
-                    MultiTouchContext *mulctx = context->find_multi_touch_context(desc.touch_id);
-                    if (mulctx) {
-                        if (mulctx->cur_pressed_window == window && mulctx->cur_pressed_key == key_index) {
+                    MultiTouchContext *multi_touch_context = context->find_multi_touch_context(desc.touch_id);
+                    if (multi_touch_context) {
+                        if (multi_touch_context->cur_pressed_window == window &&
+                            multi_touch_context->cur_pressed_key == key_index) {
                             found = TRUE;
                         }
                     }
                 }
             }
             if (!found) {
-                btncontext->state = BUTTON_STATE_NORMAL;
+                button_context->state = BUTTON_STATE_NORMAL;
                 redraw = TRUE;
             }
         }
@@ -1911,14 +1973,11 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
 #ifdef DIRECTLY_DRAW_ON_EVENTS
             CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
             if (builder) {
-                builder->draw_button(window, NULL, key_index, btncontext->state, TRUE);
+                builder->draw_button(window, NULL, key_index, button_context->state, TRUE);
             }
 #else
             if (savedInputMode == context->get_input_mode()) {
-                CSCLWindows *windows = CSCLWindows::get_instance();
-                if (windows) {
-                    windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
-                }
+                windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
             }
 
 #endif
@@ -1947,28 +2006,28 @@ CSCLController::mouse_press(sclwindow window, sclint x, sclint y, scltouchdevice
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
 
-    sclint btnIndex = NOT_USED;
-    SclWindowContext *winctx = NULL;
+    sclint button_index = NOT_USED;
+    SclWindowContext *window_context = NULL;
     if (windows) {
         const SclLayout *layout = cache->get_cur_layout(window);
         if (layout) {
             x += layout->mouse_manipulate_x;
             y += layout->mouse_manipulate_y;
         }
-        winctx = windows->get_window_context(window);
+        window_context = windows->get_window_context(window);
         /* If the dim window is virtual and currently active, let's just skip this event */
         if (windows->is_base_window(window)) {
-            SclWindowContext *dimctx = windows->get_window_context(windows->get_dim_window());
-            if (dimctx) {
-                if (dimctx->is_virtual && !(dimctx->hidden)) {
+            SclWindowContext *dim_window_context = windows->get_window_context(windows->get_dim_window());
+            if (dim_window_context) {
+                if (dim_window_context->is_virtual && !(dim_window_context->hidden)) {
                     window = windows->get_dim_window();
-                    winctx = dimctx;
+                    window_context = dim_window_context;
                 }
             }
         }
     }
 
-    if (cache && state && windows && context && winctx) {
+    if (cache && state && windows && context && window_context) {
         SCLDisplayMode display_mode = context->get_display_mode();
         SclResParserManager *sclres_manager = SclResParserManager::get_instance();
         PSclDefaultConfigure default_configure = NULL;
@@ -1997,8 +2056,8 @@ CSCLController::mouse_press(sclwindow window, sclint x, sclint y, scltouchdevice
         context->set_cur_pressed_window(touch_id, window);
         context->set_cur_pressed_point(touch_id, x, y);
         context->set_cur_pressed_time(touch_id);
-        context->set_cur_move_window(touch_id, window);
-        context->set_cur_move_point(touch_id, x, y);
+        context->set_cur_moving_window(touch_id, window);
+        context->set_cur_moving_point(touch_id, x, y);
         context->set_last_touch_device_id(touch_id);
         context->set_cur_drag_state(touch_id, SCL_DRAG_STATE_NONE);
         context->set_cur_key_modifier(touch_id, KEY_MODIFIER_NONE);
@@ -2019,7 +2078,7 @@ CSCLController::mouse_press(sclwindow window, sclint x, sclint y, scltouchdevice
         context->set_prev_pressed_window(touch_id, SCLWINDOW_INVALID);
         context->set_prev_pressed_key(touch_id, NOT_USED);
         context->set_prev_drag_state(touch_id, SCL_DRAG_STATE_NONE);
-        context->set_prev_move_point(touch_id, x, y);
+        context->set_prev_moving_point(touch_id, x, y);
 
         /* Destroy key related timers */
         events->destroy_timer(SCL_TIMER_BUTTON_DELAY);
@@ -2032,68 +2091,97 @@ CSCLController::mouse_press(sclwindow window, sclint x, sclint y, scltouchdevice
         handle_engine_signal(SCL_SIG_MOUSE_PRESS, window);
 
         /* Adjust event x and y positions as relative position to the virtual window */
-        if (winctx) {
-            /*if (winctx->isVirtual) {
-                SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
-                if (basectx) {
-                    x -= (winctx->x - basectx->x);
-                    y -= (winctx->y - basectx->y);
+        if (window_context) {
+            /*if (window_context->isVirtual) {
+                SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+                if (base_window_context) {
+                    x -= (window_context->x - base_window_context->x);
+                    y -= (window_context->y - base_window_context->y);
                 }
             }*/
         }
 
         if (!isSubEvent) {
-            /* Iterate all the buttons and inform the event */
-            sclboolean ended = FALSE;
-            for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
-                SclButtonContext *btncontext = cache->get_cur_button_context(window, loop);
-                const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
-                if (btncontext && coordinate) {
-                    if (!(btncontext->used)) {
-                        ended = TRUE;
-                    } else if (btncontext->state != BUTTON_STATE_DISABLED &&
-                                coordinate->button_type != BUTTON_TYPE_UIITEM) {
-                        if (process_button_pressed_event(window, x, y, loop, touch_id, actual_event)) {
-                            if (windows->is_base_window(window)) {
-                                state->set_cur_action_state(ACTION_STATE_BASE_PRESS);
-                            } else {
-                                state->set_cur_action_state(ACTION_STATE_POPUP_PRESS);
-                            }
-                            btnIndex = loop;
-                            ret = TRUE;
-                        }
-                    }
-                }
-            }
-
-            /* For covering a missing area about 1 pixel */
-            if (!ret) {
-                for (int loop = 0;loop < MAX_KEY;loop++) {
-                    SclButtonContext *btncontext = cache->get_cur_button_context(window, loop);
-                    const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, loop);
-                    if (btncontext && coordinate) {
-                        if (!(btncontext->used)) {
-                            break;
-                        } else if (btncontext->state != BUTTON_STATE_DISABLED &&
+            sclboolean process_finished = FALSE;
+            do {
+                /* Iterate all the buttons and inform the event */
+                sclboolean ended = FALSE;
+                for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
+                    SclButtonContext *button_context = cache->get_cur_button_context(window, loop);
+                    const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
+                    if (button_context && coordinate) {
+                        if (!(button_context->used)) {
+                            ended = TRUE;
+                        } else if (button_context->state != BUTTON_STATE_DISABLED &&
                                     coordinate->button_type != BUTTON_TYPE_UIITEM) {
-                            if (process_button_pressed_event(window, x+1, y+1, loop, touch_id, actual_event)) {
+                            if (process_button_pressed_event(window, x, y, loop, touch_id, actual_event)) {
                                 if (windows->is_base_window(window)) {
                                     state->set_cur_action_state(ACTION_STATE_BASE_PRESS);
                                 } else {
                                     state->set_cur_action_state(ACTION_STATE_POPUP_PRESS);
                                 }
-                                btnIndex = loop;
+                                button_index = loop;
+                                ret = TRUE;
+                            }
+                        }
+                    }
+                }
+
+                /* For covering a missing area about 1 pixel */
+                if (!ret) {
+                    for (int loop = 0;loop < MAX_KEY;loop++) {
+                        SclButtonContext *button_context = cache->get_cur_button_context(window, loop);
+                        const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, loop);
+                        if (button_context && coordinate) {
+                            if (!(button_context->used)) {
                                 break;
+                            } else if (button_context->state != BUTTON_STATE_DISABLED &&
+                                        coordinate->button_type != BUTTON_TYPE_UIITEM) {
+                                if (process_button_pressed_event(window, x+1, y+1, loop, touch_id, actual_event)) {
+                                    if (windows->is_base_window(window)) {
+                                        state->set_cur_action_state(ACTION_STATE_BASE_PRESS);
+                                    } else {
+                                        state->set_cur_action_state(ACTION_STATE_POPUP_PRESS);
+                                    }
+                                    button_index = loop;
+                                    break;
+                                }
                             }
+                        } else {
+                            break;
                         }
                     }
                 }
-            }
+
+                if (windows->is_base_window(window)) {
+                    process_finished = TRUE;
+                } else if (button_index != NOT_USED) {
+                    process_finished = TRUE;
+                } else {
+                    const SclLayout *layout = cache->get_cur_layout(window);
+                    if (layout) {
+                        if (layout->use_sw_background && layout->bg_color.a == 0) {
+                            /* If we could not find appropriate button in this popup window and the popup is transparent */
+                            SclWindowContext *base_window_context =
+                                windows->get_window_context(windows->get_base_window());
+                            if (base_window_context) {
+                                x = (window_context->geometry.x + x - base_window_context->geometry.x);
+                                y = (window_context->geometry.y + y - base_window_context->geometry.y);
+                            }
+                            window = windows->get_base_window();
+                        } else {
+                            process_finished = TRUE;
+                        }
+                    } else {
+                        process_finished = TRUE;
+                    }
+                }
+            } while (!process_finished);
         }
 
-        sclwindow skipwindow = window;
-        if (ret && btnIndex != NOT_USED) {
-            const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, btnIndex);
+        sclwindow skip_window = window;
+        if (ret && button_index != NOT_USED) {
+            const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, button_index);
             if (coordinate) {
                 sclboolean dont_close_popup = FALSE;
                 if (coordinate->dont_close_popup) {
@@ -2103,34 +2191,34 @@ CSCLController::mouse_press(sclwindow window, sclint x, sclint y, scltouchdevice
                 if (coordinate->popup_type == POPUP_TYPE_BTN_PRESS_POPUP_DRAG) {
                     /* Check the opened popup was opened by this button */
                     sclwindow popupwin = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
-                    SclWindowContext *popupctx = windows->get_window_context(popupwin);
-                    if (popupctx) {
-                        SclWindowOpener opener = popupctx->opener;
-                        if (opener.window == window && opener.key == btnIndex) {
+                    SclWindowContext *popup_window_context = windows->get_window_context(popupwin);
+                    if (popup_window_context) {
+                        SclWindowOpener opener = popup_window_context->opener;
+                        if (opener.window == window && opener.key == button_index) {
                             dont_close_popup = TRUE;
                         }
                     }
                 }
                 if (dont_close_popup) {
-                    skipwindow = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+                    skip_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
                 }
             }
         }
-        windows->close_all_popups(skipwindow);
+        windows->close_all_popups(skip_window);
 
         /* When press event occured in popup window, reset POPUP_TIMEOUT timer */
         if (!(windows->is_base_window(window))) {
-            if (winctx->timeout > 0) {
+            if (window_context->timeout > 0) {
                 events->destroy_timer(SCL_TIMER_POPUP_TIMEOUT);
-                events->create_timer(SCL_TIMER_POPUP_TIMEOUT, winctx->timeout, 0, TRUE);
+                events->create_timer(SCL_TIMER_POPUP_TIMEOUT, window_context->timeout, 0, TRUE);
             }
-        } else if (skipwindow != window) { /* Or the pressed button has dont_close_popup property, reset POPUP_TIMEOUT timer */
-            //SclWindowContext *skipwinctx = windows->get_window_context(skipwindow, FALSE);
-            SclWindowContext *skipwinctx = windows->get_window_context(skipwindow);
-            if (skipwinctx) {
-                if (skipwinctx->timeout > 0) {
+        } else if (skip_window != window) { /* Or the pressed button has dont_close_popup property, reset POPUP_TIMEOUT timer */
+            //SclWindowContext *skip_window_context = windows->get_window_context(skip_window, FALSE);
+            SclWindowContext *skip_window_context = windows->get_window_context(skip_window);
+            if (skip_window_context) {
+                if (skip_window_context->timeout > 0) {
                     events->destroy_timer(SCL_TIMER_POPUP_TIMEOUT);
-                    events->create_timer(SCL_TIMER_POPUP_TIMEOUT, skipwinctx->timeout, 0, TRUE);
+                    events->create_timer(SCL_TIMER_POPUP_TIMEOUT, skip_window_context->timeout, 0, TRUE);
                 }
             }
         }
@@ -2157,19 +2245,21 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
     CSCLEventHandler *handler = CSCLEventHandler::get_instance();
+    CSCLEvents *events = CSCLEvents::get_instance();
 
-    sclint btnIndex = NOT_USED;
+    sclint button_index = NOT_USED;
 
-    if (cache && state && windows && context && utils && handler && context->find_multi_touch_context(touch_id)) {
+    if (cache && state && windows && context && utils && handler && events &&
+        context->find_multi_touch_context(touch_id)) {
         const SclLayout *layout = cache->get_cur_layout(window);
         if (layout) {
             x += layout->mouse_manipulate_x;
             y += layout->mouse_manipulate_y;
         }
 
-        sclwindow skipwindow = SCLWINDOW_INVALID;
+        sclwindow skip_window = SCLWINDOW_INVALID;
         SCLDisplayMode display_mode = context->get_display_mode();
-        
+
         SclResParserManager *sclres_manager = SclResParserManager::get_instance();
         PSclDefaultConfigure default_configure = NULL;
         if (sclres_manager) {
@@ -2179,28 +2269,28 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
             adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &x, &y);
         }
 
-        context->set_cur_move_window(touch_id, SCLWINDOW_INVALID);
+        context->set_cur_moving_window(touch_id, SCLWINDOW_INVALID);
 
         sclwindow pressed_window = context->get_cur_pressed_window(touch_id);
         scl8 pressed_key = context->get_cur_pressed_key(touch_id);
-        //SclWindowContext *winctx = windows->get_window_context(window, TRUE);
-        SclWindowContext *winctx = windows->get_window_context(window);
+        //SclWindowContext *window_context = windows->get_window_context(window, TRUE);
+        SclWindowContext *window_context = windows->get_window_context(window);
         /* Adjust event x and y positions as relative position to the virtual window */
-        if (winctx) {
-            /*if (winctx->isVirtual) {
-                SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
-                if (basectx) {
-                    x -= (winctx->x - basectx->x);
-                    y -= (winctx->y - basectx->y);
+        if (window_context) {
+            /*if (window_context->isVirtual) {
+                SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+                if (base_window_context) {
+                    x -= (window_context->x - base_window_context->x);
+                    y -= (window_context->y - base_window_context->y);
                 }
             }*/
             /* If the dim window is virtual and currently active, consider base window's event is occured in dim window */
             if (windows->is_base_window(window)) {
-                SclWindowContext *dimctx = windows->get_window_context(windows->get_dim_window());
-                if (dimctx) {
-                    if (dimctx->is_virtual && !(dimctx->hidden)) {
+                SclWindowContext *dim_window_context = windows->get_window_context(windows->get_dim_window());
+                if (dim_window_context) {
+                    if (dim_window_context->is_virtual && !(dim_window_context->hidden)) {
                         window = windows->get_dim_window();
-                        winctx = dimctx;
+                        window_context = dim_window_context;
                     }
                 }
             }
@@ -2208,7 +2298,6 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
 
         /* Iterate all the buttons and inform the event */
         sclboolean ended = FALSE;
-        CSCLUtils *utils = CSCLUtils::get_instance();
 
         /* FIXME : The routine below seems to be removed, which was originally requested by Vodafone,
          * to slow down the speed of repeat key right before stopping repeatkey event */
@@ -2230,20 +2319,33 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
                 float etime;
                 etime = ((t1.tv_sec * 1000000 + t1.tv_usec) - (t0.tv_sec * 1000000 + t0.tv_usec))/1000.0;
                 if (etime < SCL_FLICK_GESTURE_RECOG_TIME) {
-                    sclint direction = DRAG_NONE;
+                    SCLDragType drag_type = DRAG_NONE;
                     if (x > context->get_cur_pressed_point(touch_id).x + utils->get_scaled_x(SCL_FLICK_GESTURE_RECOG_THRESHOLD)) {
-                        direction = DRAG_RIGHT;
+                        drag_type = DRAG_RIGHT;
                     }
                     if (x < context->get_cur_pressed_point(touch_id).x - utils->get_scaled_x(SCL_FLICK_GESTURE_RECOG_THRESHOLD)) {
-                        direction = DRAG_LEFT;
+                        drag_type = DRAG_LEFT;
                     }
                     if (y > context->get_cur_pressed_point(touch_id).y + utils->get_scaled_y(SCL_FLICK_GESTURE_RECOG_THRESHOLD)) {
-                        direction = DRAG_DOWN;
+                        drag_type = DRAG_DOWN;
                     }
                     if (y < context->get_cur_pressed_point(touch_id).y - utils->get_scaled_y(SCL_FLICK_GESTURE_RECOG_THRESHOLD)) {
-                        direction = DRAG_UP;
-                    }
-                    if (handler->on_event_notification(SCL_UINOTITYPE_GESTURE_FLICK, direction)) {
+                        drag_type = DRAG_UP;
+                    }
+                    SclNotiGestureFlickDesc desc;
+                    SclUIEventDesc ui_event_desc;
+                    ui_event_desc.key_value = NULL;
+                    ui_event_desc.key_event = NOT_USED;
+                    ui_event_desc.key_modifier = KEY_MODIFIER_NONE;
+                    ui_event_desc.event_type = EVENT_TYPE_RELEASE;
+                    ui_event_desc.touch_id = touch_id;
+                    ui_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
+                    ui_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
+                    ui_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
+                    ui_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
+                    desc.ui_event_desc = &ui_event_desc;
+                    desc.drag_type = drag_type;
+                    if (handler->on_event_notification(SCL_UINOTITYPE_GESTURE_FLICK, &desc)) {
                         ended = TRUE;
                     }
                 }
@@ -2252,35 +2354,39 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
 
         /* FIXME : We should consider this kind of action in general manner, not only specific to autopopup */
         /* And also, this kind of implementation only selects button that was highlighted at least once. */
-        /* iPhone supports highlighting autopopup buttons with its direction, even if the pointer never goes up on the button */
         // {
-        //SclWindowContext *pressedCtx = windows->get_window_context(pressed_window, FALSE);
-        SclWindowContext *pressedCtx = windows->get_window_context(pressed_window);
-        if (pressedCtx) {
-            utils->log("PRESSED CTX : %p %d %d\n", pressed_window, pressedCtx->geometry.x, pressedCtx->geometry.y);
+        //SclWindowContext *pressed_window_context = windows->get_window_context(pressed_window, FALSE);
+        SclWindowContext *pressed_window_context = windows->get_window_context(pressed_window);
+        if (pressed_window_context) {
+            utils->log("PRESSED CTX : %p %d %d\n", pressed_window,
+                pressed_window_context->geometry.x, pressed_window_context->geometry.y);
             //if (pressedCtx->popuptype == POPUP_TYPE_AUTO_POPUP) {
             sclboolean grab_event = FALSE;
-            const SclLayout *layout = cache->get_cur_layout(pressed_window);
-            if (layout) {
-                if (layout->style == LAYOUT_STYLE_POPUP_GRAB) {
+            const SclLayout *pressed_layout = cache->get_cur_layout(pressed_window);
+            if (pressed_layout) {
+                if (pressed_layout->style == LAYOUT_STYLE_POPUP_GRAB) {
                     grab_event = TRUE;
                 }
                 /* If the topmost window has the POPUP_GRAB style, find the nearest button to the mouse pointer */
                 if (grab_event) {
                     /* If the layout's addGrab* values are defined, process this event only if the event occured inside grab area */
                     sclboolean in_grab_area = TRUE;
-                    if (layout->add_grab_left != NOT_USED && x < (pressedCtx->geometry.x - layout->add_grab_left)) {
+                    if (pressed_layout->add_grab_left != NOT_USED &&
+                        x < (pressed_window_context->geometry.x - pressed_layout->add_grab_left)) {
                         in_grab_area = FALSE;
                     }
-                    if (layout->add_grab_right != NOT_USED &&
-                        x > (pressedCtx->geometry.x + pressedCtx->geometry.width + layout->add_grab_right)) {
+                    if (pressed_layout->add_grab_right != NOT_USED &&
+                        x > (pressed_window_context->geometry.x + pressed_window_context->geometry.width
+                        + pressed_layout->add_grab_right)) {
                         in_grab_area = FALSE;
                     }
-                    if (layout->add_grab_top != NOT_USED && y < (pressedCtx->geometry.y - layout->add_grab_top)) {
+                    if (pressed_layout->add_grab_top != NOT_USED &&
+                        y < (pressed_window_context->geometry.y - pressed_layout->add_grab_top)) {
                         in_grab_area = FALSE;
                     }
-                    if (layout->add_grab_bottom != NOT_USED &&
-                        y > (pressedCtx->geometry.y + pressedCtx->geometry.height + layout->add_grab_bottom)) {
+                    if (pressed_layout->add_grab_bottom != NOT_USED &&
+                        y > (pressed_window_context->geometry.y + pressed_window_context->geometry.height
+                        + pressed_layout->add_grab_bottom)) {
                         in_grab_area = FALSE;
                     }
                     if (in_grab_area) {
@@ -2290,12 +2396,12 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
                             y = coord->y + (coord->height / 2);
 
                             for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
-                                SclButtonContext *btncontext = cache->get_cur_button_context(pressed_window, loop);
+                                SclButtonContext *button_context = cache->get_cur_button_context(pressed_window, loop);
                                 const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
-                                if (btncontext && coordinate) {
-                                    if (!(btncontext->used)) {
+                                if (button_context && coordinate) {
+                                    if (!(button_context->used)) {
                                         ended = TRUE;
-                                    } else if (btncontext->state != BUTTON_STATE_DISABLED &&
+                                    } else if (button_context->state != BUTTON_STATE_DISABLED &&
                                                 coordinate->button_type != BUTTON_TYPE_UIITEM) {
                                         if (process_button_release_event(pressed_window, x, y, loop, touch_id, actual_event)) {
                                             ret = TRUE;
@@ -2311,7 +2417,7 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
         }
         // }
 
-        SclButtonContext *btncontext = cache->get_cur_button_context(pressed_window, pressed_key);
+        SclButtonContext *button_context = cache->get_cur_button_context(pressed_window, pressed_key);
         const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
 
         /* FIXME : The rule below would not be a general requirement. A policy is needed regarding this. */
@@ -2325,102 +2431,124 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
             if (windows->is_base_window(window)) {
                 ended = TRUE;
                 /* In case of direction button, the release event on other window should be processed */
-                if (coordinate && winctx && pressedCtx) {
+                if (coordinate && window_context && pressed_window_context) {
                     if (coordinate->button_type == BUTTON_TYPE_DIRECTION || coordinate->button_type == BUTTON_TYPE_RELATIVE_DIRECTION) {
-                        sclint relx = (winctx->geometry.x + x) - pressedCtx->geometry.x;
-                        sclint rely = (winctx->geometry.y + y) - pressedCtx->geometry.y;
+                        sclint relx = (window_context->geometry.x + x) - pressed_window_context->geometry.x;
+                        sclint rely = (window_context->geometry.y + y) - pressed_window_context->geometry.y;
                         if (process_button_release_event(pressed_window, relx, rely, pressed_key, touch_id, actual_event)) {
-                            btnIndex = pressed_key;
+                            button_index = pressed_key;
                             ret = TRUE;
                             x = coordinate->x + (coordinate->width / 2);
                             y = coordinate->y + (coordinate->height / 2);
-                            skipwindow = pressed_window;
+                            skip_window = pressed_window;
                         }
                     }
                 }
             }
         }
 
-        MultiTouchContext *mulctx = context->find_multi_touch_context(touch_id);
-        if (mulctx) {
-            if (!(mulctx->is_sub_event)) {
-                /* First check if the event occured in pressed key's threshold area */
-                if (btncontext && coordinate && !ended) {
-                    if (btncontext->used && btncontext->state != BUTTON_STATE_DISABLED) {
-                        if (process_button_release_event(pressed_window, x, y, pressed_key, touch_id, actual_event)) {
-                            btnIndex = pressed_key;
-                            ret = TRUE;
-                            x = coordinate->x + (coordinate->width / 2);
-                            y = coordinate->y + (coordinate->height / 2);
+        sclboolean process_finished = FALSE;
+        do {
+            MultiTouchContext *multi_touch_context = context->find_multi_touch_context(touch_id);
+            if (multi_touch_context) {
+                if (!(multi_touch_context->is_sub_event)) {
+                    /* First check if the event occured in pressed key's threshold area */
+                    if (button_context && coordinate && !ended) {
+                        if (button_context->used && button_context->state != BUTTON_STATE_DISABLED) {
+                            if (process_button_release_event(pressed_window, x, y, pressed_key, touch_id, actual_event)) {
+                                button_index = pressed_key;
+                                ret = TRUE;
+                                x = coordinate->x + (coordinate->width / 2);
+                                y = coordinate->y + (coordinate->height / 2);
+                            }
                         }
                     }
-                }
-                for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
-                    SclButtonContext *btncontext = cache->get_cur_button_context(window, loop);
-                    const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
-                    if (btncontext && coordinate) {
-                        if (!(btncontext->used)) {
-                            ended = TRUE;
-                        } else if (btncontext->state != BUTTON_STATE_DISABLED &&
-                                    coordinate->button_type != BUTTON_TYPE_UIITEM) {
-                            if (window != pressed_window || loop != pressed_key) {
-                                if (process_button_release_event(window, x, y, loop, touch_id, actual_event)) {
-                                    btnIndex = loop;
-                                    ret = TRUE;
+                    for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
+                        SclButtonContext *cur_context = cache->get_cur_button_context(window, loop);
+                        const SclLayoutKeyCoordinate *cur_coordinate = cache->get_cur_layout_key_coordinate(window, loop);
+                        if (cur_context && cur_coordinate) {
+                            if (!(cur_context->used)) {
+                                ended = TRUE;
+                            } else if (cur_context->state != BUTTON_STATE_DISABLED &&
+                                        cur_coordinate->button_type != BUTTON_TYPE_UIITEM) {
+                                if (window != pressed_window || loop != pressed_key) {
+                                    if (process_button_release_event(window, x, y, loop, touch_id, actual_event)) {
+                                        button_index = loop;
+                                        ret = TRUE;
+                                    }
                                 }
                             }
                         }
                     }
-                }
-            } else {
-                SclUIEventDesc key_event_desc = {0};
-                key_event_desc.key_value = NULL;
-                key_event_desc.key_event = NOT_USED;
-                key_event_desc.key_modifier = KEY_MODIFIER_NONE;
-                key_event_desc.event_type = EVENT_TYPE_NONE;
-                key_event_desc.touch_id = touch_id;
-                key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
-                key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
-
-                key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
+                } else {
+                    process_finished = TRUE;
 
-                handler->on_event_key_clicked(key_event_desc);
-            }
-        }
+                    SclUIEventDesc key_event_desc;
+                    key_event_desc.key_value = NULL;
+                    key_event_desc.key_event = NOT_USED;
+                    key_event_desc.key_modifier = KEY_MODIFIER_NONE;
+                    key_event_desc.event_type = EVENT_TYPE_NONE;
+                    key_event_desc.touch_id = touch_id;
+                    key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
+                    key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
+                    key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
 
-        /* For covering a missing area about 1 pixel */
-        if (!ret) {
-            ended = FALSE;
+                    key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
 
-            if (state->get_cur_action_state() == ACTION_STATE_POPUP_INIT ||
-                    state->get_cur_action_state() == ACTION_STATE_POPUP_PRESS ||
-                    state->get_cur_action_state() == ACTION_STATE_POPUP_MOVING ||
-                    state->get_cur_action_state() == ACTION_STATE_POPUP_RELEASE ||
-                    state->get_cur_action_state() == ACTION_STATE_POPUP_REPEATKEY ||
-                    state->get_cur_action_state() == ACTION_STATE_POPUP_LONGKEY) {
-                if (windows->is_base_window(window)) {
-                    ended = TRUE;
+                    handler->on_event_key_clicked(key_event_desc);
                 }
             }
 
-            for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
-                SclButtonContext *btncontext = cache->get_cur_button_context(window, loop);
-                if (btncontext && coordinate) {
-                    if (!(btncontext->used)) {
+            /* For covering a missing area about 1 pixel */
+            if (!ret) {
+                ended = FALSE;
+
+                if (state->get_cur_action_state() == ACTION_STATE_POPUP_INIT ||
+                        state->get_cur_action_state() == ACTION_STATE_POPUP_PRESS ||
+                        state->get_cur_action_state() == ACTION_STATE_POPUP_MOVING ||
+                        state->get_cur_action_state() == ACTION_STATE_POPUP_RELEASE ||
+                        state->get_cur_action_state() == ACTION_STATE_POPUP_REPEATKEY ||
+                        state->get_cur_action_state() == ACTION_STATE_POPUP_LONGKEY) {
+                    if (windows->is_base_window(window)) {
                         ended = TRUE;
-                        break;
-                    } else if (btncontext->state != BUTTON_STATE_DISABLED &&
-                                coordinate->button_type != BUTTON_TYPE_UIITEM) {
-                        if (process_button_release_event(window, x+1, y+1, loop, touch_id)) {
-                            btnIndex = loop;
-                            ret = TRUE;
+                    }
+                }
+
+                for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
+                    SclButtonContext *cur_context = cache->get_cur_button_context(window, loop);
+                    if (cur_context && coordinate) {
+                        if (!(cur_context->used)) {
+                            ended = TRUE;
                             break;
+                        } else if (cur_context->state != BUTTON_STATE_DISABLED &&
+                                    coordinate->button_type != BUTTON_TYPE_UIITEM) {
+                            if (process_button_release_event(window, x+1, y+1, loop, touch_id)) {
+                                button_index = loop;
+                                ret = TRUE;
+                                break;
+                            }
                         }
                     }
                 }
             }
-        }
+            if (windows->is_base_window(window)) {
+                process_finished = TRUE;
+            } else if (button_index != NOT_USED) {
+                process_finished = TRUE;
+            } else {
+                if (layout && layout->use_sw_background && layout->bg_color.a == 0) {
+                    /* If we could not find appropriate button in this popup window and the popup is transparent */
+                    SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+                    if (base_window_context) {
+                        x = (window_context->geometry.x + x - base_window_context->geometry.x);
+                        y = (window_context->geometry.y + y - base_window_context->geometry.y);
+                    }
+                    window = windows->get_base_window();
+                } else {
+                    process_finished = TRUE;
+                }
+            }
+        } while (!process_finished);
 
         if (windows->is_base_window(window)) {
             state->set_cur_action_state(ACTION_STATE_BASE_INIT);
@@ -2429,14 +2557,13 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
         }
 
         /* Restore previously pressed button's context and redraw it */
-        if (btncontext && coordinate) {
-            btncontext->state = BUTTON_STATE_NORMAL;
+        if (button_context && coordinate) {
+            button_context->state = BUTTON_STATE_NORMAL;
             /* Commented below line to postpone some of the feedback for releasing */
             //windows->update_window(pressed_window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
         }
 
         /* If there is postponed update of button, update it now */
-        CSCLEvents *events = CSCLEvents::get_instance();
         sclwindow last_win = context->get_last_pressed_window();
         scl8 last_key = context->get_last_pressed_key();
         if (last_win != SCLWINDOW_INVALID && last_key != NOT_USED) {
@@ -2454,25 +2581,32 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
         sclboolean signaled = FALSE;
         if (coordinate) {
             switch (coordinate->popup_type) {
-            case POPUP_TYPE_BTN_RELEASE_POPUP:
-            case POPUP_TYPE_BTN_RELEASE_POPUP_ONCE:
-            case POPUP_TYPE_BTN_LONGPRESS_POPUP:
-            case POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE:
-                /* Fix me : We should consider z-order */
-                skipwindow = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
-                handle_engine_signal(SCL_SIG_MOUSE_RELEASE, skipwindow);
-                signaled = TRUE;
-                break;
+                case POPUP_TYPE_BTN_RELEASE_POPUP:
+                case POPUP_TYPE_BTN_RELEASE_POPUP_ONCE:
+                case POPUP_TYPE_BTN_LONGPRESS_POPUP:
+                case POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE:
+                    {
+                        /* Fix me : We should consider z-order */
+                        skip_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+                        handle_engine_signal(SCL_SIG_MOUSE_RELEASE, skip_window);
+                        signaled = TRUE;
+                    }
+                    break;
+                case POPUP_TYPE_NONE: break;
+                case POPUP_TYPE_BTN_PRESS_POPUP_DRAG: break;
+                case POPUP_TYPE_AUTO_POPUP: break;
+                case MAX_POPUP_TYPE: break;
+                default: break;
             }
         }
         if (!signaled) {
-            //SclWindowContext *ctx = windows->get_window_context(window, FALSE);
-            SclWindowContext *ctx = windows->get_window_context(window);
-            if (ctx) {
-                if (ctx->popup_type == POPUP_TYPE_BTN_RELEASE_POPUP ||
-                    ctx->popup_type == POPUP_TYPE_BTN_LONGPRESS_POPUP) {
+            //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+            window_context = windows->get_window_context(window);
+            if (window_context) {
+                if (window_context->popup_type == POPUP_TYPE_BTN_RELEASE_POPUP ||
+                    window_context->popup_type == POPUP_TYPE_BTN_LONGPRESS_POPUP) {
                     /* Don't close window if the clicked button is a child of ReleasePopup window */
-                    skipwindow = window;
+                    skip_window = window;
                     handle_engine_signal(SCL_SIG_MOUSE_RELEASE, window);
                     signaled = TRUE;
                 }
@@ -2485,27 +2619,27 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
         context->set_cur_pressed_key(touch_id, NOT_USED);
         context->set_cur_pressed_window(touch_id, SCLWINDOW_INVALID);
 
-        if (ret && btnIndex != NOT_USED) {
-            const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, btnIndex);
-            if (coordinate) {
-                if (coordinate->dont_close_popup) {
-                    skipwindow = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+        if (ret && button_index != NOT_USED) {
+            const SclLayoutKeyCoordinate *cur_coordinate = cache->get_cur_layout_key_coordinate(window, button_index);
+            if (cur_coordinate) {
+                if (cur_coordinate->dont_close_popup) {
+                    skip_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
                 }
             }
         } else {
             if (pressed_window == windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP)) {
-                if (pressedCtx) {
-                    if (pressedCtx->popup_type != POPUP_TYPE_BTN_RELEASE_POPUP_ONCE &&
-                        pressedCtx->popup_type != POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE &&
-                        pressedCtx->popup_type != POPUP_TYPE_AUTO_POPUP &&
-                        pressedCtx->popup_type != POPUP_TYPE_BTN_PRESS_POPUP_DRAG)
+                if (pressed_window_context) {
+                    if (pressed_window_context->popup_type != POPUP_TYPE_BTN_RELEASE_POPUP_ONCE &&
+                        pressed_window_context->popup_type != POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE &&
+                        pressed_window_context->popup_type != POPUP_TYPE_AUTO_POPUP &&
+                        pressed_window_context->popup_type != POPUP_TYPE_BTN_PRESS_POPUP_DRAG)
                     {
-                        skipwindow = pressed_window;
+                        skip_window = pressed_window;
                     }
                 }
             }
         }
-        windows->close_all_popups(skipwindow);
+        windows->close_all_popups(skip_window);
 
         /* Destroy key related timers */
         events->destroy_timer(SCL_TIMER_AUTOPOPUP);
@@ -2518,14 +2652,14 @@ CSCLController::mouse_release(sclwindow window, sclint x, sclint y, scltouchdevi
             /* To postpone some of the feedback for releasing */
             events->create_timer(SCL_TIMER_BUTTON_DELAY, m_button_delay_duration, 0);
         } else {
-            sclwindow last_win = context->get_last_pressed_window();
-            scl8 last_key = context->get_last_pressed_key();
+            last_win = context->get_last_pressed_window();
+            last_key = context->get_last_pressed_key();
 
             if (last_win != SCLWINDOW_INVALID && last_key != NOT_USED) {
-                const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(last_win, last_key);
-                if (coordinate) {
+                const SclLayoutKeyCoordinate* last_coordinate = cache->get_cur_layout_key_coordinate(last_win, last_key);
+                if (last_coordinate) {
                     windows->update_window(last_win,
-                        coordinate->x, coordinate->y, coordinate->width, coordinate->height);
+                        last_coordinate->x, last_coordinate->y, last_coordinate->width, last_coordinate->height);
                 }
             }
 
@@ -2595,7 +2729,7 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
     PSclModifierDecoration sclres_modifier_decoration = sclres_manager->get_modifier_decoration_table();
     assert(sclres_modifier_decoration != NULL);
 
-    if (cache && state && windows && context && utils && adjustment) {
+    if (cache && state && windows && context && utils && adjustment && sclres_manager) {
         const SclLayout *layout = cache->get_cur_layout(window);
         if (layout) {
             x += layout->mouse_manipulate_x;
@@ -2604,32 +2738,28 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
 
         if (!(context->find_multi_touch_context(touch_id))) return FALSE;
 
-        SclResParserManager *sclres_manager = SclResParserManager::get_instance();
-        PSclDefaultConfigure default_configure = NULL;
-        if (sclres_manager) {
-            default_configure = sclres_manager->get_default_configure();
-        }
+        PSclDefaultConfigure default_configure = sclres_manager->get_default_configure();
         if (default_configure) {
             SCLDisplayMode display_mode = context->get_display_mode();
             adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &x, &y);
         }
 
-        //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
-        SclWindowContext *winctx = windows->get_window_context(window);
+        //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+        SclWindowContext *window_context = windows->get_window_context(window);
         /* Adjust event x and y positions as relative position to the virtual window */
-        if (winctx) {
-            /*if (winctx->isVirtual) {
-                SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
-                if (basectx) {
-                    x -= (winctx->x - basectx->x);
-                    y -= (winctx->y - basectx->y);
+        if (window_context) {
+            /*if (window_context->isVirtual) {
+                SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+                if (base_window_context) {
+                    x -= (window_context->x - base_window_context->x);
+                    y -= (window_context->y - base_window_context->y);
                 }
             }*/
             /* If the dim window is virtual and currently active, let's just skip this event */
             if (windows->is_base_window(window)) {
-                SclWindowContext *dimctx = windows->get_window_context(windows->get_dim_window());
-                if (dimctx) {
-                    if (dimctx->is_virtual && !(dimctx->hidden)) {
+                SclWindowContext *dim_window_context = windows->get_window_context(windows->get_dim_window());
+                if (dim_window_context) {
+                    if (dim_window_context->is_virtual && !(dim_window_context->hidden)) {
                         return FALSE;
                     }
                 }
@@ -2642,7 +2772,7 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
 
         sclwindow pressed_window = context->get_cur_pressed_window(touch_id);
         scl8 pressed_key = context->get_cur_pressed_key(touch_id);
-        SclButtonContext *btncontext = cache->get_cur_button_context(pressed_window, pressed_key);
+        SclButtonContext *button_context = cache->get_cur_button_context(pressed_window, pressed_key);
         const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
 
         /* If the multitouch type is SETTLE_PREVIOUS and is not the last touch device, let's ignore move events */
@@ -2654,8 +2784,8 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
             }
         }
 
-        context->set_cur_move_point(touch_id, x, y);
-        context->set_cur_move_window(touch_id, window);
+        context->set_cur_moving_point(touch_id, x, y);
+        context->set_cur_moving_window(touch_id, window);
 
         /* If in longkey state, do not process, just return */
         if (state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY ||
@@ -2700,11 +2830,11 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
         sclint originx = x;
         sclint originy = y;
         if (pressed_window != window) {
-            //SclWindowContext *pressedwinctx = windows->get_window_context(pressed_window, FALSE);
-            SclWindowContext *pressedwinctx = windows->get_window_context(pressed_window);
-            if (winctx && pressedwinctx) {
-                originx = (winctx->geometry.x - pressedwinctx->geometry.x) + x;
-                originy = (winctx->geometry.y - pressedwinctx->geometry.y) + y;
+            //SclWindowContext *pressed_window_context = windows->get_window_context(pressed_window, FALSE);
+            SclWindowContext *pressed_window_context = windows->get_window_context(pressed_window);
+            if (window_context && pressed_window_context) {
+                originx = (window_context->geometry.x - pressed_window_context->geometry.x) + x;
+                originy = (window_context->geometry.y - pressed_window_context->geometry.y) + y;
             }
         }
         sclint startx = originx;
@@ -2716,8 +2846,7 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
             starty = context->get_cur_pressed_point(touch_id).y;
             sclint deltax = originx - startx;
             sclint deltay = originy - starty;
-            sclfloat dist = utils->get_approximate_distance(originx, originy, startx, starty);
-            CSCLUtils *utils = CSCLUtils::get_instance();
+            sclfloat approximate_dist = utils->get_approximate_distance(originx, originy, startx, starty);
 
             sclboolean update_magnifier = FALSE;
             sclboolean drag_state_changed = FALSE;
@@ -2731,7 +2860,7 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
             if (coordinate->button_type == BUTTON_TYPE_DIRECTION) {
                 /* Do not check farthest move point if current drag state is SCL_DRAG_STATE_RETURN */
                 if (context->get_cur_drag_state(touch_id) != SCL_DRAG_STATE_RETURN) {
-                    if (dist > context->get_farthest_move_dist(touch_id)) {
+                    if (approximate_dist > context->get_farthest_move_dist(touch_id)) {
                         context->set_farthest_move_point(touch_id, originx, originy);
                     }
                 }
@@ -2741,7 +2870,7 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
                 } else if (cur_drag_state != SCL_DRAG_STATE_NONE) {
                     direction_recog_dist *= SCL_DRAG_RETURN_RECOG_THRESHOLD_OTHER;
                 }
-                if (dist > direction_recog_dist) {
+                if (approximate_dist > direction_recog_dist) {
                     next_drag_state = get_drag_state(deltax, deltay);
                     /* Disable longkey if dragging is recognized */
                     events->destroy_timer(SCL_TIMER_LONGKEY);
@@ -2806,14 +2935,17 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
                     }
                 }
                 if (dist > direction_recog_dist) {
-                    SclUIEventDesc desc = {0};
-                    SCLShiftState shiftidx = context->get_shift_state();
+                    SclUIEventDesc desc;
+                    SCLShiftState shift_index = context->get_shift_state();
+                    if (context->get_caps_lock_mode()) {
+                        shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+                    }
                     desc.key_type = coordinate->key_type;
-                    desc.key_value = coordinate->key_value[shiftidx][0];
-                    desc.key_event = coordinate->key_event[shiftidx][0];
+                    desc.key_value = coordinate->key_value[shift_index][0];
+                    desc.key_event = coordinate->key_event[shift_index][0];
                     desc.event_type = EVENT_TYPE_MOVE;
                     desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                    desc.mouse_current_point = context->get_cur_move_point(touch_id);
+                    desc.mouse_current_point = context->get_cur_moving_point(touch_id);
                     desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
                     desc.key_modifier = key_modifier;
 
@@ -2823,15 +2955,15 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
                 }
             } else if (coordinate->button_type == BUTTON_TYPE_RELATIVE_DIRECTION) {
                 if (cur_drag_state != SCL_DRAG_STATE_NONE) {
-                    startx = context->get_prev_move_point(touch_id).x;
-                    starty = context->get_prev_move_point(touch_id).y;
-                    dist = utils->get_approximate_distance(originx, originy, startx, starty);
+                    startx = context->get_prev_moving_point(touch_id).x;
+                    starty = context->get_prev_moving_point(touch_id).y;
+                    approximate_dist = utils->get_approximate_distance(originx, originy, startx, starty);
                     direction_recog_dist = SCL_DIRECTION_RELATIVE_RECOG_DIST * utils->get_smallest_scale_rate();
                 }
                 deltax = originx - startx;
                 deltay = originy - starty;
                 //printf("DIST : %f, RECOG : %f\n", dist, direction_recog_dist);
-                if (dist > direction_recog_dist) {
+                if (approximate_dist > direction_recog_dist) {
                     next_drag_state = get_drag_state(deltax, deltay);
                     /* Disable longkey if dragging is recognized */
                     events->destroy_timer(SCL_TIMER_LONGKEY);
@@ -2879,14 +3011,17 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
                             }
                         }
 
-                        SclUIEventDesc desc = {0};
-                        SCLShiftState shiftidx = context->get_shift_state();
+                        SclUIEventDesc desc;
+                        SCLShiftState shift_index = context->get_shift_state();
+                        if (context->get_caps_lock_mode()) {
+                            shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+                        }
                         desc.key_type = coordinate->key_type;
-                        desc.key_value = coordinate->key_value[shiftidx][0];
-                        desc.key_event = coordinate->key_event[shiftidx][0];
+                        desc.key_value = coordinate->key_value[shift_index][0];
+                        desc.key_event = coordinate->key_event[shift_index][0];
                         desc.event_type = EVENT_TYPE_MOVE;
                         desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
-                        desc.mouse_current_point = context->get_cur_move_point(touch_id);
+                        desc.mouse_current_point = context->get_cur_moving_point(touch_id);
                         desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
                         desc.key_modifier = key_modifier;
 
@@ -2894,7 +3029,7 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
                             update_magnifier = TRUE;
                         }
                     }
-                    context->set_prev_move_point(touch_id, originx, originy);
+                    context->set_prev_moving_point(touch_id, originx, originy);
                 }
                 if (drag_state_changed) {
                     /* When the dragging direction changes, save the current position as farthest point for future comparison */
@@ -2904,24 +3039,14 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
             }
 
             if (update_magnifier) {
-                SclResParserManager *sclres_manager = SclResParserManager::get_instance();
                 PSclMagnifierWndConfigure magnifier_configure = NULL;
                 if (sclres_manager) {
                     magnifier_configure = sclres_manager->get_magnifier_configure();
                 }
 
-                const SclLayout *layout = cache->get_cur_layout(windows->get_base_window());
-                if (layout && magnifier_configure) {
-                    sclfloat scale_rate_x, scale_rate_y;
-                    if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
-                        scale_rate_x = utils->get_scale_rate_x();
-                        scale_rate_y = utils->get_scale_rate_y();
-                    } else {
-                        scale_rate_x = utils->get_scale_rate_y();
-                        scale_rate_y = utils->get_scale_rate_x();
-                    }
-
-                    SclPoint zoomwinpos = {0,};
+                const SclLayout *base_layout = cache->get_cur_layout(windows->get_base_window());
+                if (base_layout && magnifier_configure) {
+                    SclPoint zoomwinpos = {0,0};
                     /* calculates x position to be set */
                     zoomwinpos.x = (coordinate->x + (coordinate->width / 2)) -
                         (magnifier_configure->width * utils->get_custom_scale_rate_x() / 2);
@@ -2931,10 +3056,9 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
                     utils->get_screen_resolution(&scnWidth, &scnHeight);
 
                     zoomwinpos.y =  coordinate->y - magnifier_configure->height * utils->get_custom_scale_rate_y();
-                    SclWindowContext *winctx = windows->get_window_context(window);
-                    if (winctx) {
-                        zoomwinpos.x += winctx->geometry.x;
-                        zoomwinpos.y += winctx->geometry.y;
+                    if (window_context) {
+                        zoomwinpos.x += window_context->geometry.x;
+                        zoomwinpos.y += window_context->geometry.y;
                     }
                     if (zoomwinpos.x < 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x()) {
                         zoomwinpos.x = 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x();
@@ -2962,51 +3086,51 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
                 grab_event = TRUE;
             }
             /* If the topmost window has the POPUP_GRAB style, find the nearest button to the mouse pointer */
-            if (grab_event && winctx) {
+            if (grab_event && window_context) {
                 /* If the layout's addGrab* values are defined, process this event only if the event occured inside grab area */
                 sclboolean in_grab_area = TRUE;
                 if (layout->add_grab_left != NOT_USED && x < -(layout->add_grab_left)) {
                     in_grab_area = FALSE;
                 }
-                if (layout->add_grab_right != NOT_USED && x > (winctx->geometry.width + layout->add_grab_right)) {
+                if (layout->add_grab_right != NOT_USED && x >
+                    (window_context->geometry.width + layout->add_grab_right)) {
                     in_grab_area = FALSE;
                 }
                 if (layout->add_grab_top != NOT_USED && y < -(layout->add_grab_top)) {
                     in_grab_area = FALSE;
                 }
-                if (layout->add_grab_bottom != NOT_USED && y > (winctx->geometry.height + layout->add_grab_bottom)) {
+                if (layout->add_grab_bottom != NOT_USED && y >
+                    (window_context->geometry.height + layout->add_grab_bottom)) {
                     in_grab_area = FALSE;
                 }
                 if (in_grab_area) {
-                    CSCLResourceCache *cache = CSCLResourceCache::get_instance();
-                    if (cache) {
-                        float min_dist = (float)((unsigned int)(-1));
-                        int min_dist_index = NOT_USED;
-                        for (int loop = 0;loop < MAX_KEY && !ended && !ret;loop++) {
-                            btncontext = cache->get_cur_button_context(window, loop);
-                            const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
-                            if (btncontext && coordinate) {
-                                if (!(btncontext->used)) {
-                                    ended = TRUE;
-                                } else if (btncontext->state != BUTTON_STATE_DISABLED &&
-                                    coordinate->button_type != BUTTON_TYPE_UIITEM) {
-                                        const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
-                                        if (coordinate) {
-                                            float dist = utils->get_approximate_distance(x, y,
-                                                    coordinate->x + (coordinate->width / 2), coordinate->y + (coordinate->height / 2));
-                                            if (dist < min_dist) {
-                                                min_dist_index = loop;
-                                                min_dist = dist;
-                                            }
-                                        }
+                    float min_dist = (float)((unsigned int)(-1));
+                    int min_dist_index = NOT_USED;
+                    for (int loop = 0;loop < MAX_KEY && !ended && !ret;loop++) {
+                        button_context = cache->get_cur_button_context(window, loop);
+                        const SclLayoutKeyCoordinate *cur_coordinate = cache->get_cur_layout_key_coordinate(window, loop);
+                        if (button_context && cur_coordinate) {
+                            if (!(button_context->used)) {
+                                ended = TRUE;
+                            } else if (button_context->state != BUTTON_STATE_DISABLED &&
+                                cur_coordinate->button_type != BUTTON_TYPE_UIITEM) {
+                                float dist = utils->get_approximate_distance(x, y,
+                                        cur_coordinate->x + (cur_coordinate->width / 2),
+                                        cur_coordinate->y + (cur_coordinate->height / 2));
+                                if (dist < min_dist) {
+                                    min_dist_index = loop;
+                                    min_dist = dist;
                                 }
                             }
                         }
-                        /* When we found the nearest button, generate this event on the button */
-                        if (min_dist_index != NOT_USED) {
-                            const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, min_dist_index);
-                            x = coordinate->x + (coordinate->width / 2);
-                            y = coordinate->y + (coordinate->height / 2);
+                    }
+                    /* When we found the nearest button, generate this event on the button */
+                    if (min_dist_index != NOT_USED) {
+                        const SclLayoutKeyCoordinate *min_coordinate =
+                            cache->get_cur_layout_key_coordinate(window, min_dist_index);
+                        if (min_coordinate) {
+                            x = min_coordinate->x + (min_coordinate->width / 2);
+                            y = min_coordinate->y + (min_coordinate->height / 2);
                             if (process_button_move_event(window, x, y, min_dist_index, touch_id, actual_event)) {
                                 ret = TRUE;
                             }
@@ -3014,37 +3138,64 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
                     }
                 }
             } else {
-                MultiTouchContext *mulctx = context->find_multi_touch_context(touch_id);
-                if (mulctx) {
-                    if (!(mulctx->is_sub_event)) {
-                        /* First check if the event occured in pressed key's threshold area */
-                        if (btncontext && coordinate) {
-                            if (pressed_window == window) { // Check only when the window is the one initally pressed
-                                if (btncontext->used && btncontext->state != BUTTON_STATE_DISABLED) {
-                                    if (process_button_move_event(pressed_window, x, y, pressed_key, touch_id, actual_event)) {
-                                        ret = TRUE;
-                                        x = coordinate->x + (coordinate->width / 2);
-                                        y = coordinate->y + (coordinate->height / 2);
+                MultiTouchContext *multi_touch_context = context->find_multi_touch_context(touch_id);
+                if (multi_touch_context) {
+                    sclint button_index = NOT_USED;
+                    if (!(multi_touch_context->is_sub_event)) {
+                        sclboolean process_finished = FALSE;
+                        do {
+                            /* First check if the event occured in pressed key's threshold area */
+                            if (button_context && coordinate) {
+                                if (pressed_window == window) { // Check only when the window is the one initally pressed
+                                    if (button_context->used && button_context->state != BUTTON_STATE_DISABLED) {
+                                        if (process_button_move_event(pressed_window, x, y, pressed_key, touch_id, actual_event)) {
+                                            ret = TRUE;
+                                            x = coordinate->x + (coordinate->width / 2);
+                                            y = coordinate->y + (coordinate->height / 2);
+                                            button_index = pressed_key;
+                                        }
                                     }
                                 }
                             }
-                        }
-                        for (int loop = 0;loop < MAX_KEY && !ended && !ret;loop++) {
-                            btncontext = cache->get_cur_button_context(window, loop);
-                            const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
-                            if (btncontext && coordinate) {
-                                if (!(btncontext->used)) {
-                                    ended = TRUE;
-                                } else if (btncontext->state != BUTTON_STATE_DISABLED &&
-                                            coordinate->button_type != BUTTON_TYPE_UIITEM) {
-                                    if (window != pressed_window || loop != pressed_key) {
-                                        if (process_button_move_event(window, x, y, loop, touch_id, actual_event)) {
-                                            ret = TRUE;
+                            for (int loop = 0;loop < MAX_KEY && !ended && !ret;loop++) {
+                                button_context = cache->get_cur_button_context(window, loop);
+                                const SclLayoutKeyCoordinate *cur_coordinate =
+                                    cache->get_cur_layout_key_coordinate(window, loop);
+                                if (button_context && cur_coordinate) {
+                                    if (!(button_context->used)) {
+                                        ended = TRUE;
+                                    } else if (button_context->state != BUTTON_STATE_DISABLED &&
+                                                cur_coordinate->button_type != BUTTON_TYPE_UIITEM) {
+                                        if (window != pressed_window || loop != pressed_key) {
+                                            if (process_button_move_event(window, x, y, loop, touch_id, actual_event)) {
+                                                ret = TRUE;
+                                                button_index = loop;
+                                            }
                                         }
                                     }
                                 }
                             }
-                        }
+
+                            if (windows->is_base_window(window)) {
+                                process_finished = TRUE;
+                            } else if (button_index != NOT_USED) {
+                                process_finished = TRUE;
+                            } else {
+                                const SclLayout *cur_layout = cache->get_cur_layout(window);
+                                if (cur_layout && cur_layout->use_sw_background && cur_layout->bg_color.a == 0) {
+                                    /* If we could not find appropriate button in this popup window and the popup is transparent */
+                                    SclWindowContext *base_window_context =
+                                        windows->get_window_context(windows->get_base_window());
+                                    if (base_window_context) {
+                                        x = (window_context->geometry.x + x - base_window_context->geometry.x);
+                                        y = (window_context->geometry.y + y - base_window_context->geometry.y);
+                                    }
+                                    window = windows->get_base_window();
+                                } else {
+                                    process_finished = TRUE;
+                                }
+                            }
+                        } while (!process_finished);
                     }
                 }
             }
@@ -3092,12 +3243,12 @@ CSCLController::mouse_over(sclwindow window, sclint x, sclint y)
         sclboolean ended = FALSE;
 
         for (int loop = 0; loop < MAX_KEY && !ended && !ret; loop++) {
-            SclButtonContext *btncontext = cache->get_cur_button_context(window, loop);
+            SclButtonContext *button_context = cache->get_cur_button_context(window, loop);
             const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
-            if (btncontext && coordinate) {
-                if (!(btncontext->used)) {
+            if (button_context && coordinate) {
+                if (!(button_context->used)) {
                     ended = TRUE;
-                } else if (btncontext->state != BUTTON_STATE_DISABLED &&
+                } else if (button_context->state != BUTTON_STATE_DISABLED &&
                             coordinate->button_type != BUTTON_TYPE_UIITEM) {
                     if (process_button_over_event(window, x, y, loop)) {
                         ret = TRUE;
@@ -3120,10 +3271,6 @@ CSCLController::mouse_over(sclwindow window, sclint x, sclint y)
 sclboolean
 CSCLController::timer_event(const scl32 data)
 {
-    struct my_srtuct {
-        struct typeA {short x; short y;};
-        struct typeB {short x; short y;};
-    } strt;
     SCL_DEBUG();
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLContext *context = CSCLContext::get_instance();
@@ -3135,6 +3282,9 @@ CSCLController::timer_event(const scl32 data)
     scl16 id = SCL_LOWORD(data); /* Timer ID */
     scl16 value = SCL_HIWORD(data); /* event unique ID */
 
+    if (!windows || !context || !events || !state || !cache || !handler)
+        return FALSE;
+
     switch (id) {
     case SCL_TIMER_AUTOPOPUP: {
         /* Checks whether my event id is availble */
@@ -3151,56 +3301,72 @@ CSCLController::timer_event(const scl32 data)
                 state->get_cur_action_state() == ACTION_STATE_POPUP_REPEATKEY
            ) {
             /* Ignores if the event id is different */
+            events->destroy_timer(id);
             return FALSE;
         }
 
-        SclRectangle rect = {0,};
+        SclRectangle rect = {0,0,0,0};
         sclwindow window = context->get_cur_pressed_window(context->get_last_touch_device_id());
-        sclbyte keyIndex = context->get_cur_pressed_key(context->get_last_touch_device_id());
+        sclbyte key_index = context->get_cur_pressed_key(context->get_last_touch_device_id());
 
-        if (configure_autopopup_window(window, keyIndex, &rect)) {
+        if (configure_autopopup_window(window, key_index, &rect)) {
             /* Let's change out pressed button's state back to normal */
-            SclButtonContext *btncontext = cache->get_cur_button_context(window, keyIndex);
-            const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, keyIndex);
-
-            if (btncontext) {
-                if (btncontext->state == BUTTON_STATE_PRESSED) {
-                    btncontext->state = BUTTON_STATE_NORMAL;
-                    CSCLWindows *windows = CSCLWindows::get_instance();
-                    if (windows && coordinate) {
+            SclButtonContext *button_context = cache->get_cur_button_context(window, key_index);
+            const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
+
+            if (button_context) {
+                if (button_context->state == BUTTON_STATE_PRESSED) {
+                    button_context->state = BUTTON_STATE_NORMAL;
+                    if (coordinate) {
                         windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
                     }
                 }
             }
             /* Hide magnifier window when opening autopopup window */
             windows->hide_window(windows->get_magnifier_window());
-            /* Currently, window does not support virtual window */
-            SclWindowOpener opener;
-            opener.window = window;
-            opener.key = keyIndex;
-            sclwindow popup_window = windows->open_popup(
-                opener,
-                rect,
-                NOT_USED,
-                SCL_LAYOUT_AUTOPOPUP, POPUP_TYPE_AUTO_POPUP,
-                FALSE,
-                FALSE
-            );
+
+            sclwindow popup_window = SCLWINDOW_INVALID;
+
+            SclNotiPopupOpeningDesc desc;
+            desc.ui_event_desc = NULL;
+            desc.input_mode = SCL_LAYOUT_AUTOPOPUP_NAME;
+            if (SCL_EVENT_PASS_ON ==
+                handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENING, &desc)) {
+                    /* Currently, window does not support virtual window */
+                    SclWindowOpener opener;
+                    opener.window = window;
+                    opener.key = key_index;
+
+                    popup_window = windows->open_popup(
+                        opener,
+                        rect,
+                        NOT_USED,
+                        SCL_LAYOUT_AUTOPOPUP, POPUP_TYPE_AUTO_POPUP,
+                        FALSE,
+                        FALSE
+                        );
+
+                    SclNotiPopupOpenedDesc opened_desc;
+                    opened_desc.ui_event_desc = NULL;
+                    opened_desc.input_mode = desc.input_mode;
+                    opened_desc.window = popup_window;
+                    handler->on_event_notification(SCL_UINOTITYPE_POPUP_OPENED, &opened_desc);
+            }
+
             windows->hide_window(windows->get_magnifier_window());
             _play_tts_for_layout_autopopup_name();
 
-            sclwindow move_window = context->get_cur_move_window(context->get_last_touch_device_id());
-            SclPoint move_point = context->get_cur_move_point(context->get_last_touch_device_id());
-            SclWindowContext *move_ctx = windows->get_window_context(move_window);
-            SclWindowContext *popup_ctx = windows->get_window_context(popup_window);
-            if (move_ctx && popup_ctx) {
-                move_point.x = (move_ctx->geometry.x - popup_ctx->geometry.x) + move_point.x;
-                move_point.y = (move_ctx->geometry.y - popup_ctx->geometry.y) + move_point.y;
+            sclwindow moving_window = context->get_cur_moving_window(context->get_last_touch_device_id());
+            SclPoint moving_point = context->get_cur_moving_point(context->get_last_touch_device_id());
+            SclWindowContext *moving_window_context = windows->get_window_context(moving_window);
+            SclWindowContext *popup_window_context = windows->get_window_context(popup_window);
+            if (moving_window_context && popup_window_context) {
+                moving_point.x = (moving_window_context->geometry.x - popup_window_context->geometry.x) + moving_point.x;
+                moving_point.y = (moving_window_context->geometry.y - popup_window_context->geometry.y) + moving_point.y;
             }
-            printf("AUTOPOPUP : %d %d\n", move_point.x, move_point.y);
+            //printf("AUTOPOPUP : %d %d\n", moving_point.x, moving_point.y);
 
-            CSCLWindows *windows = CSCLWindows::get_instance();
-            if (windows && coordinate) {
+            if (coordinate) {
                 windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
             }
         }
@@ -3225,6 +3391,7 @@ CSCLController::timer_event(const scl32 data)
                 state->get_cur_action_state() == ACTION_STATE_POPUP_REPEATKEY
            ) {
             /* Ignores if the event id is different */
+            events->destroy_timer(id);
             return FALSE;
         }
         /* Ignores if the event id is different */
@@ -3235,9 +3402,9 @@ CSCLController::timer_event(const scl32 data)
             handle_engine_signal(SCL_SIG_MOUSE_LONG_PRESS, window);
             windows->update_window(windows->get_magnifier_window());
 /*
-            SclButtonContext *btncontext = cache->get_cur_button_context(window, key_index);
-            if (btncontext->state == BUTTON_STATE_PRESSED) {
-                btncontext->state = BUTTON_STATE_NORMAL;
+            SclButtonContext *button_context = cache->get_cur_button_context(window, key_index);
+            if (button_context->state == BUTTON_STATE_PRESSED) {
+                button_context->state = BUTTON_STATE_NORMAL;
                 CSCLWindows *windows = CSCLWindows::get_instance();
                 if (windows) {
                     const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
@@ -3284,15 +3451,16 @@ CSCLController::timer_event(const scl32 data)
                  state->get_cur_action_state() != ACTION_STATE_POPUP_REPEATKEY)
            ) {
             /* Ignores if the event id is different */
+            events->destroy_timer(id);
             return FALSE;
         }
         sclwindow window = context->get_cur_pressed_window(context->get_last_touch_device_id());
-        sclbyte keyIndex = context->get_cur_pressed_key(context->get_last_touch_device_id());
+        sclbyte key_index = context->get_cur_pressed_key(context->get_last_touch_device_id());
         scllong interval = m_repeat_key_duration - (m_key_repeated_num * SCL_REPEATKEY_ACCELERATION);
         if (interval < SCL_REPEATKEY_MIN_DURATION) {
             interval = SCL_REPEATKEY_MIN_DURATION;
         }
-        process_button_repeat_pressed_event(window, keyIndex, context->get_last_touch_device_id());
+        process_button_repeat_pressed_event(window, key_index, context->get_last_touch_device_id());
         events->destroy_timer(id);
         events->create_timer(SCL_TIMER_REPEATKEY, interval, value);
         m_key_repeated_num++;
@@ -3319,17 +3487,38 @@ CSCLController::timer_event(const scl32 data)
     }
     break;
     case SCL_TIMER_POPUP_TIMEOUT: {
-        windows->close_all_popups();
+        SclNotiPopupClosingDesc desc;
+        desc.ui_event_desc = NULL;
+        desc.input_mode = NULL;
+        desc.timed_out = TRUE;
+
+        SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+        if (sclres_manager) {
+            const PSclInputModeConfigure sclres_input_mode_configure =
+                sclres_manager->get_input_mode_configure_table();
+            sclwindow window = windows->get_nth_popup_window(SCL_WINDOW_Z_TOP);
+            SclWindowContext *window_context = windows->get_window_context(window);
+            if (window_context && sclres_input_mode_configure) {
+                if (scl_check_arrindex(window_context->inputmode, MAX_SCL_INPUT_MODE)) {
+                    desc.input_mode = sclres_input_mode_configure[window_context->inputmode].name;
+                }
+            }
+        }
 
-        handler->on_event_notification(SCL_UINOTITYPE_POPUP_TIMEOUT, data);
+        if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_POPUP_CLOSING, &desc)) {
+            windows->close_all_popups();
+
+            SclNotiPopupClosedDesc closed_desc;
+            closed_desc.ui_event_desc = desc.ui_event_desc;
+            closed_desc.input_mode = desc.input_mode;
+            closed_desc.timed_out = desc.timed_out;
+            handler->on_event_notification(SCL_UINOTITYPE_POPUP_CLOSED, &desc);
+        }
         events->destroy_timer(id);
         return FALSE;
     }
     break;
     case SCL_TIMER_AUTOTEST: {
-        CSCLResourceCache *cache = CSCLResourceCache::get_instance();
-        SCLDisplayMode display_mode =  context->get_display_mode();
-
         sclint rnd = rand() % 100;
         sclint x = (rand() % (cache->get_cur_layout(windows->get_base_window())->width));
         sclint y = (rand() % (cache->get_cur_layout(windows->get_base_window())->height));
@@ -3351,6 +3540,13 @@ CSCLController::timer_event(const scl32 data)
         return FALSE;
     }
     break;
+    case SCL_TIMER_ANIMATION: {
+        CSCLAnimator *animator = CSCLAnimator::get_instance();
+        if (animator) {
+            return animator->animator_timer();
+        }
+        return TRUE;
+    }
 
     default: {
         events->destroy_timer(id);
@@ -3427,6 +3623,17 @@ void CSCLController::handle_engine_signal( SclInternalSignal signal, sclwindow t
                 windows->close_all_popups();
             }
             break;
+        case SCL_SIG_START:
+        case SCL_SIG_INPMODE_CHANGE:
+        case SCL_SIG_DISP_CHANGE:
+        case SCL_SIG_POPUP_SHOW:
+        case SCL_SIG_POPUP_HIDE:
+        case SCL_SIG_MOUSE_PRESS:
+        case SCL_SIG_MOUSE_LONG_PRESS:
+        case SCL_SIG_MOUSE_RELEASE:
+        case SCL_SIG_KEYEVENT:
+        default:
+            break;
     }
 
     int loop = 0;
@@ -3470,8 +3677,13 @@ void CSCLController::handle_engine_signal( SclInternalSignal signal, sclwindow t
             case SIGACTION_UNSET_SHIFT: {
                 CSCLEventHandler *handler = CSCLEventHandler::get_instance();
                 if (handler) {
+
+                    SclNotiShiftStateChangeDesc desc;
+                    desc.ui_event_desc = NULL;
+                    desc.shift_state = SCL_SHIFT_STATE_OFF;
+
                     if (SCL_EVENT_PASS_ON ==
-                        handler->on_event_notification(SCL_UINOTITYPE_SHIFT_STATE_CHANGE, SCL_SHIFT_STATE_OFF)) {
+                        handler->on_event_notification(SCL_UINOTITYPE_SHIFT_STATE_CHANGE, &desc)) {
                         context->set_shift_state(SCL_SHIFT_STATE_OFF);
                     }
                 }
@@ -3485,6 +3697,8 @@ void CSCLController::handle_engine_signal( SclInternalSignal signal, sclwindow t
             break;
             case SIGACTION_INIT_INPUTMODE:
             break;
+            default:
+            break;
             }
         }
     }
@@ -3604,10 +3818,13 @@ CSCLController::configure_autopopup_window(sclwindow window, sclbyte key_index,
     }
 
     if (utils && context && windows && cache && coordinate && rect && autopopup_configure) {
-        SCLShiftState shiftidx = context->get_shift_state();
-        if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+        SCLShiftState shift_index = context->get_shift_state();
+        if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
+        if (context->get_caps_lock_mode()) {
+            shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+        }
 
-        if (utils->get_autopopup_window_variables(coordinate->autopopup_key_labels[shiftidx],
+        if (utils->get_autopopup_window_variables(coordinate->autopopup_key_labels[shift_index],
                 &num_keys, &num_columns, &num_rows, &rect->width, &rect->height)) {
 
             /* There is no need for an autopopup window if number of keys are equal to or less than 0 */
@@ -3672,42 +3889,44 @@ CSCLController::configure_autopopup_window(sclwindow window, sclbyte key_index,
  * button A gets restored to its initial state and B gets pressed instead.
  */
 sclboolean
-CSCLController::check_event_transition_enabled(const SclLayoutKeyCoordinate *btnFrom, const SclLayoutKeyCoordinate *btnTo)
+CSCLController::check_event_transition_enabled(const SclLayoutKeyCoordinate *btn_from, const SclLayoutKeyCoordinate *btn_to)
 {
     sclboolean ret = FALSE;
-    sclbyte typeFrom = BUTTON_TYPE_NORMAL; /* To enable event transition even if no button is pressed currently */
-    sclbyte typeTo = MAX_BUTTON_TYPE;
+    sclbyte type_from = BUTTON_TYPE_NORMAL; /* To enable event transition even if no button is pressed currently */
+    sclbyte type_to = MAX_BUTTON_TYPE;
 
     const sclboolean TRANSITION_TABLE[MAX_BUTTON_TYPE][MAX_BUTTON_TYPE] = {
-        //     NORMAL  GRAB    SELFISH DRAG    MULTITAP        ROTATION        DIRECTION       R_DIRECTION     UIITEM
+        //     NORMAL  GRAB    SELFISH DRAG    MULTITAP        ROTATION        DIRECTION       R_DIRECTION     TOGGLE  UIITEM
         //     From : NORMAL
-        {      TRUE,   0,      0,              TRUE,   TRUE,           TRUE,           0,                      0,                      0},
+        {      TRUE,   0,      0,              TRUE,   TRUE,           TRUE,           0,                      0,                      TRUE,           0},
         //     From : GRAB
-        {      0,              0,      0,              0,              0,                      0,                      0,                      0,                      0},
+        {      0,              0,      0,              0,              0,                      0,                      0,                      0,                      0,                      0},
         //     From : SELFISH
-        {      0,              0,      0,              0,              0,                      0,                      0,                      0,                      0},
+        {      0,              0,      0,              0,              0,                      0,                      0,                      0,                      0,                      0},
         //     From : DRAG
-        {      TRUE,   0,      0,              TRUE,   TRUE,           TRUE,           0,                      0,                      0},
+        {      TRUE,   0,      0,              TRUE,   TRUE,           TRUE,           0,                      0,                      TRUE,           0},
         //     From : MULTITAP
-        {      TRUE,   0,      0,              TRUE,   TRUE,           TRUE,           0,                      0,                      0},
+        {      TRUE,   0,      0,              TRUE,   TRUE,           TRUE,           0,                      0,                      TRUE,           0},
         //     From : ROTATION
-        {      TRUE,   0,      0,              TRUE,   TRUE,           TRUE,           0,                      0,                      0},
+        {      TRUE,   0,      0,              TRUE,   TRUE,           TRUE,           0,                      0,                      TRUE,           0},
         //     From : DIRECTION
-        {      0,              0,      0,              0,              0,                      0,                      0,                      0,                      0},
+        {      0,              0,      0,              0,              0,                      0,                      0,                      0,                      0,                      0},
         //     From : R_DIRECTION
-        {      0,              0,      0,              0,              0,                      0,                      0,                      0,                      0},
+        {      0,              0,      0,              0,              0,                      0,                      0,                      0,                      0,                      0},
         //     From : UIITEM
-        {      0,              0,      0,              0,              0,                      0,                      0,                      0,                      0},
+        {      0,              0,      0,              0,              0,                      0,                      0,                      0,                      0,                      0},
+        //     From : TOGGLE
+        {      TRUE,   0,      0,              TRUE,   TRUE,           TRUE,           0,                      0,                      TRUE,           0},
     };
 
-    if (btnFrom) typeFrom = btnFrom->button_type;
-    if (btnTo) typeTo = btnTo->button_type;
+    if (btn_from) type_from = btn_from->button_type;
+    if (btn_to) type_to = btn_to->button_type;
 
-    scl_assert_return_false(typeFrom >= 0 && typeFrom < MAX_BUTTON_TYPE);
-    scl_assert_return_false(typeTo >= 0 && typeTo < MAX_BUTTON_TYPE);
+    scl_assert_return_false(type_from >= 0 && type_from < MAX_BUTTON_TYPE);
+    scl_assert_return_false(type_to >= 0 && type_to < MAX_BUTTON_TYPE);
 
-    if (typeFrom < MAX_BUTTON_TYPE && typeTo < MAX_BUTTON_TYPE) {
-        ret = TRANSITION_TABLE[typeFrom][typeTo];
+    if (type_from < MAX_BUTTON_TYPE && type_to < MAX_BUTTON_TYPE) {
+        ret = TRANSITION_TABLE[type_from][type_to];
     }
 
     return ret;
index 7eab4ab..38f982c 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index ea9e0f6..f5202af 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 7e68e3c..34d1392 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index ef17a15..7d4c2ba 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -59,7 +59,6 @@ static void handle_shift_button_click_event(SclUIEventDesc ui_event_desc)
                     /* The default next state should be LOCK state */
                     SCLShiftState next_state = SCL_SHIFT_STATE_LOCK;
                     if (context->get_shift_multi_touch_enabled()) {
-                        CSCLContext *context = CSCLContext::get_instance();
                         if (context) {
                             if (context->get_shift_multi_touch_state() == SCL_SHIFT_MULTITOUCH_ON_PRESSED) {
                                 /* If the shift multi touch state is ON_PRESSED, don't leave ON state now */
@@ -77,6 +76,9 @@ static void handle_shift_button_click_event(SclUIEventDesc ui_event_desc)
                     uiimpl->set_shift_state(SCL_SHIFT_STATE_OFF);
                 }
                 break;
+                case SCL_SHIFT_STATE_MAX:
+                default:
+                    break;
             }
         }
     }
@@ -101,9 +103,8 @@ static void handle_shift_state_on_button_click_event(SclUIEventDesc ui_event_des
         turn_shift_off = FALSE;
     }
     /* If we are in ON_PRESSED or ON_KEY_ENTERED mode of shift multi touch state, do not turn it off now */
-    if (context->get_shift_multi_touch_enabled() && turn_shift_off) {
-        CSCLContext *context = CSCLContext::get_instance();
-        if (context) {
+    if (context) {
+        if (context->get_shift_multi_touch_enabled() && turn_shift_off) {
             if (context->get_shift_multi_touch_state() == SCL_SHIFT_MULTITOUCH_ON_PRESSED) {
                 context->set_shift_multi_touch_state(SCL_SHIFT_MULTITOUCH_ON_KEY_ENTERED);
                 turn_shift_off = FALSE;
@@ -209,7 +210,7 @@ CSCLEventHandler::on_event_drag_state_changed(SclUIEventDesc ui_event_desc)
 }
 
 SCLEventReturnType
-CSCLEventHandler::on_event_notification(SCLUINotiType noti_type, sclint etc_info)
+CSCLEventHandler::on_event_notification(SCLUINotiType noti_type, SclNotiDesc *etc_info)
 {
     SCLEventReturnType ret = SCL_EVENT_PASS_ON;
 
@@ -235,18 +236,22 @@ CSCLEventHandler::set_input_mode(const sclchar *input_mode)
     SCL_DEBUG();
 
     sclboolean ret = FALSE;
-    m_cur_input_mode_event_callback = NULL;
-
-    if (input_mode) {
-        std::string id = input_mode;
-        std::map<std::string, ISCLUIEventCallback*>::iterator iter = m_input_mode_event_callbacks.find(input_mode);
-        if (iter != m_input_mode_event_callbacks.end()) {
-            m_cur_input_mode_event_callback = (iter->second);
+    SclNotiInputModeChangeDesc desc;
+    desc.input_mode = input_mode;
+    if (SCL_EVENT_PASS_ON == on_event_notification(SCL_UINOTITYPE_INPUT_MODE_CHANGE, &desc)) {
+        m_cur_input_mode_event_callback = NULL;
+
+        if (input_mode) {
+            std::string id = input_mode;
+            std::map<std::string, ISCLUIEventCallback*>::iterator iter = m_input_mode_event_callbacks.find(input_mode);
+            if (iter != m_input_mode_event_callbacks.end()) {
+                m_cur_input_mode_event_callback = (iter->second);
+            }
         }
-    }
 
-    if (m_cur_input_mode_event_callback) {
-        ret = TRUE;
+        if (m_cur_input_mode_event_callback) {
+            ret = TRUE;
+        }
     }
 
     return ret;
@@ -287,6 +292,7 @@ CSCLEventHandler::pre_process_ui_event(SclUIEventDesc &ui_event_desc)
         {"Right",       MVK_Right       },
         {"Up",          MVK_Up          },
         {"Down",        MVK_Down        },
+        {"Escape",      MVK_Escape      },
     };
 
     /* Translate key_values only when key_event is 0 and key_value is not NULL */
index b03e6c8..7f5eb5d 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 #include "scldebug.h"
 #include "sclwindows.h"
 
+#include "sclcontroller.h"
+#include "sclresourcecache.h"
+#include "sclkeyfocushandler.h"
+#include <dlog.h>
+
 using namespace scl;
 
 CSCLEvents::CSCLEvents()
@@ -39,8 +44,6 @@ CSCLEvents::~CSCLEvents()
 {
     SCL_DEBUG();
 
-    fini();
-
     if (m_impl) {
         delete m_impl;
         m_impl = NULL;
@@ -88,10 +91,10 @@ void
 CSCLEvents::connect_window_events( sclwindow wnd, const sclint evt )
 {
     CSCLWindows *windows = CSCLWindows::get_instance();
-    //SclWindowContext *winctx = windows->get_window_context(wnd, FALSE);
-    SclWindowContext *winctx = windows->get_window_context(wnd);
-    if (winctx) {
-        if (!(winctx->is_virtual)) {
+    //SclWindowContext *window_context = windows->get_window_context(wnd, FALSE);
+    SclWindowContext *window_context = windows->get_window_context(wnd);
+    if (window_context) {
+        if (!(window_context->is_virtual)) {
             get_scl_events_impl()->connect_window_events(wnd, evt);
         }
     }
@@ -109,4 +112,97 @@ CSCLEvents::get_touch_event_offset()
     return &m_touch_event_offset;
 }
 
+sclboolean
+CSCLEvents::process_key_event(const char *key)
+{
+    const char *keyname = key;
+    LOGD("=-=-=-=- key_pressed \n");
+    CSCLController *controller = CSCLController::get_instance();
+    LOGD("=-=-=-=- keyname(char) = %s \n",keyname);
+
+    CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+    const SclLayoutKeyCoordinate *prevcoordinate = NULL;
+    const SclLayoutKeyCoordinate *coordinate = NULL;
+
+    CSCLWindows *windows = CSCLWindows::get_instance();
+    CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
+
+    sclwindow current_focus_window = focus_handler->get_current_focus_window();
+    scl8 current_key_index = focus_handler->get_current_focus_key();
+    sclwindow focus_window = current_focus_window;
+    scl8 key_index = current_key_index;
+
+    if (strcmp(keyname, "Right") == 0) {
+        focus_handler->process_navigation(HIGHLIGHT_NAVIGATE_RIGHT);
+        focus_window = focus_handler->get_current_focus_window();
+        key_index = focus_handler->get_current_focus_key();
+    } else if (strcmp(keyname, "Left") == 0) {
+        focus_handler->process_navigation(HIGHLIGHT_NAVIGATE_LEFT);
+        focus_window = focus_handler->get_current_focus_window();
+        key_index = focus_handler->get_current_focus_key();
+    } else if (strcmp(keyname, "Up") == 0) {
+        focus_handler->process_navigation(HIGHLIGHT_NAVIGATE_UP);
+        focus_window = focus_handler->get_current_focus_window();
+        key_index = focus_handler->get_current_focus_key();
+    } else if (strcmp(keyname, "Down") == 0) {
+        focus_handler->process_navigation(HIGHLIGHT_NAVIGATE_DOWN);
+        focus_window = focus_handler->get_current_focus_window();
+        key_index = focus_handler->get_current_focus_key();
+    } else if ((strcmp(keyname, "Return") == 0)||(strcmp(keyname, "Enter") == 0)) {
+        coordinate = cache->get_cur_layout_key_coordinate(current_focus_window, current_key_index);
+        //button_context->state = BUTTON_STATE_NORMAL;
+        controller->mouse_press(current_focus_window, coordinate->x, coordinate->y, TRUE);
+        controller->mouse_release(current_focus_window, coordinate->x, coordinate->y, TRUE);
+        if (KEY_TYPE_MODECHANGE != coordinate->key_type) {
+            //button_context->state = BUTTON_STATE_PRESSED;
+            //windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
+        } else {
+            focus_handler->init_key_index();
+        }
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+
+    if (current_key_index != key_index || current_focus_window != focus_window) {
+        prevcoordinate = cache->get_cur_layout_key_coordinate(current_focus_window, current_key_index);
+        coordinate = cache->get_cur_layout_key_coordinate(focus_window, key_index);
+        //prev_button_context->state = BUTTON_STATE_NORMAL;
+        //button_context->state = BUTTON_STATE_PRESSED;
+        if (current_focus_window == focus_window) {
+            sclshort x,y,width,height;
+            if (prevcoordinate->x < coordinate->x) {
+                x = prevcoordinate->x;
+            } else {
+                x = coordinate->x;
+            }
+
+            if (prevcoordinate->y < coordinate->y) {
+                y = prevcoordinate->y;
+            } else {
+                y = coordinate->y;
+            }
+
+            if (prevcoordinate->x + prevcoordinate->width > coordinate->x + coordinate->width) {
+                width = prevcoordinate->x + prevcoordinate->width - x;
+            } else {
+                width = coordinate->x + coordinate->width - x;
+            }
+
+            if (prevcoordinate->y + prevcoordinate->height > coordinate->y + coordinate->height) {
+                height = prevcoordinate->y + prevcoordinate->height - y;
+            } else {
+                height = coordinate->y + coordinate->height - y;
+            }
+            windows->update_window(focus_window, x, y, width, height);
+        } else {
+            windows->update_window(focus_window,
+                coordinate->x, coordinate->y, coordinate->width, coordinate->height);
+            windows->update_window(current_focus_window,
+                prevcoordinate->x, prevcoordinate->y, prevcoordinate->width, prevcoordinate->height);
+        }
+    } else {
+    }
+    return TRUE;
+}
 
index ae4f857..2829999 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 581401d..218f63a 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 048f973..36856be 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -41,8 +41,6 @@ CSCLGraphics::~CSCLGraphics()
 {
     SCL_DEBUG();
 
-    fini();
-
     if (m_impl) {
         delete m_impl;
         m_impl = NULL;
index b10503d..c4d1d44 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -32,8 +32,6 @@ CSCLGwes::CSCLGwes()
 CSCLGwes::~CSCLGwes()
 {
     SCL_DEBUG();
-
-    fini();
 }
 
 void CSCLGwes::init(sclwindow parent, scl16 width, scl16 height)
index 1d2c161..a2ec3e5 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
diff --git a/scl/sclkeyfocushandler.cpp b/scl/sclkeyfocushandler.cpp
new file mode 100644 (file)
index 0000000..7b7f3d1
--- /dev/null
@@ -0,0 +1,831 @@
+/*
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "sclkeyfocushandler.h"
+#include <Elementary.h>
+#include <Evas.h>
+#include <dlog.h>
+#include <Ecore_X.h>
+#include <utilX.h>
+#include "sclres_type.h"
+#include "scldebug.h"
+#include "sclcontext.h"
+#include "sclresourcecache.h"
+#include "sclwindows.h"
+#include "scleventhandler.h"
+#include "sclres_manager.h"
+#include "sclanimator.h"
+
+using namespace scl;
+
+/**
+ * Constructor
+ */
+CSCLKeyFocusHandler::CSCLKeyFocusHandler()
+{
+    SCL_DEBUG();
+#ifdef USING_KEY_GRAB
+    m_keyboard_grabbed = FALSE;
+#endif
+    m_focus_key = NOT_USED;
+    m_focus_window = SCLWINDOW_INVALID;
+
+#ifdef TARGET_EMULATOR
+    create_sniffer_window();
+#endif
+}
+
+/**
+ * Destructor
+ */
+CSCLKeyFocusHandler::~CSCLKeyFocusHandler()
+{
+    SCL_DEBUG();
+}
+
+CSCLKeyFocusHandler*
+CSCLKeyFocusHandler::get_instance()
+{
+    static CSCLKeyFocusHandler instance;
+    return &instance;
+}
+
+#ifdef USING_KEY_GRAB
+/**
+ * Grabs the navigation and Return keys
+ */
+bool
+CSCLKeyFocusHandler::grab_keyboard(const sclwindow parent)
+{
+    Evas_Object *window = (Evas_Object *)parent;
+    Ecore_X_Window x_window = elm_win_xwindow_get(window);
+
+    Display *x_display = (Display *)ecore_x_display_get();
+    int grab_result;
+
+    grab_result = utilx_grab_key(x_display, x_window, "Return", EXCLUSIVE_GRAB);
+    if (0 == grab_result) {
+        LOGD("Return Key Grabbed successfully\n");
+    } else if (EXCLUSIVE_GRABBED_ALREADY == grab_result) {
+        LOGD("Return Key already grabbed in Exclusiv mode\n");
+    } else {
+        LOGD("Failed to Grab Return key\n");
+    }
+    m_keyboard_grabbed = TRUE;
+    return TRUE;
+}
+
+/**
+ * UnGrabs the navigation and Return keys
+ */
+void
+CSCLKeyFocusHandler::ungrab_keyboard(const sclwindow parent)
+{
+    Evas_Object *window = (Evas_Object *)parent;
+    Ecore_X_Window x_window = elm_win_xwindow_get(window);
+    Display *x_display = (Display *)ecore_x_display_get();
+    int grab_result;
+    grab_result = utilx_ungrab_key(x_display, x_window, "Return");
+    if(0 == grab_result) {
+        LOGD("Return Key UnGrabbed successfully\n");
+    } else {
+        LOGD("Failed to UnGrab Return key\n");
+    }
+    m_keyboard_grabbed = FALSE;
+}
+
+#endif /*USING_KEY_GRAB*/
+
+
+void
+CSCLKeyFocusHandler::popup_opened(sclwindow window)
+{
+
+}
+
+void
+CSCLKeyFocusHandler::popup_closed(sclwindow window)
+{
+    sclshort layout = NOT_USED;
+    CSCLContext *context = CSCLContext::get_instance();
+    CSCLWindows *windows = CSCLWindows::get_instance();
+    SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    PSclLayoutKeyCoordinatePointerTable sclres_layout_key_coordinate_pointer_frame = NULL;
+
+    if (context && windows && sclres_manager) {
+        sclres_layout_key_coordinate_pointer_frame = sclres_manager->get_key_coordinate_pointer_frame();
+        layout = context->get_popup_layout(m_focus_window);
+    }
+    if (sclres_layout_key_coordinate_pointer_frame &&
+        scl_check_arrindex(layout, MAX_SCL_LAYOUT) && scl_check_arrindex(m_focus_key, MAX_KEY)) {
+            SclLayoutKeyCoordinatePointer cur = sclres_layout_key_coordinate_pointer_frame[layout][m_focus_key];
+            SclWindowContext *window_context = windows->get_window_context(m_focus_window);
+            SclRectangle cur_key_coordinate;
+            if (window_context) {
+                cur_key_coordinate.x = cur->x + window_context->geometry.x;
+                cur_key_coordinate.y = cur->y + window_context->geometry.y;
+                cur_key_coordinate.width = cur->width;
+                cur_key_coordinate.height = cur->height;
+            }
+
+            m_focus_window = windows->get_base_window();
+            m_focus_key = get_next_candidate_key(HIGHLIGHT_NAVIGATE_NONE, cur_key_coordinate, windows->get_base_window()).candidate;
+    }
+}
+
+/**
+ * Resets the navigation info
+ */
+void
+CSCLKeyFocusHandler::reset_key_navigation_info(sclwindow window)
+{
+    CSCLWindows *windows = CSCLWindows::get_instance();
+    if (windows) {
+        if (windows->is_base_window(window)) {
+            m_focus_window = window;
+            m_focus_key = 0;
+        }
+    }
+}
+
+/**
+ * Compares the sub-layout values
+ */
+inline bool
+CSCLKeyFocusHandler::sub_layout_match(sclchar *layout1,sclchar *layout2)
+{
+    if (layout1) {
+        if (layout2) {
+            if (strcmp(layout1, layout2) == 0) {
+                return TRUE;
+            }
+        }
+    } else if (layout2) {
+        return FALSE;
+    } else {
+        return TRUE;
+    }
+    return FALSE;
+}
+
+/**
+ * Builds the key navigation info
+ */
+void
+CSCLKeyFocusHandler::update_key_navigation_info(sclwindow window, scl8 index, SclLayoutKeyCoordinatePointer p_next_key)
+{
+
+}
+
+/**
+ * Finalize the navigation info
+ */
+void
+CSCLKeyFocusHandler::finalize_key_navigation_info(sclwindow window)
+{
+
+}
+
+/**
+ * Initializes the key index to first key of first row
+ */
+void
+CSCLKeyFocusHandler::init_key_index()
+{
+
+}
+
+/**
+ * Returns the currently focused key index
+ */
+scl8
+CSCLKeyFocusHandler::get_current_focus_key(void)
+{
+    return m_focus_key;
+}
+
+/**
+ * Returns the currently focused window
+ */
+sclwindow
+CSCLKeyFocusHandler::get_current_focus_window(void)
+{
+    return m_focus_window;
+}
+
+#ifndef min
+#define min(a,b)    (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef max
+#define max(a,b)    (((a) > (b)) ? (a) : (b))
+#endif
+/* If 2 lines overlap, this will return minus value of overlapping length,
+    and return positive distance value otherwise */
+int calculate_distance(int start_1, int end_1, int start_2, int end_2)
+{
+    return -1 * (min(end_1, end_2) - max(start_1, start_2));
+}
+
+/**
+ * Computes and Returns the key index for next focussed key depending upon the navigation direction
+ */
+NEXT_CANDIDATE_INFO
+CSCLKeyFocusHandler::get_next_candidate_key(SCLHighlightNavigationDirection direction, SclRectangle cur, sclwindow window)
+{
+    NEXT_CANDIDATE_INFO ret;
+    ret.candidate = NOT_USED;
+    ret.candidate_otherside = NOT_USED;
+
+    int candidate = NOT_USED;
+    int candidate_distance_x = INT_MAX;
+    int candidate_distance_y = INT_MAX;
+
+    int otherside_candidate = NOT_USED;
+
+    sclshort layout = NOT_USED;
+
+    CSCLContext *context = CSCLContext::get_instance();
+    CSCLWindows *windows = CSCLWindows::get_instance();
+    CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+
+    SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    PSclLayoutKeyCoordinatePointerTable sclres_layout_key_coordinate_pointer_frame = NULL;
+
+    if (context && windows && sclres_manager) {
+        sclres_layout_key_coordinate_pointer_frame = sclres_manager->get_key_coordinate_pointer_frame();
+
+        if (windows->is_base_window(window)) {
+            layout = context->get_base_layout();
+        } else {
+            layout = context->get_popup_layout(window);
+        }
+    }
+    if (sclres_layout_key_coordinate_pointer_frame && cache && scl_check_arrindex(layout, MAX_SCL_LAYOUT)) {
+        for (sclint loop = 0;loop < MAX_KEY; loop++) {
+            SclLayoutKeyCoordinatePointer p = sclres_layout_key_coordinate_pointer_frame[layout][loop];
+            if (p && (loop != m_focus_key || window != m_focus_window)) {
+                if (p->sub_layout && context->get_cur_sublayout()) {
+                    if (!sub_layout_match(p->sub_layout, context->get_cur_sublayout())) {
+                        continue;
+                    }
+                }
+                SclWindowContext *window_context = windows->get_window_context(window);
+                SclRectangle btn = {0, 0, 0, 0};
+                if (window_context) {
+                    btn.x = p->x + window_context->geometry.x;
+                    btn.y = p->y + window_context->geometry.y;
+                    btn.width = p->width;
+                    btn.height = p->height;
+                }
+                if (windows->is_base_window(window)) {
+                    btn.x += cache->get_custom_starting_coordinates().x;
+                    btn.y += cache->get_custom_starting_coordinates().y;
+                }
+
+                int temp_distance_x;
+                int temp_distance_y;
+
+                switch(direction) {
+                    case HIGHLIGHT_NAVIGATE_LEFT:
+                        temp_distance_y = calculate_distance(btn.y, btn.y + btn.height, cur.y, cur.y + cur.height);
+                        //if (temp_distance_y <= candidate_distance_y) {
+                        if (temp_distance_y <= candidate_distance_y && temp_distance_y < 0) {
+                            /* If the button is closer in Y axis, consider this to be the closer regardless of X */
+                            if (temp_distance_y < candidate_distance_y) {
+                                candidate_distance_x = INT_MAX;
+                            }
+                            /* Save for otherside */
+                            otherside_candidate = loop;
+                            temp_distance_x = calculate_distance(btn.x, btn.x + btn.width, cur.x, cur.x + cur.width);
+                            if (temp_distance_x < candidate_distance_x) {
+                                if (btn.x < cur.x) {
+                                    candidate = loop;
+                                    candidate_distance_x = temp_distance_x;
+                                    candidate_distance_y = temp_distance_y;
+                                }
+                            }
+                        }
+                        break;
+                    case HIGHLIGHT_NAVIGATE_RIGHT:
+                        temp_distance_y = calculate_distance(btn.y, btn.y + btn.height, cur.y, cur.y + cur.height);
+                        //if (temp_distance_y <= candidate_distance_y) {
+                        if (temp_distance_y <= candidate_distance_y && temp_distance_y < 0) {
+                            /* If the button is closer in Y axis, consider this to be the closer regardless of X */
+                            if (temp_distance_y < candidate_distance_y) {
+                                candidate_distance_x = INT_MAX;
+                            }
+                            /* Save for otherside */
+                            if (otherside_candidate == NOT_USED) {
+                                otherside_candidate = loop;
+                            }
+                            temp_distance_x = calculate_distance(btn.x, btn.x + btn.width, cur.x, cur.x + cur.width);
+                            if (temp_distance_x < candidate_distance_x) {
+                                if (btn.x > cur.x) {
+                                    candidate = loop;
+                                    candidate_distance_x = temp_distance_x;
+                                    candidate_distance_y = temp_distance_y;
+                                }
+                            }
+                        }
+                        break;
+                    case HIGHLIGHT_NAVIGATE_UP:
+                        temp_distance_x = calculate_distance(btn.x, btn.x + btn.width, cur.x, cur.x + cur.width);
+                        if (temp_distance_x <= candidate_distance_x) {
+                            /* If the button is closer in X axis, consider this to be the closer regardless of Y */
+                            if (temp_distance_x < candidate_distance_x) {
+                                candidate_distance_y = INT_MAX;
+                            }
+                            temp_distance_y = calculate_distance(btn.y, btn.y + btn.height, cur.y, cur.y + cur.height);
+                            if (temp_distance_y < candidate_distance_y) {
+                                if (btn.y < cur.y) {
+                                    candidate = loop;
+                                    candidate_distance_x = temp_distance_x;
+                                    candidate_distance_y = temp_distance_y;
+                                }
+                            }
+                        }
+                        break;
+                    case HIGHLIGHT_NAVIGATE_DOWN:
+                        temp_distance_x = calculate_distance(btn.x, btn.x + btn.width, cur.x, cur.x + cur.width);
+                        if (temp_distance_x <= candidate_distance_x) {
+                            /* If the button is closer in X axis, consider this to be the closer regardless of Y */
+                            if (temp_distance_x < candidate_distance_x) {
+                                candidate_distance_y = INT_MAX;
+                            }
+                            temp_distance_y = calculate_distance(btn.y, btn.y + btn.height, cur.y, cur.y + cur.height);
+                            if (temp_distance_y < candidate_distance_y) {
+                                if (btn.y > cur.y) {
+                                    candidate = loop;
+                                    candidate_distance_x = temp_distance_x;
+                                    candidate_distance_y = temp_distance_y;
+                                }
+                            }
+                        }
+                        break;
+                    default:
+                        temp_distance_y = calculate_distance(btn.y, btn.y + btn.height, cur.y, cur.y + cur.height);
+                        if (temp_distance_y <= candidate_distance_y) {
+                            temp_distance_x = calculate_distance(btn.x, btn.x + btn.width, cur.x, cur.x + cur.width);
+                            if (temp_distance_x <= candidate_distance_x) {
+                                candidate = loop;
+                                candidate_distance_x = temp_distance_x;
+                                candidate_distance_y = temp_distance_y;
+                            }
+                        }
+                        break;
+                }
+            }
+        }
+
+        ret.candidate = candidate;
+        ret.candidate_otherside = otherside_candidate;
+    }
+
+    return ret;
+}
+
+static void copy_rectangle(SclLayoutKeyCoordinatePointer src, SclRectangle *dest)
+{
+    if (src && dest) {
+        (dest)->x = (src)->x;
+        (dest)->y = (src)->y;
+        (dest)->width = (src)->width;
+        (dest)->height = (src)->height;
+    }
+}
+
+void
+CSCLKeyFocusHandler::process_navigation(SCLHighlightNavigationDirection direction)
+{
+    CSCLContext *context = CSCLContext::get_instance();
+    CSCLWindows *windows = CSCLWindows::get_instance();
+    CSCLEventHandler *handler = CSCLEventHandler::get_instance();
+    CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+    SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    sclshort layout = NOT_USED;
+
+    sclwindow prev_window = m_focus_window;
+    scl8 prev_key = m_focus_key;
+    sclwindow next_window = m_focus_window;
+    scl8 next_key = m_focus_key;
+
+    PSclLayoutKeyCoordinatePointerTable sclres_layout_key_coordinate_pointer_frame = NULL;
+
+    if (context && windows && handler && sclres_manager) {
+        sclres_layout_key_coordinate_pointer_frame = sclres_manager->get_key_coordinate_pointer_frame();
+
+        if (windows->is_base_window(m_focus_window)) {
+            layout = context->get_base_layout();
+        } else {
+            layout = context->get_popup_layout(m_focus_window);
+        }
+    }
+
+    if (sclres_layout_key_coordinate_pointer_frame && context->get_highlight_ui_enabled() &&
+        scl_check_arrindex(layout, MAX_SCL_LAYOUT) && scl_check_arrindex(m_focus_key, MAX_KEY)) {
+        SclLayoutKeyCoordinatePointer cur = sclres_layout_key_coordinate_pointer_frame[layout][m_focus_key];
+
+        /* To compare with buttons in popup window, let's convert to global coordinates */
+        SclWindowContext *window_context = windows->get_window_context(m_focus_window);
+        SclRectangle cur_key_coordinate;
+        if (window_context && cur && cache) {
+            cur_key_coordinate.x = cur->x + window_context->geometry.x;
+            cur_key_coordinate.y = cur->y + window_context->geometry.y;
+            cur_key_coordinate.width = cur->width;
+            cur_key_coordinate.height = cur->height;
+
+            if (windows->is_base_window(m_focus_window)) {
+                cur_key_coordinate.x += cache->get_custom_starting_coordinates().x;
+                cur_key_coordinate.y += cache->get_custom_starting_coordinates().y;
+            }
+        }
+
+        NEXT_CANDIDATE_INFO base_candidate;
+        base_candidate.candidate = base_candidate.candidate_otherside = NOT_USED;
+        NEXT_CANDIDATE_INFO popup_candidate;
+        popup_candidate.candidate = popup_candidate.candidate_otherside = NOT_USED;
+        sclboolean search_in_base_window = TRUE;
+        sclboolean exclude_popup_covered_area = FALSE;
+
+        if (!windows->is_base_window(windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP))) {
+            if (cache && scl_check_arrindex(window_context->inputmode, MAX_SCL_INPUT_MODE)) {
+                const SclLayout *cur_layout =
+                    cache->get_cur_layout(windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP));
+                if (cur_layout) {
+                    if (!(cur_layout->use_sw_background) || cur_layout->bg_color.a != 0) {
+                        const PSclInputModeConfigure sclres_input_mode_configure =
+                            sclres_manager->get_input_mode_configure_table();
+                        if (sclres_input_mode_configure[window_context->inputmode].use_dim_window) {
+                            search_in_base_window = FALSE;
+                        } else {
+                            exclude_popup_covered_area = TRUE;
+                        }
+                    }
+                }
+            }
+            popup_candidate = get_next_candidate_key(direction, cur_key_coordinate,
+                windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP));
+        }
+        /* Now search buttons in base window */
+        if (search_in_base_window) {
+            base_candidate = get_next_candidate_key(direction, cur_key_coordinate, windows->get_base_window());
+        }
+
+        if (popup_candidate.candidate == NOT_USED && base_candidate.candidate != NOT_USED) {
+            next_window = windows->get_base_window();
+            next_key = base_candidate.candidate;
+        } else if (popup_candidate.candidate != NOT_USED && base_candidate.candidate == NOT_USED) {
+            next_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+            next_key = popup_candidate.candidate;
+        } else if (popup_candidate.candidate == NOT_USED && base_candidate.candidate == NOT_USED) {
+            if (base_candidate.candidate_otherside != NOT_USED) {
+                next_window = windows->get_base_window();
+                next_key = base_candidate.candidate_otherside;
+            } else if (popup_candidate.candidate_otherside != NOT_USED) {
+                next_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+                next_key = popup_candidate.candidate;
+            }
+        } else {
+            /* Compare those 2 candidates */
+            sclwindow popup_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+            sclshort base_layout = context->get_base_layout();
+            sclshort popup_layout = context->get_popup_layout(popup_window);
+
+            SclLayoutKeyCoordinatePointer base_key =
+                sclres_layout_key_coordinate_pointer_frame[base_layout][base_candidate.candidate];
+            SclLayoutKeyCoordinatePointer popup_key =
+                sclres_layout_key_coordinate_pointer_frame[popup_layout][popup_candidate.candidate];
+
+            SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+            SclWindowContext *popup_window_context = windows->get_window_context(popup_window);
+
+            SclRectangle base_key_coordinate;
+            if (base_window_context) {
+                base_key_coordinate.x = base_key->x + base_window_context->geometry.x;
+                base_key_coordinate.y = base_key->y + base_window_context->geometry.y;
+                base_key_coordinate.width = base_key->width;
+                base_key_coordinate.height = base_key->height;
+
+                base_key_coordinate.x += cache->get_custom_starting_coordinates().x;
+                base_key_coordinate.y += cache->get_custom_starting_coordinates().y;
+            }
+
+            SclRectangle popup_key_coordinate = {0, 0, 0, 0};
+            if (popup_window_context) {
+                popup_key_coordinate.x = popup_key->x + popup_window_context->geometry.x;
+                popup_key_coordinate.y = popup_key->y + popup_window_context->geometry.y;
+                popup_key_coordinate.width = popup_key->width;
+                popup_key_coordinate.height = popup_key->height;
+            }
+
+            if (exclude_popup_covered_area) {
+                CSCLUtils *utils = CSCLUtils::get_instance();
+                if (utils) {
+                    /* If the base candidate key is covered by popup window, do not choose it */
+                    if (utils->is_rect_overlap(base_key_coordinate, popup_window_context->geometry)) {
+                        base_candidate.candidate = NOT_USED;
+                    }
+                }
+            }
+            /* If the base candidate key wasn't excluded */
+            if (base_candidate.candidate != NOT_USED) {
+                int base_distance_x = INT_MAX;
+                int base_distance_y = INT_MAX;
+                int popup_distance_x = INT_MAX;
+                int popup_distance_y = INT_MAX;
+
+                base_distance_x = calculate_distance(
+                    cur_key_coordinate.x, cur_key_coordinate.x + cur_key_coordinate.width,
+                    base_key_coordinate.x, base_key_coordinate.x + base_key_coordinate.width);
+                base_distance_y = calculate_distance(
+                    cur_key_coordinate.y, cur_key_coordinate.y + cur_key_coordinate.height,
+                    base_key_coordinate.y, base_key_coordinate.y + base_key_coordinate.height);
+
+                popup_distance_x = calculate_distance(
+                    cur_key_coordinate.x, cur_key_coordinate.x + cur_key_coordinate.width,
+                    popup_key_coordinate.x, popup_key_coordinate.x + popup_key_coordinate.width);
+                popup_distance_y = calculate_distance(
+                    cur_key_coordinate.y, cur_key_coordinate.y + cur_key_coordinate.height,
+                    popup_key_coordinate.y, popup_key_coordinate.y + popup_key_coordinate.height);
+
+                if (direction == HIGHLIGHT_NAVIGATE_LEFT || direction == HIGHLIGHT_NAVIGATE_RIGHT) {
+                    int minimum_distance = -1 * (cur_key_coordinate.height / 3);
+                    if (base_distance_y > minimum_distance && popup_distance_y > minimum_distance) {
+                        minimum_distance = 0;
+                    }
+                    if (base_distance_y < minimum_distance && popup_distance_y < minimum_distance) {
+                        if (base_distance_x < popup_distance_x) {
+                            next_window = windows->get_base_window();
+                            next_key = base_candidate.candidate;
+                        } else {
+                            next_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+                            next_key = popup_candidate.candidate;
+                        }
+                    } else if (base_distance_y < minimum_distance) {
+                        next_window = windows->get_base_window();
+                        next_key = base_candidate.candidate;
+                    } else {
+                        next_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+                        next_key = popup_candidate.candidate;
+                    }
+                } else if (direction == HIGHLIGHT_NAVIGATE_UP || direction == HIGHLIGHT_NAVIGATE_DOWN) {
+                    int minimum_distance = -1 * (cur_key_coordinate.width / 3);
+                    if (base_distance_x > minimum_distance && popup_distance_x > minimum_distance) {
+                        minimum_distance = 0;
+                    }
+                    if (base_distance_x < minimum_distance && popup_distance_x < minimum_distance) {
+                        if (base_distance_y < popup_distance_y) {
+                            next_window = windows->get_base_window();
+                            next_key = base_candidate.candidate;
+                        } else {
+                            next_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+                            next_key = popup_candidate.candidate;
+                        }
+                    } else if (base_distance_x < minimum_distance) {
+                        next_window = windows->get_base_window();
+                        next_key = base_candidate.candidate;
+                    } else {
+                        next_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+                        next_key = popup_candidate.candidate;
+                    }
+                }
+            }
+        }
+
+        SclNotiHighlighNavigateDesc desc;
+        desc.direction = direction;
+        desc.window_from = prev_window;
+        desc.key_from = prev_key;
+        desc.window_to = next_window;
+        desc.key_to = next_key;
+        if (SCL_EVENT_PASS_ON == handler->on_event_notification(SCL_UINOTITYPE_HIGHLIGHT_NAVIGATE, &desc)) {
+            CSCLAnimator *animator = CSCLAnimator::get_instance();
+            if (animator) {
+                sclboolean start_animation = FALSE;
+                if (windows->is_base_window(desc.window_to) && windows->is_base_window(desc.window_from)) {
+                    if(desc.key_to != desc.key_from) {
+                        start_animation = TRUE;
+                    }
+                } else {
+                    SclWindowContext *window_context_from = windows->get_window_context(desc.window_from);
+                    SclWindowContext *window_context_to = windows->get_window_context(desc.window_to);
+                    if (window_context_from && window_context_to) {
+                        if ((windows->is_base_window(desc.window_from) || window_context_from->is_virtual) &&
+                            (windows->is_base_window(desc.window_to) || window_context_to->is_virtual)) {
+                                start_animation = TRUE;
+                        }
+                    }
+                }
+                if (start_animation &&
+                    context->get_highlight_ui_enabled() &&
+                    context->get_highlight_ui_animation_enabled() &&
+                    animator->check_animation_supported()) {
+                        sclshort layout_from = NOT_USED;
+                        sclshort layout_to = NOT_USED;
+                        if (windows->is_base_window(desc.window_from)) {
+                            layout_from = context->get_base_layout();
+                        } else {
+                            layout_from = context->get_popup_layout(desc.window_from);
+                        }
+                        if (windows->is_base_window(desc.window_to)) {
+                            layout_to = context->get_base_layout();
+                        } else {
+                            layout_to = context->get_popup_layout(desc.window_to);
+                        }
+
+                        SclLayoutKeyCoordinatePointer prev_coordinate =
+                            sclres_layout_key_coordinate_pointer_frame[layout_from][desc.key_from];
+                        SclLayoutKeyCoordinatePointer next_coordinate =
+                            sclres_layout_key_coordinate_pointer_frame[layout_to][desc.key_to];
+
+                        SclRectangle prev_rect;
+                        SclRectangle next_rect;
+                        copy_rectangle( prev_coordinate, &(prev_rect) );
+                        copy_rectangle( next_coordinate, &(next_rect) );
+
+                        if (windows->is_base_window(desc.window_from)) {
+                            prev_rect.x += cache->get_custom_starting_coordinates().x;
+                            prev_rect.y += cache->get_custom_starting_coordinates().y;
+                        } else {
+                            /* Convert popup window coordinates relative to base window */
+                            SclWindowContext *base_window_context =
+                                windows->get_window_context(windows->get_base_window());
+                            SclWindowContext *prev_window_context =
+                                windows->get_window_context(desc.window_from);
+                            if (base_window_context && prev_window_context) {
+                                prev_rect.x += (prev_window_context->geometry.x - base_window_context->geometry.x);
+                                prev_rect.y += (prev_window_context->geometry.y - base_window_context->geometry.y);
+                            }
+                        }
+                        if (windows->is_base_window(desc.window_to)) {
+                            next_rect.x += cache->get_custom_starting_coordinates().x;
+                            next_rect.y += cache->get_custom_starting_coordinates().y;
+                        } else {
+                            /* Convert popup window coordinates relative to base window */
+                            SclWindowContext *base_window_context =
+                                windows->get_window_context(windows->get_base_window());
+                            SclWindowContext *next_window_context =
+                                windows->get_window_context(desc.window_to);
+                            if (base_window_context && next_window_context) {
+                                next_rect.x += (next_window_context->geometry.x - base_window_context->geometry.x);
+                                next_rect.y += (next_window_context->geometry.y - base_window_context->geometry.y);
+                            }
+                        }
+                        /* Let's check if the navigation animation should be in circular movement */
+                        sclboolean circular = FALSE;
+                        /* If our 2 buttons overlap in Y axis */
+                        if (calculate_distance(
+                            prev_rect.y, prev_rect.y + prev_rect.height,
+                            next_rect.y, next_rect.y + next_rect.height) < 0) {
+                                /* And if those 2 buttons are side buttons, let's run the animation in circular mode */
+                                if (prev_coordinate->is_side_button && next_coordinate->is_side_button) {
+                                    circular = TRUE;
+                                }
+                        }
+
+                        sclint id = animator->find_animator_by_type(ANIMATION_TYPE_HIGHLIGHT_UI);
+                        if (id == NOT_USED) {
+                            SclAnimationDesc animdesc;
+                            animdesc.type = ANIMATION_TYPE_HIGHLIGHT_UI;
+                            animdesc.length = SCL_ANIMATION_TIME;
+
+                            animdesc.rect_from = prev_rect;
+                            animdesc.rect_to = next_rect;
+
+                            animdesc.window_from = desc.window_from;
+                            animdesc.window_to = desc.window_to;
+                            animdesc.circular = circular;
+
+                            id = animator->create_animator(&animdesc);
+                            animator->start_animator(id);
+                        } else {
+                            SclAnimationState *state = animator->get_animation_state(id);
+                            if (state) {
+                                if (state->active) {
+                                    /* FIXME : When we have time later,
+                                        let's use the currect rect so that the animation starts from the current position,
+                                        considering the circular movement case */
+                                    //state->desc.rect_from = state->rect_cur;
+                                    state->desc.rect_from = prev_rect;
+                                } else {
+                                    state->active = TRUE;
+                                    state->desc.rect_from = prev_rect;
+                                }
+                                state->step = 0;
+                                state->desc.circular = circular;
+
+                                state->desc.rect_to = next_rect;
+
+                                state->desc.window_from = desc.window_from;
+                                state->desc.window_to = desc.window_to;
+                            }
+                            animator->start_animator(id);
+                        }
+                }
+            }
+            m_focus_window = desc.window_to;
+            m_focus_key = desc.key_to;
+        }
+    }
+}
+
+#ifdef TARGET_EMULATOR
+
+static Ecore_Event_Handler *_sniffer_win_show_handler         = NULL;
+
+/**
+ * ecore event handler deletion
+ */
+static void delete_sniffer_win_show_handler (void)
+{
+    if (_sniffer_win_show_handler) {
+        ecore_event_handler_del (_sniffer_win_show_handler);
+        _sniffer_win_show_handler = NULL;
+    }
+}
+
+/**
+ * callback for window show event (sniffer window)
+ */
+static Eina_Bool x_event_sniffer_window_show_cb (void *data, int ev_type, void *event)
+{
+
+    Evas_Object *evas_window = (Evas_Object *)data;
+    Ecore_X_Window x_window = elm_win_xwindow_get(evas_window);
+    Ecore_X_Event_Window_Show *e = (Ecore_X_Event_Window_Show*)event;
+
+    if (e->win == x_window) {
+
+        LOGD("INSIDE =-=-=-=- x_event_sniffer_window_show_cb, Trying to Grab Key Board : \n");
+        Eina_Bool ret = ecore_x_keyboard_grab(x_window);
+
+        if (EINA_TRUE == ret) {
+            LOGD("Keyboard Grabbed successfully by sniffer\n");
+        } else {
+            LOGD("Failed to Grab keyboard by sniffer\n");
+        }
+        ecore_event_handler_del(_sniffer_win_show_handler);
+        return ECORE_CALLBACK_CANCEL;
+    }
+    LOGD("Wrong window .. renewing callback\n");
+    return ECORE_CALLBACK_RENEW;
+}
+
+/**
+ * sniffer window creation function, the keyboard would be grabbed by this window in case of Tizen Emulator
+ */
+void
+CSCLKeyFocusHandler::create_sniffer_window(void)
+{
+    LOGD("CSCLKeyFocusHandler : INSIDE =-=-=-=- create_sniffer_window : \n");
+    Evas_Object *win = NULL;
+
+    win = elm_win_add(NULL, "KEY_SNIFFER", ELM_WIN_UTILITY);
+
+    elm_win_borderless_set(win, EINA_TRUE);
+    elm_win_alpha_set(win, EINA_FALSE);
+    elm_win_title_set(win, "KEY_SNIFFER");
+    elm_win_fullscreen_set(win,EINA_FALSE);
+    set_window_accepts_focus(win, FALSE);
+    evas_object_show(win);
+    evas_object_resize(win, 100, 100);
+    m_sniffer = win;
+    _sniffer_win_show_handler = ecore_event_handler_add (ECORE_X_EVENT_WINDOW_SHOW, x_event_sniffer_window_show_cb, m_sniffer);
+}
+
+void
+CSCLKeyFocusHandler::set_window_accepts_focus(const sclwindow window, sclboolean acceptable)
+{
+    Eina_Bool accepts_focus;
+    Ecore_X_Window_State_Hint initial_state;
+    Ecore_X_Pixmap icon_pixmap;
+    Ecore_X_Pixmap icon_mask;
+    Ecore_X_Window icon_window;
+    Ecore_X_Window window_group;
+    Eina_Bool is_urgent;
+
+    if (window) {
+        ecore_x_icccm_hints_get(elm_win_xwindow_get(static_cast<Evas_Object*>(window)),
+            &accepts_focus, &initial_state, &icon_pixmap, &icon_mask, &icon_window, &window_group, &is_urgent);
+        ecore_x_icccm_hints_set(elm_win_xwindow_get(static_cast<Evas_Object*>(window)),
+            acceptable, initial_state, icon_pixmap, icon_mask, icon_window, window_group, is_urgent);
+    }
+}
+
+
+#endif
+
+
index d980cd0..84c40bb 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -26,6 +26,9 @@
 #include "scluibuilder.h"
 #include "sclres_manager.h"
 #include <assert.h>
+
+//Includes for CSCLKeyFocusHandler
+#include "sclkeyfocushandler.h"
 using namespace scl;
 
 CSCLResourceCache::CSCLResourceCache()
@@ -55,6 +58,10 @@ CSCLResourceCache::init()
 
     resize_resource_elements_by_resolution();
 
+    mCurStartingCoordinates.x = 0;
+    mCurStartingCoordinates.y = 0;
+    mCurStartingCoordinatesOption = SCL_STARTING_COORDINATES_OPTION_ALL;
+
     return TRUE;
 }
 
@@ -195,7 +202,7 @@ CSCLResourceCache::resize_resource_elements_by_resolution()
         const PSclLabelPropertiesTable sclres_label_properties = sclres_manager->get_label_properties_frame();
         const PSclAutoPopupConfigure sclres_autopopup_configure = sclres_manager->get_autopopup_configure();
         const PSclMagnifierWndConfigure sclres_magnifier_configure = sclres_manager->get_magnifier_configure();
-        
+
         assert(sclres_default_configure != NULL);
         assert(sclres_input_mode_configure != NULL);
         assert(sclres_modifier_decoration != NULL);
@@ -318,7 +325,7 @@ CSCLResourceCache::copy_from_privatekeyproperties(const SclPrivateKeyProperties*
             for (inner_loop = 0;inner_loop < MAX_SIZE_OF_LABEL_FOR_ONE;inner_loop++) {
                 if (!(privProperties->label[loop][inner_loop].empty())) {
                     coordinate->label[loop][inner_loop] =
-                        (sclchar*)privProperties->label[loop][inner_loop].c_str();
+                        const_cast<sclchar*>(privProperties->label[loop][inner_loop].c_str());
                 }
             }
         }
@@ -326,7 +333,7 @@ CSCLResourceCache::copy_from_privatekeyproperties(const SclPrivateKeyProperties*
             for (inner_loop = 0;inner_loop < SCL_BUTTON_STATE_MAX;inner_loop++) {
                 if (!(privProperties->image_label_path[loop][inner_loop].empty())) {
                     coordinate->image_label_path[loop][inner_loop] =
-                        (sclchar*)privProperties->image_label_path[loop][inner_loop].c_str();
+                        const_cast<sclchar*>(privProperties->image_label_path[loop][inner_loop].c_str());
                 }
             }
         }
@@ -334,7 +341,7 @@ CSCLResourceCache::copy_from_privatekeyproperties(const SclPrivateKeyProperties*
             for (inner_loop = 0;inner_loop < SCL_BUTTON_STATE_MAX;inner_loop++) {
                 if (!(privProperties->bg_image_path[loop][inner_loop].empty())) {
                     coordinate->bg_image_path[loop][inner_loop] =
-                        (sclchar*)privProperties->bg_image_path[loop][inner_loop].c_str();
+                        const_cast<sclchar*>(privProperties->bg_image_path[loop][inner_loop].c_str());
                 }
             }
         }
@@ -343,7 +350,7 @@ CSCLResourceCache::copy_from_privatekeyproperties(const SclPrivateKeyProperties*
             for (inner_loop = 0;inner_loop < MAX_SIZE_OF_MULTITAP_CHAR;inner_loop++) {
                 if (!(privProperties->key_value[loop][inner_loop].empty())) {
                     coordinate->key_value[loop][inner_loop] =
-                        (sclchar*)privProperties->key_value[loop][inner_loop].c_str();
+                        const_cast<sclchar*>(privProperties->key_value[loop][inner_loop].c_str());
                 }
             }
         }
@@ -359,7 +366,7 @@ CSCLResourceCache::copy_from_privatekeyproperties(const SclPrivateKeyProperties*
             for (inner_loop = 0;inner_loop < MAX_SIZE_OF_MULTITAP_CHAR;inner_loop++) {
                 if (!(privProperties->hint_string[loop][inner_loop].empty())) {
                     coordinate->hint_string[loop][inner_loop] =
-                        (sclchar*)privProperties->hint_string[loop][inner_loop].c_str();
+                        const_cast<sclchar*>(privProperties->hint_string[loop][inner_loop].c_str());
                 }
             }
         }
@@ -745,7 +752,7 @@ CSCLResourceCache::add_private_key(SclPrivateKeyProperties* privProperties, sclb
     ret = loop;
 
     sclboolean found = FALSE;
-    for (sclint loop = 0;loop < MAX_KEY; loop++) {
+    for (loop = 0;loop < MAX_KEY; loop++) {
         if ((!(privProperties->custom_id.empty())) && mCurBaseLayoutKeyCoordinates[loop].custom_id) {
             if (privProperties->custom_id.compare(mCurBaseLayoutKeyCoordinates[loop].custom_id) == 0) {
                 /* sets the current properties to private key properties */
@@ -800,7 +807,7 @@ CSCLResourceCache::remove_private_key(sclint id)
         return FALSE;
     }
     if (scl_check_arrindex(layout, MAX_SCL_LAYOUT)) {
-        for (sclint loop = 0;loop < MAX_KEY; loop++) {
+        for (loop = 0;loop < MAX_KEY; loop++) {
             if ((!(mPrivateKeyProperties[id].custom_id.empty())) && mCurBaseLayoutKeyCoordinates[loop].custom_id) {
                 if (mPrivateKeyProperties[id].custom_id.compare(mCurBaseLayoutKeyCoordinates[loop].custom_id) == 0) {
                     SclLayoutKeyCoordinatePointer p = sclres_layout_key_coordinate_pointer_frame[layout][loop];
@@ -875,7 +882,6 @@ CSCLResourceCache::recompute_layout(sclwindow window)
 
     sclshort layout =  NOT_USED;
     if (windows && context && utils) {
-        sclbyte display = context->get_display_mode();
         sclbyte inputmode = context->get_input_mode();
 
         if (windows->is_base_window(window)) {
@@ -909,13 +915,13 @@ CSCLResourceCache::recompute_layout(sclwindow window)
 
             if (popupindex >= 0 && popupindex < MAX_POPUP_WINDOW) {
                 if (!(windows->is_base_window(window))) {
-                    SclWindowContext *winctx = windows->get_window_context(window);
-                    if (winctx) {
-                        if (winctx->inputmode != NOT_USED) {
-                            inputmode = winctx->inputmode;
+                    SclWindowContext *window_context = windows->get_window_context(window);
+                    if (window_context) {
+                        if (window_context->inputmode != NOT_USED) {
+                            inputmode = window_context->inputmode;
                         }
-                        if (winctx->layout != NOT_USED) {
-                            layout = winctx->layout;
+                        if (window_context->layout != NOT_USED) {
+                            layout = window_context->layout;
                         }
                     }
                 }
@@ -928,6 +934,7 @@ CSCLResourceCache::recompute_layout(sclwindow window)
         }
 
         if (pCurLayout && pCurLayoutKeyCoordinate && pCurButtonContext) {
+            memset(pCurButtonContext, 0x00, sizeof(SclButtonContext) * MAX_KEY);
             /* If the layout index represents system-defined autopopup, generate layout and key properties data */
             if (layout == SCL_LAYOUT_AUTOPOPUP) {
                 const SclLayoutKeyCoordinate *coordinate =
@@ -945,11 +952,16 @@ CSCLResourceCache::recompute_layout(sclwindow window)
                         if (!p) break;
                         memcpy((SclLayoutKeyCoordinatePointer)pCurLayoutKeyCoordinate + i, p, sizeof(SclLayoutKeyCoordinate));
                     }
-                    memset(pCurButtonContext, 0x00, sizeof(SclButtonContext) * MAX_KEY);
 
+                    CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
+                    //reset navigation info
+                    focus_handler->reset_key_navigation_info(window);
                     for (loop = 0;loop < MAX_KEY;loop++) {
                         SclLayoutKeyCoordinatePointer p = sclres_layout_key_coordinate_pointer_frame[layout][loop];
                         if (p && p->valid) {
+                            //BUILDING KEY NAVIGATION INFO
+                            focus_handler->update_key_navigation_info(window, loop, p);
+                            //BUILDING KEY NAVIGATION INFO COMPLETED
                             (*pCurButtonContext)[loop].used = TRUE;
                             if (popupindex != NOT_USED) {
                                 change_by_privatekey(inputmode, layout, loop, &(mCurPopupLayoutKeyCoordinates[popupindex][loop]));
@@ -962,16 +974,22 @@ CSCLResourceCache::recompute_layout(sclwindow window)
                             }
 
                             /* If this button's custom id is in the disabled key list, make it disabled */
+                            sclboolean found = false;
                             if ((*pCurLayoutKeyCoordinate)[loop].custom_id) {
                                 for (sclint inner_loop = 0;inner_loop < MAX_DISABLED_KEY;inner_loop++) {
                                     if (!(mDisabledKeyList[inner_loop].empty())) {
                                         if (mDisabledKeyList[inner_loop].compare(
                                             (*pCurLayoutKeyCoordinate)[loop].custom_id) == 0) {
                                                 (*pCurButtonContext)[loop].state = BUTTON_STATE_DISABLED;
+                                                found = true;
                                         }
                                     }
                                 }
                             }
+                            if (!found) {
+                                (*pCurButtonContext)[loop].state = BUTTON_STATE_NORMAL;
+                            }
+                            (*pCurButtonContext)[loop].toggled = FALSE;
 
                             /* Apply the custom scale rate value */
                             (*pCurLayoutKeyCoordinate)[loop].x *= utils->get_custom_scale_rate_x();
@@ -988,8 +1006,16 @@ CSCLResourceCache::recompute_layout(sclwindow window)
                             (*pCurLayoutKeyCoordinate)[loop].extract_offset_y *= utils->get_custom_scale_rate_y();
                             (*pCurLayoutKeyCoordinate)[loop].magnifier_offset_x *= utils->get_custom_scale_rate_x();
                             (*pCurLayoutKeyCoordinate)[loop].magnifier_offset_y *= utils->get_custom_scale_rate_y();
+
+                            if (windows->is_base_window(window)) {
+                                /* Apply the custom starting coordinates */
+                                (*pCurLayoutKeyCoordinate)[loop].x += mCurStartingCoordinates.x;
+                                (*pCurLayoutKeyCoordinate)[loop].y += mCurStartingCoordinates.y;
+                            }
                         }
                     }
+                    //finalize navigation info
+                    focus_handler->finalize_key_navigation_info(window);
                 }
             }
 
@@ -1124,12 +1150,15 @@ void CSCLResourceCache::generate_autopopup_layout( const SclLayoutKeyCoordinate
     }
 
     int loop;
-    if (coordinate && autopopup_configure) {
+    if (utils && context && coordinate && autopopup_configure) {
         sclbyte num_keys, num_columns, num_rows;
         sclint x, y, width, height;
-        SCLShiftState shiftidx = context->get_shift_state();
-        if (shiftidx < 0 || shiftidx >= SCL_SHIFT_STATE_MAX) shiftidx = SCL_SHIFT_STATE_OFF;
-        if (utils->get_autopopup_window_variables(coordinate->autopopup_key_labels[shiftidx], &num_keys, &num_columns, &num_rows, &width, &height)) {
+        SCLShiftState shift_index = context->get_shift_state();
+        if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
+        if (context->get_caps_lock_mode()) {
+            shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+        }
+        if (utils->get_autopopup_window_variables(coordinate->autopopup_key_labels[shift_index], &num_keys, &num_columns, &num_rows, &width, &height)) {
             int row = 0, column = 0;
 
             pCurLayout->use_magnifier_window = FALSE;
@@ -1204,9 +1233,21 @@ void CSCLResourceCache::generate_autopopup_layout( const SclLayoutKeyCoordinate
 
                 (*pCurLayoutKeyCoordinates)[loop].valid = TRUE;
                 (*pCurLayoutKeyCoordinates)[loop].label_count = 1;
-                (*pCurLayoutKeyCoordinates)[loop].label[0][0] = coordinate->autopopup_key_labels[0][loop];
-                (*pCurLayoutKeyCoordinates)[loop].label[1][0] = coordinate->autopopup_key_labels[1][loop];
-                (*pCurLayoutKeyCoordinates)[loop].label[2][0] = coordinate->autopopup_key_labels[2][loop];
+                if (context->get_caps_lock_mode()) {
+                    (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_OFF][0] =
+                        coordinate->autopopup_key_labels[SCL_SHIFT_STATE_ON][loop];
+                    (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_ON][0] =
+                        coordinate->autopopup_key_labels[SCL_SHIFT_STATE_OFF][loop];
+                    (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_LOCK][0] =
+                        coordinate->autopopup_key_labels[SCL_SHIFT_STATE_OFF][loop];
+                } else {
+                    (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_OFF][0] =
+                        coordinate->autopopup_key_labels[SCL_SHIFT_STATE_OFF][loop];
+                    (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_ON][0] =
+                        coordinate->autopopup_key_labels[SCL_SHIFT_STATE_ON][loop];
+                    (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_LOCK][0] =
+                        coordinate->autopopup_key_labels[SCL_SHIFT_STATE_LOCK][loop];
+                }
                 //(*pCurLayoutKeyProperties)[loop].labelPropId = SCL_LABEL_PROPERTY_AUTOPOPUP;
                 (*pCurLayoutKeyCoordinates)[loop].label_type = autopopup_configure->label_type;
                 memset((*pCurLayoutKeyCoordinates)[loop].image_label_path, 0x00, sizeof((*pCurLayoutKeyCoordinates)[loop].image_label_path));
@@ -1344,8 +1385,10 @@ void CSCLResourceCache::generate_autopopup_layout( const SclLayoutKeyCoordinate
                                 (*pCurLayoutKeyCoordinates)[loop + decoidx].height =
                                     autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
                                 break;
+                            default:
+                                break;
                         }
-                        
+
                         (*pCurButtonContext)[loop + decoidx].used = TRUE;
                         (*pCurLayoutKeyCoordinates)[loop + decoidx].valid = TRUE;
                         (*pCurLayoutKeyCoordinates)[loop + decoidx].button_type = BUTTON_TYPE_UIITEM;
@@ -1397,8 +1440,8 @@ CSCLResourceCache::clone_keyproperties(SclPrivateKeyProperties* priv, sclbyte in
         clear_privatekeyproperties(priv);
 
         /* gets the value of the previous key properties */
-        sclint loop;
-        SclLayoutKeyCoordinate keyCoordinate = { 0 };
+        SclLayoutKeyCoordinate keyCoordinate;
+        memset(&keyCoordinate, 0x00, sizeof(keyCoordinate));
         if (scl_check_arrindex_unsigned(layout_index, MAX_SCL_LAYOUT) &&
             scl_check_arrindex_unsigned(key_index, MAX_KEY)) {
             SclLayoutKeyCoordinatePointer p = sclres_layout_key_coordinate_pointer_frame[layout_index][key_index];
@@ -1453,7 +1496,7 @@ CSCLResourceCache::set_private_key(SclPrivateKeyProperties* properties, sclboole
  * @param fRedraw If true, it will redraw the current key
  */
 sclint
-CSCLResourceCache::set_private_key(sclchar* custom_id, sclchar* label, sclchar* imagelabel[SCL_BUTTON_STATE_MAX], sclchar* imagebg[SCL_BUTTON_STATE_MAX], sclulong key_event, sclchar *key_value, sclboolean fRedraw, sclboolean fPendingUpdate)
+CSCLResourceCache::set_private_key(const sclchar* custom_id, sclchar* label, sclchar* imagelabel[SCL_BUTTON_STATE_MAX], sclchar* imagebg[SCL_BUTTON_STATE_MAX], sclulong key_event, sclchar *key_value, sclboolean fRedraw, sclboolean fPendingUpdate)
 {
     SCL_DEBUG();
 
@@ -1636,3 +1679,28 @@ CSCLResourceCache::find_substituted_string(const sclchar *original)
 
     return ret;
 }
+
+void
+CSCLResourceCache::set_custom_starting_coordinates(sclint x, sclint y)
+{
+    mCurStartingCoordinates.x = x;
+    mCurStartingCoordinates.y = y;
+}
+
+SclPoint
+CSCLResourceCache::get_custom_starting_coordinates()
+{
+    return mCurStartingCoordinates;
+}
+
+void
+CSCLResourceCache::set_custom_starting_coordinates_option(SCLStartingCoordinatesOption option)
+{
+    mCurStartingCoordinatesOption = option;
+}
+
+SCLStartingCoordinatesOption
+CSCLResourceCache::get_custom_starting_coordinates_option()
+{
+    return mCurStartingCoordinatesOption;
+}
index 15e4bf8..286d8f3 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -103,6 +103,54 @@ CSCLUI::set_input_mode(const sclchar *input_mode)
 }
 
 /**
+ * Returns the current input mode
+ */
+const sclchar*
+CSCLUI::get_input_mode()
+{
+    const sclchar *ret = NULL;
+
+    if (m_impl) {
+        ret = m_impl->get_input_mode();
+    }
+
+    return ret;
+}
+
+/**
+ * Sets the given popup window's input mode to the given mode
+ * @Usage
+ * gCore->set_input_mode("INPUT_MODE_SYMBOL");
+ */
+sclboolean
+CSCLUI::set_popup_input_mode(sclwindow window, const sclchar *input_mode)
+{
+    sclboolean ret = FALSE;
+
+    if (m_impl) {
+        ret = m_impl->set_popup_input_mode(window, input_mode);
+    }
+
+    return ret;
+}
+
+/**
+ * Returns the given popup window's input mode
+ */
+const sclchar*
+CSCLUI::get_popup_input_mode(sclwindow window)
+{
+    const sclchar *ret = NULL;
+
+    if (m_impl) {
+        ret = m_impl->get_popup_input_mode(window);
+    }
+
+    return ret;
+}
+
+
+/**
  * Sets the current rotation
  */
 sclboolean
@@ -148,23 +196,6 @@ CSCLUI::get_display_mode()
 }
 
 /**
- * Returns the current input mode
- */
-const sclchar*
-CSCLUI::get_input_mode()
-{
-    const sclchar *ret = NULL;
-
-    if (m_impl) {
-        ret = m_impl->get_input_mode();
-    }
-
-    return ret;
-}
-
-
-
-/**
  * Sets a private key to the current context
  * The other properties except given parameters will keep to the orginal value.
  * @Usage
@@ -232,6 +263,25 @@ CSCLUI::set_shift_state(SCLShiftState state)
     }
 }
 
+sclboolean
+CSCLUI::get_caps_lock_mode()
+{
+    sclboolean ret = FALSE;
+    if (m_impl) {
+        ret = m_impl->get_caps_lock_mode();
+    }
+    return ret;
+}
+
+void
+CSCLUI::set_caps_lock_mode(sclboolean state)
+{
+    if (m_impl) {
+        m_impl->set_caps_lock_mode(state);
+    }
+}
+
+
 /**
  * This function will be called by the user which uses SCL when the context of the focus application is changed
  * ISE user should explicitly call this function when the context of application is changed.
@@ -339,12 +389,34 @@ CSCLUI::set_custom_scale_rate(sclfloat x, sclfloat y)
 }
 
 /**
+ * Sets the custom starting coordinates for drawing the keyboard's content
+ */
+void
+CSCLUI::set_custom_starting_coordinates(sclint x, sclint y)
+{
+    if (m_impl) {
+        m_impl->set_custom_starting_coordinates(x, y);
+    }
+}
+
+/**
+ * Sets the custom starting coordinates option for drawing the keyboard's content
+ */
+void
+CSCLUI::set_custom_starting_coordinates_option(SCLStartingCoordinatesOption option)
+{
+    if (m_impl) {
+        m_impl->set_custom_starting_coordinates_option(option);
+    }
+}
+
+/**
  * Returns the scl main window size
  */
 SclRectangle
 CSCLUI::get_main_window_rect()
 {
-    SclRectangle ret = {0};
+    SclRectangle ret = {0,0,0,0};
 
     if (m_impl) {
         ret = m_impl->get_main_window_rect();
@@ -359,7 +431,7 @@ CSCLUI::get_main_window_rect()
 SclSize
 CSCLUI::get_input_mode_size(const sclchar *input_mode, SCLDisplayMode display_mode)
 {
-    SclSize ret = {0};
+    SclSize ret = {0,0};
 
     if (m_impl) {
         ret = m_impl->get_input_mode_size(input_mode, display_mode);
@@ -526,6 +598,22 @@ CSCLUI::enable_shift_multi_touch(sclboolean enabled)
 }
 
 void
+CSCLUI::enable_highlight_ui(sclboolean enabled)
+{
+    if (m_impl) {
+        m_impl->enable_highlight_ui(enabled);
+    }
+}
+
+void
+CSCLUI::enable_highlight_ui_animation(sclboolean enabled)
+{
+    if (m_impl) {
+        m_impl->enable_highlight_ui_animation(enabled);
+    }
+}
+
+void
 CSCLUI::enable_touch_offset(sclboolean enabled)
 {
     if (m_impl) {
@@ -602,3 +690,12 @@ CSCLUI::get_autocapital_shift_state() {
 
     return flag;
 }
+
+sclboolean
+CSCLUI::process_key_event(const char *key)
+{
+    if (m_impl) {
+        return m_impl->process_key_event(key);
+    }
+    return FALSE;
+}
index 05ff15a..c67d7f0 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -25,6 +25,8 @@
 #include "sclcontext.h"
 #include "sclimageproxy.h"
 #include "sclactionstate.h"
+#include "sclkeyfocushandler.h"
+#include "sclanimator.h"
 
 //#include "sclresource.h"
 #include <assert.h>
@@ -87,7 +89,8 @@ CSCLUIBuilder::init(sclwindow parent)
             mode = sclres_manager->get_inputmode_id(default_configure->input_mode);
         }
         /* Make sure these variables does not exceed the size of our array */
-        if (!scl_check_arrindex(mode, MAX_SCL_INPUT_MODE) || !scl_check_arrindex(mode, sclres_manager->get_inputmode_size())) {
+        if (!scl_check_arrindex(mode, MAX_SCL_INPUT_MODE) ||
+            !scl_check_arrindex(mode, sclres_manager->get_inputmode_size())) {
             mode = 0;
         }
         if (!scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
@@ -157,13 +160,14 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y,
     CSCLGraphics *graphics = CSCLGraphics::get_instance();
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
     CSCLContext *context = CSCLContext::get_instance();
+    CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
 
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
     PSclDefaultConfigure default_configure = NULL;
     if (sclres_manager) {
         default_configure = sclres_manager->get_default_configure();
     }
-    if (events && windows && graphics && cache && context && default_configure) {
+    if (events && windows && graphics && cache && context && focus_handler && default_configure) {
     /* FIXME : The draw_ctx should be acquired from the base window also, if the target window is virtual
        However, for ease of developement, leave the drawctx to be acquired from the target window for now
        Should modify the EFLObject list management routine after fixing the issue described above
@@ -176,12 +180,12 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y,
             /* For the magnifier window */
             ret = show_magnifier(window, draw_ctx);
         } else if (window == windows->get_dim_window()) {
-            SclWindowContext *dimctx = windows->get_window_context(window);
-            if (dimctx) {
+            SclWindowContext *dim_window_context = windows->get_window_context(window);
+            if (dim_window_context) {
                 SclSize size;
                 SclColor color;
-                size.width = dimctx->geometry.width;
-                size.height = dimctx->geometry.height;
+                size.width = dim_window_context->geometry.width;
+                size.height = dim_window_context->geometry.height;
                 color = default_configure->dim_color;
                 draw_window_bg_by_sw(window, draw_ctx, size, 0.0, color, color);
                 /*sclchar composed_path[_POSIX_PATH_MAX] = {0,};
@@ -195,33 +199,39 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y,
             // FIXME implement later
             // SclLayoutInfoCache *info_cache = cache->get_cur_layout_info_cache(window);
             if (layout) {
-                CSCLWindows *windows = CSCLWindows::get_instance();
-                //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
-                SclWindowContext *winctx = windows->get_window_context(window);
+                //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+                SclWindowContext *window_context = windows->get_window_context(window);
                 scl_assert_return_false(layout);
 
                 if (layout->use_sw_background) {
-                    if (winctx) {
+                    if (window_context) {
                         SclSize size;
-                        size.width = winctx->geometry.width;
-                        size.height = winctx->geometry.height;
+                        size.width = window_context->geometry.width;
+                        size.height = window_context->geometry.height;
                         draw_window_bg_by_sw(window, draw_ctx, size, layout->bg_line_width, layout->bg_line_color, layout->bg_color);
                     }
                 } else if (layout->image_path[BUTTON_STATE_NORMAL]) {
-                    /* If the target window is virtual window, let's draw it on the base window */
                     sclint targetx = 0;
                     sclint targety = 0;
+                    /* If the target window is virtual window, let's draw it on the base window */
                     sclwindow targetwin = window;
-                    if (winctx) {
-                        if (winctx->is_virtual) {
-                            //SclWindowContext *basectx = windows->get_window_context(windows->get_base_window(), FALSE);
-                            SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
-                            if (basectx) {
+                    if (window_context) {
+                        if (window_context->is_virtual) {
+                            /*SclWindowContext *base_window_context =
+                                windows->get_window_context(windows->get_base_window(), FALSE);*/
+                            SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+                            if (base_window_context) {
                                 targetwin = windows->get_base_window();
-                                targetx = winctx->geometry.x - basectx->geometry.x;
-                                targety = winctx->geometry.y - basectx->geometry.y;
+                                targetx = window_context->geometry.x - base_window_context->geometry.x;
+                                targety = window_context->geometry.y - base_window_context->geometry.y;
                             }
                         }
+                        /* Apply custom starting coordinates only to the base window, and if the option is ALL */
+                        if (windows->is_base_window(window) &&
+                            cache->get_custom_starting_coordinates_option() == SCL_STARTING_COORDINATES_OPTION_ALL) {
+                            targetx += cache->get_custom_starting_coordinates().x;
+                            targety += cache->get_custom_starting_coordinates().y;
+                        }
                         if (strlen(layout->image_path[BUTTON_STATE_NORMAL]) > 0) {
                             /*SclImageCachedInfo cached_info = {0, };
                             cached_info.nine_patch_left = info_cache->bg_image_path[BUTTON_STATE_NORMAL].left;
@@ -232,15 +242,59 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y,
                             sclchar composed_path[_POSIX_PATH_MAX] = {0,};
                             m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, layout->image_path[BUTTON_STATE_NORMAL]);
                             // Temporary testing for EFL backend.. Otherwise the background image covers other buttons
-                            if (winctx && (x + y + width + height == 0)) {
-                                //graphics->draw_image(targetwin, draw_ctx, composed_path, &cached_info, targetx, targety, layout->width, layout->height, winctx->layout_image_offset.x, winctx->layout_image_offset.y, -1, -1, layout->extract_background);
-                                graphics->draw_image(targetwin, draw_ctx, composed_path, NULL, targetx, targety, layout->width, layout->height,
-                                                        winctx->layout_image_offset.x, winctx->layout_image_offset.y, -1, -1, layout->extract_background);
+                            if (window_context && (x + y + width + height == 0)) {
+                                //graphics->draw_image(targetwin, draw_ctx, composed_path, &cached_info, targetx, targety, layout->width, layout->height, window_context->layout_image_offset.x, winctx->layout_image_offset.y, -1, -1, layout->extract_background);
+                                graphics->draw_image(targetwin, draw_ctx, composed_path, NULL,
+                                    targetx, targety, layout->width, layout->height,
+                                    window_context->layout_image_offset.x, window_context->layout_image_offset.y,
+                                    -1, -1, layout->extract_background);
                             }
                         }
                     }
                 }
                 draw_button_all(window, draw_ctx, x, y, width, height);
+
+                //if (highlight_ui_enabled)
+                if (focus_handler->get_current_focus_window() == window) {
+                    sclint startx = 0;
+                    sclint starty = 0;
+
+                    SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+                    if (window_context && base_window_context) {
+                        if (window_context->is_virtual) {
+                            startx += (window_context->geometry.x - base_window_context->geometry.x);
+                            starty += (window_context->geometry.y - base_window_context->geometry.y);
+                        }
+                    }
+
+                    sclboolean draw_highlight_ui = TRUE;
+                    SclAnimationState *state = NULL;
+                    CSCLAnimator *animator = CSCLAnimator::get_instance();
+                    if (animator) {
+                        sclint id = animator->find_animator_by_type(ANIMATION_TYPE_HIGHLIGHT_UI);
+                        state = animator->get_animation_state(id);
+                    }
+                    if (state) {
+                        // If currently the highlight UI is being animated, don't draw it here
+                        if (state->active) {
+                            draw_highlight_ui = FALSE;
+                        }
+                    }
+
+                    if (draw_highlight_ui && context->get_highlight_ui_enabled()) {
+                        sclchar composed_path[_POSIX_PATH_MAX] = {0,};
+                        const SclLayoutKeyCoordinate *coordinate = NULL;
+                        scl8 current_key_index = focus_handler->get_current_focus_key();
+                        coordinate = cache->get_cur_layout_key_coordinate(window, current_key_index);
+                        /* FIXME : Need to use highlight image */
+                        m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, SCL_HIGHLIGHT_UI_IMAGE);
+                        if (coordinate) {
+                            // Draw highlight
+                            graphics->draw_image(window, draw_ctx, composed_path, NULL,
+                                startx + coordinate->x, starty + coordinate->y, coordinate->width, coordinate->height);
+                        }
+                    }
+                }
             }
         }
         graphics->end_paint(window, draw_ctx);
@@ -267,13 +321,13 @@ CSCLUIBuilder::draw_button_all(const sclwindow window, const scldrawctx draw_ctx
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
     SclLayoutKeyCoordinate* coordinate = NULL;
-    SclButtonContext* btncontext = NULL;
+    SclButtonContext* button_context = NULL;
 
     if (context && cache && utils) {
         for (sclint idx = 0; idx < MAX_KEY; idx++) {
             coordinate = cache->get_cur_layout_key_coordinate(window, idx);
-            btncontext = cache->get_cur_button_context(window, idx);
-            if (coordinate && btncontext) {
+            button_context = cache->get_cur_button_context(window, idx);
+            if (coordinate && button_context) {
                 /* First check if this button is enabled in current active sublayout */
                 sclboolean subLayoutMatch = TRUE;
                 if (coordinate->sub_layout && context->get_cur_sublayout()) {
@@ -284,7 +338,11 @@ CSCLUIBuilder::draw_button_all(const sclwindow window, const scldrawctx draw_ctx
                 if (coordinate->valid && subLayoutMatch) {
                     SclRectangle itemrect = {coordinate->x, coordinate->y, coordinate->width, coordinate->height};
                     if (drawall || utils->is_rect_overlap(itemrect, updatearea)) {
-                        if (!draw_button(window, draw_ctx, idx, btncontext->state)) {
+                        SCLButtonState state = button_context->state;
+                        if (button_context->toggled) {
+                            state = BUTTON_STATE_TOGGLED;
+                        }
+                        if (!draw_button(window, draw_ctx, idx, state)) {
                             break;
                         }
                     }
@@ -312,10 +370,10 @@ CSCLUIBuilder::draw_button(const sclwindow window, scldrawctx draw_ctx, const sc
     CSCLGraphics *graphics = CSCLGraphics::get_instance();
 
     if (cache && context && graphics) {
-        SclButtonContext* btncontext = cache->get_cur_button_context(window, key_index);
+        SclButtonContext* button_context = cache->get_cur_button_context(window, key_index);
 
-        if (btncontext) {
-            if (!btncontext->used) {
+        if (button_context) {
+            if (!button_context->used) {
                 return FALSE;
             }
 
@@ -328,8 +386,8 @@ CSCLUIBuilder::draw_button(const sclwindow window, scldrawctx draw_ctx, const sc
 
             /* FIXME : There is a case that begin_pain fails. Inspection on the root cause is needed */
             if (draw_ctx) {
-                SCLShiftState shiftidx = context->get_shift_state();
-                if (shiftidx < 0 || shiftidx >= SCL_SHIFT_STATE_MAX) shiftidx = SCL_SHIFT_STATE_OFF;
+                SCLShiftState shift_index = context->get_shift_state();
+                if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
 
                 const SclLayout* layout = cache->get_cur_layout(window);
                 const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
@@ -343,22 +401,22 @@ CSCLUIBuilder::draw_button(const sclwindow window, scldrawctx draw_ctx, const sc
                         draw_button_bg_by_sw(window, draw_ctx, key_index, state);
                     } else {
                         /* check it whether uses an individual images */
-                        if (coordinate->bg_image_path[shiftidx][state]) {
-                            if (strcmp(coordinate->bg_image_path[shiftidx][state], SCL_BACKGROUND_IMAGE_STRING) != 0) {
+                        if (coordinate->bg_image_path[shift_index][state]) {
+                            if (strcmp(coordinate->bg_image_path[shift_index][state], SCL_BACKGROUND_IMAGE_STRING) != 0) {
                                 /* case 2 (uses an indivisual image) */
-                                draw_button_bg_by_img(window, draw_ctx, key_index, state, shiftidx);
+                                draw_button_bg_by_img(window, draw_ctx, key_index, state, shift_index);
                             } else {
                                 /* case 3 (uses the layout background image) */
-                                draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shiftidx);
+                                draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shift_index);
                             }
                         } else if (force_draw_bg) {
-                            draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shiftidx);
+                            draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shift_index);
                         }
                         /* case 4 (don't draw anything for button's background if image_path is NULL) */
                     }
 
                     /* 2. displaying the label of the button */
-                    draw_button_label(window, draw_ctx, key_index, state, shiftidx);
+                    draw_button_label(window, draw_ctx, key_index, state, shift_index);
                 }
             }
 
@@ -378,7 +436,7 @@ CSCLUIBuilder::draw_button(const sclwindow window, scldrawctx draw_ctx, const sc
  * @remark draw_button
  */
 sclboolean
-CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state, const sclboolean shift)
+CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, SCLButtonState state, SCLShiftState shift)
 {
     SCL_DEBUG();
 
@@ -397,16 +455,16 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c
         sclint targetaddx = 0;
         sclint targetaddy = 0;
         sclwindow targetwin = window;
-        //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
-        SclWindowContext *winctx = windows->get_window_context(window);
-        if (winctx) {
-            if (winctx->is_virtual) {
-                //SclWindowContext *basectx = windows->get_window_context(windows->get_base_window(), FALSE);
-                SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
-                if (basectx) {
+        //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+        SclWindowContext *window_context = windows->get_window_context(window);
+        if (window_context) {
+            if (window_context->is_virtual) {
+                //SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+                SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+                if (base_window_context) {
                     targetwin = windows->get_base_window();
-                    targetaddx = winctx->geometry.x - basectx->geometry.x;
-                    targetaddy = winctx->geometry.y - basectx->geometry.y;
+                    targetaddx = window_context->geometry.x - base_window_context->geometry.x;
+                    targetaddy = window_context->geometry.y - base_window_context->geometry.y;
                 }
             }
         }
@@ -433,7 +491,7 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c
                     imgSize.height = coordinate->height;
                 }
 
-                SclPoint pos = {0,};
+                SclPoint pos = {0,0};
                 const SclLabelProperties *labelproperties = cache->get_label_properties(coordinate->image_label_type, 0);
                 if (labelproperties) {
                     SCLLabelAlignment align = labelproperties->alignment;
@@ -492,7 +550,6 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c
         /* for text */
         for (int idx = 0; idx < coordinate->label_count; idx++) {
             SclFontInfo info;
-            CSCLResourceCache *cache = CSCLResourceCache::get_instance();
             const SclLabelProperties *labelproperties = cache->get_label_properties(coordinate->label_type, idx);
             if (labelproperties) {
                 const sclchar *label = coordinate->label[shift][idx];
@@ -501,10 +558,10 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c
                 /* If the button type is BUTTON_TYPE_ROTATION, display current keyvalue */
                 if (idx == 0) {
                     if (coordinate->button_type == BUTTON_TYPE_ROTATION) {
-                        SclButtonContext* btncontext = cache->get_cur_button_context(window, key_index);
-                        if (btncontext) {
-                            if (btncontext->multikeyIdx < MAX_SIZE_OF_MULTITAP_CHAR) {
-                                label = coordinate->key_value[shift][btncontext->multikeyIdx];
+                        SclButtonContext* button_context = cache->get_cur_button_context(window, key_index);
+                        if (button_context) {
+                            if (button_context->multikeyIdx < MAX_SIZE_OF_MULTITAP_CHAR) {
+                                label = coordinate->key_value[shift][button_context->multikeyIdx];
                             }
                         }
                     }
@@ -554,9 +611,9 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c
                             (sclint)coordinate->height,
                             labelproperties->alignment,
                             labelproperties->padding_x * utils->get_custom_scale_rate_x(),
-                            labelproperties->padding_y * utils->get_custom_scale_rate_x(),
+                            labelproperties->padding_y * utils->get_custom_scale_rate_y(),
                             labelproperties->inner_width * utils->get_custom_scale_rate_x(),
-                            labelproperties->inner_height * utils->get_custom_scale_rate_x()
+                            labelproperties->inner_height * utils->get_custom_scale_rate_y()
                         );
                     }
                     graphics->draw_text(
@@ -572,9 +629,9 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c
                         (sclint)coordinate->height,
                         labelproperties->alignment,
                         labelproperties->padding_x * utils->get_custom_scale_rate_x(),
-                        labelproperties->padding_y * utils->get_custom_scale_rate_x(),
+                        labelproperties->padding_y * utils->get_custom_scale_rate_y(),
                         labelproperties->inner_width * utils->get_custom_scale_rate_x(),
-                        labelproperties->inner_height * utils->get_custom_scale_rate_x()
+                        labelproperties->inner_height * utils->get_custom_scale_rate_y()
                     );
                 }
             }
@@ -598,19 +655,22 @@ CSCLUIBuilder::draw_window_bg_by_sw(const sclwindow window, const scldrawctx dra
 
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLGraphics *graphics = CSCLGraphics::get_instance();
+    CSCLResourceCache *cache = CSCLResourceCache::get_instance();
 
-    if (graphics && windows) {
+    if (graphics && windows && cache) {
         /* If the target window is virtual window, let's draw it on the base window */
         sclwindow targetwin = window;
-        //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
-        SclWindowContext *winctx = windows->get_window_context(window);
-        if (winctx) {
-            if (winctx->is_virtual) {
+        //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+        SclWindowContext *window_context = windows->get_window_context(window);
+        if (window_context) {
+            if (window_context->is_virtual) {
                 targetwin = windows->get_base_window();
             }
         }
 
-        graphics->draw_rectangle(targetwin, draw_ctx, 0, 0, size.width, size.height, line_width, line_color, TRUE, fill_color);
+        graphics->draw_rectangle(targetwin, draw_ctx,
+            cache->get_custom_starting_coordinates().x, cache->get_custom_starting_coordinates().y,
+            size.width, size.height, line_width, line_color, TRUE, fill_color);
     }
 
     return TRUE;
@@ -675,7 +735,7 @@ CSCLUIBuilder::draw_button_bg_by_sw(const sclwindow window, const scldrawctx dra
  * @remark draw_button
  */
 sclboolean
-CSCLUIBuilder::draw_button_bg_by_img(const sclwindow window, const scldrawctx draw_ctx,const scl16 key_index, const SCLButtonState state, const sclboolean shift)
+CSCLUIBuilder::draw_button_bg_by_img(const sclwindow window, const scldrawctx draw_ctx, scl16 key_index, SCLButtonState state, SCLShiftState shift)
 {
     SCL_DEBUG();
 
@@ -700,7 +760,7 @@ CSCLUIBuilder::draw_button_bg_by_img(const sclwindow window, const scldrawctx dr
         /* Check if we need to decorate the button's drag state */
         //if (context->get_cur_drag_state(context->get_last_touch_device_id()) != SCL_DRAG_STATE_NONE &&
         if (context->get_cur_key_modifier(context->get_last_touch_device_id()) != KEY_MODIFIER_NONE &&
-            context->get_cur_pressed_window(context->get_last_touch_device_id()) == window && 
+            context->get_cur_pressed_window(context->get_last_touch_device_id()) == window &&
             context->get_cur_pressed_key(context->get_last_touch_device_id()) == key_index &&
             coordinate->modifier_decorator) {
                 sclchar *decoration_bg_img = NULL;
@@ -739,16 +799,16 @@ CSCLUIBuilder::draw_button_bg_by_img(const sclwindow window, const scldrawctx dr
         sclint targetx = coordinate->x;
         sclint targety = coordinate->y;
         sclwindow targetwin = window;
-        //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
-        SclWindowContext *winctx = windows->get_window_context(window);
-        if (winctx) {
-            if (winctx->is_virtual) {
-                //SclWindowContext *basectx = windows->get_window_context(windows->get_base_window(), FALSE);
-                SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
-                if (basectx) {
+        //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+        SclWindowContext *window_context = windows->get_window_context(window);
+        if (window_context) {
+            if (window_context->is_virtual) {
+                //SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+                SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+                if (base_window_context) {
                     targetwin = windows->get_base_window();
-                    targetx += winctx->geometry.x - basectx->geometry.x;
-                    targety += winctx->geometry.y - basectx->geometry.y;
+                    targetx += window_context->geometry.x - base_window_context->geometry.x;
+                    targety += window_context->geometry.y - base_window_context->geometry.y;
                 }
             }
         }
@@ -803,16 +863,16 @@ CSCLUIBuilder::draw_button_bg_by_layoutimg(const sclwindow window, const scldraw
     scl_assert_return_false(state >= BUTTON_STATE_NORMAL && state < SCL_BUTTON_STATE_MAX);
 
     CSCLWindows *windows = CSCLWindows::get_instance();
-    //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
-    SclWindowContext *winctx = windows->get_window_context(window);
+    //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+    SclWindowContext *window_context = windows->get_window_context(window);
 
     sclchar composed_path[_POSIX_PATH_MAX] = {0,};
-    if (context && cache && coordinate && winctx) {
+    if (context && cache && coordinate && window_context) {
         sclboolean path_composed = FALSE;
         /* Check if we need to decorate the button's drag state */
         //if (context->get_cur_drag_state(context->get_last_touch_device_id()) != SCL_DRAG_STATE_NONE &&
         if (context->get_cur_key_modifier(context->get_last_touch_device_id()) != KEY_MODIFIER_NONE &&
-            context->get_cur_pressed_window(context->get_last_touch_device_id()) == window && 
+            context->get_cur_pressed_window(context->get_last_touch_device_id()) == window &&
             context->get_cur_pressed_key(context->get_last_touch_device_id()) == key_index &&
             coordinate->modifier_decorator) {
                 sclchar *decoration_bg_img = NULL;
@@ -855,8 +915,8 @@ CSCLUIBuilder::draw_button_bg_by_layoutimg(const sclwindow window, const scldraw
                 (sclint)coordinate->y - (sclint)coordinate->add_hit_top,
                 (sclint)coordinate->width + (sclint)coordinate->add_hit_left + (sclint)coordinate->add_hit_right,
                 (sclint)coordinate->height + (sclint)coordinate->add_hit_top + (sclint)coordinate->add_hit_bottom,
-                winctx->imgOffsetx + (sclint)coordinate->x - (sclint)coordinate->add_hit_left,
-                winctx->imgOffsety + (sclint)coordinate->y - (sclint)coordinate->add_hit_top,
+                window_context->imgOffsetx + (sclint)coordinate->x - (sclint)coordinate->add_hit_left,
+                window_context->imgOffsety + (sclint)coordinate->y - (sclint)coordinate->add_hit_top,
                 (sclint)coordinate->width + (sclint)coordinate->add_hit_left + (sclint)coordinate->add_hit_right,
                 (sclint)coordinate->height + (sclint)coordinate->add_hit_top + (sclint)coordinate->add_hit_bottom,
                 TRUE
@@ -864,11 +924,11 @@ CSCLUIBuilder::draw_button_bg_by_layoutimg(const sclwindow window, const scldraw
         } else {*/
             sclint dest_x = coordinate->x;
             sclint dest_y = coordinate->y;
-            if (winctx->is_virtual) {
-                SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
-                if (basectx) {
-                    dest_x += (winctx->geometry.x - basectx->geometry.x);
-                    dest_y += (winctx->geometry.y - basectx->geometry.y);
+            if (window_context->is_virtual) {
+                SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+                if (base_window_context) {
+                    dest_x += (window_context->geometry.x - base_window_context->geometry.x);
+                    dest_y += (window_context->geometry.y - base_window_context->geometry.y);
                 }
             }
 
@@ -881,8 +941,8 @@ CSCLUIBuilder::draw_button_bg_by_layoutimg(const sclwindow window, const scldraw
                 dest_y,
                 (sclint)coordinate->width,
                 (sclint)coordinate->height,
-                winctx->layout_image_offset.x + (sclint)coordinate->x,
-                winctx->layout_image_offset.y + (sclint)coordinate->y,
+                window_context->layout_image_offset.x + (sclint)coordinate->x,
+                window_context->layout_image_offset.y + (sclint)coordinate->y,
                 (sclint)coordinate->width,
                 (sclint)coordinate->height,
                 TRUE
@@ -922,9 +982,12 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx)
     CSCLWindows *windows = CSCLWindows::get_instance();
     const SclLayout *layout = cache->get_cur_layout(windows->get_base_window());
     SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
-    SclButtonContext* btncontext = cache->get_cur_button_context(pressed_window, pressed_key);
-    SCLShiftState shiftidx = context->get_shift_state();
-    if (shiftidx < 0 || shiftidx >= SCL_SHIFT_STATE_MAX) shiftidx = SCL_SHIFT_STATE_OFF;
+    SclButtonContext* button_context = cache->get_cur_button_context(pressed_window, pressed_key);
+    SCLShiftState shift_index = context->get_shift_state();
+    if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
+    if (context->get_caps_lock_mode()) {
+        shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+    }
 
     /* Do not show if current layout does not allow magnifier */
     if (!(layout->use_magnifier_window)) {
@@ -945,8 +1008,8 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx)
         }
         /* FIXME : workaround for not showing magnifier for recent symbols */
         /* Do not show if there's nothing to show */
-        //const char *targetstr = coordinate->key_value[shiftidx][btncontext->multikeyIdx];
-        const char *targetstr = coordinate->label[shiftidx][0];
+        //const char *targetstr = coordinate->key_value[shift_index][button_context->multikeyIdx];
+        const char *targetstr = coordinate->label[shift_index][0];
         if (state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY ||
             state->get_cur_action_state() == ACTION_STATE_POPUP_LONGKEY ) {
                 targetstr = coordinate->long_key_value;
@@ -963,19 +1026,19 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx)
         }
         if (targetstr == NULL) {
             if (utils) {
-                utils->log("coordinate->key_value[shift][btncontext->multikeyIdx] == NULL \n");
+                utils->log("coordinate->key_value[shift][button_context->multikeyIdx] == NULL \n");
             }
             return FALSE;
         } else if (strlen(targetstr) == 0) {
             if (utils) {
-                utils->log("coordinate->key_value[shift][btncontext->multikeyIdx]) == 0 \n");
+                utils->log("coordinate->key_value[shift][button_context->multikeyIdx]) == 0 \n");
             }
             return FALSE;
         }
     }
 
 #if 0
-    SclPoint pos = {0,};
+    SclPoint pos = {0,0};
     /* calculates x position to be set */
     pos.x = (coordinate->x + (coordinate->width / 2)) - (utils->get_scale_x(scl_magnifier_configure.width) / 2);
 
@@ -993,26 +1056,18 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx)
     }
     if (coordinate && magnifier_configure) {
         sclchar composed_path[_POSIX_PATH_MAX] = {0,};
-        sclfloat scale_rate_x, scale_rate_y;
-        if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
-            scale_rate_x = m_utils->get_scale_rate_x();
-            scale_rate_y = m_utils->get_scale_rate_y();
-        } else {
-            scale_rate_x = m_utils->get_scale_rate_y();
-            scale_rate_y = m_utils->get_scale_rate_x();
-        }
         if (state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY) {
             m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, magnifier_configure->bg_long_key_image_path);
             m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
                 magnifier_configure->width * utils->get_custom_scale_rate_x(),
                 magnifier_configure->height * utils->get_custom_scale_rate_y());
         } else {
-            if (context->get_shift_state() == SCL_SHIFT_STATE_LOCK) {
+            if (shift_index == SCL_SHIFT_STATE_LOCK) {
                 m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, magnifier_configure->bg_shift_lock_image_path);
                 m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
                     magnifier_configure->width * utils->get_custom_scale_rate_x(),
                     magnifier_configure->height * utils->get_custom_scale_rate_y());
-            } else if (context->get_shift_state() == SCL_SHIFT_STATE_ON) {
+            } else if (shift_index == SCL_SHIFT_STATE_ON) {
                 m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, magnifier_configure->bg_shift_image_path);
                 m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
                     magnifier_configure->width * utils->get_custom_scale_rate_x(),
@@ -1030,12 +1085,10 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx)
             const SclLabelProperties *labelproperties = cache->get_label_properties(magnifier_configure->label_type, loop);
             if (labelproperties) {
                 if (labelproperties->valid) {
-                    SCLShiftState shiftidx = context->get_shift_state();
-                    if (shiftidx < 0 || shiftidx >= SCL_SHIFT_STATE_MAX) shiftidx = SCL_SHIFT_STATE_OFF;
                     if (magnifier_configure->show_shift_label) {
-                        shiftidx = SCL_SHIFT_STATE_ON;
+                        shift_index = SCL_SHIFT_STATE_ON;
                     }
-                    if (coordinate->use_long_key_magnifier && state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY ||
+                    if ((coordinate->use_long_key_magnifier && state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY) ||
                         state->get_cur_action_state() == ACTION_STATE_POPUP_LONGKEY) {
                             const sclchar* targetstr = coordinate->long_key_value;
                             const sclchar* customstr = context->get_custom_magnifier_label(context->get_last_touch_device_id(), loop);
@@ -1057,12 +1110,12 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx)
                         const sclchar* customstr = context->get_custom_magnifier_label(context->get_last_touch_device_id(), loop);
                         if (customstr) {
                             targetstr = customstr;
-                        } else if (coordinate->magnifier_label[shiftidx][loop]) {
-                            targetstr = coordinate->magnifier_label[shiftidx][loop];
+                        } else if (coordinate->magnifier_label[shift_index][loop]) {
+                            targetstr = coordinate->magnifier_label[shift_index][loop];
                             targetstr = cache->find_substituted_string(targetstr);
                         } else if (loop == 0) {
                             /* Don't display sublabels of each buttons in magnifier window - this policy can be changed, but for now */
-                            targetstr = coordinate->label[shiftidx][btncontext->multikeyIdx];
+                            targetstr = coordinate->label[shift_index][button_context->multikeyIdx];
                             targetstr = cache->find_substituted_string(targetstr);
                         }
                         if (targetstr) {
@@ -1120,6 +1173,9 @@ CSCLUIBuilder::draw_magnifier_label(const sclwindow window, const scldrawctx dra
 
             SCLShiftState shiftstate = context->get_shift_state();
             if (scl_check_arrindex(shiftstate, SCL_SHIFT_STATE_MAX)) {
+                if (context->get_caps_lock_mode()) {
+                    shiftstate = (shiftstate == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+                }
                 graphics->draw_text(
                     window,
                     draw_ctx,
index c83acf9..76512c6 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -26,6 +26,8 @@
 #include "sclerroradjustment.h"
 #include "sclres_manager.h"
 #include "scleventhandler.h"
+#include "sclkeyfocushandler.h"
+#include "sclanimator.h"
 
 using namespace scl;
 
@@ -113,8 +115,6 @@ CSCLUIImpl::show()
 {
     SCL_DEBUG();
 
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLUtils *utils = CSCLUtils::get_instance();
         CSCLWindows *windows = CSCLWindows::get_instance();
@@ -125,8 +125,6 @@ CSCLUIImpl::show()
             //if (auto_relocate) {
             if (TRUE) {
                 /* Let's relocate our base window - bottomed center aligned */
-                sclint width, height;
-                //get_layout_size(&width, &height);
                 SclRectangle rect = get_main_window_rect();
 
                 sclint scrx, scry;
@@ -154,8 +152,6 @@ CSCLUIImpl::hide()
 {
     SCL_DEBUG();
 
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLController *controller = CSCLController::get_instance();
         CSCLWindows *windows = CSCLWindows::get_instance();
@@ -176,8 +172,6 @@ CSCLUIImpl::set_ui_event_callback(ISCLUIEventCallback *callback, const sclchar *
 {
     SCL_DEBUG();
 
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLEventHandler *handler = CSCLEventHandler::get_instance();
         if (handler) {
@@ -203,6 +197,7 @@ CSCLUIImpl::set_input_mode(const sclchar *input_mode)
         CSCLController *controller = CSCLController::get_instance();
         CSCLWindows *windows = CSCLWindows::get_instance();
         CSCLEventHandler *handler = CSCLEventHandler::get_instance();
+        CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
 
         scl8 mode = NOT_USED;
 
@@ -211,10 +206,82 @@ CSCLUIImpl::set_input_mode(const sclchar *input_mode)
             mode = sclres_manager->get_inputmode_id(input_mode);
         }
 
-        if (controller && windows && handler && mode != NOT_USED) {
+        if (controller && windows && handler && focus_handler && mode != NOT_USED) {
             handler->set_input_mode(input_mode);
             ret = controller->process_input_mode_change(mode);
             windows->update_window(windows->get_base_window());
+            focus_handler->init_key_index();
+        }
+    }
+
+    SCL_DEBUG_ELAPASED_TIME_END();
+    return ret;
+}
+
+/**
+ * Returns the current input mode
+ */
+const sclchar*
+CSCLUIImpl::get_input_mode()
+{
+    SCL_DEBUG();
+
+    const sclchar *ret = NULL;
+    if (m_initialized) {
+        CSCLContext *context = CSCLContext::get_instance();
+        SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+        if (context && sclres_manager) {
+            scl8 inputmode_id = context->get_input_mode();
+            ret = sclres_manager->get_inputmode_name(inputmode_id);
+        }
+    }
+    return ret;
+}
+
+
+/**
+ * Sets the given popup window's input mode to the given mode
+ * @Usage
+ * gCore->set_input_mode("INPUT_MODE_SYMBOL");
+ */
+sclboolean
+CSCLUIImpl::set_popup_input_mode(sclwindow window, const sclchar *input_mode)
+{
+    SCL_DEBUG();
+    SCL_DEBUG_ELAPASED_TIME_START();
+
+    sclboolean ret = FALSE;
+
+    if (m_initialized) {
+        CSCLWindows *windows = CSCLWindows::get_instance();
+        CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+        CSCLContext *context = CSCLContext::get_instance();
+
+        scl8 mode = NOT_USED;
+        sclshort layout = NOT_USED;
+        SclWindowContext *window_context = NULL;
+
+        SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+        if (sclres_manager && windows && context) {
+            SCLDisplayMode display_mode = context->get_display_mode();
+            PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
+            mode = sclres_manager->get_inputmode_id(input_mode);
+            window_context = windows->get_window_context(window);
+            if (sclres_input_mode_configure &&
+                scl_check_arrindex(mode, MAX_SCL_INPUT_MODE) &&
+                scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
+                    layout = sclres_manager->get_layout_id(sclres_input_mode_configure[mode].layouts[display_mode]);
+            }
+        }
+
+        if (cache && windows && window_context) {
+            if (mode != NOT_USED && mode != window_context->inputmode && layout != NOT_USED) {
+                window_context->inputmode = mode;
+                window_context->layout = layout;
+                cache->recompute_layout(window);
+                windows->update_window(window);
+                ret = TRUE;
+            }
         }
     }
 
@@ -223,6 +290,32 @@ CSCLUIImpl::set_input_mode(const sclchar *input_mode)
 }
 
 /**
+ * Returns the given window's input mode
+ */
+const sclchar*
+CSCLUIImpl::get_popup_input_mode(sclwindow window)
+{
+    SCL_DEBUG();
+
+    const sclchar *ret = NULL;
+
+    if (m_initialized) {
+        CSCLWindows *windows = CSCLWindows::get_instance();
+        SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+        if (windows && sclres_manager) {
+            SclWindowContext *window_context = windows->get_window_context(window);
+            if (window_context) {
+                if (scl_check_arrindex(window_context->inputmode, MAX_SCL_INPUT_MODE)) {
+                    ret = sclres_manager->get_inputmode_name(window_context->inputmode);
+                }
+            }
+        }
+    }
+
+    return ret;
+}
+
+/**
  * Sets the current rotation
  */
 sclboolean
@@ -243,8 +336,6 @@ CSCLUIImpl::set_rotation(SCLRotation rotation)
             //if (auto_relocate) {
             if (TRUE) {
                 /* Let's relocate our base window - bottomed center aligned */
-                sclint width, height;
-                //get_layout_size(&width, &height);
                 SclRectangle rect = get_main_window_rect();
 
                 sclint scrx, scry;
@@ -298,28 +389,6 @@ CSCLUIImpl::get_display_mode()
 }
 
 /**
- * Returns the current input mode
- */
-const sclchar*
-CSCLUIImpl::get_input_mode()
-{
-    SCL_DEBUG();
-
-    const sclchar *ret = NULL;
-    if (m_initialized) {
-        CSCLContext *context = CSCLContext::get_instance();
-        SclResParserManager *sclres_manager = SclResParserManager::get_instance();
-        if (context && sclres_manager) {
-            scl8 inputmode_id = context->get_input_mode();
-            ret = sclres_manager->get_inputmode_name(inputmode_id);
-        }
-    }
-    return ret;
-}
-
-
-
-/**
  * Sets a private key to the current context
  * The other properties except given parameters will keep to the orginal value.
  * @Usage
@@ -336,7 +405,7 @@ CSCLUIImpl::set_private_key(const sclchar* custom_id, sclchar* label, sclchar* i
         CSCLWindows *windows = CSCLWindows::get_instance();
         CSCLResourceCache *cache = CSCLResourceCache::get_instance();
         if (windows && cache) {
-            ret = cache->set_private_key((sclchar*)custom_id, label, imagelabel, imagebg,
+            ret = cache->set_private_key(custom_id, label, imagelabel, imagebg,
                 key_event, key_value, fRedraw, windows->get_update_pending());
         }
     }
@@ -351,8 +420,6 @@ void
 CSCLUIImpl::unset_private_key(const sclchar* custom_id)
 {
     SCL_DEBUG();
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLResourceCache *cache = CSCLResourceCache::get_instance();
         if (cache) {
@@ -418,7 +485,11 @@ CSCLUIImpl::set_shift_state(SCLShiftState state)
         /*inform the client that the shift state changed */
         CSCLEventHandler *handler = CSCLEventHandler::get_instance();
         if (handler) {
-            SCLEventReturnType ret = handler->on_event_notification(SCL_UINOTITYPE_SHIFT_STATE_CHANGE, state);
+            SclNotiShiftStateChangeDesc desc;
+            desc.ui_event_desc = NULL;
+            desc.shift_state = state;
+
+            SCLEventReturnType ret = handler->on_event_notification(SCL_UINOTITYPE_SHIFT_STATE_CHANGE, &desc);
             if (ret == SCL_EVENT_DONE) {
                 return;
             }
@@ -443,6 +514,36 @@ CSCLUIImpl::set_shift_state(SCLShiftState state)
     }
 }
 
+sclboolean
+CSCLUIImpl::get_caps_lock_mode()
+{
+    sclboolean ret = FALSE;
+    if (m_initialized) {
+        CSCLContext *context = CSCLContext::get_instance();
+        if (context) {
+            ret = context->get_caps_lock_mode();
+        }
+    }
+    return ret;
+}
+
+void
+CSCLUIImpl::set_caps_lock_mode(sclboolean mode)
+{
+    if (m_initialized) {
+        CSCLContext *context = CSCLContext::get_instance();
+        CSCLWindows *windows = CSCLWindows::get_instance();
+
+        if (context && windows) {
+            sclboolean current_mode = context->get_caps_lock_mode();
+            if (mode != current_mode) {
+                context->set_caps_lock_mode(mode);
+                windows->update_window(windows->get_base_window());
+            }
+        }
+    }
+}
+
 /**
  * This function will be called by the user which uses SCL when the context of the focus application is changed
  * ISE user should explicitly call this function when the context of application is changed.
@@ -453,8 +554,6 @@ void
 CSCLUIImpl::notify_app_focus_changed()
 {
     SCL_DEBUG();
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLController *controller = CSCLController::get_instance();
         if (controller) {
@@ -467,8 +566,6 @@ void
 CSCLUIImpl::reset_popup_timeout()
 {
     SCL_DEBUG();
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLEvents *events = CSCLEvents::get_instance();
         CSCLWindows *windows = CSCLWindows::get_instance();
@@ -479,14 +576,14 @@ CSCLUIImpl::reset_popup_timeout()
             sclbyte index = 0;
             sclboolean timerset = FALSE;
             sclwindow window = SCLWINDOW_INVALID;
-            SclWindowContext *winctx = NULL;
+            SclWindowContext *window_context = NULL;
             do {
                 window = windows->get_nth_window_in_Z_order_list(index);
-                //winctx = windows->get_window_context(window, FALSE);
-                winctx = windows->get_window_context(window);
-                if (winctx) {
-                    if (winctx->timeout != 0) {
-                        events->create_timer(SCL_TIMER_POPUP_TIMEOUT, winctx->timeout, 0, TRUE);
+                //window_context = windows->get_window_context(window, FALSE);
+                window_context = windows->get_window_context(window);
+                if (window_context) {
+                    if (window_context->timeout != 0) {
+                        events->create_timer(SCL_TIMER_POPUP_TIMEOUT, window_context->timeout, 0, TRUE);
                         timerset = TRUE;
                     }
                     index++;
@@ -500,8 +597,6 @@ void
 CSCLUIImpl::close_all_popups()
 {
     SCL_DEBUG();
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLWindows *windows = CSCLWindows::get_instance();
         if (windows) {
@@ -610,24 +705,52 @@ CSCLUIImpl::set_custom_scale_rate(sclfloat x, sclfloat y)
 }
 
 /**
+ * Sets the custom starting coordinates for drawing the keyboard's content
+ */
+void
+CSCLUIImpl::set_custom_starting_coordinates(sclint x, sclint y)
+{
+    if (m_initialized) {
+        CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+        if (cache) {
+            cache->set_custom_starting_coordinates(x, y);
+        }
+    }
+}
+
+/**
+ * Sets the custom starting coordinates option for drawing the keyboard's content
+ */
+void
+CSCLUIImpl::set_custom_starting_coordinates_option(SCLStartingCoordinatesOption option)
+{
+    if (m_initialized) {
+        CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+        if (cache) {
+            cache->set_custom_starting_coordinates_option(option);
+        }
+    }
+}
+
+/**
  * Returns the scl base window size
  */
 SclRectangle
 CSCLUIImpl::get_main_window_rect()
 {
-    SclRectangle ret = {0};
+    SclRectangle ret = {0,0,0,0};
 
     if (m_initialized) {
         CSCLResourceCache *cache = CSCLResourceCache::get_instance();
         CSCLWindows *windows = CSCLWindows::get_instance();
         if (cache && windows) {
             //const SclLayout *layout  = cache->get_cur_layout(windows->get_base_window());
-            SclWindowContext *winctx = windows->get_window_context(windows->get_base_window());
-            if (winctx) {
-                ret.x = winctx->geometry.x;
-                ret.y = winctx->geometry.y;
-                ret.width = winctx->geometry.width;
-                ret.height = winctx->geometry.height;
+            SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+            if (window_context) {
+                ret.x = window_context->geometry.x;
+                ret.y = window_context->geometry.y;
+                ret.width = window_context->geometry.width;
+                ret.height = window_context->geometry.height;
             }
         }
     }
@@ -641,7 +764,7 @@ CSCLUIImpl::get_main_window_rect()
 SclSize
 CSCLUIImpl::get_input_mode_size(const sclchar *input_mode, SCLDisplayMode display_mode)
 {
-    SclSize ret = {0};
+    SclSize ret = {0,0};
 
     if (m_initialized) {
         CSCLUtils *utils = CSCLUtils::get_instance();
@@ -669,8 +792,6 @@ CSCLUIImpl::get_input_mode_size(const sclchar *input_mode, SCLDisplayMode displa
 void
 CSCLUIImpl::get_screen_resolution(sclint *width, sclint *height)
 {
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLUtils *utils = CSCLUtils::get_instance();
         if (utils && width && height) {
@@ -684,8 +805,6 @@ CSCLUIImpl::get_screen_resolution(sclint *width, sclint *height)
 void
 CSCLUIImpl::set_debug_mode(SCLDebugMode mode)
 {
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLController *controller = CSCLController::get_instance();
         if (controller) {
@@ -710,8 +829,6 @@ CSCLUIImpl::get_debug_mode()
 void
 CSCLUIImpl::set_update_pending(sclboolean pend)
 {
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLWindows *windows = CSCLWindows::get_instance();
         if (windows) {
@@ -723,8 +840,6 @@ CSCLUIImpl::set_update_pending(sclboolean pend)
 void
 CSCLUIImpl::enable_button(const sclchar* custom_id, sclboolean enabled)
 {
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLResourceCache *cache = CSCLResourceCache::get_instance();
         if (cache) {
@@ -834,8 +949,6 @@ CSCLUIImpl::set_button_delay_duration(scllong msc)
 void
 CSCLUIImpl::enable_magnifier(sclboolean enabled)
 {
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLContext *context = CSCLContext::get_instance();
         if (context) {
@@ -847,8 +960,6 @@ CSCLUIImpl::enable_magnifier(sclboolean enabled)
 void
 CSCLUIImpl::enable_sound(sclboolean enabled)
 {
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLContext *context = CSCLContext::get_instance();
         if (context) {
@@ -860,8 +971,6 @@ CSCLUIImpl::enable_sound(sclboolean enabled)
 void
 CSCLUIImpl::enable_vibration(sclboolean enabled)
 {
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLContext *context = CSCLContext::get_instance();
         if (context) {
@@ -873,8 +982,6 @@ CSCLUIImpl::enable_vibration(sclboolean enabled)
 void
 CSCLUIImpl::enable_tts(sclboolean enabled)
 {
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLContext *context = CSCLContext::get_instance();
         if (context) {
@@ -886,8 +993,6 @@ CSCLUIImpl::enable_tts(sclboolean enabled)
 void
 CSCLUIImpl::enable_shift_multi_touch(sclboolean enabled)
 {
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLContext *context = CSCLContext::get_instance();
         if (context) {
@@ -897,6 +1002,43 @@ CSCLUIImpl::enable_shift_multi_touch(sclboolean enabled)
 }
 
 void
+CSCLUIImpl::enable_highlight_ui(sclboolean enabled)
+{
+    if (m_initialized) {
+        CSCLContext *context = CSCLContext::get_instance();
+        CSCLWindows *windows = CSCLWindows::get_instance();
+        if (context) {
+            context->set_highlight_ui_enabled(enabled);
+
+            sclwindow window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+            windows->update_window(window);
+            if (!(windows->is_base_window(window))) {
+                windows->update_window(windows->get_base_window());
+            }
+        }
+    }
+}
+
+void
+CSCLUIImpl::enable_highlight_ui_animation(sclboolean enabled)
+{
+    if (m_initialized) {
+        CSCLContext *context = CSCLContext::get_instance();
+        CSCLAnimator *animator = CSCLAnimator::get_instance();
+        if (context && animator) {
+            context->set_highlight_ui_animation_enabled(enabled);
+
+            if (!enabled) {
+                sclint id = animator->find_animator_by_type(ANIMATION_TYPE_HIGHLIGHT_UI);
+                if (id != NOT_USED) {
+                    animator->destroy_animator(id);
+                }
+            }
+        }
+    }
+}
+
+void
 CSCLUIImpl::enable_touch_offset(sclboolean enabled)
 {
     CSCLErrorAdjustment *adjustment = CSCLErrorAdjustment::get_instance();
@@ -908,8 +1050,6 @@ CSCLUIImpl::enable_touch_offset(sclboolean enabled)
 void
 CSCLUIImpl::disable_input_events(sclboolean disabled)
 {
-    sclboolean ret = FALSE;
-
     if (m_initialized) {
         CSCLController *controller = CSCLController::get_instance();
         if (controller) {
@@ -993,3 +1133,13 @@ sclboolean
 CSCLUIImpl::get_autocapital_shift_state() {
     return m_autocapital_shift_state;
 }
+
+sclboolean
+CSCLUIImpl::process_key_event(const char *key)
+{
+    if (m_initialized) {
+        CSCLEvents *events = CSCLEvents::get_instance();
+        return events->process_key_event(key);
+    }
+    return FALSE;
+}
index 1ace1ba..075c961 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -47,9 +47,6 @@ CSCLUtils::CSCLUtils()
 CSCLUtils::~CSCLUtils()
 {
     SCL_DEBUG();
-
-    /* To make sure everything's cleaned up */
-    fini();
 }
 
 CSCLUtils* CSCLUtils::get_instance()
index 8afe3e8..8cfff68 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -29,6 +29,7 @@
 #include "sclcontroller.h"
 #include "sclactionstate.h"
 #include "sclres_manager.h"
+#include "sclkeyfocushandler.h"
 
 using namespace scl;
 
@@ -40,10 +41,10 @@ CSCLWindows::CSCLWindows()
 
     m_impl = NULL;
 
-    memset(&m_base_winctx, 0x00, sizeof(SclWindowContext));
-    memset(&m_magnifier_winctx, 0x00, sizeof(SclWindowContext));
-    memset(&m_dim_winctx, 0x00, sizeof(SclWindowContext));
-    memset(m_popup_winctx, 0x00, sizeof(SclWindowContext) * MAX_POPUP_WINDOW);
+    memset(&m_base_window_context, 0x00, sizeof(SclWindowContext));
+    memset(&m_magnifier_window_context, 0x00, sizeof(SclWindowContext));
+    memset(&m_dim_window_context, 0x00, sizeof(SclWindowContext));
+    memset(m_popup_window_context, 0x00, sizeof(SclWindowContext) * MAX_POPUP_WINDOW);
 
     m_pending_update = FALSE;
 
@@ -82,27 +83,27 @@ void CSCLWindows::fini()
     if (impl) {
         impl->fini();
 
-        if (SCLWINDOW_INVALID != m_base_winctx.window) {
-            impl->destroy_window(m_base_winctx.window);
-            m_base_winctx.window = SCLWINDOW_INVALID;
+        if (SCLWINDOW_INVALID != m_base_window_context.window) {
+            impl->destroy_window(m_base_window_context.window);
+            m_base_window_context.window = SCLWINDOW_INVALID;
         }
 
-        if (SCLWINDOW_INVALID != m_magnifier_winctx.window) {
-            impl->destroy_window(m_magnifier_winctx.window);
-            m_magnifier_winctx.window = SCLWINDOW_INVALID;
+        if (SCLWINDOW_INVALID != m_magnifier_window_context.window) {
+            impl->destroy_window(m_magnifier_window_context.window);
+            m_magnifier_window_context.window = SCLWINDOW_INVALID;
         }
 
-        if (SCLWINDOW_INVALID != m_dim_winctx.window) {
-            impl->destroy_window(m_dim_winctx.window);
-            m_dim_winctx.window = SCLWINDOW_INVALID;
+        if (SCLWINDOW_INVALID != m_dim_window_context.window) {
+            impl->destroy_window(m_dim_window_context.window);
+            m_dim_window_context.window = SCLWINDOW_INVALID;
         }
 
         for (int loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (m_popup_winctx[loop].window != SCLWINDOW_INVALID) {
-                if (!m_popup_winctx[loop].is_virtual) {
-                    impl->destroy_window(m_popup_winctx[loop].window);
+            if (m_popup_window_context[loop].window != SCLWINDOW_INVALID) {
+                if (!m_popup_window_context[loop].is_virtual) {
+                    impl->destroy_window(m_popup_window_context[loop].window);
                 }
-                m_popup_winctx[loop].window = SCLWINDOW_INVALID;
+                m_popup_window_context[loop].window = SCLWINDOW_INVALID;
             }
         }
     }
@@ -146,12 +147,12 @@ sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectang
 
     if (events && state && controller && cache && context && windows && utils) {
         for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (m_popup_winctx[loop].window != SCLWINDOW_INVALID) {
-                if (m_popup_winctx[loop].layout == layout) return SCLWINDOW_INVALID;
+            if (m_popup_window_context[loop].window != SCLWINDOW_INVALID) {
+                if (m_popup_window_context[loop].layout == layout) return SCLWINDOW_INVALID;
             }
         }
 
-        sclwindow window = create_window(opener, geometry, inputmode, layout, popup_type, is_virtual, img_offset_x, img_offset_y, timeout);
+        window = create_window(opener, geometry, inputmode, layout, popup_type, is_virtual, img_offset_x, img_offset_y, timeout);
         events->destroy_timer(SCL_TIMER_POPUP_TIMEOUT);
         if (timeout > 0) {
             events->create_timer(SCL_TIMER_POPUP_TIMEOUT, timeout, layout);
@@ -163,27 +164,27 @@ sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectang
         events->connect_window_events(window, SCL_EVENT_MOUSE | SCL_EVENT_EXPOSE);
         controller->handle_engine_signal(SCL_SIG_POPUP_SHOW, window);
 
-        /* Shows the dim window if it uses the dimwindow */
+        /* Shows the dim window if it uses the dim_window */
         if (use_dim_window) {
-            sclwindow dimWindow = get_dim_window();
+            sclwindow dim_window = get_dim_window();
 
             /* Currently, get_window_rect does not work normally (need to check X). So I have commented it*/
             SclRectangle rect;
             get_window_rect(get_base_window(), &rect);
-            resize_window(dimWindow, rect.width, rect.height);
-            move_window(dimWindow, rect.x, rect.y);
-            events->connect_window_events(dimWindow, SCL_EVENT_MOUSE);
+            resize_window(dim_window, rect.width, rect.height);
+            move_window(dim_window, rect.x, rect.y);
+            events->connect_window_events(dim_window, SCL_EVENT_MOUSE);
             /*If we use transient_for them the ISE will occure some crash. It needs to check X11*/
-            set_parent(opener.window, dimWindow);
-            SclWindowContext *dimctx = get_window_context(get_dim_window());
-            if (dimctx) {
-                if (dimctx->is_virtual) {
+            set_parent(opener.window, dim_window);
+            SclWindowContext *dim_window_context = get_window_context(get_dim_window());
+            if (dim_window_context) {
+                if (dim_window_context->is_virtual) {
                     set_parent(opener.window, window);
                 } else {
-                    set_parent(dimWindow, window);
+                    set_parent(dim_window, window);
                 }
             }
-            show_window(dimWindow);
+            show_window(dim_window);
         } else {
             /*If we use transient_for them the ISE will occure some crash. It needs to check X11*/
             set_parent(opener.window, window);
@@ -194,22 +195,24 @@ sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectang
 
         state->set_cur_action_state(ACTION_STATE_POPUP_INIT);
 
-        const SclLayout *layout = cache->get_cur_layout(window);
-        if (layout) {
+        const SclLayout *cur_layout = cache->get_cur_layout(window);
+        if (cur_layout) {
             /* If the newly opened popup window has POPUP_GRAB style, lets press the nearest button on the new window */
-            if (layout->style == LAYOUT_STYLE_POPUP_GRAB) {
+            if (cur_layout->style == LAYOUT_STYLE_POPUP_GRAB) {
                 sclwindow pressed_window = context->get_cur_pressed_window(context->get_last_touch_device_id());
                 sclbyte pressed_key = context->get_cur_pressed_key(context->get_last_touch_device_id());
 
                 const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
 
-                sclwindow move_window = context->get_cur_move_window(context->get_last_touch_device_id());
-                SclPoint move_point = context->get_cur_move_point(context->get_last_touch_device_id());
-                SclWindowContext *move_ctx = windows->get_window_context(move_window);
-                SclWindowContext *popup_ctx = windows->get_window_context(window);
-                if (move_ctx && popup_ctx) {
-                    move_point.x = (move_ctx->geometry.x - popup_ctx->geometry.x) + move_point.x;
-                    move_point.y = (move_ctx->geometry.y - popup_ctx->geometry.y) + move_point.y;
+                sclwindow moving_window = context->get_cur_moving_window(context->get_last_touch_device_id());
+                SclPoint moving_point = context->get_cur_moving_point(context->get_last_touch_device_id());
+                SclWindowContext *moving_window_context = windows->get_window_context(moving_window);
+                SclWindowContext *popup_window_context = windows->get_window_context(window);
+                if (moving_window_context && popup_window_context) {
+                    moving_point.x =
+                        (moving_window_context->geometry.x - popup_window_context->geometry.x) + moving_point.x;
+                    moving_point.y =
+                        (moving_window_context->geometry.y - popup_window_context->geometry.y) + moving_point.y;
                 }
 
                 /* Find the nearest button on the autopopup window */
@@ -217,17 +220,19 @@ sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectang
                 sclfloat min_dist = (float)((sclu32)(-1));
                 sclint min_dist_index = NOT_USED;
                 for (sclint loop = 0;loop < MAX_KEY && !ended;loop++) {
-                    SclButtonContext *popup_btncontext = cache->get_cur_button_context(window, loop);
+                    SclButtonContext *popup_button_context = cache->get_cur_button_context(window, loop);
                     const SclLayoutKeyCoordinate *popup_coordinate = cache->get_cur_layout_key_coordinate(window, loop);
-                    if (popup_btncontext && popup_coordinate) {
-                        if (!(popup_btncontext->used)) {
+                    if (popup_button_context && popup_coordinate) {
+                        if (!(popup_button_context->used)) {
                             ended = TRUE;
-                        } else if (popup_btncontext->state != BUTTON_STATE_DISABLED &&
+                        } else if (popup_button_context->state != BUTTON_STATE_DISABLED &&
                             popup_coordinate->button_type != BUTTON_TYPE_UIITEM) {
                                 if (popup_coordinate) {
-                                    float dist = utils->get_approximate_distance(move_point.x, move_point.y,
-                                        popup_coordinate->x + (popup_coordinate->width / 2) - layout->mouse_manipulate_x,
-                                        popup_coordinate->y + (popup_coordinate->height / 2) - layout->mouse_manipulate_y);
+                                    float dist = utils->get_approximate_distance(moving_point.x, moving_point.y,
+                                        popup_coordinate->x + (popup_coordinate->width / 2) -
+                                        cur_layout->mouse_manipulate_x,
+                                        popup_coordinate->y + (popup_coordinate->height / 2) -
+                                        cur_layout->mouse_manipulate_y);
                                     if (dist < min_dist) {
                                         min_dist_index = loop;
                                         min_dist = dist;
@@ -241,8 +246,10 @@ sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectang
                     const SclLayoutKeyCoordinate *popup_coordinate =
                         cache->get_cur_layout_key_coordinate(window, min_dist_index);
                     if (popup_coordinate) {
-                        sclint x = popup_coordinate->x + (popup_coordinate->width / 2) - layout->mouse_manipulate_x;
-                        sclint y = popup_coordinate->y + (popup_coordinate->height / 2) - layout->mouse_manipulate_y;
+                        sclint x = popup_coordinate->x + (popup_coordinate->width / 2) -
+                            cur_layout->mouse_manipulate_x;
+                        sclint y = popup_coordinate->y + (popup_coordinate->height / 2) -
+                            cur_layout->mouse_manipulate_y;
                         controller->mouse_press(window, x, y, context->get_last_touch_device_id());
                     }
                 }
@@ -250,8 +257,8 @@ sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectang
                 /* The below code block seems unnecessary since we already invoked mouse_press() */
                 /*context->set_cur_pressed_window(context->get_last_touch_device_id(), window);
                 context->set_cur_pressed_key(context->get_last_touch_device_id(), min_dist_index);
-                if (btncontext) {
-                    btncontext->state = BUTTON_STATE_NORMAL;
+                if (button_context) {
+                    button_context->state = BUTTON_STATE_NORMAL;
                 }*/
 
                 windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
@@ -266,6 +273,10 @@ bool CSCLWindows::close_popup(sclwindow window)
 {
     printf("close_popup window (%p) \n",window);
 
+    CSCLKeyFocusHandler *focus_handler = CSCLKeyFocusHandler::get_instance();
+    if (focus_handler) {
+        focus_handler->popup_closed(window);
+    }
     pop_window_in_Z_order_list(window);
 
     hide_window(get_dim_window());
@@ -301,23 +312,24 @@ CSCLWindows::create_base_window(const sclwindow parent, scl16 width, scl16 heigh
     SCL_DEBUG();
 
     if (m_initialized) {
-        m_base_winctx.hidden = TRUE;
-        m_base_winctx.geometry.width = width;
-        m_base_winctx.geometry.height = height;
-        m_base_winctx.is_virtual = FALSE;
-        m_base_winctx.popup_type = POPUP_TYPE_NONE;
-        m_base_winctx.opener.window = parent;
-        m_base_winctx.geometry.x = m_base_winctx.geometry.y = 0;
-        m_base_winctx.etc_info = NULL;
-        m_base_winctx.window = get_scl_windows_impl()->create_base_window(parent, &m_base_winctx, width, height);
-
-        push_window_in_Z_order_list(m_base_winctx.window);
+        m_base_window_context.hidden = TRUE;
+        m_base_window_context.geometry.width = width;
+        m_base_window_context.geometry.height = height;
+        m_base_window_context.is_virtual = FALSE;
+        m_base_window_context.popup_type = POPUP_TYPE_NONE;
+        m_base_window_context.opener.window = parent;
+        m_base_window_context.geometry.x = m_base_window_context.geometry.y = 0;
+        m_base_window_context.etc_info = NULL;
+        m_base_window_context.window =
+            get_scl_windows_impl()->create_base_window(parent, &m_base_window_context, width, height);
+
+        push_window_in_Z_order_list(m_base_window_context.window);
     }
 
     // Update the position information
     //get_window_context(parent, TRUE);
 
-    return m_base_winctx.window;
+    return m_base_window_context.window;
 }
 
 /**
@@ -342,32 +354,33 @@ CSCLWindows::create_window(const SclWindowOpener opener, const SclRectangle &geo
 
     if (impl) {
         for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (m_popup_winctx[loop].window == SCLWINDOW_INVALID) {
-                m_popup_winctx[loop].hidden = TRUE;
-                m_popup_winctx[loop].opener = opener;
-                m_popup_winctx[loop].etc_info = NULL;
-                m_popup_winctx[loop].inputmode = inputmode;
-                m_popup_winctx[loop].layout = layout;
-                m_popup_winctx[loop].popup_type = popup_type;
-                m_popup_winctx[loop].is_virtual = is_virtual;
+            if (m_popup_window_context[loop].window == SCLWINDOW_INVALID) {
+                m_popup_window_context[loop].hidden = TRUE;
+                m_popup_window_context[loop].opener = opener;
+                m_popup_window_context[loop].etc_info = NULL;
+                m_popup_window_context[loop].inputmode = inputmode;
+                m_popup_window_context[loop].layout = layout;
+                m_popup_window_context[loop].popup_type = popup_type;
+                m_popup_window_context[loop].is_virtual = is_virtual;
 
-                m_popup_winctx[loop].geometry = geometry;
+                m_popup_window_context[loop].geometry = geometry;
 
-                m_popup_winctx[loop].layout_image_offset.x = img_offset_x;
-                m_popup_winctx[loop].layout_image_offset.y = img_offset_y;
+                m_popup_window_context[loop].layout_image_offset.x = img_offset_x;
+                m_popup_window_context[loop].layout_image_offset.y = img_offset_y;
 
-                m_popup_winctx[loop].timeout = timeout;
+                m_popup_window_context[loop].timeout = timeout;
 
                 if (!is_virtual) {
-                    window = impl->create_window(opener.window, &(m_popup_winctx[loop]), geometry.width, geometry.height);
+                    window = impl->create_window(opener.window,
+                        &(m_popup_window_context[loop]), geometry.width, geometry.height);
                 } else {
                     window = reinterpret_cast<sclwindow>(loop + 1);
                 }
                 if (window) {
-                    m_popup_winctx[loop].window = window;
+                    m_popup_window_context[loop].window = window;
                 }
                 //set_window_rotation(window, context->get_rotation_degree());
-                if (!m_popup_winctx[loop].is_virtual) {
+                if (!m_popup_window_context[loop].is_virtual) {
                     impl->move_window(window, geometry.x, geometry.y);
                 }
                 break;
@@ -393,17 +406,17 @@ CSCLWindows::create_magnifier_window(const sclwindow parent, scl16 x, scl16 y, s
     sclwindow window = SCLWINDOW_INVALID;
 
     if (impl && m_initialized) {
-        if (m_magnifier_winctx.window == SCLWINDOW_INVALID) {
-            window = impl->create_magnifier_window(parent, &m_magnifier_winctx, width, height);
+        if (m_magnifier_window_context.window == SCLWINDOW_INVALID) {
+            window = impl->create_magnifier_window(parent, &m_magnifier_window_context, width, height);
             impl->set_keep_above(window, TRUE);
             if (window) {
-                m_magnifier_winctx.window = window;
-                m_magnifier_winctx.geometry.width = width;
-                m_magnifier_winctx.geometry.height = height;
-                m_magnifier_winctx.hidden = TRUE;
+                m_magnifier_window_context.window = window;
+                m_magnifier_window_context.geometry.width = width;
+                m_magnifier_window_context.geometry.height = height;
+                m_magnifier_window_context.hidden = TRUE;
             }
         } else {
-            window = m_magnifier_winctx.window;
+            window = m_magnifier_window_context.window;
         }
         set_parent(parent, window);
 
@@ -424,11 +437,11 @@ sclwindow
 CSCLWindows::get_magnifier_window()
 {
     SCL_DEBUG();
-    return m_magnifier_winctx.window;
+    return m_magnifier_window_context.window;
 }
 
 sclwindow
-CSCLWindows::create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindows::create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
 {
     SCL_DEBUG();
 
@@ -442,19 +455,19 @@ CSCLWindows::create_dim_window(const sclwindow parent, SclWindowContext *winctx,
     }
 
     if (impl && m_initialized && default_configure) {
-        if (m_dim_winctx.window == NULL) {
-            m_dim_winctx.hidden = TRUE;
+        if (m_dim_window_context.window == NULL) {
+            m_dim_window_context.hidden = TRUE;
             if (default_configure->use_actual_dim_window) {
-                window = impl->create_dim_window(parent, &m_dim_winctx, width, height);
+                window = impl->create_dim_window(parent, &m_dim_window_context, width, height);
             } else {
                 window = reinterpret_cast<sclwindow>(SCLWINDOW_VIRTUAL_DIM);
-                m_dim_winctx.is_virtual = TRUE;
+                m_dim_window_context.is_virtual = TRUE;
             }
             if (window) {
-                m_dim_winctx.window = window;
+                m_dim_window_context.window = window;
             }
         } else {
-            window = m_dim_winctx.window;
+            window = m_dim_window_context.window;
         }
 
         if (window == NULL) {
@@ -469,7 +482,7 @@ sclwindow
 CSCLWindows::get_dim_window()
 {
     SCL_DEBUG();
-    return m_dim_winctx.window;
+    return m_dim_window_context.window;
 }
 
 bool
@@ -481,28 +494,28 @@ CSCLWindows::destroy_window(sclwindow window)
     sclboolean ret = FALSE;
 
     if (impl) {
-        if (window == m_base_winctx.window) {
+        if (window == m_base_window_context.window) {
             impl->destroy_window(window);
-            memset(&m_base_winctx, 0x00, sizeof(SclWindowContext));
-            m_base_winctx.window = SCLWINDOW_INVALID;
+            memset(&m_base_window_context, 0x00, sizeof(SclWindowContext));
+            m_base_window_context.window = SCLWINDOW_INVALID;
             ret = TRUE;
-        } else if (window == m_magnifier_winctx.window) {
+        } else if (window == m_magnifier_window_context.window) {
             impl->destroy_window(window);
-            memset(&m_magnifier_winctx, 0x00, sizeof(SclWindowContext));
-            m_magnifier_winctx.window = SCLWINDOW_INVALID;
+            memset(&m_magnifier_window_context, 0x00, sizeof(SclWindowContext));
+            m_magnifier_window_context.window = SCLWINDOW_INVALID;
             ret = TRUE;
-        } else if (window == m_dim_winctx.window) {
+        } else if (window == m_dim_window_context.window) {
             impl->destroy_window(window);
-            memset(&m_dim_winctx, 0x00, sizeof(SclWindowContext));
-            m_dim_winctx.window = SCLWINDOW_INVALID;
+            memset(&m_dim_window_context, 0x00, sizeof(SclWindowContext));
+            m_dim_window_context.window = SCLWINDOW_INVALID;
             ret = TRUE;
         } else {
             for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-                if (m_popup_winctx[loop].window == window) {
+                if (m_popup_window_context[loop].window == window) {
                     impl->destroy_window(window);
-                    memset(&m_popup_winctx[loop], 0x00, sizeof(SclWindowContext));
+                    memset(&m_popup_window_context[loop], 0x00, sizeof(SclWindowContext));
                     ret = TRUE;
-                    m_popup_winctx[loop].window = SCLWINDOW_INVALID;
+                    m_popup_window_context[loop].window = SCLWINDOW_INVALID;
                     break;
                 }
             }
@@ -517,7 +530,7 @@ CSCLWindows::get_base_window()
 {
     SCL_DEBUG();
 
-    return m_base_winctx.window;
+    return m_base_window_context.window;
 }
 
 sclboolean
@@ -528,7 +541,7 @@ CSCLWindows::is_base_window(sclwindow window)
     sclboolean ret = FALSE;
 
     if (window != SCLWINDOW_INVALID) {
-        if (window == m_base_winctx.window) {
+        if (window == m_base_window_context.window) {
             ret = TRUE;
         }
     }
@@ -543,16 +556,16 @@ CSCLWindows::find_by_etcinfo( void* etc_info )
 
     sclwindow ret = SCLWINDOW_INVALID;
 
-    if (etc_info == m_base_winctx.etc_info) {
-        ret = m_base_winctx.window;
-    } else if (etc_info == m_magnifier_winctx.etc_info) {
-        ret = m_magnifier_winctx.window;
-    } else if (etc_info == m_dim_winctx.etc_info) {
-        ret = m_dim_winctx.window;
+    if (etc_info == m_base_window_context.etc_info) {
+        ret = m_base_window_context.window;
+    } else if (etc_info == m_magnifier_window_context.etc_info) {
+        ret = m_magnifier_window_context.window;
+    } else if (etc_info == m_dim_window_context.etc_info) {
+        ret = m_dim_window_context.window;
     } else {
         for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (etc_info == m_popup_winctx[loop].etc_info) {
-                ret = m_popup_winctx[loop].window;
+            if (etc_info == m_popup_window_context[loop].etc_info) {
+                ret = m_popup_window_context[loop].window;
                 break;
             }
         }
@@ -569,28 +582,28 @@ CSCLWindows::get_window_context(sclwindow window)
 
     SclWindowContext* ret = NULL;
 
-    if (window == m_base_winctx.window) {
+    if (window == m_base_window_context.window) {
         /*if (geometry_update) {
             SclRectangle rect;
             get_window_rect(window, &rect);
-            m_base_winctx.geometry.x = rect.x;
-            m_base_winctx.geometry.y = rect.y;
+            m_base_window_context.geometry.x = rect.x;
+            m_base_window_context.geometry.y = rect.y;
         }*/
-        ret = &m_base_winctx;
-    } else if (window == m_magnifier_winctx.window) {
-        ret = &m_magnifier_winctx;
-    } else if (window == m_dim_winctx.window) {
-        ret = &m_dim_winctx;
+        ret = &m_base_window_context;
+    } else if (window == m_magnifier_window_context.window) {
+        ret = &m_magnifier_window_context;
+    } else if (window == m_dim_window_context.window) {
+        ret = &m_dim_window_context;
     } else {
         for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (m_popup_winctx[loop].window == window) {
+            if (m_popup_window_context[loop].window == window) {
                 /*if (geometry_update) {
                     SclRectangle rect;
                     get_window_rect(window, &rect);
-                    m_popup_winctx[loop].geometry.x = rect.x;
-                    m_popup_winctx[loop].geometry.y = rect.y;
+                    m_popup_window_context[loop].geometry.x = rect.x;
+                    m_popup_window_context[loop].geometry.y = rect.y;
                 }*/
-                ret = &m_popup_winctx[loop];
+                ret = &m_popup_window_context[loop];
                 break;
             }
         }
@@ -604,12 +617,12 @@ CSCLWindows::set_window_context(sclwindow window, SclWindowContext* context)
 {
     SCL_DEBUG();
 
-    if (window == m_base_winctx.window) {
-        memcpy(&m_base_winctx,context, sizeof(SclWindowContext));
+    if (window == m_base_window_context.window) {
+        memcpy(&m_base_window_context,context, sizeof(SclWindowContext));
     } else {
         for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (m_popup_winctx[loop].window == window) {
-                memcpy(&m_popup_winctx[loop], context, sizeof(SclWindowContext));
+            if (m_popup_window_context[loop].window == window) {
+                memcpy(&m_popup_window_context[loop], context, sizeof(SclWindowContext));
                 break;
             }
         }
@@ -624,7 +637,7 @@ CSCLWindows::find_popup_window_index(sclwindow window)
     scl8 ret = NOT_USED;
 
     for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-        if (m_popup_winctx[loop].window == window) {
+        if (m_popup_window_context[loop].window == window) {
             ret = loop;
             break;
         }
@@ -639,24 +652,24 @@ CSCLWindows::move_window(const sclwindow window, scl16 x, scl16 y)
     SCL_DEBUG();
 
     sclboolean is_virtual = FALSE;
-    if (window == m_base_winctx.window) {
-        m_base_winctx.geometry.x = x;
-        m_base_winctx.geometry.y = y;
-        is_virtual = m_base_winctx.is_virtual;
-    } else if (window == m_magnifier_winctx.window) {
-        m_magnifier_winctx.geometry.x = x;
-        m_magnifier_winctx.geometry.y = y;
-        is_virtual = m_magnifier_winctx.is_virtual;
-    } else if (window == m_dim_winctx.window) {
-        m_dim_winctx.geometry.x = x;
-        m_dim_winctx.geometry.y = y;
-        is_virtual = m_dim_winctx.is_virtual;
+    if (window == m_base_window_context.window) {
+        m_base_window_context.geometry.x = x;
+        m_base_window_context.geometry.y = y;
+        is_virtual = m_base_window_context.is_virtual;
+    } else if (window == m_magnifier_window_context.window) {
+        m_magnifier_window_context.geometry.x = x;
+        m_magnifier_window_context.geometry.y = y;
+        is_virtual = m_magnifier_window_context.is_virtual;
+    } else if (window == m_dim_window_context.window) {
+        m_dim_window_context.geometry.x = x;
+        m_dim_window_context.geometry.y = y;
+        is_virtual = m_dim_window_context.is_virtual;
     } else {
         for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (m_popup_winctx[loop].window == window) {
-                m_popup_winctx[loop].geometry.x = x;
-                m_popup_winctx[loop].geometry.y = y;
-                is_virtual = m_popup_winctx[loop].is_virtual;
+            if (m_popup_window_context[loop].window == window) {
+                m_popup_window_context[loop].geometry.x = x;
+                m_popup_window_context[loop].geometry.y = y;
+                is_virtual = m_popup_window_context[loop].is_virtual;
                 break;
             }
         }
@@ -675,24 +688,24 @@ CSCLWindows::resize_window(const sclwindow window, scl16 width, scl16 height)
     SCL_DEBUG();
 
     sclboolean is_virtual = FALSE;
-    if (window == m_base_winctx.window) {
-        m_base_winctx.geometry.width = width;
-        m_base_winctx.geometry.height = height;
-        is_virtual = m_base_winctx.is_virtual;
-    } else if (window == m_magnifier_winctx.window) {
-        m_magnifier_winctx.geometry.width = width;
-        m_magnifier_winctx.geometry.height = height;
-        is_virtual = m_magnifier_winctx.is_virtual;
-    } else if (window == m_dim_winctx.window) {
-        m_dim_winctx.geometry.width = width;
-        m_dim_winctx.geometry.height = height;
-        is_virtual = m_dim_winctx.is_virtual;
+    if (window == m_base_window_context.window) {
+        m_base_window_context.geometry.width = width;
+        m_base_window_context.geometry.height = height;
+        is_virtual = m_base_window_context.is_virtual;
+    } else if (window == m_magnifier_window_context.window) {
+        m_magnifier_window_context.geometry.width = width;
+        m_magnifier_window_context.geometry.height = height;
+        is_virtual = m_magnifier_window_context.is_virtual;
+    } else if (window == m_dim_window_context.window) {
+        m_dim_window_context.geometry.width = width;
+        m_dim_window_context.geometry.height = height;
+        is_virtual = m_dim_window_context.is_virtual;
     } else {
         for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (m_popup_winctx[loop].window == window) {
-                m_popup_winctx[loop].geometry.width = width;
-                m_popup_winctx[loop].geometry.height = height;
-                is_virtual = m_popup_winctx[loop].is_virtual;
+            if (m_popup_window_context[loop].window == window) {
+                m_popup_window_context[loop].geometry.width = width;
+                m_popup_window_context[loop].geometry.height = height;
+                is_virtual = m_popup_window_context[loop].is_virtual;
                 break;
             }
         }
@@ -711,32 +724,32 @@ CSCLWindows::move_resize_window(const sclwindow window, scl16 x, scl16 y, scl16
     SCL_DEBUG();
 
     sclboolean is_virtual = FALSE;
-    if (window == m_base_winctx.window) {
-        m_base_winctx.geometry.x = x;
-        m_base_winctx.geometry.y = y;
-        m_base_winctx.geometry.width = width;
-        m_base_winctx.geometry.height = height;
-        is_virtual = m_base_winctx.is_virtual;
-    } else if (window == m_magnifier_winctx.window) {
-        m_magnifier_winctx.geometry.x = x;
-        m_magnifier_winctx.geometry.y = y;
-        m_magnifier_winctx.geometry.width = width;
-        m_magnifier_winctx.geometry.height = height;
-        is_virtual = m_magnifier_winctx.is_virtual;
-    } else if (window == m_dim_winctx.window) {
-        m_dim_winctx.geometry.x = x;
-        m_dim_winctx.geometry.y = y;
-        m_dim_winctx.geometry.width = width;
-        m_dim_winctx.geometry.height = height;
-        is_virtual = m_dim_winctx.is_virtual;
+    if (window == m_base_window_context.window) {
+        m_base_window_context.geometry.x = x;
+        m_base_window_context.geometry.y = y;
+        m_base_window_context.geometry.width = width;
+        m_base_window_context.geometry.height = height;
+        is_virtual = m_base_window_context.is_virtual;
+    } else if (window == m_magnifier_window_context.window) {
+        m_magnifier_window_context.geometry.x = x;
+        m_magnifier_window_context.geometry.y = y;
+        m_magnifier_window_context.geometry.width = width;
+        m_magnifier_window_context.geometry.height = height;
+        is_virtual = m_magnifier_window_context.is_virtual;
+    } else if (window == m_dim_window_context.window) {
+        m_dim_window_context.geometry.x = x;
+        m_dim_window_context.geometry.y = y;
+        m_dim_window_context.geometry.width = width;
+        m_dim_window_context.geometry.height = height;
+        is_virtual = m_dim_window_context.is_virtual;
     } else {
         for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (m_popup_winctx[loop].window == window) {
-                m_popup_winctx[loop].geometry.x = x;
-                m_popup_winctx[loop].geometry.y = y;
-                m_popup_winctx[loop].geometry.width = width;
-                m_popup_winctx[loop].geometry.height = height;
-                is_virtual = m_popup_winctx[loop].is_virtual;
+            if (m_popup_window_context[loop].window == window) {
+                m_popup_window_context[loop].geometry.x = x;
+                m_popup_window_context[loop].geometry.y = y;
+                m_popup_window_context[loop].geometry.width = width;
+                m_popup_window_context[loop].geometry.height = height;
+                is_virtual = m_popup_window_context[loop].is_virtual;
                 break;
             }
         }
@@ -809,7 +822,7 @@ sclwindow CSCLWindows::get_nth_popup_window( sclbyte index )
     scl_assert_return_null(index >= 0 && index < MAX_POPUP_WINDOW);
 
     if (index < MAX_POPUP_WINDOW) {
-        return m_popup_winctx[index].window;
+        return m_popup_window_context[index].window;
     }
 
     return SCLWINDOW_INVALID;
@@ -831,10 +844,10 @@ sclbyte CSCLWindows::get_Z_order(sclwindow window)
 void CSCLWindows::set_parent( const sclwindow parent, const sclwindow window )
 {
     /* Do not set parent if the window is a virtual window */
-    //SclWindowContext *winctx = get_window_context(window, FALSE);
-    SclWindowContext *winctx = get_window_context(window);
-    if (winctx) {
-        if (!(winctx->is_virtual)) {
+    //SclWindowContext *window_context = get_window_context(window, FALSE);
+    SclWindowContext *window_context = get_window_context(window);
+    if (window_context) {
+        if (!(window_context->is_virtual)) {
             CSCLWindowsImpl* impl = get_scl_windows_impl();
             if (impl) {
                 impl->set_parent(parent, window);
@@ -851,17 +864,9 @@ void CSCLWindows::set_window_rotation(const sclwindow window, SCLRotation rotati
 
     if (impl) {
         if (window == NULL) {
-            impl->set_window_rotation(m_base_winctx.window, rotation);
-            if (SCLWINDOW_INVALID != m_magnifier_winctx.window) {
+            impl->set_window_rotation(m_base_window_context.window, rotation);
+            if (SCLWINDOW_INVALID != m_magnifier_window_context.window) {
                 CSCLUtils *utils = CSCLUtils::get_instance();
-                sclfloat scale_rate_x, scale_rate_y;
-                if (rotation == ROTATION_90_CW || rotation == ROTATION_90_CCW) {
-                    scale_rate_x = utils->get_scale_rate_y();
-                    scale_rate_y = utils->get_scale_rate_x();
-                } else {
-                    scale_rate_x = utils->get_scale_rate_x();
-                    scale_rate_y = utils->get_scale_rate_y();
-                }
 
                 SclResParserManager *sclres_manager = SclResParserManager::get_instance();
                 PSclMagnifierWndConfigure magnifier_configure = NULL;
@@ -869,27 +874,27 @@ void CSCLWindows::set_window_rotation(const sclwindow window, SCLRotation rotati
                     magnifier_configure = sclres_manager->get_magnifier_configure();
                 }
                 if (magnifier_configure) {
-                    m_magnifier_winctx.geometry.width =
+                    m_magnifier_window_context.geometry.width =
                         magnifier_configure->width * utils->get_custom_scale_rate_x();
-                    m_magnifier_winctx.geometry.height =
+                    m_magnifier_window_context.geometry.height =
                         magnifier_configure->height * utils->get_custom_scale_rate_y();
 
-                    impl->set_window_rotation(m_magnifier_winctx.window, rotation);
+                    impl->set_window_rotation(m_magnifier_window_context.window, rotation);
                 }
             }
 
-            if (SCLWINDOW_INVALID != m_dim_winctx.window) {
+            if (SCLWINDOW_INVALID != m_dim_window_context.window) {
                 /* For indivisual window rotation */
-                impl->set_window_rotation(m_dim_winctx.window, rotation);
-                //resize_window(m_dim_winctx.window, m_base_winctx.width, m_base_winctx.height);
-                //move_window(m_dim_winctx.window, m_base_winctx.x, m_base_winctx.y);
-                hide_window(m_dim_winctx.window);
+                impl->set_window_rotation(m_dim_window_context.window, rotation);
+                //resize_window(m_dim_window_context.window, m_base_window_context.width, m_base_winctx.height);
+                //move_window(m_dim_window_context.window, m_base_window_context.x, m_base_winctx.y);
+                hide_window(m_dim_window_context.window);
             }
             /* For indivisual window rotation
             for (int loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-                if (m_popup_winctx[loop].window != SCLWINDOW_INVALID) {
-                    if (!m_popup_winctx[loop].isVirtual) {
-                        get_scl_windows_impl()->set_window_rotation(m_popup_winctx[loop].window, degree);
+                if (m_popup_window_context[loop].window != SCLWINDOW_INVALID) {
+                    if (!m_popup_window_context[loop].isVirtual) {
+                        get_scl_windows_impl()->set_window_rotation(m_popup_window_context[loop].window, degree);
                     }
                 }
             }
@@ -902,9 +907,9 @@ void CSCLWindows::set_window_rotation(const sclwindow window, SCLRotation rotati
 
     // Update the position information
     //get_window_context(window, TRUE);
-    SclWindowContext *winctx = get_window_context(window);
-    if (winctx) {
-        get_window_rect(window, &(winctx->geometry));
+    SclWindowContext *window_context = get_window_context(window);
+    if (window_context) {
+        get_window_rect(window, &(window_context->geometry));
     }
 }
 
@@ -914,16 +919,16 @@ CSCLWindows::show_window(const sclwindow window, sclboolean queue /*= FALSE*/)
 {
     SCL_DEBUG();
 
-    if (window == m_base_winctx.window) {
-        m_base_winctx.hidden = FALSE;
-    } else if (window == m_magnifier_winctx.window) {
-        m_magnifier_winctx.hidden = FALSE;
-    } else if (window == m_dim_winctx.window) {
-        m_dim_winctx.hidden = FALSE;
+    if (window == m_base_window_context.window) {
+        m_base_window_context.hidden = FALSE;
+    } else if (window == m_magnifier_window_context.window) {
+        m_magnifier_window_context.hidden = FALSE;
+    } else if (window == m_dim_window_context.window) {
+        m_dim_window_context.hidden = FALSE;
     } else {
         for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (m_popup_winctx[loop].window == window) {
-                m_popup_winctx[loop].hidden = FALSE;
+            if (m_popup_window_context[loop].window == window) {
+                m_popup_window_context[loop].hidden = FALSE;
                 break;
             }
         }
@@ -940,16 +945,16 @@ CSCLWindows::hide_window(const sclwindow window, sclboolean force /*= FALSE*/)
 {
     SCL_DEBUG();
 
-    if (window == m_base_winctx.window) {
-        m_base_winctx.hidden = TRUE;
-    } else if (window == m_magnifier_winctx.window) {
-        m_magnifier_winctx.hidden = TRUE;
-    } else if (window == m_dim_winctx.window) {
-        m_dim_winctx.hidden = TRUE;
+    if (window == m_base_window_context.window) {
+        m_base_window_context.hidden = TRUE;
+    } else if (window == m_magnifier_window_context.window) {
+        m_magnifier_window_context.hidden = TRUE;
+    } else if (window == m_dim_window_context.window) {
+        m_dim_window_context.hidden = TRUE;
     } else {
         for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-            if (m_popup_winctx[loop].window == window) {
-                m_popup_winctx[loop].hidden = TRUE;
+            if (m_popup_window_context[loop].window == window) {
+                m_popup_window_context[loop].hidden = TRUE;
                 break;
             }
         }
@@ -975,7 +980,7 @@ CSCLWindows::set_update_pending(sclboolean pend)
 {
     m_pending_update = pend;
     if (!pend) {
-        update_window(m_base_winctx.window);
+        update_window(m_base_window_context.window);
     }
 }
 
@@ -1004,27 +1009,27 @@ CSCLWindows::get_window_rect(const sclwindow window, SclRectangle *rect) {
     sclboolean is_virtual = FALSE;
     sclboolean ret = FALSE;
     if (rect) {
-        if (window == m_base_winctx.window) {
-            is_virtual = m_base_winctx.is_virtual;
+        if (window == m_base_window_context.window) {
+            is_virtual = m_base_window_context.is_virtual;
             if (is_virtual) {
-                *rect = m_base_winctx.geometry;
+                *rect = m_base_window_context.geometry;
             }
-        } else if (window == m_magnifier_winctx.window) {
-            is_virtual = m_magnifier_winctx.is_virtual;
+        } else if (window == m_magnifier_window_context.window) {
+            is_virtual = m_magnifier_window_context.is_virtual;
             if (is_virtual) {
-                *rect = m_magnifier_winctx.geometry;
+                *rect = m_magnifier_window_context.geometry;
             }
-        } else if (window == m_dim_winctx.window) {
-            is_virtual = m_dim_winctx.is_virtual;
+        } else if (window == m_dim_window_context.window) {
+            is_virtual = m_dim_window_context.is_virtual;
             if (is_virtual) {
-                *rect = m_dim_winctx.geometry;
+                *rect = m_dim_window_context.geometry;
             }
         } else {
             for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
-                if (m_popup_winctx[loop].window == window) {
-                    is_virtual = m_popup_winctx[loop].is_virtual;
+                if (m_popup_window_context[loop].window == window) {
+                    is_virtual = m_popup_window_context[loop].is_virtual;
                     if (is_virtual) {
-                        *rect = m_popup_winctx[loop].geometry;
+                        *rect = m_popup_window_context[loop].geometry;
                     }
                     break;
                 }
index 9b727a9..e739576 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -40,7 +40,6 @@ static tts_h tts = NULL;
 static Eina_Bool _get_default_zone_geometry_info (Ecore_X_Window root, scluint *x, scluint *y, scluint *w, scluint *h)
 {
     Ecore_X_Atom zone_geometry_atom;
-    Ecore_X_Window default_zone;
     Ecore_X_Window* zone_lists;
     sclint num_zone_lists;
     sclint num_ret;
@@ -92,7 +91,7 @@ void accessibility_changed_cb(keynode_t *key, void* data)
                 if (TTS_ERROR_NONE != r) {
                     LOGD("tts_create FAILED : result(%d)", r);
                 } else {
-                    tts_set_mode (tts, TTS_MODE_SCREEN_READER);
+                    r = tts_set_mode (tts, TTS_MODE_SCREEN_READER);
                 }
                 if (TTS_ERROR_NONE != r) {
                     LOGD("tts_set_mode FAILED : result(%d)", r);
@@ -160,6 +159,7 @@ CSCLUtilsImplLinux::get_screen_resolution(sclint *x, sclint *y) {
     static Evas_Coord scr_w = 0, scr_h = 0;
     if (scr_w == 0 || scr_h == 0) {
         scluint w, h;
+        w = h = 0;
         if (_get_default_zone_geometry_info(ecore_x_window_root_first_get(), NULL, NULL, &w, &h)) {
             scr_w = w;
             scr_h = h;
@@ -199,7 +199,7 @@ CSCLUtilsImplLinux::play_tts(const sclchar* str) {
                 LOGD("Fail to stop TTS : ret(%d)\n", r);
             }
         }
-        r = tts_add_text(tts, str, "en_US", TTS_VOICE_TYPE_FEMALE, TTS_SPEED_NORMAL, &utt_id);
+        r = tts_add_text(tts, str, NULL, TTS_VOICE_TYPE_AUTO, TTS_SPEED_AUTO, &utt_id);
         if (TTS_ERROR_NONE == r) {
             r = tts_play(tts);
             if (TTS_ERROR_NONE != r) {
index 004b7d4..f6a3969 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 6b16cb5..95f0022 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index ad6d4a6..5c17f50 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -62,7 +62,7 @@ public: /* These are the functions need to be implemented by the descendants of
     virtual bool get_nine_patch_info(const char *filename, SclNinePatchInfo *info) = 0;
 
     /* Function returning the name of current SclRes instance */
-    virtual const char* name() = 0;
+    virtual const char* get_name() = 0;
 
 private:
     std::string m_resource_directory;
index 658987c..aecfae9 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -225,8 +225,8 @@ SclResParserManager::get_nine_patch_info(const char *filename, SclNinePatchInfo
 }
 
 const char*
-SclResParserManager::name() {
+SclResParserManager::get_name() {
     if (_current_parser == NULL) return NULL;
 
-    return _current_parser->name();
+    return _current_parser->get_name();
 }
index e565557..b98a571 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -51,7 +51,7 @@ class SclResParserManager{
         int get_modifier_decoration_id(const char *name);
         bool get_nine_patch_info(const char *filename, SclNinePatchInfo *info);
 
-        const char* name();
+        const char* get_name();
         void destroy();
     private:
         SclResParserManager();
index 58187dd..6065aaf 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 #include "sclstructs.h"
 #include "sclresource.h"
 
-#define MAX_SCL_INPUT_MODE 128
-#define MAX_SCL_LAYOUT 255
+#define MAX_SCL_INPUT_MODE 64
+#define MAX_SCL_LAYOUT 128
 #define MAX_SCL_LABEL_PROPERTIES 128
-#define MAX_SCL_MODIFIER_DECORATION_NUM 128
+#define MAX_SCL_MODIFIER_DECORATION_NUM 64
 
 typedef SclInputModeConfigure (*PSclInputModeConfigure);
 typedef SclLayout (*PSclLayout);
index 64c4925..c670682 100644 (file)
@@ -30,8 +30,6 @@ SET(SRCS
     ../res/simple_debug.cpp
 )
 
-SET(PACKAGE ${PROJECT_NAME})
-SET(PKGNAME ${PACKAGE})
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(BINDIR "${PREFIX}/bin")
 SET(METADATADIR "${PREFIX}/share/libscl-ui")
@@ -61,9 +59,6 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fpie -Wall")
 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g")
 
-ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
-ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
-
 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
 
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
index 1b2b42a..c7ed81c 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -90,7 +90,7 @@ encode_autopopup_configure_record(ResourceStorage& storage, const PSclAutoPopupC
 
 int
 encode_autopopup_configure_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
-    int init_size = storage.size();
+    int init_size = storage.get_size();
 
     XMLResource *xmlresource = XMLResource::get_instance();
     PSclAutoPopupConfigure autopopupConfigure = xmlresource->get_autopopup_configure();
@@ -107,10 +107,10 @@ encode_autopopup_configure_file(ResourceStorage& storage, IMetaData_Helper& md_h
 
     encode_autopopup_configure_record(storage, autopopupConfigure, record_width);
 
-    int size = storage.size() - init_size;
+    int size = storage.get_size() - init_size;
     storage.random_put<sint_t>(size, 8, init_size);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -119,7 +119,7 @@ encode_autopopup_configure_file(const char* file, IMetaData_Helper& md_helper) {
     ResourceStorage storage;
     encode_autopopup_configure_file(storage, md_helper);
     storage.toFile(file);
-    return storage.size();
+    return storage.get_size();
 }
 int
 encode_autopopup_configure_file(const char* file, int &offset, IMetaData_Helper& md_helper) {
@@ -128,5 +128,5 @@ encode_autopopup_configure_file(const char* file, int &offset, IMetaData_Helper&
     encode_autopopup_configure_file(storage, md_helper);
     storage.toFile(file, offset);
 
-    return storage.size();
+    return storage.get_size();
 }
index 476409c..55c45da 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -91,7 +91,7 @@ encode_default_configure_record(ResourceStorage& storage, const PSclDefaultConfi
 
 int
 encode_default_configure_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
-    int init_size = storage.size();
+    int init_size = storage.get_size();
 
     XMLResource *xmlresource = XMLResource::get_instance();
     PSclDefaultConfigure defaultConfigure = xmlresource->get_default_configure();
@@ -106,9 +106,9 @@ encode_default_configure_file(ResourceStorage& storage, IMetaData_Helper& md_hel
     storage.reserve(8);
     encode_default_configure_record(storage, defaultConfigure, record_width);
 
-    int size = storage.size() - init_size;
+    int size = storage.get_size() - init_size;
     storage.random_put<sint_t>(size, 8, init_size);
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -119,7 +119,7 @@ encode_default_configure_file(const char* file, IMetaData_Helper& md_helper) {
     encode_default_configure_file(storage, md_helper);
     storage.toFile(file);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -130,5 +130,5 @@ encode_default_configure_file(const char* file, int& offset, IMetaData_Helper& m
     encode_default_configure_file(storage, md_helper);
     storage.toFile(file, offset);
 
-    return storage.size();
+    return storage.get_size();
 }
index 1221549..d8a4bf7 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -44,7 +44,7 @@ encode_input_mode_configure_record(ResourceStorage& storage, const PSclInputMode
 
 int encode_input_mode_configure_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
 
-    int init_size = storage.size();
+    int init_size = storage.get_size();
     /*size 4bytes*/
     const int INPUT_MODE_CONFIGURE_SIZE_WIDTH = 4;
 
@@ -69,9 +69,9 @@ int encode_input_mode_configure_file(ResourceStorage& storage, IMetaData_Helper&
         cur++;
     }
 
-    int advance_size = storage.size() - init_size;
+    int advance_size = storage.get_size() - init_size;
     storage.random_put<sint_t>(advance_size, 8, init_size);
-    return storage.size();
+    return storage.get_size();
 }
 
 int encode_input_mode_configure_file(const char* file, int& offset, IMetaData_Helper& md_helper) {
@@ -81,7 +81,7 @@ int encode_input_mode_configure_file(const char* file, int& offset, IMetaData_He
     encode_input_mode_configure_file(storage, md_helper);
     storage.toFile(file, offset);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int encode_input_mode_configure_file(const char* file, IMetaData_Helper& md_helper) {
@@ -91,5 +91,5 @@ int encode_input_mode_configure_file(const char* file, IMetaData_Helper& md_help
     encode_input_mode_configure_file(storage, md_helper);
     storage.toFile(file);
 
-    return storage.size();
+    return storage.get_size();
 }
index 5603703..49dde94 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -237,7 +237,7 @@ encode_key_coordinate_frame_file(ResourceStorage& storage, IMetaData_Helper& md_
     // 2 byte (range[0-65536))
     const int KEY_COORDIANTE_REC_DATA_SIZE_BYTES = 2;
 
-    int init_size = storage.size();
+    int init_size = storage.get_size();
     // data size
     storage.reserve(DATA_SIZE_BYTES);
 
@@ -256,19 +256,19 @@ encode_key_coordinate_frame_file(ResourceStorage& storage, IMetaData_Helper& md_
     storage.reserve(KEY_COORDIANTE_REC_DATA_SIZE_BYTES);
 
     Key_coordinate_record_width record_width;
-    set_key_coordinate_record_width(md_helper, record_width);
+    set_key_coordinate_record_width(&md_helper, record_width);
 
 
     int key_coordinate_rec_data_size = 0;
     for ( int i = 0; i < layout_num; ++i) {
         for ( int j = 0; j < pKey_num_array[i]; ++j) {
-            int pre_size = storage.size();
+            int pre_size = storage.get_size();
 
             SclLayoutKeyCoordinatePointer cur = _key_coordinate_pointer_frame[i][j];
             if (!cur) break;
             encode_key_coordinate_record(storage, cur, record_width);
 
-            int aft_size = storage.size();
+            int aft_size = storage.get_size();
             if (key_coordinate_rec_data_size == 0) {
                 key_coordinate_rec_data_size = aft_size - pre_size;
             }
@@ -278,7 +278,7 @@ encode_key_coordinate_frame_file(ResourceStorage& storage, IMetaData_Helper& md_
 
     delete[] pKey_num_array;
 
-    int advance_size = storage.size() - init_size;
+    int advance_size = storage.get_size() - init_size;
     storage.random_put<sint_t>(advance_size, DATA_SIZE_BYTES, init_size);
 
     // random put key_coordinate_rec_data_size
@@ -290,7 +290,7 @@ encode_key_coordinate_frame_file(ResourceStorage& storage, IMetaData_Helper& md_
                                 KEY_COORDIANTE_REC_DATA_SIZE_BYTES,
                                 key_coordinate_rec_data_offset);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -301,7 +301,7 @@ encode_key_coordinate_frame_file(const char* file, int& offset, IMetaData_Helper
     encode_key_coordinate_frame_file(storage, md_helper);
     storage.toFile(file, offset);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -312,5 +312,5 @@ encode_key_coordinate_frame_file(const char* file, IMetaData_Helper& md_helper)
     encode_key_coordinate_frame_file(storage, md_helper);
     storage.toFile(file);
 
-    return storage.size();
+    return storage.get_size();
 }
index 3f3a5d3..7cd4472 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -80,14 +80,10 @@ encode_label_properties_record(ResourceStorage& storage, const PSclLabelProperti
     }
 }
 
-static bool isEmptyRecord(const SclLayoutKeyCoordinate& cur) {
-    return (cur.x == 0 && cur.y == 0 && cur.width == 0 && cur.height == 0);
-}
-
 int
 encode_label_properties_frame_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
 
-    int init_size = storage.size();
+    int init_size = storage.get_size();
 
     /*size 4bytes*/
     const int SIZE_WIDTH = 4;
@@ -116,10 +112,10 @@ encode_label_properties_frame_file(ResourceStorage& storage, IMetaData_Helper& m
         }
     }
 
-    int advance_size = storage.size() - init_size;
+    int advance_size = storage.get_size() - init_size;
     storage.random_put<sint_t>(advance_size, 8, init_size);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -131,7 +127,7 @@ encode_label_properties_frame_file(const char* file, int& offset, IMetaData_Help
     encode_label_properties_frame_file(storage, md_helper);
     storage.toFile(file, offset);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -143,5 +139,5 @@ encode_label_properties_frame_file(const char* file, IMetaData_Helper& md_helper
     encode_label_properties_frame_file(storage, md_helper);
     storage.toFile(file);
 
-    return storage.size();
+    return storage.get_size();
 }
index 64f9b03..5f05bd5 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -123,7 +123,7 @@ encode_layout_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
     // 2 byte (range[0-65536))
     const int LAYOUT_REC_DATA_SIZE_BYTES = 2;
 
-    const int init_size = storage.size();
+    const int init_size = storage.get_size();
 
     XMLResource *xmlresource = XMLResource::get_instance();
     PSclLayout layoutTable = xmlresource->get_layout_table();
@@ -150,10 +150,10 @@ encode_layout_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
 
     int layout_rec_data_size = 0;
     for ( int i = 0; i < size; ++i) {
-        int pre_size = storage.size();
+        int pre_size = storage.get_size();
         encode_layout_record(storage, cur, record_width);
 
-        int aft_size = storage.size();
+        int aft_size = storage.get_size();
         if (layout_rec_data_size == 0) {
             layout_rec_data_size = aft_size - pre_size;
         }
@@ -163,7 +163,7 @@ encode_layout_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
     }
 
     // back write data size
-    int advance_size = storage.size() - init_size;
+    int advance_size = storage.get_size() - init_size;
 
     // random put advance_size
     int data_size_offset = init_size;
@@ -173,7 +173,7 @@ encode_layout_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
     int layout_rec_data_offset = init_size + DATA_SIZE_BYTES + REC_NUM_BYTES;
     storage.random_put<sint_t>(layout_rec_data_size, LAYOUT_REC_DATA_SIZE_BYTES, layout_rec_data_offset);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -185,7 +185,7 @@ encode_layout_file(const char* file, IMetaData_Helper& md_helper) {
 
     storage.toFile(file);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -197,5 +197,5 @@ encode_layout_file(const char* file, int& offset, IMetaData_Helper& md_helper) {
 
     storage.toFile(file, offset);
 
-    return storage.size();
+    return storage.get_size();
 }
index 95c39cb..dbcef48 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -64,7 +64,7 @@ encode_magnifier_configure_record(ResourceStorage& storage, const PSclMagnifierW
 int
 encode_magnifier_configure_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
 
-    int init_size = storage.size();
+    int init_size = storage.get_size();
 
     XMLResource *xmlresource = XMLResource::get_instance();
     PSclMagnifierWndConfigure magnifierConfigure = xmlresource->get_magnifier_configure();
@@ -80,11 +80,11 @@ encode_magnifier_configure_file(ResourceStorage& storage, IMetaData_Helper& md_h
     storage.reserve(8);
     encode_magnifier_configure_record(storage, magnifierConfigure, record_width);
 
-    int advance_size = storage.size() - init_size;
+    int advance_size = storage.get_size() - init_size;
 
     storage.random_put<sint_t>(advance_size, 8, init_size);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -96,7 +96,7 @@ encode_magnifier_configure_file(const char* file, int& offset, IMetaData_Helper&
     encode_magnifier_configure_file(storage, md_helper);
     storage.toFile(file, offset);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -108,5 +108,5 @@ encode_magnifier_configure_file(const char* file, IMetaData_Helper& md_helper) {
     encode_magnifier_configure_file(storage, md_helper);
     storage.toFile(file);
 
-    return storage.size();
+    return storage.get_size();
 }
index e890b5d..d0262e6 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -36,7 +36,7 @@ encode_metadata_record(ResourceStorage& storage, const MetaData_Record& metadata
 }
 void
 encode_metadata(ResourceStorage& storage, const MetaData& metadata ) {
-    int init_size = storage.size();
+    int init_size = storage.get_size();
 
     storage.reserve(8);
     storage.put(metadata.m_version);
@@ -48,7 +48,7 @@ encode_metadata(ResourceStorage& storage, const MetaData& metadata ) {
         encode_metadata_record(storage, metadata.m_vec_metadata_record.at(i));
     }
 
-    int block_size = storage.size() - init_size;
+    int block_size = storage.get_size() - init_size;
     storage.random_put<sint_t>(block_size, 8, init_size);
 }
 
index 596226d..fe6636a 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -35,7 +35,7 @@ encode_modifier_decoration_record(ResourceStorage& storage, const PSclModifierDe
 int
 encode_modifier_decoration_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
 
-    int init_size = storage.size();
+    int init_size = storage.get_size();
 
     XMLResource *xmlresource = XMLResource::get_instance();
     PSclModifierDecoration modifierDecorationTable = xmlresource->get_modifier_decoration_table();
@@ -60,10 +60,10 @@ encode_modifier_decoration_file(ResourceStorage& storage, IMetaData_Helper& md_h
         cur++;
     }
 
-    int advance_size = storage.size() - init_size;
+    int advance_size = storage.get_size() - init_size;
     storage.random_put<sint_t>(advance_size, 8, init_size);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -75,7 +75,7 @@ encode_modifier_decoration_file(const char* file, IMetaData_Helper& md_helper) {
     encode_modifier_decoration_file(storage, md_helper);
     storage.toFile(file);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -87,5 +87,5 @@ encode_modifier_decoration_file(const char* file, int& offset, IMetaData_Helper&
     encode_modifier_decoration_file(storage, md_helper);
     storage.toFile(file, offset);
 
-    return storage.size();
+    return storage.get_size();
 }
index 643402b..3749558 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -41,7 +41,7 @@ encode_nine_patch_info(ResourceStorage& storage, const SclNinePatchInfo* cur, co
 int
 encode_nine_patch_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
 
-    int init_size = storage.size();
+    int init_size = storage.get_size();
 
     XMLResource *xmlresource = XMLResource::get_instance();
     if (xmlresource == NULL) {
@@ -68,10 +68,10 @@ encode_nine_patch_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
         cur++;
     }
 
-    int size = storage.size() - init_size;
+    int size = storage.get_size() - init_size;
     storage.random_put<sint_t>(size, 8, init_size);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -82,7 +82,7 @@ encode_nine_patch_file(const char* file, IMetaData_Helper& md_helper) {
     encode_nine_patch_file(storage, md_helper);
     storage.toFile(file);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int
@@ -93,5 +93,5 @@ encode_nine_patch_file(const char* file, int& offset,  IMetaData_Helper& md_help
     encode_nine_patch_file(storage, md_helper);
     storage.toFile(file, offset);
 
-    return storage.size();
+    return storage.get_size();
 }
index ada6c84..c766a95 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 0ed66bf..3414dd9 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 61a165f..6cf24ff 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index e7ebc31..0575317 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index e58a836..5f11ca0 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index aa0daa3..a128526 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 84132bd..5abff57 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index e7d3e2f..d4e5730 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 2f49b6c..592965d 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 7757196..a6fd564 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index e0650c0..f0bfc38 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 4db7fe9..d1aac65 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 596c892..281857b 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 615591d..45fd818 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 8a116ef..416469b 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index e18a4bb..71e9ebb 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 196420f..8f767ba 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index b7ed025..932885f 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -75,7 +75,7 @@ class ResourceStorage{
         int random_put(T data, int width, int random_offset);
 
     // get the current used size
-    const int size()const;
+    const int get_size() const;
 
     // get the capability of the storage
     const int capability() const;
index ea7b66a..bc3d5e7 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -43,7 +43,7 @@ inline ResourceStorage::
 }
 
 inline const int ResourceStorage::
-size()const{
+get_size() const{
     return m_size;
 }
 
@@ -123,9 +123,9 @@ reserve(int bytes) {
 }
 inline int ResourceStorage::
 storage_cat(ResourceStorage& storage) {
-    if (storage.size() == 0) return 0;
+    if (storage.get_size() == 0) return 0;
 
-    int size = storage.size();
+    int size = storage.get_size();
     check_storage(size);
     memcpy(m_storage + m_size, storage.m_storage, size);
 
@@ -143,7 +143,7 @@ check_storage(int width) {
 inline void ResourceStorage::
 expand_storage() {
     unsigned int _new_size = (unsigned int)(m_capability + __RE_NEW_LENGTH__);
-    if (_new_size > __MAX_NEW_SIZE__) {
+    if (_new_size > (unsigned int)__MAX_NEW_SIZE__) {
         printf("expand_storage failed: size is limited to %d\n", __MAX_NEW_SIZE__);
         return;
     }
index effe915..33804fc 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -30,7 +30,7 @@ class String_Encoder:public IString_Encoder{
         }
 
         void set_path(const char* file) {
-            this->file = file;
+            this->m_file = file;
         }
 
         /* @ insert str to string vector */
@@ -55,15 +55,15 @@ class String_Encoder:public IString_Encoder{
         int encode() const{
             ResourceStorage storage;
             encode(storage);
-            storage.toFile(file);
-            return storage.size();
+            storage.toFile(m_file);
+            return storage.get_size();
         }
         int encode(int& offset) const{
             ResourceStorage storage;
             encode(storage);
-            storage.toFile(file, offset);
+            storage.toFile(m_file, offset);
 
-            return storage.size();
+            return storage.get_size();
         }
 
         int encode(ResourceStorage& storage) const{
@@ -76,11 +76,11 @@ class String_Encoder:public IString_Encoder{
                 storage.put(it->c_str());
             }
 
-            return storage.size();
+            return storage.get_size();
         }
 
     private:
         std::vector<std::string> m_vec_string;
-        const char* file;
+        const char* m_file;
 };
 #endif
index 714fcb4..f1f24a2 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 108dcf6..f8eea3d 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -41,7 +41,7 @@ encode(const char* file)const{
     encode_metadata(storage, metadata);
     storage.toFile(file);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int MetaData_Handler::
@@ -50,13 +50,13 @@ encode(const char* file, int& offset)const{
     encode_metadata(storage, metadata);
     storage.toFile(file, offset);
 
-    return storage.size();
+    return storage.get_size();
 }
 
 int MetaData_Handler::
 encode(ResourceStorage& storage)const{
     encode_metadata(storage, metadata);
-    return storage.size();
+    return storage.get_size();
 }
 
 const unsigned short MetaData_Handler::
@@ -64,7 +64,7 @@ get_width(const char* field_name) const{
     if (field_name == NULL) return 0;
 
     int idx = m_current_metadata_record_id;
-    if (idx < 0 || idx > metadata.m_vec_metadata_record.size()) return 0;
+    if (idx < 0 || idx > (int)metadata.m_vec_metadata_record.size()) return 0;
 
     const MetaData_Record&  metadata_record = metadata.m_vec_metadata_record.at(idx);
 
@@ -76,7 +76,7 @@ get_width(const char* field_name) const{
 const unsigned short MetaData_Handler::
 get_width(const char* name, const MetaData_Record& metadata_record) const{
     assert(name);
-    for (int i = 0; i < metadata_record.vField.size(); ++i) {
+    for (size_t i = 0; i < metadata_record.vField.size(); ++i) {
         if ( 0 == strcmp(name, metadata_record.vField.at(i).m_name)) {
             return metadata_record.vField.at(i).m_width;
         }
@@ -88,7 +88,7 @@ const int MetaData_Handler::
 find_metadata_record_index(const char* name)const{
     assert(name);
 
-    for ( int i = 0; i < metadata.m_vec_metadata_record.size(); ++i) {
+    for ( size_t i = 0; i < metadata.m_vec_metadata_record.size(); ++i) {
         const MetaData_Record& metadata_record = metadata.m_vec_metadata_record.at(i);
 
         if (0 == strcmp(metadata_record.m_name, name)) {
@@ -109,7 +109,8 @@ parsing_field(const xmlNodePtr node, MetaData_Field& data, const MetaData_Width&
     xmlChar* name = xmlGetProp(node, (const xmlChar*)"name");
     if (name == NULL) return -1;
     /*FIXME strncpy ?*/
-    strcpy(data.m_name, (const char*)name);
+    strncpy(data.m_name, (const char*)name, sizeof(data.m_name));
+    data.m_name[sizeof(data.m_name)-1] = '\0';
     xmlFree(name);
 
     xmlChar* type = xmlGetProp(node, (const xmlChar*)"type");
@@ -118,25 +119,28 @@ parsing_field(const xmlNodePtr node, MetaData_Field& data, const MetaData_Width&
     int ret = 0;
     if (0 == xmlStrcmp(type, (const xmlChar*)"string_id")) {
         /*FIXME use vaule instead string*/
-        strcpy(data.m_type, (const char*)type);
+        strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
+        data.m_type[sizeof(data.m_type) - 1] = '\0';
         data.m_width = metadataWidth.string_id_width;
     } else if ( 0 == xmlStrcmp(type, (const xmlChar*)"int8")) {
-        strcpy(data.m_type, (const char*)type);
+        strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
+        data.m_type[sizeof(data.m_type) - 1] = '\0';
         data.m_width = 1;
-
     } else if ( 0 == xmlStrcmp(type, (const xmlChar*)"int16")) {
-        strcpy(data.m_type, (const char*)type);
+        strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
+        data.m_type[sizeof(data.m_type) - 1] = '\0';
         data.m_width = 2;
-
     } else if ( 0 == xmlStrcmp(type, (const xmlChar*)"int32")) {
-        strcpy(data.m_type, (const char*)type);
+        strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
+        data.m_type[sizeof(data.m_type) - 1] = '\0';
         data.m_width = 4;
-
     } else if ( 0 == xmlStrcmp(type, (const xmlChar*)"float32")) {
-        strcpy(data.m_type, (const char*)type);
+        strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
+        data.m_type[sizeof(data.m_type) - 1] = '\0';
         data.m_width = 4;
     } else if ( 0 == xmlStrcmp(type, (const xmlChar*)"float64")) {
-        strcpy(data.m_type, (const char*)type);
+        strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
+        data.m_type[sizeof(data.m_type) - 1] = '\0';
         data.m_width = 8;
     }
     else{
@@ -153,7 +157,8 @@ parsing_record(const xmlNodePtr curNode, MetaData_Record& metadataRecord, const
     //parsing struct name
     xmlChar* name = xmlGetProp(curNode, (const xmlChar*)"name");
     if (name == NULL) return -1;
-    strcpy(metadataRecord.m_name, (const char*)name);
+    strncpy(metadataRecord.m_name, (const char*)name, sizeof(metadataRecord.m_name));
+    metadataRecord.m_name[sizeof(metadataRecord.m_name)-1] = '\0';
     xmlFree(name);
 
     xmlNodePtr childNode = curNode->xmlChildrenNode;
@@ -227,7 +232,8 @@ parsing_metadata() {
 
     xmlChar* version = xmlGetProp(curNode, (const xmlChar*)"version");
     if (version) {
-        strcpy(metadata.m_version, (const char*)version);
+        strncpy(metadata.m_version, (const char*)version, sizeof(metadata.m_version));
+        metadata.m_version[sizeof(metadata.m_version)-1] = '\0';
         xmlFree(version);
     } else {
         strcpy(metadata.m_version, (const char*)"");
index 0e4a3e0..6b7d960 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -17,7 +17,6 @@
 
 #include <limits.h>
 #include <unistd.h>
-#include "xml2dat.h"
 #include "string_encoder.h"
 #include "metadata_handler.h"
 #include "encode_layout.h"
@@ -172,8 +171,8 @@ int main(const int argc, char* argv[]) {
             rs.put<sint_t>(offset_table[i], OFFSET_WIDTH);
         }
 
-        int offset = 0;
-        int ret = rs.toFile(bin_file, offset);
+        int bin_offset = 0;
+        int ret = rs.toFile(bin_file, bin_offset);
         if (ret < 0) {
             printf("error\n");
             return -1;
index 4305c32..2376889 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -275,9 +275,10 @@ class AutoPopupConfigureParserImpl {
                 button_state = BUTTON_STATE_PRESSED;
             } else if (equal_prop(cur_node, "button_state", "normal")) {
                 button_state = BUTTON_STATE_NORMAL;
-            }
-            else if (equal_prop(cur_node, "button_state", "disabled")) {
+            } else if (equal_prop(cur_node, "button_state", "disabled")) {
                 button_state = BUTTON_STATE_DISABLED;
+            } else if (equal_prop(cur_node, "button_state", "toggled")) {
+                button_state = BUTTON_STATE_TOGGLED;
             }
             return button_state;
 
index 2113b12..ec52c6e 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index be8757d..b227be0 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 203ca21..bbbe19b 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 8ec0130..a7f9698 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 3a5a032..d0810f5 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 31e3eaf..e62829b 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -19,6 +19,7 @@
 #define __LAYOUT_PARSER__H__
 
 #include "sclres_type.h"
+#include <vector>
 
 class LayoutParserImpl;
 
@@ -27,7 +28,8 @@ class LayoutParser {
     public:
     ~LayoutParser();
     static LayoutParser *get_instance();
-    int init(const char *dir, char **layout_files, int size);
+    int init(const char *dir,
+        const std::vector<std::string> &vec_layout_file_name);
 
     void load(int layout_id);
     void unload();
index 77274ed..c6c0b82 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -57,8 +57,9 @@ class ButtonTypeHelper{
         static const int ROTATION = 5;
         static const int DIRECTION = 6;
         static const int RELATIVE_DIRECTION = 7;
-        static const int UIITEM = 8;
-        static const int MAX = 9;
+        static const int TOGGLE = 8;
+        static const int UIITEM = 9;
+        static const int MAX = 10;
         static const int DEFAULT = 0;
 
         static const std::string pcNormal;
@@ -69,6 +70,7 @@ class ButtonTypeHelper{
         static const std::string pcRotation;
         static const std::string pcDirection;
         static const std::string pcRelative_Direction;
+        static const std::string pcToggle;
         static const std::string pcUiitem;
 
         static const std::string toString(const int val);
index edbf61a..a4e8c9f 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 4862cde..82c6e28 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index a6b3fdf..0a4f168 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 4c0f40e..fccd249 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index b645656..1ed8aa4 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index e42cbd0..3f74b23 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -61,7 +61,7 @@ class XMLResource: public sclres::SclRes{
     int get_modifier_decoration_id(const char *name);
     bool get_nine_patch_info(const char *filename, SclNinePatchInfo *info);
 
-    const char* name() {
+    const char* get_name() {
         return "xmlparser";
     }
 
index bd9822c..8ab7a58 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -76,7 +76,6 @@ class InputModeConfigureParserImpl {
             xmlDocPtr doc;
             xmlNodePtr cur_node;
 
-            xmlChar* key;
 
             doc = xmlReadFile(input_file, NULL, 0);
             if (doc == NULL) {
@@ -103,16 +102,6 @@ class InputModeConfigureParserImpl {
             SclInputModeConfigure* cur_rec = m_input_mode_configure_table;
             while (cur_node != NULL) {
                 if (0 == xmlStrcmp(cur_node->name, (const xmlChar *)INPUT_MODE_CONFIGURE_MODE_TAG)) {
-                    set_input_mode_configure_default_record(cur_rec);
-
-                    key = xmlGetProp(cur_node, (const xmlChar*)INPUT_MODE_CONFIGURE_MODE_NAME_ATTRIBUTE);
-                    if (key) {
-                        cur_rec->name = (sclchar*)key;
-                    }
-
-                    get_prop_bool(cur_node, INPUT_MODE_CONFIGURE_MODE_DIM_WINDOW_ATTRIBUTE, &(cur_rec->use_dim_window));
-                    get_prop_bool(cur_node, INPUT_MODE_CONFIGURE_MODE_VIRTUAL_WINDOW_ATTRIBUTE, &(cur_rec->use_virtual_window));
-
                     parsing_mode_node(cur_node, cur_rec);
                     m_inputmode_size++;
                     cur_rec++;
@@ -140,9 +129,9 @@ class InputModeConfigureParserImpl {
         void parsing_mode_node(const xmlNodePtr cur_node, const PSclInputModeConfigure cur_rec) {
             assert(cur_node != NULL);
             assert(cur_rec != NULL);
+            set_input_mode_configure_default_record(cur_rec);
 
-            sclboolean val;
-            get_prop_bool(cur_node, INPUT_MODE_CONFIGURE_MODE_VIRTUAL_WINDOW_ATTRIBUTE, &val);
+            get_prop_bool(cur_node, INPUT_MODE_CONFIGURE_MODE_VIRTUAL_WINDOW_ATTRIBUTE, &(cur_rec->use_virtual_window));
             get_prop_bool(cur_node, INPUT_MODE_CONFIGURE_MODE_DIM_WINDOW_ATTRIBUTE, &(cur_rec->use_dim_window));
 
             xmlChar* temp = xmlGetProp(cur_node, (const xmlChar*)INPUT_MODE_CONFIGURE_MODE_NAME_ATTRIBUTE);
index 64ceea3..15dbe7b 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -45,7 +45,7 @@ match_alignment(const char* key) {
 
     int value = LABEL_ALIGN_LEFT_TOP;
 
-    for(int i = 0; i < sizeof(table)/sizeof(Match_table_t); ++i) {
+    for(size_t i = 0; i < sizeof(table)/sizeof(Match_table_t); ++i) {
         if (0 == strcmp(key, table[i].key))
         {
             value = table[i].value;
@@ -80,7 +80,7 @@ match_shadow_direction(const char* key) {
 
     int value = SHADOW_DIRECTION_NONE;
 
-    for(int i = 0; i < sizeof(table)/sizeof(Match_table_t); ++i) {
+    for(size_t i = 0; i < sizeof(table)/sizeof(Match_table_t); ++i) {
         if (0 == strcmp(key, table[i].key))
         {
             value = table[i].value;
@@ -369,9 +369,10 @@ class LabelPropertiesParserImpl {
             button_state = BUTTON_STATE_PRESSED;
         } else if (equal_prop(cur_node, "button", "normal")) {
             button_state = BUTTON_STATE_NORMAL;
-        }
-        else if (equal_prop(cur_node, "button", "disabled")) {
+        } else if (equal_prop(cur_node, "button", "disabled")) {
             button_state = BUTTON_STATE_DISABLED;
+        } else if (equal_prop(cur_node, "button", "toggled")) {
+            button_state = BUTTON_STATE_TOGGLED;
         }
         return button_state;
     }
index 26077d2..a0ead26 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -81,6 +81,7 @@ using namespace std;
 #define LAYOUT_BACKGROUND_NORMAL_TAG "button_normal"
 #define LAYOUT_BACKGROUND_PRESSED_TAG "button_pressed"
 #define LAYOUT_BACKGROUND_DISABLED_TAG "button_disabled"
+#define LAYOUT_BACKGROUND_TOGGLED_TAG "button_toggled"
 
 #define LAYOUT_ROW_TAG "row"
 #define LAYOUT_ROW_SUBLAYOUT_ID_ATTRIBUTE "sub_layout"
@@ -182,7 +183,7 @@ class LayoutParserImpl {
         int get_multitouch_type_prop(const xmlNodePtr cur_node);
         int get_extra_option_prop(const xmlNodePtr cur_node);
 
-        int parsing_layout_table(char **layout_files, int size);
+        int parsing_layout_table(const vector<string> &layout_file_name);
         void parsing_layout_node(const xmlNodePtr cur_node, const PSclLayout cur_rec_layout, int layout_no);
         void loading_coordinate_resources(const xmlNodePtr cur_node, const PSclLayout cur_rec_layout, int layout_no);
         void parsing_background(const xmlNodePtr cur_node, const PSclLayout);
@@ -218,7 +219,7 @@ class LayoutParserImpl {
     private:
         int m_layout_size;
         SclLayout m_layout_table[MAX_SCL_LAYOUT];
-        sclchar *m_layout_files[MAX_SCL_LAYOUT];
+        vector<string> m_file_names;
         SclLayoutKeyCoordinate* m_key_coordinate_pointer_frame[MAX_SCL_LAYOUT][MAX_KEY];
 
         std::vector<xmlChar*> m_vec_layout_strings;
@@ -229,7 +230,6 @@ class LayoutParserImpl {
 
 LayoutParserImpl::LayoutParserImpl() {
     m_layout_size = 0;
-    memset(m_layout_files, 0x00, sizeof(char*) * MAX_SCL_LAYOUT);
     memset(m_layout_table, 0x00, sizeof(SclLayout) * MAX_SCL_LAYOUT);
     memset(m_key_coordinate_pointer_frame, 0x00, sizeof(SclLayoutKeyCoordinatePointer) * MAX_SCL_LAYOUT * MAX_KEY);
 }
@@ -240,11 +240,6 @@ LayoutParserImpl::~LayoutParserImpl() {
             free(m_key_coordinate_pointer_frame[i][j]);
             m_key_coordinate_pointer_frame[i][j] = NULL;
         }
-
-        if (m_layout_files[i]) {
-            free(m_layout_files[i]);
-            m_layout_files[i] = NULL;
-        }
     }
 
     release_layout_strings();
@@ -257,12 +252,10 @@ LayoutParserImpl::load(int layout_id) {
         xmlDocPtr doc;
         xmlNodePtr cur_node;
 
-        char input_file[_POSIX_PATH_MAX] = {0};
-        snprintf(input_file, _POSIX_PATH_MAX, "%s/%s", m_dir.c_str(), m_layout_files[layout_id]);
-
-        doc = xmlReadFile(input_file, NULL, 0);
+        string input_file = m_dir + "/" + m_file_names[layout_id];
+        doc = xmlReadFile(input_file.c_str(), NULL, 0);
         if (doc == NULL) {
-            SCLLOG(SclLog::ERROR, "Could not load file: %s.", input_file);
+            SCLLOG(SclLog::ERROR, "Could not load file: %s.", input_file.c_str());
             exit(1);
         }
 
@@ -324,7 +317,7 @@ LayoutParserImpl::add_layout_string(xmlChar* newstr) {
 
 void
 LayoutParserImpl::release_layout_strings() {
-    for(int loop = 0;loop < m_vec_layout_strings.size();loop++) {
+    for(size_t loop = 0; loop < m_vec_layout_strings.size(); loop++) {
         if (m_vec_layout_strings[loop]) {
             xmlFree(m_vec_layout_strings[loop]);
         }
@@ -341,7 +334,7 @@ LayoutParserImpl::add_key_string(xmlChar* newstr) {
 
 void
 LayoutParserImpl::release_key_strings() {
-    for(int loop = 0;loop < m_vec_key_strings.size();loop++) {
+    for(size_t loop = 0; loop < m_vec_key_strings.size(); loop++) {
         if (m_vec_key_strings[loop]) {
             xmlFree(m_vec_key_strings[loop]);
         }
@@ -351,18 +344,14 @@ LayoutParserImpl::release_key_strings() {
 
 int
 LayoutParserImpl::get_layout_index(const char *name) {
-    int ret = NOT_USED;
-    if (name) {
-        for(int loop = 0;loop < MAX_SCL_LAYOUT && ret == NOT_USED;loop++) {
-            if (m_layout_table[loop].name) {
-                if (strcmp(m_layout_table[loop].name, name) == 0) {
-                    ret = loop;
-                    break;
-                }
-            }
-        }
+    string strName = (string)name;
+    vector<string>::iterator it;
+    // make sure that the m_file_names are sorted.
+    it = lower_bound(m_file_names.begin(), m_file_names.end(), strName);
+    if (it != m_file_names.end() && *it == strName) {
+        return it-m_file_names.begin();
     }
-    return ret;
+    return NOT_USED;
 }
 
 PSclLayout
@@ -381,14 +370,15 @@ LayoutParserImpl::get_key_coordinate_pointer_frame() {
 }
 
 int
-LayoutParserImpl::parsing_layout_table(char** file, int file_num) {
-    m_layout_size = file_num;
-    for (int index = 0; index < file_num; ++index) {
-        m_layout_files[index] = strdup(file[index]);
+LayoutParserImpl::parsing_layout_table(const vector<string> &vec_file) {
+    m_file_names = vec_file;
+    m_layout_size = vec_file.size();
+    vector<string>::const_iterator it;
+    for (it = vec_file.begin(); it != vec_file.end(); it++) {
         xmlDocPtr doc;
         xmlNodePtr cur_node;
 
-        string input_file = m_dir + "/" + m_layout_files[index];
+        string input_file = m_dir + "/" + *it;
         doc = xmlReadFile(input_file.c_str(), NULL, 0);
         if (doc == NULL) {
             SCLLOG(SclLog::DEBUG, "Could not load file: %s.", input_file.c_str());
@@ -408,9 +398,10 @@ LayoutParserImpl::parsing_layout_table(char** file, int file_num) {
             return -1;
         }
 
-        PSclLayout cur_rec_layout = m_layout_table + index;
-        parsing_layout_node(cur_node, cur_rec_layout, index);
-        cur_rec_layout->name = (sclchar*)strdup(m_layout_files[index]);
+        int layout_id = it - vec_file.begin();
+        PSclLayout cur_rec_layout = &(m_layout_table[layout_id]);
+        parsing_layout_node(cur_node, cur_rec_layout, layout_id);
+        cur_rec_layout->name = (sclchar*)strdup(it->c_str());
 
         xmlFreeDoc(doc);
     }
@@ -426,20 +417,22 @@ LayoutParserImpl::parsing_background(
 
     xmlNodePtr child_node = cur_node->xmlChildrenNode;
     while ( child_node != NULL) {
-        if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )"button_normal") ) {
+        if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )LAYOUT_BACKGROUND_NORMAL_TAG) ) {
             xmlChar *key = xmlNodeGetContent(child_node);
             cur_layout->image_path[BUTTON_STATE_NORMAL] = (char *)key;
             add_layout_string(key);
-        }
-        else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )"button_pressed") ) {
+        } else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )LAYOUT_BACKGROUND_PRESSED_TAG) ) {
             xmlChar *key = xmlNodeGetContent(child_node);
             cur_layout->image_path[BUTTON_STATE_PRESSED] = (char *)key;
             add_layout_string(key);
-        }
-        else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )"button_disabled") ) {
+        } else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )LAYOUT_BACKGROUND_DISABLED_TAG ) ) {
             xmlChar *key = xmlNodeGetContent(child_node);
             cur_layout->image_path[BUTTON_STATE_DISABLED] = (char *)key;
             add_layout_string(key);
+        } else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )LAYOUT_BACKGROUND_TOGGLED_TAG ) ) {
+            xmlChar *key = xmlNodeGetContent(child_node);
+            cur_layout->image_path[BUTTON_STATE_TOGGLED] = (char *)key;
+            add_layout_string(key);
         }
 
         child_node = child_node->next;
@@ -499,6 +492,7 @@ LayoutParserImpl::set_default_layout_value(const PSclLayout cur_layout) {
     cur_layout->image_path[BUTTON_STATE_NORMAL]      = NULL;
     cur_layout->image_path[BUTTON_STATE_PRESSED]     = NULL;
     cur_layout->image_path[BUTTON_STATE_DISABLED]    = NULL;
+    cur_layout->image_path[BUTTON_STATE_TOGGLED]     = NULL;
 
     cur_layout->use_sw_button = false;
     cur_layout->use_magnifier_window = false;
@@ -675,11 +669,8 @@ LayoutParserImpl::parsing_layout_node(
 
     set_default_layout_value(cur_rec_layout);
 
-    int row_y = 0;
     xmlChar* key;
 
-    SclLayoutKeyCoordinatePointer *cur_key = &m_key_coordinate_pointer_frame[layout_no][0];
-
     if (equal_prop(cur_node, LAYOUT_DIRECTION_ATTRIBUTE,
         LAYOUT_DIRECTION_ATTRIBUTE_LANDSCAPE_VALUE)) {
         cur_rec_layout->display_mode = DISPLAYMODE_LANDSCAPE;
@@ -759,7 +750,6 @@ LayoutParserImpl::loading_coordinate_resources(
     assert(cur_node != NULL);
 
     int row_y = 0;
-    xmlChar* key;
 
     SclLayoutKeyCoordinatePointer *cur_key = &m_key_coordinate_pointer_frame[layout_no][0];
 
@@ -838,7 +828,7 @@ LayoutParserImpl::get_drag_state_prop(const xmlNodePtr cur_node) {
 
     int drag_state = SCL_DRAG_STATE_NONE;
 
-    for(int i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
+    for(size_t i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
         if (0 == strcmp((const char*)key, table[i].key))
         {
             drag_state = table[i].value;
@@ -860,7 +850,6 @@ LayoutParserImpl::get_shift_state_prop(const xmlNodePtr cur_node) {
         shift_state = SCL_SHIFT_STATE_ON;
     } else if (equal_prop(cur_node, "shift", "off")) {
         shift_state = SCL_SHIFT_STATE_OFF;
-
     } else if (equal_prop(cur_node, "shift", "loc")) {
         shift_state = SCL_SHIFT_STATE_LOCK;
     }
@@ -875,9 +864,10 @@ LayoutParserImpl::get_button_state_prop(const xmlNodePtr cur_node) {
         button_state = BUTTON_STATE_PRESSED;
     } else if (equal_prop(cur_node, "button", "normal")) {
         button_state = BUTTON_STATE_NORMAL;
-    }
-    else if (equal_prop(cur_node, "button", "disabled")) {
+    } else if (equal_prop(cur_node, "button", "disabled")) {
         button_state = BUTTON_STATE_DISABLED;
+    } else if (equal_prop(cur_node, "button", "toggled")) {
+        button_state = BUTTON_STATE_TOGGLED;
     }
     return button_state;
 }
@@ -901,7 +891,7 @@ LayoutParserImpl::get_multitouch_type_prop(const xmlNodePtr cur_node) {
 
     int type = SCL_MULTI_TOUCH_TYPE_EXCLUSIVE;
 
-    for(int i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
+    for(size_t i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
         if (0 == strcmp((const char*)key, table[i].key))
         {
             type = table[i].value;
@@ -936,7 +926,7 @@ LayoutParserImpl::get_extra_option_prop(
 
     int type = DIRECTION_EXTRA_OPTION_4_DIRECTIONS;
 
-    for(int i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
+    for(size_t i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
         if (0 == strcmp((const char*)key, table[i].key))
         {
             type = table[i].value;
@@ -1442,11 +1432,11 @@ LayoutParser::get_instance() {
 }
 
 int
-LayoutParser::init(const char* dir, char **layout_files, int size) {
+LayoutParser::init(const char* dir, const vector<string> &vec_file) {
     int ret = -1;
-    if (dir && layout_files) {
+    if (dir) {
         m_impl->set_directory(dir);
-        ret = m_impl->parsing_layout_table(layout_files, size);
+        ret = m_impl->parsing_layout_table(vec_file);
     }
 
     return ret;
index 6b730d6..e304ce5 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -82,6 +82,7 @@ const string ButtonTypeHelper::pcMultitap = "multitap";
 const string ButtonTypeHelper::pcRotation = "rotation";
 const string ButtonTypeHelper::pcDirection = "direction";
 const string ButtonTypeHelper::pcRelative_Direction = "relative_direction";
+const string ButtonTypeHelper::pcToggle = "toggle";
 const string ButtonTypeHelper::pcUiitem = "uiitem";
 
 const string ButtonTypeHelper::toString(const int val) {
@@ -126,6 +127,8 @@ const int ButtonTypeHelper::Int(const string str) {
         return DIRECTION;
     } else if (str ==  pcRelative_Direction) {
         return RELATIVE_DIRECTION;
+    } else if (str ==  pcToggle) {
+        return TOGGLE;
     } else if (str ==  pcUiitem) {
         return UIITEM;
     } else {
index e969d81..d3f0e34 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 5a587c8..7e122ba 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -33,19 +33,16 @@ class MainEntryParserImpl {
 
             doc = xmlReadFile(input_file, NULL, 0);
             if (doc == NULL) {
-                SCLLOG(SclLog::DEBUG, "Could not load file: %s.", input_file);
                 return -1;
             }
 
             cur_node = xmlDocGetRootElement(doc);
             if (cur_node == NULL) {
-                SCLLOG(SclLog::DEBUG, "MainEntryParser: empty document.\n");
                 xmlFreeDoc(doc);
                 return -1;
             }
             if (0 != xmlStrcmp(cur_node->name, (const xmlChar*)"main-entry"))
             {
-                SCLLOG(SclLog::DEBUG, "MainEntryParser: root name error: %s\n!", (char *)cur_node->name);
                 xmlFreeDoc(doc);
                 return -1;
             }
@@ -111,9 +108,7 @@ MainEntryParser::MainEntryParser() {
 
 MainEntryParser::~MainEntryParser() {
     if (m_impl) {
-        SCLLOG(SclLog::MESSAGE, "~MainEntryParser() has called");
         delete m_impl;
-        m_impl = NULL;
     }
 }
 
index 42e2ac8..16febf3 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -80,7 +80,7 @@ get_key_modifier_state_prop(const char* key ) {
 
     int key_modifier_state = KEY_MODIFIER_NONE;
 
-    for(int i = 0; i < sizeof(table)/sizeof(Key_modifier_state_match_table_t); ++i) {
+    for(size_t i = 0; i < sizeof(table)/sizeof(Key_modifier_state_match_table_t); ++i) {
         if (0 == strcmp(key, table[i].key) )
         {
             key_modifier_state = table[i].key_modifier_state;
index 4b275b5..13e444e 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index 39e0374..045ca9a 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
index c872c03..53e2fab 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
  *
- * Licensed under the Flora License, Version 1.1 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://floralicense.org/license/
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 #include <assert.h>
 #include <limits.h>
 #include <string.h>
+#include <string>
+#include <vector>
+#include <algorithm>
 #include "xmlresource.h"
 #include "simple_debug.h"
-
+using namespace std;
 using namespace xmlresource;
 
 XMLResource::XMLResource() {
@@ -55,56 +58,28 @@ XMLResource::get_instance() {
 }
 
 static void
-get_layout_files(char **layout_files, int* size) {
-    if (layout_files == NULL) return;
-    int layout_file_size = 0;
-
-    InputModeConfigParser *input_mode_configure_parser = InputModeConfigParser::get_instance();
-    for(int inputmode = 0; inputmode < MAX_SCL_INPUT_MODE; inputmode++) {
-        int empty_index;
-        const sclchar* cur_layout_file;
-        PSclInputModeConfigure configure_table = input_mode_configure_parser->get_input_mode_configure_table();
-        SclInputModeConfigure& cur_input_mode_configure = configure_table[inputmode];
-
-        for(int display = 0; display < DISPLAYMODE_MAX; display++) {
-            char *cur_layout_file = cur_input_mode_configure.layouts[display];
-            if (cur_layout_file == NULL) {
-                continue;
-            }
-            bool found = false;
-            int empty_index = NOT_USED;
-
-            for(int checkidx = 0; checkidx < MAX_SCL_LAYOUT; checkidx++) {
-                // not found (assert array end with null)
-                if (layout_files[checkidx] == NULL) {
-                    empty_index = checkidx;
-                    break;
-                }
-                // found layout
-                else if (strncmp(layout_files[checkidx], cur_layout_file, _POSIX_PATH_MAX) == 0) {
-                    found = true;
-                    break;
-                }
-            }
-
-            if (found) {
-                continue;
-            }
-
-            if (empty_index == NOT_USED) {
-                SCLLOG(SclLog::ERROR, "No space for new layout %s\n", cur_layout_file);
-            }
-
-            if (empty_index != NOT_USED) {
-                layout_file_size++;
-                layout_files[empty_index] = strdup(cur_layout_file);
+get_layout_files(PSclInputModeConfigure input_mode_table,
+    size_t input_mode_size, vector<string> &vec_file) {
+    vec_file.clear();
+    for (unsigned int mode = 0; mode < input_mode_size; mode++) {
+        SclInputModeConfigure &input_mode = input_mode_table[mode];
+        for (int direct = 0; direct < DISPLAYMODE_MAX; direct++) {
+            char * layout_file_path = input_mode.layouts[direct];
+            if (layout_file_path
+                    && 0 != strcmp(layout_file_path, "")) {
+                vec_file.push_back(layout_file_path);
             }
         }
     }
-    if (size) {
-        *size = layout_file_size;
-    }
+
+    // quick sort
+    std::sort(vec_file.begin(), vec_file.end());
+    // use std::unique() to puts duplicates to the [last, end)
+    vector<string>::iterator last = std::unique(vec_file.begin(), vec_file.end());
+    // remove the duplicated items, [last, end)
+    vec_file.erase(last, vec_file.end());
 }
+
 void
 XMLResource::init(const char *entry_filepath) {
     if (m_main_entry_parser == NULL) {
@@ -203,26 +178,17 @@ XMLResource::init(const char *entry_filepath) {
     SCLLOG(SclLog::MESSAGE, "init layout\n\n");
     if (m_layout_parser == NULL) {
         m_layout_parser = LayoutParser::get_instance();
-        char **layout_files = NULL;
-        int layout_file_size = 0;
-
-        layout_files = (char**)malloc(sizeof(char*) * MAX_SCL_LAYOUT);
-        if (layout_files == NULL) {
-            SCLLOG(SclLog::ERROR, "layout init");
-            exit(1);
-        }
-        memset(layout_files, 0, sizeof(char*) * MAX_SCL_LAYOUT);
 
-        get_layout_files(layout_files, &layout_file_size);
-        if ( 0 != m_layout_parser->init(get_resource_directory(), layout_files, layout_file_size)) {
+        vector<string> vec_layout_file_name;
+        get_layout_files(
+            m_input_mode_configure_parser->get_input_mode_configure_table(),
+            m_input_mode_configure_parser->get_inputmode_size(),
+            vec_layout_file_name);
+        if ( 0 != m_layout_parser->init(get_resource_directory(),
+            vec_layout_file_name)) {
             /* layout is necessary */
             SCLLOG(SclLog::ERROR, "layout init");
         }
-        for (int i = 0; i < layout_file_size; ++i) {
-            free(layout_files[i]);
-        }
-
-        free(layout_files);
     }
 
     SCLLOG(SclLog::MESSAGE, "init Text XML resources OK.\n\n");