tizen 2.4 release accepted/tizen_2.4_mobile tizen_2.4 accepted/tizen/2.4/mobile/20151029.041805 submit/tizen_2.4/20151028.062511 tizen_2.4_mobile_release
authorjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 06:32:11 +0000 (15:32 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 06:32:11 +0000 (15:32 +0900)
48 files changed:
CMakeLists.txt [new file with mode: 0755]
LICENSE [new file with mode: 0755]
NOTICE [new file with mode: 0755]
attach-panel-camera.manifest [new file with mode: 0644]
attach-panel-camera.xml [new file with mode: 0755]
inc/attach-panel-camera.h [new file with mode: 0644]
inc/utils/config.h [new file with mode: 0755]
inc/utils/logger.h [new file with mode: 0644]
inc/utils/ui-utils.h [new file with mode: 0644]
inc/view/main-view.h [new file with mode: 0755]
inc/view/window.h [new file with mode: 0644]
packaging/attach-panel-camera.spec [new file with mode: 0755]
po/CMakeLists.txt [new file with mode: 0644]
po/POTFILES.in [new file with mode: 0644]
po/update-po.sh [new file with mode: 0644]
res/edje/attach-panel-camera.edc [new file with mode: 0755]
res/images/back.png [new file with mode: 0644]
res/images/bar.png [new file with mode: 0644]
res/images/camera_btn_camcorder.png [new file with mode: 0644]
res/images/camera_btn_camcorder_press.png [new file with mode: 0644]
res/images/camera_btn_switch.png [new file with mode: 0644]
res/images/camera_btn_switch_press.png [new file with mode: 0644]
res/images/camera_icon_recording.png [new file with mode: 0755]
res/images/camera_icon_recording_pause.png [new file with mode: 0755]
res/images/camera_rec_pause.png [new file with mode: 0755]
res/images/camera_rec_pause_press.png [new file with mode: 0755]
res/images/camera_rec_recording.png [new file with mode: 0755]
res/images/camera_rec_recording_press.png [new file with mode: 0755]
res/images/camera_rec_stop.png [new file with mode: 0755]
res/images/camera_rec_stop_press.png [new file with mode: 0755]
res/images/changecamera.png [new file with mode: 0644]
res/images/changecamera_press.png [new file with mode: 0644]
res/images/none.png [new file with mode: 0644]
res/images/shutter.png [new file with mode: 0644]
res/images/shutter2.png [new file with mode: 0644]
res/images/shutter_dim.png [new file with mode: 0755]
res/images/timer_10.png [new file with mode: 0644]
res/images/timer_10_selected.png [new file with mode: 0644]
res/images/timer_2.png [new file with mode: 0644]
res/images/timer_2_selected.png [new file with mode: 0644]
res/images/timer_5.png [new file with mode: 0644]
res/images/timer_5_selected.png [new file with mode: 0644]
res/images/transparent.png [new file with mode: 0644]
res/sounds/sounds_count.mp3 [new file with mode: 0644]
src/attach-panel-camera.c [new file with mode: 0755]
src/utils/ui-utils.c [new file with mode: 0644]
src/view/main-view.c [new file with mode: 0755]
src/view/window.c [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..b95d686
--- /dev/null
@@ -0,0 +1,116 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(attach-panel-camera C)
+
+message(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
+message("furcate arm or i686")
+EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_VERSION)
+message("This package is building by ${CMAKE_SYSTEM_VERSION}")
+message(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+       SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX}/ug)
+SET(LIBDIR "${PREFIX}/lib")
+SET(RESDIR "${PREFIX}/res")
+SET(DATADIR "${PREFIX}/data")
+SET(LOCALEDIR "${RESDIR}/locale")
+SET(IMAGEDIR "${RESDIR}/images")
+SET(EDJEDIR "${RESDIR}/edje")
+SET(ETCDIR "${RESDIR}/etc")
+
+SET(VERSION 1.0)
+
+ADD_DEFINITIONS("-D_USE_DLOG_")
+ADD_DEFINITIONS("-D_USE_SECURE_LOG_")
+ADD_DEFINITIONS("-D_USE_ROTATE_BG_GE")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+#ADD_DEFINITIONS("-D_USE_CUSTOMIZED_GENGRID_STYLE")
+#ADD_DEFINITIONS("-D_USE_SHOW_SELECTED_COUNT_IN_TITLE")
+#ADD_DEFINITIONS("-D_USE_ADD_TO_HOME_FOR_IMAGES")
+
+file(GLOB UG_SRCS
+       "src/*.c"
+       "src/utils/*.c"
+       "src/view/*.c"
+)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc
+                                       ${CMAKE_CURRENT_SOURCE_DIR}/inc/utils
+                                       ${CMAKE_CURRENT_SOURCE_DIR}/inc/view
+                                       )
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+       elementary
+       evas
+       edje
+       ecore
+       capi-appfw-application
+       ui-gadget-1
+       capi-content-media-content
+       capi-media-camera
+       capi-media-image-util
+       capi-media-recorder
+       capi-system-device
+       libexif
+)
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=hidden")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fpie")
+SET(CMAKE_C_FLAGS_RELEASE "-O2 -fpie")
+SET(CMAKE_LDFLAGS "-Wl,-zdefs" )
+SET(camera_UG_PROJECT_NAME attach-panel-camera)
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+
+if(NOT "${CMAKE_SYSTEM_VERSION}" MATCHES "^arm.*")
+       ADD_DEFINITIONS(-DCAMERA_MACHINE_I686)
+endif()
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+       ADD_DEFINITIONS("-DTARGET")
+       MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+#SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${UG_SRCS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.0.1)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-ldl")
+
+# EDJ
+ADD_CUSTOM_COMMAND(OUTPUT attach-panel-camera.edj
+
+                COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/res/images/
+                               -sd  ${CMAKE_CURRENT_SOURCE_DIR}/res/sounds
+                ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/attach-panel-camera.edc
+                               ${CMAKE_BINARY_DIR}/attach-panel-camera.edj
+                DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/attach-panel-camera.edc
+)
+
+
+ADD_CUSTOM_TARGET(attach-panel-camera_edj_build DEPENDS attach-panel-camera.edj)
+ADD_DEPENDENCIES(${PROJECT_NAME} attach-panel-camera_edj_build)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/apps/${PROJECT_NAME}/lib/ug/)
+
+INSTALL(FILES ${CMAKE_BINARY_DIR}/attach-panel-camera.edj DESTINATION /usr/ug/res/edje/${PROJECT_NAME}/)
+
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION /usr/ug/res/images/${PROJECT_NAME}/)
+
+
+#INSTALL(FILES ${PROJECT_NAME}.xml DESTINATION /usr/share/packages)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.xml DESTINATION /usr/share/packages/)
+
+# Install appcontrol icon
+#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/res/icon/attach-panel-camera.png DESTINATION /usr/ug/res/images/attach-panel-camera)
+
diff --git a/LICENSE b/LICENSE
new file mode 100755 (executable)
index 0000000..54b213e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,204 @@
+Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
+
+                                 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/NOTICE b/NOTICE
new file mode 100755 (executable)
index 0000000..851c000
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,2 @@
+Copyright (c) 2000-2015 Samsung Electronics Co., Ltd. All rights reserved.
+
diff --git a/attach-panel-camera.manifest b/attach-panel-camera.manifest
new file mode 100644 (file)
index 0000000..0a1a913
--- /dev/null
@@ -0,0 +1,15 @@
+<manifest>
+        <define>
+                <domain name="attach-panel-camera"/>
+               <provide>
+                        <label name="attach-panel-camera::data"/>
+               </provide>
+                <request>
+                        <smack request="aul::launch" type="x" />
+                        <smack request="attach-panel-camera::data" type="rw"/>
+                </request>
+        </define>
+        <request>
+                <domain name="_"/>
+        </request>
+</manifest>
diff --git a/attach-panel-camera.xml b/attach-panel-camera.xml
new file mode 100755 (executable)
index 0000000..05f861c
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="attach-panel-camera" version="0.1.0" install-location="internal-only">
+       <label>Camera-UG</label>
+       <author email="chitta.rs@samsung.com" href="www.samsung.com">CHITTA RANJAN</author>
+       <description>Camera-UG</description>
+
+       <ui-application appid="attach-panel-camera" exec="/usr/ug/bin/attach-panel-camera" ui-gadget="true" nodisplay="true" multiple="true" type="capp" taskmanage="false" process-pool="true">
+
+               <label>Camera-UG</label>
+               <label xml:lang="en-us">CameraUG</label>
+       </ui-application>
+
+    <privileges>
+        <privilege>http://developer.samsung.com/tizen/privilege/ui-gadget.admin</privilege>
+        <privilege>http://tizen.org/privilege/camera</privilege>
+       <privilege>http://tizen.org/privilege/recorder</privilege>
+       <privilege>http://tizen.org/privilege/mediastorage</privilege>
+       <privilege>http://tizen.org/privilege/content.read</privilege>
+       <privilege>http://tizen.org/privilege/content.write</privilege>
+    </privileges>
+</manifest>
diff --git a/inc/attach-panel-camera.h b/inc/attach-panel-camera.h
new file mode 100644 (file)
index 0000000..104aa0e
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2000-2015 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.
+*
+*/
+
+
+
+#ifndef __ATTACH_PANEL_CAMERA_H__
+#define __ATTACH_PANEL_CAMERA_H__
+
+#include <Elementary.h>
+#include <libintl.h>
+
+#define PKGNAME "attach-panel-camera"
+
+#ifndef _EDJ
+#define _EDJ(o)                        elm_layout_edje_get(o)
+#endif
+#ifndef _
+#define _(s)                   dgettext(PKGNAME, s)
+#endif
+#ifndef dgettext_noop
+#define dgettext_noop(s)       (s)
+#endif
+#ifndef N_
+#define N_(s)                  dgettext_noop(s)
+#endif
+
+#endif                         /* __ATTACH_PANEL_CAMERA_H__ */
diff --git a/inc/utils/config.h b/inc/utils/config.h
new file mode 100755 (executable)
index 0000000..09642e2
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2000-2015 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.
+*
+*/
+
+
+#ifndef __CONFIG_H__
+#define __CONFIG_H__
+
+#include <app.h>
+#include <linux/limits.h>
+
+#define SELF_CAMERA_LAYOUT  "edje/attach-panel-camera/attach-panel-camera.edj"
+#define SOUND_COUNT         "sounds/sounds_count.mp3"
+
+#define POPUP_BUTTON_STYLE  "popup_button/default"
+#define POPUP_BUTTON_PART   "button1"
+
+/* storage path */
+#define INTERNAL_DCIM_PATH  "/opt/usr/media/DCIM"
+#define CAMERA_DIRECTORY    INTERNAL_DCIM_PATH"/Camera"
+#define IMAGE_MIME_TYPE     "image/*"
+
+
+/**
+ * @brief Get resources folder absolute path
+ * @return Absolute path to resources folder
+ */
+static inline const char *get_res_path()
+{
+    static char res_folder_path[PATH_MAX] = { '\0' };
+    if(res_folder_path[0] == '\0')
+    {
+        char *resource_path_buf = "/usr/ug/res/";
+        strncpy(res_folder_path, resource_path_buf, PATH_MAX-1);
+
+    }
+    return res_folder_path;
+}
+
+/**
+ * @brief Get resource absolute path
+ * @param[in]   file_path   Resource path relative to resources directory
+ * @return Resource absolute path
+ */
+static inline const char *get_resource_path(const char *file_path)
+{
+    static char res_path[PATH_MAX] = { '\0' };
+    snprintf(res_path, PATH_MAX, "%s%s", get_res_path(), file_path);
+    return res_path;
+}
+
+#endif /* __CONFIG_H__ */
diff --git a/inc/utils/logger.h b/inc/utils/logger.h
new file mode 100644 (file)
index 0000000..d2e5c14
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2000-2015 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.
+*
+*/
+
+
+#ifndef __LOGGER_H__
+#define __LOGGER_H__
+
+#define LOG_TAG "ATTACH_PANEL_CAMERA"
+
+#include <dlog.h>
+
+#define INF(fmt, arg...) dlog_print(DLOG_INFO, LOG_TAG, fmt,  ##arg)
+#define DBG(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, fmt,  ##arg)
+#define ERR(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, fmt,  ##arg)
+
+#define WARN_IF(expr, fmt, arg...) \
+{ \
+    if (expr) \
+    { \
+        ERR(fmt, ##arg); \
+    } \
+}
+
+#define RETM_IF(expr, fmt, arg...) \
+{ \
+    if (expr) \
+    { \
+        ERR(fmt, ##arg); \
+        return; \
+    } \
+}
+
+#define RETVM_IF(expr, val, fmt, arg...) \
+{ \
+    if (expr) \
+    { \
+        ERR(fmt, ##arg); \
+        return (val); \
+    } \
+}
+
+#endif /* __LOGGER_H__ */
diff --git a/inc/utils/ui-utils.h b/inc/utils/ui-utils.h
new file mode 100644 (file)
index 0000000..90ccc46
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2000-2015 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.
+*
+*/
+
+
+#ifndef __UI_UTILS_H__
+#define __UI_UTILS_H__
+
+#include <Evas.h>
+
+#define EVENT_BACK "back"
+#define EVENT_PAUSE "pause"
+#define EVENT_RESUME "resume"
+
+/*
+ * @brief Add naviframe widget
+ * @param[in]   parent      Parent widget
+ * @return Naviframe on success, otherwise NULL
+ */
+Evas_Object *ui_utils_navi_add(Evas_Object *parent);
+
+/*
+ * @brief Add layout widget
+ * @param[in]   parent      Parent widget
+ * @param[in]   destroy_cb  Layout destroy callback
+ * @param[in]   cb_data     Data to pass to destroy_cb
+ * @return Layout on success, otherwise NULL
+ */
+Evas_Object *ui_utils_layout_add(Evas_Object *parent, Evas_Object_Event_Cb destroy_cb, void *cb_data);
+
+#endif /* __UI_UTILS_H__ */
diff --git a/inc/view/main-view.h b/inc/view/main-view.h
new file mode 100755 (executable)
index 0000000..f658ece
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2000-2015 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.
+*
+*/
+
+
+#ifndef __MAIN_VIEW_H__
+#define __MAIN_VIEW_H__
+
+#include <Evas.h>
+#include <Ecore_Evas.h>
+#include <ui-gadget-module.h>
+#include <Elementary.h>
+#include <camera.h>
+#include <recorder.h>
+#include <device/power.h>
+
+/*
+ * @brief Adding new view to parent object
+ * @param[in]   parent  Parent naviframe
+ * @return Main view layout on success, otherwise NULL
+ */
+
+/* Macros
+ */
+#define HIWORD(x)                                      ((x) >> 16)
+#define LOWORD(y)                                      (((y) << 16) >> 16)
+#define MAKE_DWORD(x, y)                               ((x) << 16 | (y))
+
+#define CAM_RESOLUTION(w, h)                           MAKE_DWORD(w, h)
+#define CAM_RESOLUTION_W(r)                            HIWORD(r)
+#define CAM_RESOLUTION_H(r)                            LOWORD(r)
+
+#if 0
+/*For 2Mp resolution*/
+#define CAM_WIDTH                              1600
+#define CAM_HEIGHT                             1200
+#else
+/*For 640X480 resolution*/
+#define CAM_WIDTH                              640
+#define CAM_HEIGHT                             480
+#endif
+#define CAM_RESOLUTION_QCIF                            CAM_RESOLUTION(176, 144)
+#define CAM_RESOLUTION_VGA                             CAM_RESOLUTION(640, 480)
+
+#define CAM_REC_MMS_MAX_SIZE   (295)   /* kbyte */
+#define CAM_REC_NORMAL_MAX_SIZE        (4*1024*1024)   /* kbyte */
+
+#define CAM_PACKAGE                                                    "org.tizen.camera-app"
+
+#define CAM_LOCALESDIR                                                 "/usr/apps/org.tizen.camera-app/res/locale/"
+
+typedef enum _CamTargetDirection {
+       CAM_TARGET_DIRECTION_INVAILD = -1,
+       CAM_TARGET_DIRECTION_PORTRAIT = 0,
+       CAM_TARGET_DIRECTION_LANDSCAPE_INVERSE = 90,
+       CAM_TARGET_DIRECTION_PORTRAIT_INVERSE = 180,
+       CAM_TARGET_DIRECTION_LANDSCAPE = 270,
+       CAM_TARGET_DIRECTION_MAX,
+} CamTargetDirection;
+
+typedef enum _CamViewType{
+       CAM_FULL_VIEW,
+       CAM_COMPACT_VIEW,
+}CamViewType;
+
+typedef enum _CamTransformType {
+       CAM_TRANSFORM_NONE,
+       CAM_TRANSFORM_CROP ,
+       CAM_TRANSFORM_RESIZE,
+}CamTransformType;
+
+enum {
+       NORMAL_BATTERY_STATUS = 0,
+       LOW_BATTERY_WARNING_STATUS,
+       LOW_BATTERY_CRITICAL_STATUS,
+};
+
+typedef struct
+{
+       Evas_Object *navi;
+       Elm_Object_Item *navi_item;
+       Evas_Object *layout;
+       Evas_Object *cameraview_layout;
+       Evas_Object *recorderview_layout;
+       Evas_Object *popup;
+       Evas_Object *preview_canvas;
+       Evas_Object *recording_icon;
+       Eina_Bool pause_state;
+       Evas_Object *progressbar_layout;
+       Evas_Object *low_battery_layout;
+       Evas_Object *progressbar;
+
+       /*check out low battery */
+       Eina_Bool battery_status;
+
+       camera_h camera;
+       recorder_h hrec;
+       Eina_Bool camera_enabled;
+       Eina_Bool self_portrait;
+       Eina_Bool is_size_limit;
+       Eina_Bool show_content;
+       int photo_resolution;
+       int video_resolution;
+       int device_type;
+       CamTargetDirection target_direction;
+       CamTransformType transformtype;
+
+       unsigned long long rec_elapsed;
+       unsigned long long pause_time;
+       unsigned long long rec_filesize;
+       unsigned long long size_limit;
+
+       Ecore_Timer *timer;
+       Ecore_Timer *pause_timer;
+       Ecore_Timer *crop_timer;
+       char filename[PATH_MAX];
+       int timer_count;
+       ui_gadget_h ug_handle;
+       CamViewType cam_view_type;
+} main_view;
+
+Evas_Object *main_view_add(Evas_Object *navi, ui_gadget_h ug_handle, unsigned long long size_limit);
+void _main_view_set_data(void *data);
+void *_main_view_get_data();
+void _main_view_app_pause();
+void _main_view_app_resume();
+void _main_view_set_target_direction(CamTargetDirection target_direction);
+void _main_view_destroy();
+void _main_view_set_cam_view_layout(CamViewType cam_view_type);
+void _main_view_set_show_content(Eina_Bool showContent);
+typedef enum _CamFileType {
+       CAM_FILE_IMAGE ,
+       CAM_FILE_VIDEO ,
+} CamFileType;
+
+#endif /* __MAIN_VIEW_H__ */
diff --git a/inc/view/window.h b/inc/view/window.h
new file mode 100644 (file)
index 0000000..48c7927
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2000-2015 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.
+*
+*/
+
+
+
+#ifndef __WINDOW_H__
+#define __WINDOW_H__
+
+#include <Evas.h>
+#include <Ecore_Evas.h>
+
+typedef struct _window window;
+
+/*
+ * @brief Create application main window
+ * @return Window on success, otherwise NULL
+ */
+window *window_create();
+
+/*
+ * @brief Lower application window to hide application without exiting
+ * @param[in]   win     Application window
+ */
+void window_destroy(window *win);
+
+/*
+ * @brief Destroy application main window
+ * @param[in]   win     Application window
+ */
+void window_lower(window *win);
+
+/*
+ * @brief Set content to be displayed in window
+ * @param[in]   win     Application window
+ * @param[in]   content Window content
+ */
+void window_content_set(window *win, Evas_Object *layout);
+
+/*
+ * @brief Get window layout to use as a parent for window content
+ * @param[in]   win     Application window
+ * @return Window layout
+ */
+Evas_Object *window_layout_get(const window *win);
+
+#endif /* __WINDOW_H__ */
diff --git a/packaging/attach-panel-camera.spec b/packaging/attach-panel-camera.spec
new file mode 100755 (executable)
index 0000000..9b17893
--- /dev/null
@@ -0,0 +1,81 @@
+%define _appdir        %{_prefix}/apps
+%define _ugdir %{_prefix}/ug
+%define _datadir %{_prefix}/share
+%define _sharedir /opt/usr/media/.iv
+Name:       attach-panel-camera
+Summary:    camera UX
+Version:    0.1.0
+Release:    1
+Group:      Applications
+License:    Apache-2.0
+Source0:    %{name}-%{version}.tar.gz
+
+%if "%{?tizen_profile_name}" == "wearable" || "%{?tizen_profile_name}" == "tv"
+ExcludeArch: %{arm} %ix86 x86_64
+%endif
+
+BuildRequires: cmake
+BuildRequires: gettext-tools
+BuildRequires: edje-tools
+
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(evas)
+BuildRequires: pkgconfig(ecore)
+BuildRequires: pkgconfig(ui-gadget-1)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-content-media-content)
+BuildRequires: pkgconfig(capi-media-image-util)
+BuildRequires: pkgconfig(capi-media-camera)
+BuildRequires: pkgconfig(capi-system-device)
+BuildRequires: pkgconfig(capi-media-recorder)
+BuildRequires: pkgconfig(libexif)
+
+%description
+Description: camera UG
+
+%prep
+%setup -q
+
+%build
+
+%if 0%{?tizen_build_binary_release_type_eng}
+export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
+export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
+%endif
+
+%ifarch %{arm}
+CXXFLAGS+=" -D_ARCH_ARM_ -mfpu=neon"
+%endif
+
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_DATA_DIR=%{_datadir} -DARCH=%{ARCH}
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+if [ ! -d %{buildroot}/opt/usr/apps/attach-panel-camera/data ]
+then
+        mkdir -p %{buildroot}/opt/usr/apps/attach-panel-camera/data
+fi
+
+%make_install
+
+mkdir -p %{buildroot}/usr/share/license
+mkdir -p %{buildroot}%{_sharedir}
+cp LICENSE %{buildroot}/usr/share/license/attach-panel-camera
+
+%post
+mkdir -p %{_prefix}/apps/%{name}/bin/
+ln -sf %{_prefix}/bin/ug-client %{_prefix}/apps/%{name}/bin/%{name}
+%postun
+
+%files
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_appdir}/%{name}/lib/ug/libattach-panel-camera.so*
+%{_prefix}/ug/res/edje/attach-panel-camera/*
+%{_prefix}/ug/res/images/attach-panel-camera/*
+%{_datadir}/packages/attach-panel-camera.xml
+%{_datadir}/license/attach-panel-camera
+
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644 (file)
index 0000000..dd48650
--- /dev/null
@@ -0,0 +1,24 @@
+# for i18n
+
+SET(POFILES en_US.po en_GB.po ja.po ko.po zh_CN.po)
+
+SET(MSGFMT "/usr/bin/msgfmt")
+
+FOREACH(pofile ${POFILES})
+       SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+       MESSAGE("PO: ${pofile}")
+       GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+       GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+       SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+       ADD_CUSTOM_COMMAND(
+                       OUTPUT ${moFile}
+                       COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+                       DEPENDS ${absPofile}
+       )
+       INSTALL(FILES ${moFile}
+                       DESTINATION /opt/ug/res/locale/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
+       SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644 (file)
index 0000000..fff846b
--- /dev/null
@@ -0,0 +1,2 @@
+# List of source files containing translatable strings.
+helloUG-efl.c
diff --git a/po/update-po.sh b/po/update-po.sh
new file mode 100644 (file)
index 0000000..4136999
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+PACKAGE=ug-helloUG-efl
+SRCROOT=..
+POTFILES=POTFILES.in
+
+#ALL_LINGUAS= am az be ca cs da de el en_CA en_GB es et fi fr hr hu it ja ko lv mk ml ms nb ne nl pa pl pt pt_BR ru rw sk sl sr sr@Latn sv ta tr uk vi zh_CN zh_TW
+ALL_LINGUAS="en_US en_GB ja ko zh_CN"
+
+XGETTEXT=/usr/bin/xgettext
+MSGMERGE=/usr/bin/msgmerge
+
+echo -n "Make ${PACKAGE}.pot  "
+if [ ! -e $POTFILES ] ; then
+       echo "$POTFILES not found"
+       exit 1
+fi
+
+$XGETTEXT --default-domain=${PACKAGE} --directory=${SRCROOT} \
+               --add-comments --keyword=_ --keyword=N_ --files-from=$POTFILES
+if [ $? -ne 0 ]; then
+       echo "error"
+       exit 1
+fi
+
+if [ ! -f ${PACKAGE}.po ]; then
+       echo "No such file: ${PACKAGE}.po"
+       exit 1
+fi
+
+rm -f ${PACKAGE}.pot && mv ${PACKAGE}.po ${PACKAGE}.pot
+echo "done"
+
+for LANG in $ALL_LINGUAS; do
+       echo "$LANG : "
+
+       if [ ! -e $LANG.po ] ; then
+               sed 's/CHARSET/UTF-8/g' ${PACKAGE}.pot > ${LANG}.po
+               echo "${LANG}.po created"
+       else
+               if $MSGMERGE ${LANG}.po ${PACKAGE}.pot -o ${LANG}.new.po ; then
+                       if cmp ${LANG}.po ${LANG}.new.po > /dev/null 2>&1; then
+                               rm -f ${LANG}.new.po
+                       else
+                               if mv -f ${LANG}.new.po ${LANG}.po; then
+                                       echo ""
+                               else
+                                       echo "msgmerge for $LANG.po failed: cannot move $LANG.new.po to $LANG.po" 1>&2
+                                       rm -f ${LANG}.new.po
+                                       exit 1
+                               fi
+                       fi
+               else
+                       echo "msgmerge for $LANG failed!"
+                       rm -f ${LANG}.new.po
+               fi
+       fi
+       echo ""
+done
+
diff --git a/res/edje/attach-panel-camera.edc b/res/edje/attach-panel-camera.edc
new file mode 100755 (executable)
index 0000000..31a1e27
--- /dev/null
@@ -0,0 +1,3430 @@
+/*
+* Copyright (c) 2000-2015 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.
+*
+*/
+
+#define MAIN_W         800
+#define MAIN_H         480
+
+#define HOR_REC_ICON_AREA_X    12
+#define HOR_REC_ICON_AREA_Y    23
+#define VER_REC_ICON_AREA_X    373
+#define INVERSE_HOR_REC_ICON_AREA_X    676
+#define INVERSE_HOR_REC_ICON_AREA_Y    406
+#define INVERSE_VER_REC_ICON_AREA_X    333
+#define INVERSE_VER_REC_ICON_AREA_Y    15
+
+#define REC_ICON_AREA_W                27
+#define REC_ICON_AREA_H                27
+
+#define RECORDING_IMAGE_W      27
+#define RECORDING_IMAGE_H      27
+
+#define HOR_REC_TIME_X         52
+#define HOR_REC_TIME_Y         20
+#define VER_REC_TIME_X         413
+#define INVERSE_HOR_REC_TIME_X         716
+#define INVERSE_HOR_REC_TIME_Y         402
+#define INVERSE_VER_REC_TIME_X         365
+#define INVERSE_VER_REC_TIME_Y         15
+
+#define REC_TIME_W             75
+#define REC_TIME_H             36
+//for wvga
+#define HOR_REC_ICON_AREA_X_WVGA       32
+#define HOR_REC_ICON_AREA_Y_WVGA       20
+#define VER_REC_ICON_AREA_X_WVGA       373
+#define INVERSE_HOR_REC_ICON_AREA_X_WVGA       656
+#define INVERSE_HOR_REC_ICON_AREA_Y_WVGA       402
+#define INVERSE_VER_REC_ICON_AREA_X_WVGA       333
+#define INVERSE_VER_REC_ICON_AREA_Y_WVGA       15
+
+#define REC_ICON_AREA_W_WVGA           36
+#define REC_ICON_AREA_H_WVGA           36
+
+#define RECORDING_IMAGE_W_WVGA 28
+#define RECORDING_IMAGE_H_WVGA 28
+
+#define HOR_REC_TIME_X_WVGA            52
+#define HOR_REC_TIME_Y_WVGA            20
+#define VER_REC_TIME_X_WVGA            413
+#define INVERSE_HOR_REC_TIME_X_WVGA            720
+#define INVERSE_HOR_REC_TIME_Y_WVGA            402
+#define INVERSE_VER_REC_TIME_X_WVGA            365
+#define INVERSE_VER_REC_TIME_Y_WVGA            15
+
+#define REC_TIME_W_WVGA                75
+#define REC_TIME_H_WVGA                36
+
+#define HOR_REC_SIZE_X_WVGA            54
+#define HOR_REC_SIZE_Y_WVGA            70
+#define VER_REC_SIZE_X_WVGA            383
+#define INVERSE_HOR_REC_SIZE_X_WVGA            694
+#define INVERSE_HOR_REC_SIZE_Y_WVGA            432
+#define INVERSE_VER_REC_SIZE_X_WVGA            365
+#define INVERSE_VER_REC_SIZE_Y_WVGA            15
+
+#define REC_SIZE_W_WVGA                75
+#define REC_SIZE_H_WVGA                36
+//
+#define HOR_REC_SIZE_X         54
+#define HOR_REC_SIZE_Y         70
+#define VER_REC_SIZE_X         393
+#define INVERSE_HOR_REC_SIZE_X         694
+#define INVERSE_HOR_REC_SIZE_Y         432
+#define INVERSE_VER_REC_SIZE_X         365
+#define INVERSE_VER_REC_SIZE_Y         15
+
+#define REC_SIZE_W             75
+#define REC_SIZE_H             36
+
+#define HOR_SHUTTER_BTN_X              686
+#define HOR_SHUTTER_BTN_Y              190.5
+#define VER_SHUTTER_BTN_X              190.5
+#define VER_SHUTTER_BTN_Y              686
+#define INVERSE_HOR_SHUTTER_BTN_X              15
+#define INVERSE_HOR_SHUTTER_BTN_Y              190.5
+#define INVERSE_VER_SHUTTER_BTN_X              190.5
+#define INVERSE_VER_SHUTTER_BTN_Y              15
+
+#define SHUTTER_BTN_W          99
+#define SHUTTER_BTN_H          99
+
+#define HOR_VIDEO_BTN_X                699.5
+#define HOR_VIDEO_BTN_Y                80.5
+#define VER_VIDEO_BTN_X                327.5
+#define VER_VIDEO_BTN_Y                699.5
+#define INVERSE_HOR_VIDEO_BTN_X                28.5
+#define INVERSE_HOR_VIDEO_BTN_Y                327.5
+#define INVERSE_VER_VIDEO_BTN_X                80.5
+#define INVERSE_VER_VIDEO_BTN_Y                28.5
+
+#define VIDEO_BTN_W            72
+#define VIDEO_BTN_H            72
+
+#define HOR_CHANGE_CAMERA_BTN_X                699.5
+#define HOR_CHANGE_CAMERA_BTN_Y                327.5
+#define VER_CHANGE_CAMERA_BTN_X                80.5
+#define VER_CHANGE_CAMERA_BTN_Y                699.5
+#define INVERSE_HOR_CHANGE_CAMERA_BTN_X                28.5
+#define INVERSE_HOR_CHANGE_CAMERA_BTN_Y                80.5
+#define INVERSE_VER_CHANGE_CAMERA_BTN_X                327.5
+#define INVERSE_VER_CHANGE_CAMERA_BTN_Y                28.5
+
+#define CHANGE_CAMERA_BTN_W            72
+#define CHANGE_CAMERA_BTN_H            72
+
+
+#define HOR_REC_STOP_BTN_X             686
+#define HOR_REC_STOP_BTN_Y             190.5
+#define VER_REC_STOP_BTN_X             190.5
+#define VER_REC_STOP_BTN_Y             686
+#define INVERSE_HOR_REC_STOP_BTN_X             15
+#define INVERSE_HOR_REC_STOP_BTN_Y             190.5
+#define INVERSE_VER_REC_STOP_BTN_X             190.5
+#define INVERSE_VER_REC_STOP_BTN_Y             15
+
+#define REC_STOP_BTN_W         99
+#define REC_STOP_BTN_H         99
+
+#define HOR_REC_PAUSE_BTN_X            699.5
+#define HOR_REC_PAUSE_BTN_Y            80.5
+#define VER_REC_PAUSE_BTN_X            327.5
+#define VER_REC_PAUSE_BTN_Y            699.5
+#define INVERSE_HOR_REC_PAUSE_BTN_X            28.5
+#define INVERSE_HOR_REC_PAUSE_BTN_Y            327.5
+#define INVERSE_VER_REC_PAUSE_BTN_X            80.5
+#define INVERSE_VER_REC_PAUSE_BTN_Y            28.5
+
+#define REC_PAUSE_BTN_W                72
+#define REC_PAUSE_BTN_H                72
+
+#define HOR_REC_RESUME_BTN_X           699.5
+#define HOR_REC_RESUME_BTN_Y           80.5
+#define VER_REC_RESUME_BTN_X           327.5
+#define VER_REC_RESUME_BTN_Y           699.5
+#define INVERSE_HOR_REC_RESUME_BTN_X           28.5
+#define INVERSE_HOR_REC_RESUME_BTN_Y           327.5
+#define INVERSE_VER_REC_RESUME_BTN_X           80.5
+#define INVERSE_VER_REC_RESUME_BTN_Y           28.5
+
+#define REC_RESUME_BTN_W               72
+#define REC_RESUME_BTN_H               72
+
+#deine BORDER_MARGIN 20
+#define IMAGE_PATH ""
+
+#define FONT_NAME "font=SLP:style=Roman"
+
+collections
+{
+styles {
+               style {
+                       name: "mode_text_middle";
+                       base: "font=Tizen:style=Regular style=outline outline_color=#4B4B4BFF font_size=26 color=#F4F4F4 align=center wrap=mixed";
+                       tag:  "br" "\n";
+                       tag:  "hilight" "+ font=Tizen:style=Bold";
+                       tag:  "b" "+ font=Tizen:style=Bold";
+                       tag:  "tab" "\t";
+               }
+       }
+images
+{
+       image: IMAGE_PATH"timer_2.png" COMP;
+       image: IMAGE_PATH"timer_2_selected.png" COMP;
+       image: IMAGE_PATH"timer_5.png" COMP;
+       image: IMAGE_PATH"timer_5_selected.png" COMP;
+       image: IMAGE_PATH"timer_10.png" COMP;
+       image: IMAGE_PATH"timer_10_selected.png" COMP;
+       image: IMAGE_PATH"bar.png" COMP;
+       image: IMAGE_PATH"shutter.png" COMP;
+       image: IMAGE_PATH"shutter2.png" COMP;
+       image: IMAGE_PATH"shutter_dim.png" COMP;
+       image: IMAGE_PATH"camera_btn_camcorder.png" COMP;
+       image: IMAGE_PATH"camera_btn_camcorder_press.png" COMP;
+       image: IMAGE_PATH"camera_btn_switch.png" COMP;
+       image: IMAGE_PATH"camera_btn_switch_press.png" COMP;
+       image: IMAGE_PATH"camera_rec_stop.png" COMP;
+       image: IMAGE_PATH"camera_rec_stop_press.png" COMP;
+       image: IMAGE_PATH"camera_rec_recording.png" COMP;
+       image: IMAGE_PATH"camera_rec_recording_press.png" COMP;
+       image: IMAGE_PATH"camera_rec_pause.png" COMP;
+       image: IMAGE_PATH"camera_rec_pause_press.png" COMP;
+       image: IMAGE_PATH"camera_icon_recording.png" COMP;
+       image: IMAGE_PATH"camera_icon_recording_pause.png" COMP;
+       image: IMAGE_PATH"none.png" COMP;
+       image: IMAGE_PATH"transparent.png" COMP;
+} //images
+    base_scale: 1.8;
+
+    group
+    {
+        name: "main_layout";
+        parts
+        {
+               part { name: "bg";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               fixed: 1 1;
+                               rel1 { relative: 0.0 0.0;}
+                               rel2 { relative: 1.0 1.0;}
+                               color : 8 8 8 255;
+                       }
+               }
+            part
+            {
+                name: "elm.swallow.content";
+                type: SWALLOW;
+                               scale: 1;
+                description
+                {
+                    rel1 { relative: 0.0 0.0; to: "bg";}
+                    rel2 { relative: 1.0 1.0; to: "bg";}
+                    visible: 1;
+                }
+            } //part
+               part { name: "main_view";
+                       type: SWALLOW;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               fixed: 1 1;
+                               rel1 { relative: 0.0 0.0; to: "bg";}
+                               rel2 { relative: 1.0 1.0; to: "bg";}
+                       }
+               }
+        } //parts
+    } //group
+
+       group
+       {
+        name: "camera_layout";
+        parts
+        {
+               part { name: "bg";
+                       type: RECT;
+                       mouse_events: 0;
+                       scale: 1;
+                       description{
+                               state:"default" 0.0;
+                               rel1 { relative: 0.0 0.0;}
+                               rel2 { relative: 1.0 1.0;}
+                               color: 255 255 255 0;
+                       }
+               }
+            part
+            {
+                name: "shutter_button";
+                type: IMAGE;
+                description
+                {
+                    rel1 { relative: VER_SHUTTER_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -170;}
+                    rel2 { relative: (VER_SHUTTER_BTN_X+SHUTTER_BTN_W)/MAIN_H 1.0; to: "bg";}
+                    min: 132 132;
+                    max: 132 132;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"shutter.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"shutter2.png";
+                }
+                description
+                {
+                                       state: "portrait" 0.0;
+                    inherit: "default" 0.0;
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"shutter2.png";
+                }
+                               description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_SHUTTER_BTN_X/MAIN_W INVERSE_HOR_SHUTTER_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_SHUTTER_BTN_X+SHUTTER_BTN_W)/MAIN_W (INVERSE_HOR_SHUTTER_BTN_Y+SHUTTER_BTN_H)/MAIN_H; to: "bg";}
+                       min: 132 132;
+                    max: 132 132;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"shutter.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"shutter2.png";
+                }
+                description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_SHUTTER_BTN_X/MAIN_H INVERSE_VER_SHUTTER_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_SHUTTER_BTN_X+SHUTTER_BTN_W)/MAIN_H (INVERSE_VER_SHUTTER_BTN_Y+SHUTTER_BTN_H)/MAIN_W; to: "bg";}
+                       min: 132 132;
+                    max: 132 132;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"shutter.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"shutter2.png";
+                }
+                description
+                {
+                                       state: "landscape" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: HOR_SHUTTER_BTN_X/MAIN_W HOR_SHUTTER_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_SHUTTER_BTN_X+SHUTTER_BTN_W)/MAIN_W (HOR_SHUTTER_BTN_Y+SHUTTER_BTN_H)/MAIN_H; to: "bg";}
+                       min: 132 132;
+                    max: 132 132;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"shutter.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"shutter2.png";
+                }
+            } //part
+            part
+            {
+                name: "video_button";
+                type: IMAGE;
+                description
+                {
+                    rel1 { relative: VER_VIDEO_BTN_X/MAIN_H 1.0; to: "bg"; offset: 0 -170;}
+                                       rel2 { relative: (VER_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_H 1.0; to: "bg";}
+                    min: 96 96;
+                    max: 96 96;
+                    visible: 0;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder_press.png";
+                }
+                description
+                {
+                                       state: "portrait" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: VER_VIDEO_BTN_X/MAIN_H 1.0; to: "bg"; offset: 0 -170;}
+                                       rel2 { relative: (VER_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_H 1.0; to: "bg";}
+                    min: 96 96;
+                    max: 96 96;
+                    visible: 0;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder.png";
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder_press.png";
+                }
+                description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_VIDEO_BTN_X/MAIN_W INVERSE_HOR_VIDEO_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_W (INVERSE_HOR_VIDEO_BTN_Y+VIDEO_BTN_H)/MAIN_H; to: "bg";}
+                    min: 96 96;
+                    max: 96 96;
+                    visible: 0;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder_press.png";
+                }
+                description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_VIDEO_BTN_X/MAIN_H INVERSE_VER_VIDEO_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_H (INVERSE_VER_VIDEO_BTN_Y+VIDEO_BTN_H)/MAIN_W; to: "bg";}
+                    min: 96 96;
+                    max: 96 96;
+                    visible: 0;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder_press.png";
+                }
+                description
+                {
+                                       state: "landscape" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: HOR_VIDEO_BTN_X/MAIN_W HOR_VIDEO_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_W (HOR_VIDEO_BTN_Y+VIDEO_BTN_H)/MAIN_H; to: "bg";}
+                    min: 96 96;
+                    max: 96 96;
+                    visible: 0;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder_press.png";
+                }
+            } //part
+            part
+            {
+                name: "change_camera_button";
+                type: IMAGE;
+                description
+                {
+                    rel1 { relative: VER_CHANGE_CAMERA_BTN_X/MAIN_H 1.0; to: "bg"; offset: 0 -170;}
+                                       rel2 { relative: (VER_CHANGE_CAMERA_BTN_X+CHANGE_CAMERA_BTN_W)/MAIN_H 1.0; to: "bg";}
+                    min: 96 96;
+                    max: 96 96;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_switch.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_switch_press.png";
+                }
+                description
+                {
+                                       state: "portrait" 0.0;
+                    //fixed: 1 1;
+                     inherit: "default" 0.0;
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_switch_press.png";
+                }
+                description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_CHANGE_CAMERA_BTN_X/MAIN_W INVERSE_HOR_CHANGE_CAMERA_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_CHANGE_CAMERA_BTN_X+CHANGE_CAMERA_BTN_W)/MAIN_W (INVERSE_HOR_CHANGE_CAMERA_BTN_Y+CHANGE_CAMERA_BTN_H)/MAIN_H; to: "bg";}
+                    min: 96 96;
+                    max: 96 96;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_switch.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_switch_press.png";
+                }
+                description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_CHANGE_CAMERA_BTN_X/MAIN_H INVERSE_VER_CHANGE_CAMERA_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_CHANGE_CAMERA_BTN_X+CHANGE_CAMERA_BTN_W)/MAIN_H (INVERSE_VER_CHANGE_CAMERA_BTN_Y+CHANGE_CAMERA_BTN_H)/MAIN_W; to: "bg";}
+                    min: 96 96;
+                    max: 96 96;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_switch.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_switch_press.png";
+                }
+                description
+                {
+                                       state: "landscape" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: HOR_CHANGE_CAMERA_BTN_X/MAIN_W HOR_CHANGE_CAMERA_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_CHANGE_CAMERA_BTN_X+CHANGE_CAMERA_BTN_W)/MAIN_W (HOR_CHANGE_CAMERA_BTN_Y+CHANGE_CAMERA_BTN_H)/MAIN_H; to: "bg";}
+                    min: 96 96;
+                    max: 96 96;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_switch.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_switch_press.png";
+                }
+            } //part
+                       part {
+                                       name: "battery_low";
+                                       type: SWALLOW;
+                                       mouse_events: 1;
+                                       repeat_events : 0;
+                                       scale: 1;
+                                       description{
+                                               state:"default" 0.0;
+                                               rel1 { relative: 0.0 0.0;}
+                                               rel2 { relative: 1.0 1.0;}
+                                       }
+                               }
+            programs
+            {
+            program {
+                               name : "camera_layout,set,landscape";
+                               source: "camera_layout";
+                               signal: "landscape";
+                               script: {
+                                       set_state(PART:"shutter_button", "landscape", 0.0);
+                                       set_state(PART:"change_camera_button", "landscape", 0.0);
+                                       set_state(PART:"video_button", "landscape", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "camera_layout,set,portrait";
+                               source: "camera_layout";
+                               signal: "portrait";
+                               script: {
+                                       set_state(PART:"shutter_button", "portrait", 0.0);
+                                       set_state(PART:"change_camera_button", "portrait", 0.0);
+                                       set_state(PART:"video_button", "portrait", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "camera_layout,set,landscape_inverse";
+                               source: "camera_layout";
+                               signal: "landscape_inverse";
+                               script: {
+                                       set_state(PART:"shutter_button", "landscape_inverse", 0.0);
+                                       set_state(PART:"change_camera_button", "landscape_inverse", 0.0);
+                                       set_state(PART:"video_button", "landscape_inverse", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "camera_layout,set,portrait_inverse";
+                               source: "camera_layout";
+                               signal: "portrait_inverse";
+                               script: {
+                                       set_state(PART:"shutter_button", "portrait_inverse", 0.0);
+                                       set_state(PART:"change_camera_button", "portrait_inverse", 0.0);
+                                       set_state(PART:"video_button", "portrait_inverse", 0.0);
+                                       }
+                               }
+                program {
+                    name: "down_shutter";
+                    signal: "mouse,down,*";
+                    source: "shutter_button";
+                    script {
+                             new st[31]
+                             new Float:vl;
+                             get_state(PART:"shutter_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"shutter_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"shutter_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"shutter_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"shutter_button", "portrait_inverse_pressed", 0.0);
+                        emit("shutter_button_down", "shutter_button");
+                    }
+                }
+                program {
+                    name: "up_shutter";
+                    signal: "mouse,up,1";
+                    source: "shutter_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"shutter_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"shutter_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"shutter_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"shutter_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"shutter_button", "portrait_inverse", 0.0);
+                        emit("shutter_button_up", "shutter_button");
+                    }
+                }
+                program
+                {
+                    name: "clicked_shutter";
+                    signal: "mouse,clicked,1";
+                    source: "shutter_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"shutter_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"shutter_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"shutter_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"shutter_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"shutter_button", "portrait_inverse", 0.0);
+                        emit("shutter_button_clicked", "shutter_button");
+                    }
+                } //program
+                program {
+                    name: "down_video";
+                    signal: "mouse,down,*";
+                    source: "video_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"video_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"video_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"video_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"video_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"video_button", "portrait_inverse_pressed", 0.0);
+                        emit("video_button_down", "video_button");
+                    }
+                }
+                program {
+                    name: "up_video";
+                    signal: "mouse,up,1";
+                    source: "video_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"video_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"video_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"video_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"video_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"video_button", "portrait_inverse", 0.0);
+                        emit("video_button_up", "video_button");
+                    }
+                }
+                program
+                {
+                    name: "clicked_video";
+                    signal: "mouse,clicked,1";
+                    source: "video_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"video_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"video_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"video_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"video_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"video_button", "portrait_inverse", 0.0);
+                       emit("video_button_clicked", "video_button");
+                    }
+                } //program
+                program {
+                    name: "down_change_camera";
+                    signal: "mouse,down,*";
+                    source: "change_camera_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"change_camera_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"change_camera_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"change_camera_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"change_camera_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"change_camera_button", "portrait_inverse_pressed", 0.0);
+                       emit("change_camera_button_down", "change_camera_button");
+                    }
+                }
+                program {
+                    name: "up_change_camera";
+                    signal: "mouse,up,1";
+                    source: "change_camera_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"change_camera_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"change_camera_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"change_camera_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"change_camera_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"change_camera_button", "portrait_inverse", 0.0);
+                        emit("change_camera_button_up", "change_camera_button");
+                    }
+                }
+                program {
+                    name: "clicked_change_camera";
+                    signal: "mouse,clicked,1";
+                    source: "change_camera_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"change_camera_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"change_camera_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"change_camera_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"change_camera_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"change_camera_button", "portrait_inverse", 0.0);
+                        emit("change_camera_button_clicked", "change_camera_button");
+                    }
+                } //program
+            } //programs
+
+        } //parts
+    } //group
+
+
+//camera layout z1
+group
+       {
+        name: "camera_layout_WVGA";
+        parts
+        {
+               part { name: "bg";
+                       type: RECT;
+                       mouse_events: 0;
+                       //scale: 1;
+                       description{
+                               state:"default" 0.0;
+                               rel1 { relative: 0.0 0.0;}
+                               rel2 { relative: 1.0 1.0;}
+                               color: 255 255 255 0;
+                       }
+               }
+            part
+            {
+                name: "shutter_button";
+                type: IMAGE;
+                               //scale: 1;
+                description
+                {
+                    //fixed: 1 1;
+                    //rel1 { relative: VER_SHUTTER_BTN_X/MAIN_H VER_SHUTTER_BTN_Y/MAIN_W; to: "bg";}
+                    //rel2 { relative: (VER_SHUTTER_BTN_X+SHUTTER_BTN_W)/MAIN_H (VER_SHUTTER_BTN_Y+SHUTTER_BTN_H)/MAIN_W; to: "bg";}
+                    rel1 { relative: VER_SHUTTER_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -128;}
+                    rel2 { relative: (VER_SHUTTER_BTN_X+SHUTTER_BTN_W)/MAIN_H 1.0; to: "bg";}
+                    min: 99 99;
+                    max: 99 99;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"shutter.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"shutter2.png";
+                }
+                description
+                {
+                                       state: "portrait" 0.0;
+                    inherit: "default" 0.0;
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"shutter2.png";
+                }
+                description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_SHUTTER_BTN_X/MAIN_W INVERSE_HOR_SHUTTER_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_SHUTTER_BTN_X+SHUTTER_BTN_W)/MAIN_W (INVERSE_HOR_SHUTTER_BTN_Y+SHUTTER_BTN_H)/MAIN_H; to: "bg";}
+                       min: 99 99;
+                    max: 99 99;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"shutter.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"shutter2.png";
+                }
+                description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_SHUTTER_BTN_X/MAIN_H INVERSE_VER_SHUTTER_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_SHUTTER_BTN_X+SHUTTER_BTN_W)/MAIN_H (INVERSE_VER_SHUTTER_BTN_Y+SHUTTER_BTN_H)/MAIN_W; to: "bg";}
+                       min: 99 99;
+                    max: 99 99;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"shutter.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"shutter2.png";
+                }
+                description
+                {
+                                       state: "landscape" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: HOR_SHUTTER_BTN_X/MAIN_W HOR_SHUTTER_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_SHUTTER_BTN_X+SHUTTER_BTN_W)/MAIN_W (HOR_SHUTTER_BTN_Y+SHUTTER_BTN_H)/MAIN_H; to: "bg";}
+                       min: 99 99;
+                    max: 99 99;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"shutter.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"shutter2.png";
+                }
+            } //part
+             part
+                       {
+                               name: "video_button";
+                type: IMAGE;
+                               //scale: 1;
+                description
+                {
+                    //fixed: 1 1;
+                                       //rel1 { relative: VER_VIDEO_BTN_X/MAIN_H VER_VIDEO_BTN_Y/MAIN_W; to: "bg";}
+                                       //rel2 { relative: (VER_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_H (VER_VIDEO_BTN_Y+VIDEO_BTN_H)/MAIN_W; to: "bg";}
+                                       rel1 { relative: VER_VIDEO_BTN_X/MAIN_H 1.0; to: "bg"; offset: 0 -128;}
+                                       rel2 { relative: (VER_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_H 1.0; to: "bg";}
+                    min: 72 72;
+                    max: 72 72;
+                    visible: 0;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder_press.png";
+                }
+                description
+                {
+                                       state: "portrait" 0.0;
+                    //fixed: 1 1;
+                                       //rel1 { relative: VER_VIDEO_BTN_X/MAIN_H VER_VIDEO_BTN_Y/MAIN_W; to: "bg";}
+                                       //rel2 { relative: (VER_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_H (VER_VIDEO_BTN_Y+VIDEO_BTN_H)/MAIN_W; to: "bg";}
+                                       rel1 { relative: VER_VIDEO_BTN_X/MAIN_H 1.0; to: "bg"; offset: 0 -128;}
+                                       rel2 { relative: (VER_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_H 1.0; to: "bg";}
+                    min: 72 72;
+                    max: 72 72;
+                    visible: 0;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder.png";
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder_press.png";
+                }
+                description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_VIDEO_BTN_X/MAIN_W INVERSE_HOR_VIDEO_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_W (INVERSE_HOR_VIDEO_BTN_Y+VIDEO_BTN_H)/MAIN_H; to: "bg";}
+                    min: 72 72;
+                    max: 72 72;
+                    visible: 0;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder_press.png";
+                }
+                description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_VIDEO_BTN_X/MAIN_H INVERSE_VER_VIDEO_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_H (INVERSE_VER_VIDEO_BTN_Y+VIDEO_BTN_H)/MAIN_W; to: "bg";}
+                    min: 72 72;
+                    max: 72 72;
+                    visible: 0;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder_press.png";
+                }
+                description
+                {
+                                       state: "landscape" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: HOR_VIDEO_BTN_X/MAIN_W HOR_VIDEO_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_VIDEO_BTN_X+VIDEO_BTN_W)/MAIN_W (HOR_VIDEO_BTN_Y+VIDEO_BTN_H)/MAIN_H; to: "bg";}
+                    min: 72 72;
+                    max: 72 72;
+                    visible: 0;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_camcorder_press.png";
+                }
+            } //part
+                       part
+            {
+                name: "change_camera_button";
+                type: IMAGE;
+                               //scale: 1;
+                description
+                {
+                    //fixed: 1 1;
+                                       //rel1 { relative: VER_CHANGE_CAMERA_BTN_X/MAIN_H VER_CHANGE_CAMERA_BTN_Y/MAIN_W; to: "bg";}
+                                       //rel2 { relative: (VER_CHANGE_CAMERA_BTN_X+CHANGE_CAMERA_BTN_W)/MAIN_H (VER_CHANGE_CAMERA_BTN_Y+CHANGE_CAMERA_BTN_H)/MAIN_W; to: "bg";}
+                                       rel1 { relative: VER_CHANGE_CAMERA_BTN_X/MAIN_H 1.0; to: "bg"; offset: 0 -128;}
+                                       rel2 { relative: (VER_CHANGE_CAMERA_BTN_X+CHANGE_CAMERA_BTN_W)/MAIN_H 1.0; to: "bg";}
+                    min: 72 72;
+                    max: 72 72;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_switch.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_switch_press.png";
+                }
+                description
+                {
+                                       state: "portrait" 0.0;
+                    //fixed: 1 1;
+                     inherit: "default" 0.0;
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_switch_press.png";
+                }
+                description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_CHANGE_CAMERA_BTN_X/MAIN_W INVERSE_HOR_CHANGE_CAMERA_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_CHANGE_CAMERA_BTN_X+CHANGE_CAMERA_BTN_W)/MAIN_W (INVERSE_HOR_CHANGE_CAMERA_BTN_Y+CHANGE_CAMERA_BTN_H)/MAIN_H; to: "bg";}
+                    min: 72 72;
+                    max: 72 72;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_switch.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_switch_press.png";
+                }
+                description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_CHANGE_CAMERA_BTN_X/MAIN_H INVERSE_VER_CHANGE_CAMERA_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_CHANGE_CAMERA_BTN_X+CHANGE_CAMERA_BTN_W)/MAIN_H (INVERSE_VER_CHANGE_CAMERA_BTN_Y+CHANGE_CAMERA_BTN_H)/MAIN_W; to: "bg";}
+                    min: 72 72;
+                    max: 72 72;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_switch.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_switch_press.png";
+                }
+                description
+                {
+                                       state: "landscape" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: HOR_CHANGE_CAMERA_BTN_X/MAIN_W HOR_CHANGE_CAMERA_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_CHANGE_CAMERA_BTN_X+CHANGE_CAMERA_BTN_W)/MAIN_W (HOR_CHANGE_CAMERA_BTN_Y+CHANGE_CAMERA_BTN_H)/MAIN_H; to: "bg";}
+                    min: 72 72;
+                    max: 72 72;
+                    visible: 1;
+                                       align: 0.5 0.5;
+                    image.normal: IMAGE_PATH"camera_btn_switch.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"camera_btn_switch_press.png";
+                }
+            } //part
+                       part {
+                               name: "battery_low";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               repeat_events : 0;
+                               //scale: 1;
+                               description{
+                                       state:"default" 0.0;
+                                       rel1 { relative: 0.0 0.0;}
+                                       rel2 { relative: 1.0 1.0;}
+                               }
+                       }
+            programs
+            {
+            program {
+                               name : "camera_layout_WVGA,set,landscape";
+                               source: "camera_layout_WVGA";
+                               signal: "landscape";
+                               script: {
+                                       set_state(PART:"shutter_button", "landscape", 0.0);
+                                       set_state(PART:"change_camera_button", "landscape", 0.0);
+                                       set_state(PART:"video_button", "landscape", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "camera_layout_WVGA,set,portrait";
+                               source: "camera_layout_WVGA";
+                               signal: "portrait";
+                               script: {
+                                       set_state(PART:"shutter_button", "portrait", 0.0);
+                                       set_state(PART:"change_camera_button", "portrait", 0.0);
+                                       set_state(PART:"video_button", "portrait", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "camera_layout_WVGA,set,landscape_inverse";
+                               source: "camera_layout_WVGA";
+                               signal: "landscape_inverse";
+                               script: {
+                                       set_state(PART:"shutter_button", "landscape_inverse", 0.0);
+                                       set_state(PART:"change_camera_button", "landscape_inverse", 0.0);
+                                       set_state(PART:"video_button", "landscape_inverse", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "camera_layout_WVGA,set,portrait_inverse";
+                               source: "camera_layout_WVGA";
+                               signal: "portrait_inverse";
+                               script: {
+                                       set_state(PART:"shutter_button", "portrait_inverse", 0.0);
+                                       set_state(PART:"change_camera_button", "portrait_inverse", 0.0);
+                                       set_state(PART:"video_button", "portrait_inverse", 0.0);
+                                       }
+                               }
+                program {
+                    name: "down_shutter";
+                    signal: "mouse,down,*";
+                    source: "shutter_button";
+                    script {
+                             new st[31]
+                             new Float:vl;
+                             get_state(PART:"shutter_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"shutter_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"shutter_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"shutter_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"shutter_button", "portrait_inverse_pressed", 0.0);
+                        emit("shutter_button_down", "shutter_button");
+                    }
+                }
+                program {
+                    name: "up_shutter";
+                    signal: "mouse,up,1";
+                    source: "shutter_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"shutter_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"shutter_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"shutter_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"shutter_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"shutter_button", "portrait_inverse", 0.0);
+                        emit("shutter_button_up", "shutter_button");
+                    }
+                }
+                program
+                {
+                    name: "clicked_shutter";
+                    signal: "mouse,clicked,1";
+                    source: "shutter_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"shutter_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"shutter_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"shutter_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"shutter_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"shutter_button", "portrait_inverse", 0.0);
+                        emit("shutter_button_clicked", "shutter_button");
+                    }
+                } //program
+                program {
+                    name: "down_video";
+                    signal: "mouse,down,*";
+                    source: "video_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"video_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"video_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"video_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"video_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"video_button", "portrait_inverse_pressed", 0.0);
+                        emit("video_button_down", "video_button");
+                    }
+                }
+                program {
+                    name: "up_video";
+                    signal: "mouse,up,1";
+                    source: "video_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"video_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"video_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"video_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"video_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"video_button", "portrait_inverse", 0.0);
+                        emit("video_button_up", "video_button");
+                    }
+                }
+                program
+                {
+                    name: "clicked_video";
+                    signal: "mouse,clicked,1";
+                    source: "video_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"video_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"video_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"video_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"video_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"video_button", "portrait_inverse", 0.0);
+                       emit("video_button_clicked", "video_button");
+                    }
+                } //program
+                program {
+                    name: "down_change_camera";
+                    signal: "mouse,down,*";
+                    source: "change_camera_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"change_camera_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"change_camera_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"change_camera_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"change_camera_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"change_camera_button", "portrait_inverse_pressed", 0.0);
+                       emit("change_camera_button_down", "change_camera_button");
+                    }
+                }
+                program {
+                    name: "up_change_camera";
+                    signal: "mouse,up,1";
+                    source: "change_camera_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"change_camera_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"change_camera_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"change_camera_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"change_camera_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"change_camera_button", "portrait_inverse", 0.0);
+                        emit("change_camera_button_up", "change_camera_button");
+                    }
+                }
+                program {
+                    name: "clicked_change_camera";
+                    signal: "mouse,clicked,1";
+                    source: "change_camera_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"change_camera_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"change_camera_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"change_camera_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"change_camera_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"change_camera_button", "portrait_inverse", 0.0);
+                        emit("change_camera_button_clicked", "change_camera_button");
+                    }
+                } //program
+            } //programs
+
+        } //parts
+    } //group
+
+    group
+    {
+        name: "recorder_layout";
+        parts
+        {
+               part { name: "bg";
+                       type: RECT;
+                       mouse_events: 0;
+                       //scale: 1;
+                       description{
+                               state:"default" 0.0;
+                               rel1 { relative: 0.0 0.0;}
+                               rel2 { relative: 1.0 1.0;}
+                               color: 255 255 255 0;
+                       }
+               }
+            part
+            {
+                name: "rec_stop_button";
+                type: IMAGE;
+                               //scale: 1;
+                description
+                {
+                    //fixed: 1 1;
+                                       rel1 { relative: VER_REC_STOP_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -170;}
+                                       rel2 { relative: (VER_REC_STOP_BTN_X+REC_STOP_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 132 132;
+                                       max: 132 132;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_stop.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_stop_press.png";
+                }
+                description
+                {
+                                       state: "portrait" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: VER_REC_STOP_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -170;}
+                                       rel2 { relative: (VER_REC_STOP_BTN_X+REC_STOP_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 132 132;
+                                       max: 132 132;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_stop.png";
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_stop_press.png";
+                }
+                description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_REC_STOP_BTN_X/MAIN_W INVERSE_HOR_REC_STOP_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_STOP_BTN_X+REC_STOP_BTN_W)/MAIN_W (INVERSE_HOR_REC_STOP_BTN_Y+REC_STOP_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 132 132;
+                                       max: 132 132;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_stop.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_stop_press.png";
+                }
+                description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_REC_STOP_BTN_X/MAIN_H INVERSE_VER_REC_STOP_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_REC_STOP_BTN_X+REC_STOP_BTN_W)/MAIN_H (INVERSE_VER_REC_STOP_BTN_Y+REC_STOP_BTN_H)/MAIN_W; to: "bg";}
+                                       min: 132 132;
+                                       max: 132 132;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_stop.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_stop_press.png";
+                }
+                description
+                {
+                                       state: "landscape" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: HOR_REC_STOP_BTN_X/MAIN_W HOR_REC_STOP_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_STOP_BTN_X+REC_STOP_BTN_W)/MAIN_W (HOR_REC_STOP_BTN_Y+REC_STOP_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 132 132;
+                                       max: 132 132;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_stop.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_stop_press.png";
+                }
+            } //part
+            part
+            {
+                name: "rec_pause_button";
+                type: IMAGE;
+                               //scale: 1;
+                description
+                {
+                    fixed: 1 1;
+                                       rel1 { relative: VER_REC_PAUSE_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -170;}
+                                       rel2 { relative: (VER_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 72 72;
+                                       max: 96 96;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_pause.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                description {
+                    state: "hide" 0.0;
+                    inherit: "default" 0.0;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+               description
+                {
+                                       state: "portrait" 0.0;
+                    fixed: 1 1;
+                    inherit: "default" 0.0;
+                                       rel1 { relative: VER_REC_PAUSE_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -170;}
+                                       rel2 { relative: (VER_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 72 72;
+                                       max: 96 96;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_pause.png";
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                 description {
+                    state: "portrait_hide" 0.0;
+                    inherit: "portrait" 0.0;
+                                       rel1 { relative: VER_REC_PAUSE_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -170;}
+                                       rel2 { relative: (VER_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 72 72;
+                                       max: 96 96;
+                    visible: 0;
+                }
+                  description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_REC_PAUSE_BTN_X/MAIN_W INVERSE_HOR_REC_PAUSE_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_W (INVERSE_HOR_REC_PAUSE_BTN_Y+REC_PAUSE_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 72 72;
+                                       max: 96 96;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_pause.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                 description {
+                    state: "landscape_inverse_hide" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                 description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_REC_PAUSE_BTN_X/MAIN_H INVERSE_VER_REC_PAUSE_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_H (INVERSE_VER_REC_PAUSE_BTN_Y+REC_PAUSE_BTN_H)/MAIN_W; to: "bg";}
+                                       min: 96 96;
+                                       max: 96 96;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_pause.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                description {
+                    state: "portrait_inverse_hide" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                 description
+                {
+                                       state: "landscape" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: HOR_REC_PAUSE_BTN_X/MAIN_W HOR_REC_PAUSE_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_W (HOR_REC_PAUSE_BTN_Y+REC_PAUSE_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 96 96;
+                                       max: 96 96;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_pause.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                description {
+                    state: "landscape_hide" 0.0;
+                    inherit: "landscape" 0.0;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+            } //part
+            part
+            {
+                name: "rec_resume_button";
+                type: IMAGE;
+                description
+                {
+                    //fixed: 1 1;
+                                       rel1 { relative: VER_REC_RESUME_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -170;}
+                                       rel2 { relative: (VER_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 96 96;
+                                       max: 96 96;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_recording.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                description {
+                    state: "visible" 0.0;
+                    inherit: "default" 0.0;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                  //this comment should be removed
+                description
+                {
+                                       state: "portrait" 0.0;
+                    //fixed: 1 1;
+                    inherit: "default" 0.0;
+                                       rel1 { relative: VER_REC_RESUME_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -170;}
+                                       rel2 { relative: (VER_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 96 96;
+                                       max: 96 96;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_recording.png";
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                 description {
+                    state: "portrait_visible" 0.0;
+                    inherit: "portrait" 0.0;
+                                       rel1 { relative: VER_REC_RESUME_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -170;}
+                                       rel2 { relative: (VER_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 72 72;
+                                       max: 96 96;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                  description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_REC_RESUME_BTN_X/MAIN_W INVERSE_HOR_REC_RESUME_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_W (INVERSE_HOR_REC_RESUME_BTN_Y+REC_RESUME_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 72 72;
+                                       max: 96 96;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_recording.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                 description {
+                    state: "landscape_inverse_visible" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                 description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_REC_RESUME_BTN_X/MAIN_H INVERSE_VER_REC_RESUME_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_H (INVERSE_VER_REC_RESUME_BTN_Y+REC_RESUME_BTN_H)/MAIN_W; to: "bg";}
+                                       min: 72 72;
+                                       max: 96 96;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_recording.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                description {
+                    state: "portrait_inverse_visible" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                 description
+                {
+                                       state: "landscape" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: HOR_REC_RESUME_BTN_X/MAIN_W HOR_REC_RESUME_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_W (HOR_REC_RESUME_BTN_Y+REC_RESUME_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 72 72;
+                                       max: 96 96;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_recording.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                description {
+                    state: "landscape_visible" 0.0;
+                    inherit: "landscape" 0.0;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+            } //part
+               part { name: "recording_time";
+                       type: TEXT;
+                       effect: OUTLINE;
+                       mouse_events: 1;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: VER_REC_TIME_X/MAIN_H 0.0; to: "bg"; offset: 0 40;}
+                               rel2 { relative: (VER_REC_TIME_X+REC_TIME_W)/MAIN_H 0.0; to: "bg"; offset: 0 68;}
+                               color:245 245 245 255;
+                               text {
+                                       size: 23;
+                                       align: 0.0 0.0;
+                               }
+                       }
+                       description {
+                               state: "invisible" 0.0;
+                               inherit: "default" 0.0;
+                               visible : 0;
+                       }
+                       description
+                {
+                                       state: "portrait" 0.0;
+                                       rel1 { relative: VER_REC_TIME_X/MAIN_H 0.0; to: "bg"; offset: 0 40;}
+                                       rel2 { relative: (VER_REC_TIME_X+REC_TIME_W)/MAIN_H 0.0; to: "bg"; offset: 0 76;}
+                               color:245 245 245 255;
+                               text {
+                                       size: 23;
+                               //      size: 13;
+                                       align: 0.0 0.0;
+                               }
+                }
+                description {
+                    state: "portrait_invisible" 0.0;
+                    inherit: "portrait" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "landscape_inverse" 0.0;
+                                       rel1 { relative: INVERSE_HOR_REC_TIME_X/MAIN_W INVERSE_HOR_REC_TIME_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_TIME_X+REC_TIME_W)/MAIN_W (INVERSE_HOR_REC_TIME_Y+REC_TIME_H)/MAIN_H; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 23;
+                                               align: 0.0 0.0;
+                                       }
+                }
+                description {
+                    state: "landscape_inverse_invisible" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    inherit: "default" 0.0;
+                    rel1 { relative: 0.1 0.8; to: "bg";}
+                                       rel2 { relative: 0.2 0.87; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 23;
+                                               align: 1.0 0.0;
+                                       }
+                }
+                description {
+                    state: "portrait_inverse_invisible" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "landscape" 0.0;
+                                       rel1 { relative: HOR_REC_TIME_X/MAIN_W HOR_REC_TIME_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_TIME_X+REC_TIME_W)/MAIN_W (HOR_REC_TIME_Y+REC_TIME_H)/MAIN_H; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 23;
+                                               align: 0.0 0.0;
+                                       }
+                }
+                description {
+                    state: "landscape_invisible" 0.0;
+                    inherit: "landscape" 0.0;
+                    visible : 0;
+                }
+               }
+               part { name: "recording_size";
+                       type: TEXT;
+                       effect: OUTLINE;
+                       mouse_events: 1;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: VER_REC_SIZE_X/MAIN_H 0.0; to: "bg"; offset: 0 80;}
+                               rel2 { relative: (VER_REC_SIZE_X+REC_SIZE_W)/MAIN_H 0.0; to: "bg"; offset: 0 116;}
+                               color:245 245 245 255;
+                               text {
+                                       size: 23;
+                                       align: 1.0 0.0;
+                               }
+                       }
+                       description {
+                               state: "invisible" 0.0;
+                               inherit: "default";
+                               visible: 0.0;
+                       }
+                        description
+                {
+                                       state: "portrait" 0.0;
+                    inherit: "default" 0.0;
+                }
+                description {
+                    state: "portrait_invisible" 0.0;
+                    inherit: "portrait" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "landscape_inverse" 0.0;
+                                       rel1 { relative: INVERSE_HOR_REC_SIZE_X/MAIN_W INVERSE_HOR_REC_SIZE_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_SIZE_X+REC_SIZE_W)/MAIN_W (INVERSE_HOR_REC_SIZE_Y+REC_SIZE_H)/MAIN_H; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 23;
+                                               align: 1.0 0.0;
+                                       }
+                }
+                description {
+                    state: "landscape_inverse_invisible" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    inherit: "default" 0.0;
+                                       rel1 { relative: INVERSE_VER_REC_SIZE_X/MAIN_H INVERSE_VER_REC_SIZE_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_REC_SIZE_X+REC_SIZE_W)/MAIN_H (INVERSE_VER_REC_SIZE_Y+REC_SIZE_H)/MAIN_W; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 23;
+                                               align: 1.0 0.0;
+                                       }
+                }
+                description {
+                    state: "portrait_inverse_invisible" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "landscape" 0.0;
+                                       rel1 { relative: HOR_REC_SIZE_X/MAIN_W HOR_REC_SIZE_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_SIZE_X+REC_SIZE_W)/MAIN_W (HOR_REC_SIZE_Y+REC_SIZE_H)/MAIN_H; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 23;
+                                               align: 0.0 0.0;
+                                       }
+                }
+                description {
+                    state: "landscape_invisible" 0.0;
+                    inherit: "landscape" 0.0;
+                    visible : 0;
+                }
+               }
+               part { name: "progressbar_area";
+                       type: SWALLOW;
+                       mouse_events: 1;
+                       //scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: 0.1 1.0; to: "bg"; offset: 0 -200;}
+                               rel2 { relative: 0.9 1.0; to: "bg"; offset: 0 -170;}
+                       }
+                       description {
+                               state: "landscape" 0.0;
+                               rel1 { relative: 0.2 0.7; to: "bg";}
+                               rel2 { relative: 0.8 0.8; to: "bg";}
+                       }
+                       description {
+                               state: "portrait" 0.0;
+                               inherit: "default" 0.0;
+                       }
+                       description {
+                               state: "invisible" 0.0;
+                               inherit: "default";
+                               visible: 0.0;
+                       }
+               }
+               part { name: "recording_icon";
+                       type: SWALLOW;
+                       mouse_events: 1;
+                       //scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: VER_REC_ICON_AREA_X/MAIN_H 0.0; to: "bg"; offset: 0 40;}
+                               rel2 { relative: (VER_REC_ICON_AREA_X+REC_ICON_AREA_W)/MAIN_H 0.0; to: "bg"; offset: 0 68;}
+                               align: 0.0 0.0;
+                       }
+                       description
+                {
+                                       state: "portrait" 0.0;
+                    inherit: "default" 0.0;
+                }
+                  description
+                {
+                                       state: "landscape_inverse" 0.0;
+                                       rel1 { relative: INVERSE_HOR_REC_ICON_AREA_X/MAIN_W INVERSE_HOR_REC_ICON_AREA_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_ICON_AREA_X+REC_ICON_AREA_W)/MAIN_W (INVERSE_HOR_REC_ICON_AREA_Y+REC_ICON_AREA_H)/MAIN_H; to: "bg";}
+                                       align: 0.5 0.5;
+                }
+                  description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    inherit: "default" 0.0;
+                    rel1 { relative: 0.0 0.9; to_x: recording_time;  to_y: "bg"; offset: -20 0;}
+                                       rel2 { relative: 0.0 1.0; to_x: recording_time; to_y: "bg";}
+                                       align: 0.0 1.0;
+                }
+                  description
+                {
+                                       state: "landscape" 0.0;
+                                       rel1 { relative: HOR_REC_ICON_AREA_X/MAIN_W HOR_REC_ICON_AREA_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_ICON_AREA_X+REC_ICON_AREA_W)/MAIN_W (HOR_REC_ICON_AREA_Y+REC_ICON_AREA_H)/MAIN_H; to: "bg";}
+                                       align: 0.5 0.5;
+                }
+               }
+            programs
+            {
+                               program {
+                               name : "recorder_layout,set,landscape";
+                               source: "recorder_layout";
+                               signal: "landscape";
+                               script: {
+                                       new st[31]
+                                       new Float:vl;
+                                       get_state(PART:"rec_resume_button", st, 30, vl);
+                                       set_state(PART:"rec_stop_button", "landscape", 0.0);
+                                       if((!strcmp(st,"landscape_visible"))||(!strcmp(st,"landscape_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape_visible", 0.0);
+                                       }
+                                       else if((!strcmp(st,"portrait_visible"))||(!strcmp(st,"portrait_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape_visible", 0.0);
+                                       }
+                                       else
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape", 0.0);
+                                       }
+                                       set_state(PART:"recording_time", "landscape", 0.0);
+                                       set_state(PART:"recording_size", "landscape", 0.0);
+                                       set_state(PART:"recording_icon", "landscape", 0.0);
+                                       set_state(PART:"progressbar_area", "landscape", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "recorder_layout,set,portrait";
+                               source: "recorder_layout";
+                               signal: "portrait";
+                               script: {
+                                       new st[31]
+                                       new Float:vl;
+                                       get_state(PART:"rec_resume_button", st, 30, vl);
+                                       set_state(PART:"rec_stop_button", "portrait", 0.0);
+                                       if((!strcmp(st,"landscape_visible"))||(!strcmp(st,"landscape_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait_visible", 0.0);
+                                       }
+                                       else if((!strcmp(st,"portrait_visible"))||(!strcmp(st,"portrait_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait_visible", 0.0);
+                                       }
+                                       else
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait", 0.0);
+                                       }
+                                       set_state(PART:"recording_time", "portrait", 0.0);
+                                       set_state(PART:"recording_size", "portrait", 0.0);
+                                       set_state(PART:"recording_icon", "portrait", 0.0);
+                                       set_state(PART:"progressbar_area", "portrait", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "recorder_layout,set,landscape_inverse";
+                               source: "recorder_layout";
+                               signal: "landscape_inverse";
+                               script: {
+                                       new st[31]
+                                       new Float:vl;
+                                       get_state(PART:"rec_resume_button", st, 30, vl);
+                                       set_state(PART:"rec_stop_button", "landscape_inverse", 0.0);
+                                       if((!strcmp(st,"landscape_visible"))||(!strcmp(st,"landscape_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape_inverse_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape_inverse_visible", 0.0);
+                                       }
+                                       else if((!strcmp(st,"portrait_visible"))||(!strcmp(st,"portrait_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape_inverse_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape_inverse_visible", 0.0);
+                                       }
+                                       else
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape_inverse", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape_inverse", 0.0);
+                                       }
+                                       set_state(PART:"recording_time", "landscape_inverse", 0.0);
+                                       set_state(PART:"recording_size", "landscape_inverse", 0.0);
+                                       set_state(PART:"recording_icon", "landscape_inverse", 0.0);
+                                       set_state(PART:"progressbar_area", "landscape", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "recorder_layout,set,portrait_inverse";
+                               source: "recorder_layout";
+                               signal: "portrait_inverse";
+                               script: {
+                                       new st[31]
+                                       new Float:vl;
+                                       get_state(PART:"rec_resume_button", st, 30, vl);
+                                       set_state(PART:"rec_stop_button", "portrait_inverse", 0.0);
+                                       if((!strcmp(st,"landscape_visible"))||(!strcmp(st,"landscape_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait_inverse_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait_inverset_visible", 0.0);
+                                       }
+                                       else if((!strcmp(st,"portrait_visible"))||(!strcmp(st,"portrait_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait_inverse_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait_inverse_visible", 0.0);
+                                       }
+                                       else
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait_inverse", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait_inverse", 0.0);
+                                       }
+                                       set_state(PART:"recording_time", "portrait_inverse", 0.0);
+                                       set_state(PART:"recording_size", "portrait_inverse", 0.0);
+                                       set_state(PART:"recording_icon", "portrait_inverse", 0.0);
+                                       set_state(PART:"progressbar_area", "portrait", 0.0);
+                                       }
+                               }
+                program {
+                    name: "down_rec_stop";
+                    signal: "mouse,down,*";
+                    source: "rec_stop_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_stop_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"rec_stop_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"rec_stop_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"rec_stop_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"rec_stop_button", "portrait_inverse_pressed", 0.0);
+                        emit("rec_stop_button_down", "rec_stop_button");
+                    }
+                }
+                program {
+                    name: "up_rec_stop";
+                    signal: "mouse,up,1";
+                    source: "rec_stop_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_stop_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"rec_stop_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"rec_stop_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"rec_stop_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"rec_stop_button", "portrait_inverse", 0.0);
+                        emit("rec_stop_button_up", "rec_stop_button");
+                    }
+                }
+                program
+                {
+                    name: "clicked_rec_stop";
+                    signal: "mouse,clicked,1";
+                    source: "rec_stop_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_stop_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"rec_stop_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"rec_stop_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"rec_stop_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"rec_stop_button", "portrait_inverse", 0.0);
+                        emit("rec_stop_button_clicked", "rec_stop_button");
+                    }
+                } //program
+                program {
+                    name: "down_rec_pause";
+                    signal: "mouse,down,*";
+                    source: "rec_pause_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_pause_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"rec_pause_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"rec_pause_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"rec_pause_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"rec_pause_button", "portrait_inverse_pressed", 0.0);
+                        emit("rec_pause_button_down", "rec_pause_button");
+                    }
+                }
+                program {
+                    name: "up_rec_pause";
+                    signal: "mouse,up,1";
+                    source: "rec_pause_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_pause_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"rec_pause_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"rec_pause_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"rec_pause_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"rec_pause_button", "portrait_inverse", 0.0);
+                        emit("rec_pause_button_up", "rec_pause_button");
+                    }
+                }
+                program
+                {
+                    name: "clicked_rec_pause";
+                    signal: "mouse,clicked,1";
+                    source: "rec_pause_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_stop_button", st, 30, vl);
+                              if ((!strcmp(st,"landscape_inverse"))||(!strcmp(st,"landscape_inverse_pressed")))
+                      {
+                        set_state(PART:"rec_pause_button", "landscape_inverse_hide", 0.0);
+                        set_state(PART:"rec_resume_button", "landscape_inverse_visible", 0.0);
+                      }
+                      else if ((!strcmp(st,"portrait_inverse"))||(!strcmp(st,"portrait_inverse_pressed")))
+                      {
+                        set_state(PART:"rec_pause_button", "portrait_inverse_hide", 0.0);
+                        set_state(PART:"rec_resume_button", "portrait_inverse_visible", 0.0);
+                      }
+                             else if ((!strcmp(st,"landscape"))||(!strcmp(st,"landscape_pressed")))
+                             {
+                        set_state(PART:"rec_pause_button", "landscape_hide", 0.0);
+                        set_state(PART:"rec_resume_button", "landscape_visible", 0.0);
+                       }
+                      else if ((!strcmp(st,"portrait"))||(!strcmp(st,"portrait_pressed")))
+                      {
+                        set_state(PART:"rec_pause_button", "portrait_hide", 0.0);
+                        set_state(PART:"rec_resume_button", "portrait_visible", 0.0);
+                      }
+                        emit("rec_pause_button_clicked", "rec_pause_button");
+                    }
+                } //program
+                program {
+                    name: "down_rec_resume";
+                    signal: "mouse,down,*";
+                    source: "rec_resume_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_resume_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"rec_resume_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"rec_resume_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"rec_resume_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"rec_resume_button", "portrait_inverse_pressed", 0.0);
+                        emit("rec_resume_button_down", "rec_resume_button");
+                    }
+                }
+                program {
+                    name: "up_rec_resume";
+                    signal: "mouse,up,1";
+                    source: "rec_resume_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_resume_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"rec_resume_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"rec_resume_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"rec_resume_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"rec_resume_button", "portrait_inverse", 0.0);
+                        emit("rec_resume_button_up", "rec_resume_button");
+                    }
+                }
+                program
+                {
+                    name: "clicked_rec_resume";
+                    signal: "mouse,clicked,1";
+                    source: "rec_resume_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_stop_button", st, 30, vl);
+                             if ((!strcmp(st, "landscape_pressed"))||(!strcmp(st, "landscape")))
+                             {
+                        set_state(PART:"rec_pause_button", "landscape", 0.0);
+                        set_state(PART:"rec_resume_button", "landscape", 0.0);
+                       }
+                      if ((!strcmp(st, "portrait_pressed"))||(!strcmp(st, "portrait")))
+                      {
+                        set_state(PART:"rec_pause_button", "portrait", 0.0);
+                        set_state(PART:"rec_resume_button", "portrait", 0.0);
+                      }
+                      if ((!strcmp(st, "landscape_inverse_pressed"))||(!strcmp(st, "landscape_inverse")))
+                      {
+                        set_state(PART:"rec_pause_button", "landscape_inverse", 0.0);
+                        set_state(PART:"rec_resume_button", "landscape_inverse", 0.0);
+                      }
+                      if ((!strcmp(st, "portrait_inverse_pressed"))||(!strcmp(st, "portrait_inverse")))
+                      {
+                        set_state(PART:"rec_pause_button", "portrait_inverse", 0.0);
+                        set_state(PART:"rec_resume_button", "portrait_inverse", 0.0);
+                      }
+                        emit("rec_resume_button_clicked", "rec_resume_button");
+                    }
+                } //program
+            } //programs
+        } //parts
+    }
+    //recorder layout for z1
+     group
+    {
+        name: "recorder_layout_WVGA";
+        parts
+        {
+               part { name: "bg";
+                       type: RECT;
+                       mouse_events: 0;
+                       //scale: 1;
+                       description{
+                               state:"default" 0.0;
+                               rel1 { relative: 0.0 0.0;}
+                               rel2 { relative: 1.0 1.0;}
+                               color: 255 255 255 0;
+                       }
+               }
+            part
+            {
+                name: "rec_stop_button";
+                type: IMAGE;
+                               //scale: 1;
+                description
+                {
+                    fixed: 1 1;
+                                       rel1 { relative: VER_REC_STOP_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -128;}
+                                       rel2 { relative: (VER_REC_STOP_BTN_X+REC_STOP_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 99 99;
+                                       max: 99 99;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_stop.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_stop_press.png";
+                }
+                description
+                {
+                                       state: "portrait" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: VER_REC_STOP_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -128;}
+                                       rel2 { relative: (VER_REC_STOP_BTN_X+REC_STOP_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 99 99;
+                                       max: 99 99;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_stop.png";
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_stop_press.png";
+                }
+                description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_REC_STOP_BTN_X/MAIN_W INVERSE_HOR_REC_STOP_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_STOP_BTN_X+REC_STOP_BTN_W)/MAIN_W (INVERSE_HOR_REC_STOP_BTN_Y+REC_STOP_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 99 99;
+                                       max: 99 99;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_stop.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_stop_press.png";
+                }
+                description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_REC_STOP_BTN_X/MAIN_H INVERSE_VER_REC_STOP_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_REC_STOP_BTN_X+REC_STOP_BTN_W)/MAIN_H (INVERSE_VER_REC_STOP_BTN_Y+REC_STOP_BTN_H)/MAIN_W; to: "bg";}
+                                       min: 99 99;
+                                       max: 99 99;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_stop.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_stop_press.png";
+                }
+                description
+                {
+                                       state: "landscape" 0.0;
+                    //fixed: 1 1;
+                                       rel1 { relative: HOR_REC_STOP_BTN_X/MAIN_W HOR_REC_STOP_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_STOP_BTN_X+REC_STOP_BTN_W)/MAIN_W (HOR_REC_STOP_BTN_Y+REC_STOP_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 99 99;
+                                       max: 99 99;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_stop.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_stop_press.png";
+                }
+            } //part
+            part
+            {
+                name: "rec_pause_button";
+                type: IMAGE;
+                               //scale: 1;
+                description
+                {
+                    fixed: 1 1;
+                                       rel1 { relative: VER_REC_PAUSE_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -128;}
+                                       rel2 { relative: (VER_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_pause.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                description {
+                    state: "hide" 0.0;
+                    inherit: "default" 0.0;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+               description
+                {
+                                       state: "portrait" 0.0;
+                    fixed: 1 1;
+                    inherit: "default" 0.0;
+                                       rel1 { relative: VER_REC_PAUSE_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -128;}
+                                       rel2 { relative: (VER_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_pause.png";
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                 description {
+                    state: "portrait_hide" 0.0;
+                    inherit: "portrait" 0.0;
+                                       rel1 { relative: VER_REC_PAUSE_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -170;}
+                                       rel2 { relative: (VER_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 0;
+                }
+                  description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_REC_PAUSE_BTN_X/MAIN_W INVERSE_HOR_REC_PAUSE_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_W (INVERSE_HOR_REC_PAUSE_BTN_Y+REC_PAUSE_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_pause.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                 description {
+                    state: "landscape_inverse_hide" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                 description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_REC_PAUSE_BTN_X/MAIN_H INVERSE_VER_REC_PAUSE_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_H (INVERSE_VER_REC_PAUSE_BTN_Y+REC_PAUSE_BTN_H)/MAIN_W; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_pause.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                description {
+                    state: "portrait_inverse_hide" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                 description
+                {
+                                       state: "landscape" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: HOR_REC_PAUSE_BTN_X/MAIN_W HOR_REC_PAUSE_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_PAUSE_BTN_X+REC_PAUSE_BTN_W)/MAIN_W (HOR_REC_PAUSE_BTN_Y+REC_PAUSE_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_pause.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+                description {
+                    state: "landscape_hide" 0.0;
+                    inherit: "landscape" 0.0;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_pause_press.png";
+                }
+            } //part
+            part
+            {
+                name: "rec_resume_button";
+                type: IMAGE;
+                               //scale: 1;
+                description
+                {
+                    fixed: 1 1;
+                                       rel1 { relative: VER_REC_RESUME_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -128;}
+                                       rel2 { relative: (VER_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_recording.png";
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                description {
+                    state: "visible" 0.0;
+                    inherit: "default" 0.0;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                  //this comment should be removed
+                description
+                {
+                                       state: "portrait" 0.0;
+                    fixed: 1 1;
+                    inherit: "default" 0.0;
+                                       rel1 { relative: VER_REC_RESUME_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -128;}
+                                       rel2 { relative: (VER_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_recording.png";
+                }
+                description {
+                    state: "portrait_pressed" 0.0;
+                    inherit: "portrait" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                 description {
+                    state: "portrait_visible" 0.0;
+                    inherit: "portrait" 0.0;
+                                       rel1 { relative: VER_REC_RESUME_BTN_X/MAIN_H 1.0; to: "bg";offset: 0 -128;}
+                                       rel2 { relative: (VER_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_H 1.0; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                  description
+                {
+                                       state: "landscape_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_HOR_REC_RESUME_BTN_X/MAIN_W INVERSE_HOR_REC_RESUME_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_W (INVERSE_HOR_REC_RESUME_BTN_Y+REC_RESUME_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_recording.png";
+                }
+                description {
+                    state: "landscape_inverse_pressed" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                 description {
+                    state: "landscape_inverse_visible" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                 description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: INVERSE_VER_REC_RESUME_BTN_X/MAIN_H INVERSE_VER_REC_RESUME_BTN_Y/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_H (INVERSE_VER_REC_RESUME_BTN_Y+REC_RESUME_BTN_H)/MAIN_W; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_recording.png";
+                }
+                description {
+                    state: "portrait_inverse_pressed" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                description {
+                    state: "portrait_inverse_visible" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                 description
+                {
+                                       state: "landscape" 0.0;
+                    fixed: 1 1;
+                                       rel1 { relative: HOR_REC_RESUME_BTN_X/MAIN_W HOR_REC_RESUME_BTN_Y/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_RESUME_BTN_X+REC_RESUME_BTN_W)/MAIN_W (HOR_REC_RESUME_BTN_Y+REC_RESUME_BTN_H)/MAIN_H; to: "bg";}
+                                       min: 72 72;
+                                       max: 72 72;
+                    visible: 0;
+                    image.normal: IMAGE_PATH"camera_rec_recording.png";
+                }
+                description {
+                    state: "landscape_pressed" 0.0;
+                    inherit: "landscape" 0.0;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+                description {
+                    state: "landscape_visible" 0.0;
+                    inherit: "landscape" 0.0;
+                    visible: 1;
+                    image.normal: IMAGE_PATH"camera_rec_recording_press.png";
+                }
+            } //part
+               part { name: "recording_time";
+                       type: TEXT;
+                       effect: OUTLINE;
+                       mouse_events: 1;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: VER_REC_TIME_X_WVGA/MAIN_H 0.0; to: "bg"; offset: 0 30;}
+                               rel2 { relative: (VER_REC_TIME_X_WVGA+REC_TIME_W)/MAIN_H 0.0; to: "bg"; offset: 0 61;}
+                               color:245 245 245 255;
+                               text {
+                                       size: 18;
+                                       align: 0.0 0.5;
+                               }
+                       }
+                       description {
+                               state: "invisible" 0.0;
+                               inherit: "default" 0.0;
+                               visible : 0;
+                       }
+                       description
+                {
+                                       state: "portrait" 0.0;
+                                       rel1 { relative: VER_REC_TIME_X_WVGA/MAIN_H 0.0; to: "bg"; offset: 0 30;}
+                                       rel2 { relative: (VER_REC_TIME_X_WVGA+REC_TIME_W)/MAIN_H 0.0; to: "bg"; offset: 0 61;}
+                               color:245 245 245 255;
+                               text {
+                                       size: 18;
+                               //      size: 13;
+                                       align: 0.0 0.5;
+                               }
+                }
+                description {
+                    state: "portrait_invisible" 0.0;
+                    inherit: "portrait" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "landscape_inverse" 0.0;
+                                       rel1 { relative: INVERSE_HOR_REC_TIME_X_WVGA/MAIN_W INVERSE_HOR_REC_TIME_Y_WVGA/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_TIME_X_WVGA+REC_TIME_W_WVGA)/MAIN_W (INVERSE_HOR_REC_TIME_Y_WVGA+REC_TIME_H)/MAIN_H; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 18;
+                                               align: 0.0 0.5;
+                                       }
+                }
+                description {
+                    state: "landscape_inverse_invisible" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    inherit: "default" 0.0;
+                    rel1 { relative: 0.1 0.8; to: "bg";}
+                                       rel2 { relative: 0.2 0.87; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 18;
+                                               align: 0.0 0.0;
+                                       }
+                }
+                description {
+                    state: "portrait_inverse_invisible" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "landscape" 0.0;
+                                       rel1 { relative: HOR_REC_TIME_X/MAIN_W HOR_REC_TIME_Y_WVGA/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_TIME_X+REC_TIME_W)/MAIN_W (HOR_REC_TIME_Y_WVGA+REC_TIME_H)/MAIN_H; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 18;
+                                               align: 0.0 0.5;
+                                       }
+                }
+                description {
+                    state: "landscape_invisible" 0.0;
+                    inherit: "landscape" 0.0;
+                    visible : 0;
+                }
+               }
+               part { name: "recording_size";
+                       type: TEXT;
+                       effect: OUTLINE;
+                       mouse_events: 1;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: VER_REC_SIZE_X_WVGA/MAIN_H 0.0; to: "bg"; offset: 0 60;}
+                               rel2 { relative: (VER_REC_SIZE_X_WVGA+REC_SIZE_W_WVGA)/MAIN_H 0.0; to: "bg"; offset: 0 87;}
+                               color:245 245 245 255;
+                               text {
+                                       size: 18;
+                                       align: 1.0 0.0;
+                               }
+                       }
+                       description {
+                               state: "invisible" 0.0;
+                               inherit: "default";
+                               visible: 0.0;
+                       }
+                        description
+                {
+                                       state: "portrait" 0.0;
+                    inherit: "default" 0.0;
+                }
+                description {
+                    state: "portrait_invisible" 0.0;
+                    inherit: "portrait" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "landscape_inverse" 0.0;
+                                       rel1 { relative: INVERSE_HOR_REC_SIZE_X_WVGA/MAIN_W INVERSE_HOR_REC_SIZE_Y_WVGA/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_SIZE_X_WVGA+REC_SIZE_W_WVGA)/MAIN_W (INVERSE_HOR_REC_SIZE_Y_WVGA+REC_SIZE_H_WVGA)/MAIN_H; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 18;
+                                               align: 1.0 0.0;
+                                       }
+                }
+                description {
+                    state: "landscape_inverse_invisible" 0.0;
+                    inherit: "landscape_inverse" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    inherit: "default" 0.0;
+                                       rel1 { relative: INVERSE_VER_REC_SIZE_X_WVGA/MAIN_H INVERSE_VER_REC_SIZE_Y_WVGA/MAIN_W; to: "bg";}
+                                       rel2 { relative: (INVERSE_VER_REC_SIZE_X_WVGA+REC_SIZE_W_WVGA)/MAIN_H (INVERSE_VER_REC_SIZE_Y_WVGA+REC_SIZE_H_WVGA)/MAIN_W; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 18;
+                                               align: 1.0 0.0;
+                                       }
+                }
+                description {
+                    state: "portrait_inverse_invisible" 0.0;
+                    inherit: "portrait_inverse" 0.0;
+                    visible : 0;
+                }
+                  description
+                {
+                                       state: "landscape" 0.0;
+                                       rel1 { relative: HOR_REC_SIZE_X_WVGA/MAIN_W HOR_REC_SIZE_Y_WVGA/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_SIZE_X_WVGA+REC_SIZE_W_WVGA)/MAIN_W (HOR_REC_SIZE_Y_WVGA+REC_SIZE_H_WVGA)/MAIN_H; to: "bg";}
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 18;
+                                               align: 0.0 0.0;
+                                       }
+                }
+                description {
+                    state: "landscape_invisible" 0.0;
+                    inherit: "landscape" 0.0;
+                    visible : 0;
+                }
+               }
+               part { name: "progressbar_area";
+                       type: SWALLOW;
+                       mouse_events: 1;
+                       //scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: 0.1 1.0; to: "bg"; offset: 0 -150;}
+                               rel2 { relative: 0.9 1.0; to: "bg"; offset: 0 -128;}
+                       }
+                       description {
+                               state: "landscape" 0.0;
+                               rel1 { relative: 0.2 0.7; to: "bg";}
+                               rel2 { relative: 0.8 0.8; to: "bg";}
+                       }
+                       description {
+                               state: "portrait" 0.0;
+                               inherit: "default" 0.0;
+                       }
+                       description {
+                               state: "invisible" 0.0;
+                               inherit: "default";
+                               visible: 0.0;
+                       }
+               }
+               part { name: "recording_icon";
+                       type: SWALLOW;
+                       mouse_events: 1;
+                       //scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: VER_REC_ICON_AREA_X_WVGA/MAIN_H 0.0; to: "bg"; offset: 0 30;}
+                               rel2 { relative: (VER_REC_ICON_AREA_X_WVGA+REC_ICON_AREA_W_WVGA)/MAIN_H 0.0; to: "bg"; offset: 0 65;}
+                               align: 0.0 0.0;
+                       }
+                       description
+                {
+                                       state: "portrait" 0.0;
+                    inherit: "default" 0.0;
+                }
+                  description
+                {
+                                       state: "landscape_inverse" 0.0;
+                                       rel1 { relative: INVERSE_HOR_REC_ICON_AREA_X/MAIN_W INVERSE_HOR_REC_ICON_AREA_Y_WVGA/MAIN_H; to: "bg";}
+                                       rel2 { relative: (INVERSE_HOR_REC_ICON_AREA_X+REC_ICON_AREA_W_WVGA)/MAIN_W (INVERSE_HOR_REC_ICON_AREA_Y_WVGA+REC_ICON_AREA_H_WVGA)/MAIN_H; to: "bg";}
+                                       align: 0.0 0.0;
+                }
+                  description
+                {
+                                       state: "portrait_inverse" 0.0;
+                    inherit: "default" 0.0;
+                    rel1 { relative: 0.0 0.9; to_x: recording_time;  to_y: "bg"; offset: -15 0;}
+                                       rel2 { relative: 0.0 1.0; to_x: recording_time; to_y: "bg";}
+                                       align: 0.0 0.0;
+                }
+                  description
+                {
+                                       state: "landscape" 0.0;
+                                       rel1 { relative: HOR_REC_ICON_AREA_X/MAIN_W (HOR_REC_ICON_AREA_Y_WVGA)/MAIN_H; to: "bg";}
+                                       rel2 { relative: (HOR_REC_ICON_AREA_X+REC_ICON_AREA_W_WVGA)/MAIN_W (HOR_REC_ICON_AREA_Y_WVGA+REC_ICON_AREA_H_WVGA)/MAIN_H; to: "bg";}
+                                       align: 0.0 0.0;
+                }
+               }
+            programs
+            {
+                               program {
+                               name : "recorder_layout_WVGA,set,landscape";
+                               source: "recorder_layout_WVGA";
+                               signal: "landscape";
+                               script: {
+                                       new st[31]
+                                       new Float:vl;
+                                       get_state(PART:"rec_resume_button", st, 30, vl);
+                                       set_state(PART:"rec_stop_button", "landscape", 0.0);
+                                       if((!strcmp(st,"landscape_visible"))||(!strcmp(st,"landscape_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape_visible", 0.0);
+                                       }
+                                       else if((!strcmp(st,"portrait_visible"))||(!strcmp(st,"portrait_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape_visible", 0.0);
+                                       }
+                                       else
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape", 0.0);
+                                       }
+                                       set_state(PART:"recording_time", "landscape", 0.0);
+                                       set_state(PART:"recording_size", "landscape", 0.0);
+                                       set_state(PART:"recording_icon", "landscape", 0.0);
+                                       set_state(PART:"progressbar_area", "landscape", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "recorder_layout_WVGA,set,portrait";
+                               source: "recorder_layout_WVGA";
+                               signal: "portrait";
+                               script: {
+                                       new st[31]
+                                       new Float:vl;
+                                       get_state(PART:"rec_resume_button", st, 30, vl);
+                                       set_state(PART:"rec_stop_button", "portrait", 0.0);
+                                       if((!strcmp(st,"landscape_visible"))||(!strcmp(st,"landscape_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait_visible", 0.0);
+                                       }
+                                       else if((!strcmp(st,"portrait_visible"))||(!strcmp(st,"portrait_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait_visible", 0.0);
+                                       }
+                                       else
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait", 0.0);
+                                       }
+                                       set_state(PART:"recording_time", "portrait", 0.0);
+                                       set_state(PART:"recording_size", "portrait", 0.0);
+                                       set_state(PART:"recording_icon", "portrait", 0.0);
+                                       set_state(PART:"progressbar_area", "portrait", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "recorder_layout_WVGA,set,landscape_inverse";
+                               source: "recorder_layout_WVGA";
+                               signal: "landscape_inverse";
+                               script: {
+                                       new st[31]
+                                       new Float:vl;
+                                       get_state(PART:"rec_resume_button", st, 30, vl);
+                                       set_state(PART:"rec_stop_button", "landscape_inverse", 0.0);
+                                       if((!strcmp(st,"landscape_visible"))||(!strcmp(st,"landscape_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape_inverse_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape_inverse_visible", 0.0);
+                                       }
+                                       else if((!strcmp(st,"portrait_visible"))||(!strcmp(st,"portrait_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape_inverse_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape_inverse_visible", 0.0);
+                                       }
+                                       else
+                                       {
+                                               set_state(PART:"rec_pause_button", "landscape_inverse", 0.0);
+                                               set_state(PART:"rec_resume_button", "landscape_inverse", 0.0);
+                                       }
+                                       set_state(PART:"recording_time", "landscape_inverse", 0.0);
+                                       set_state(PART:"recording_size", "landscape_inverse", 0.0);
+                                       set_state(PART:"recording_icon", "landscape_inverse", 0.0);
+                                       set_state(PART:"progressbar_area", "landscape_inverse", 0.0);
+                                       }
+                               }
+                               program {
+                               name : "recorder_layout_WVGA,set,portrait_inverse";
+                               source: "recorder_layout_WVGA";
+                               signal: "portrait_inverse";
+                               script: {
+                                       new st[31]
+                                       new Float:vl;
+                                       get_state(PART:"rec_resume_button", st, 30, vl);
+                                       set_state(PART:"rec_stop_button", "portrait_inverse", 0.0);
+                                       if((!strcmp(st,"landscape_visible"))||(!strcmp(st,"landscape_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait_inverse_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait_inverset_visible", 0.0);
+                                       }
+                                       else if((!strcmp(st,"portrait_visible"))||(!strcmp(st,"portrait_inverse_visible")))
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait_inverse_hide", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait_inverse_visible", 0.0);
+                                       }
+                                       else
+                                       {
+                                               set_state(PART:"rec_pause_button", "portrait_inverse", 0.0);
+                                               set_state(PART:"rec_resume_button", "portrait_inverse", 0.0);
+                                       }
+                                       set_state(PART:"recording_time", "portrait_inverse", 0.0);
+                                       set_state(PART:"recording_size", "portrait_inverse", 0.0);
+                                       set_state(PART:"recording_icon", "portrait_inverse", 0.0);
+                                       set_state(PART:"progressbar_area", "portrait_inverse", 0.0);
+                                       }
+                               }
+                program {
+                    name: "down_rec_stop";
+                    signal: "mouse,down,*";
+                    source: "rec_stop_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_stop_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"rec_stop_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"rec_stop_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"rec_stop_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"rec_stop_button", "portrait_inverse_pressed", 0.0);
+                        emit("rec_stop_button_down", "rec_stop_button");
+                    }
+                }
+                program {
+                    name: "up_rec_stop";
+                    signal: "mouse,up,1";
+                    source: "rec_stop_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_stop_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"rec_stop_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"rec_stop_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"rec_stop_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"rec_stop_button", "portrait_inverse", 0.0);
+                        emit("rec_stop_button_up", "rec_stop_button");
+                    }
+                }
+                program
+                {
+                    name: "clicked_rec_stop";
+                    signal: "mouse,clicked,1";
+                    source: "rec_stop_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_stop_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"rec_stop_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"rec_stop_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"rec_stop_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"rec_stop_button", "portrait_inverse", 0.0);
+                        emit("rec_stop_button_clicked", "rec_stop_button");
+                    }
+                } //program
+                program {
+                    name: "down_rec_pause";
+                    signal: "mouse,down,*";
+                    source: "rec_pause_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_pause_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"rec_pause_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"rec_pause_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"rec_pause_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"rec_pause_button", "portrait_inverse_pressed", 0.0);
+                        emit("rec_pause_button_down", "rec_pause_button");
+                    }
+                }
+                program {
+                    name: "up_rec_pause";
+                    signal: "mouse,up,1";
+                    source: "rec_pause_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_pause_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"rec_pause_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"rec_pause_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"rec_pause_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"rec_pause_button", "portrait_inverse", 0.0);
+                        emit("rec_pause_button_up", "rec_pause_button");
+                    }
+                }
+                program
+                {
+                    name: "clicked_rec_pause";
+                    signal: "mouse,clicked,1";
+                    source: "rec_pause_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_stop_button", st, 30, vl);
+                              if ((!strcmp(st,"landscape_inverse"))||(!strcmp(st,"landscape_inverse_pressed")))
+                      {
+                        set_state(PART:"rec_pause_button", "landscape_inverse_hide", 0.0);
+                        set_state(PART:"rec_resume_button", "landscape_inverse_visible", 0.0);
+                      }
+                      else if ((!strcmp(st,"portrait_inverse"))||(!strcmp(st,"portrait_inverse_pressed")))
+                      {
+                        set_state(PART:"rec_pause_button", "portrait_inverse_hide", 0.0);
+                        set_state(PART:"rec_resume_button", "portrait_inverse_visible", 0.0);
+                      }
+                             else if ((!strcmp(st,"landscape"))||(!strcmp(st,"landscape_pressed")))
+                             {
+                        set_state(PART:"rec_pause_button", "landscape_hide", 0.0);
+                        set_state(PART:"rec_resume_button", "landscape_visible", 0.0);
+                       }
+                      else if ((!strcmp(st,"portrait"))||(!strcmp(st,"portrait_pressed")))
+                      {
+                        set_state(PART:"rec_pause_button", "portrait_hide", 0.0);
+                        set_state(PART:"rec_resume_button", "portrait_visible", 0.0);
+                      }
+                        emit("rec_pause_button_clicked", "rec_pause_button");
+                    }
+                } //program
+                program {
+                    name: "down_rec_resume";
+                    signal: "mouse,down,*";
+                    source: "rec_resume_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_resume_button", st, 30, vl);
+                             if (!strcmp(st, "landscape"))
+                        set_state(PART:"rec_resume_button", "landscape_pressed", 0.0);
+                      if (!strcmp(st, "portrait"))
+                        set_state(PART:"rec_resume_button", "portrait_pressed", 0.0);
+                      if (!strcmp(st, "landscape_inverse"))
+                        set_state(PART:"rec_resume_button", "landscape_inverse_pressed", 0.0);
+                      if (!strcmp(st, "portrait_inverse"))
+                        set_state(PART:"rec_resume_button", "portrait_inverse_pressed", 0.0);
+                        emit("rec_resume_button_down", "rec_resume_button");
+                    }
+                }
+                program {
+                    name: "up_rec_resume";
+                    signal: "mouse,up,1";
+                    source: "rec_resume_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_resume_button", st, 30, vl);
+                             if (!strcmp(st, "landscape_pressed"))
+                        set_state(PART:"rec_resume_button", "landscape", 0.0);
+                      if (!strcmp(st, "portrait_pressed"))
+                        set_state(PART:"rec_resume_button", "portrait", 0.0);
+                      if (!strcmp(st, "landscape_inverse_pressed"))
+                        set_state(PART:"rec_resume_button", "landscape_inverse", 0.0);
+                      if (!strcmp(st, "portrait_inverse_pressed"))
+                        set_state(PART:"rec_resume_button", "portrait_inverse", 0.0);
+                        emit("rec_resume_button_up", "rec_resume_button");
+                    }
+                }
+                program
+                {
+                    name: "clicked_rec_resume";
+                    signal: "mouse,clicked,1";
+                    source: "rec_resume_button";
+                    script {
+                      new st[31]
+                             new Float:vl;
+                             get_state(PART:"rec_stop_button", st, 30, vl);
+                             if ((!strcmp(st, "landscape_pressed"))||(!strcmp(st, "landscape")))
+                             {
+                        set_state(PART:"rec_pause_button", "landscape", 0.0);
+                        set_state(PART:"rec_resume_button", "landscape", 0.0);
+                       }
+                      if ((!strcmp(st, "portrait_pressed"))||(!strcmp(st, "portrait")))
+                      {
+                        set_state(PART:"rec_pause_button", "portrait", 0.0);
+                        set_state(PART:"rec_resume_button", "portrait", 0.0);
+                      }
+                      if ((!strcmp(st, "landscape_inverse_pressed"))||(!strcmp(st, "landscape_inverse")))
+                      {
+                        set_state(PART:"rec_pause_button", "landscape_inverse", 0.0);
+                        set_state(PART:"rec_resume_button", "landscape_inverse", 0.0);
+                      }
+                      if ((!strcmp(st, "portrait_inverse_pressed"))||(!strcmp(st, "portrait_inverse")))
+                      {
+                        set_state(PART:"rec_pause_button", "portrait_inverse", 0.0);
+                        set_state(PART:"rec_resume_button", "portrait_inverse", 0.0);
+                      }
+                        emit("rec_resume_button_clicked", "rec_resume_button");
+                    }
+                } //program
+            } //programs
+        } //parts
+    }
+       group {
+               name: "progressbar_layout";
+                               parts {
+                       part {
+                               name: "progressbar_rect";
+                               type:RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0;}
+                                       rel2 { relative: 1.0 1.0;}
+                                       color:0 0 0 0;
+                               }
+                       }
+                       part {
+                               name: "progressbar";
+                               type: SWALLOW;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.2 0.0;}
+                                       rel2 { relative: 0.8 1.0;}
+                               }
+                       }
+               part {
+                               name: "left_text_val";
+                               type: TEXT;
+                               effect: OUTLINE;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to:"progressbar_rect"; relative: 0.0 0.0; }
+                                       rel2 { to:"progressbar_rect"; relative: 0.15 1.0; }
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 22;
+                                               align: 1.0 0.5;
+                                       }
+                               }
+                       }
+       /*              part {
+                               name: "slash";
+                               type: TEXT;
+                               effect: OUTLINE;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to:"left_text_val"; relative: 1.0 0.0; }
+                                       rel2 { relative: 0.5 1.5; }
+                                       color:245 245 245 255;
+                                       text {
+                                               text:"/";
+                                               size: 22;
+                                       }
+                               }
+                       }*/
+                       part {
+                               name: "right_text_val";
+                               type: TEXT;
+                               effect: OUTLINE;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to:"progressbar_rect"; relative: 0.85 0.0; }
+                                       rel2 { to:"progressbar_rect"; relative: 1.0 1.0; }
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 22;
+                                               align: 0.0 0.5;
+                                       }
+                               }
+                       }
+               }/*end parts*/
+       }/*end group : progressbar*/
+//progress bar layout for z1
+group {
+               name: "progressbar_layout_WVGA";
+                               parts {
+                       part {
+                               name: "progressbar_rect";
+                               type:RECT;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0;}
+                                       rel2 { relative: 1.0 1.0;}
+                                       color:0 0 0 0;
+                               }
+                       }
+                       part {
+                               name: "progressbar";
+                               type: SWALLOW;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.2 0.0;}
+                                       rel2 { relative: 0.8 1.0;}
+                               }
+                       }
+               part {
+                               name: "left_text_val";
+                               type: TEXT;
+                               effect: OUTLINE;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to:"progressbar_rect"; relative: 0.0 0.0; }
+                                       rel2 { to:"progressbar_rect"; relative: 0.15 1.0; }
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 16.5;
+                                               align: 1.0 0.5;
+                                       }
+                               }
+                       }
+       /*              part {
+                               name: "slash";
+                               type: TEXT;
+                               effect: OUTLINE;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to:"left_text_val"; relative: 1.0 0.0; }
+                                       rel2 { relative: 0.5 1.5; }
+                                       color:245 245 245 255;
+                                       text {
+                                               text:"/";
+                                               size: 22;
+                                       }
+                               }
+                       }*/
+                       part {
+                               name: "right_text_val";
+                               type: TEXT;
+                               effect: OUTLINE;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to:"progressbar_rect"; relative: 0.85 0.0; }
+                                       rel2 { to:"progressbar_rect"; relative: 1.0 1.0; }
+                                       color:245 245 245 255;
+                                       text {
+                                               size: 16.5;
+                                               align: 0.0 0.5;
+                                       }
+                               }
+                       }
+               }/*end parts*/
+       }/*end group : progressbar*/
+group {
+       name: "battery_low_layout";
+       parts {
+               part {
+                       name: "bg";
+                       type: RECT;
+                       scale: 1;
+                       mouse_events: 1;
+                       repeat_events: 0;
+                       description{
+                               state:"default" 0.0;
+                               color: 0 0 0 0;
+                       }
+               }
+               part {
+                               name: "low_text";
+                               type: TEXTBLOCK;
+                               effect: OUTLINE;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       visible: 1;
+                                       rel1 { relative: 0.2 1.0;offset:0 -250;}
+                                       rel2 { relative: 0.8 1.0;offset:0 -100;}
+                                       text {
+                                               style: "mode_text_middle";
+                                               align: 0.5 0.5;
+                                       }
+                                       color: 255 255 255 255;
+                               }
+                       }
+       }/*end parts*/
+}/*end group : battery_low_layout*/
+
+group {
+       name: "recording_icon";
+       parts {
+               part {
+                       name: "bg";
+                       type: RECT;
+                       scale: 1;
+                       mouse_events: 1;
+                       description{
+                               state:"default" 0.0;
+                               color: 0 0 0 0;
+                       }
+               }
+               part {
+                       name: "recording_image";
+                       type: IMAGE;
+                       scale: 1;
+                               description {
+                               state: "default" 0.0;
+                               min: 28 28;
+                               max: 40 40;
+                               align: 0.5 0.5;
+                               rel1 { relative: 0.0 0.0; to: "bg"; offset: 4 4;}
+                               rel2 { relative: 1.0 1.0; to: "bg"; offset: -4 -4;}
+                               image { normal: IMAGE_PATH"camera_icon_recording.png"; }
+                       }
+                       description {
+                               state: "pause_portrait" 0.0;
+                               inherit: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; to: "bg"; offset: 4 4;}
+                               rel2 { relative: 1.0 1.0; to: "bg"; offset: -4 -4;}
+                               image { normal: IMAGE_PATH"camera_icon_recording_pause.png"; }
+                       }
+                       description {
+                               state: "hide" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 0;
+                       }
+               }
+               /*
+               part {
+                       name: "recording_text";
+                       type: TEXT;
+                       effect: OUTLINE;
+                       mouse_events: 0;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: (RECORDING_IMAGE_W+4)/REC_ICON_AREA_W 0.0; to: "bg";}
+                               rel2 { relative: 1.0 1.0; to: "bg";}
+                               text {
+                                       size: 24;
+                                       align: 0.0 0.5;
+                                       text : "REC";
+                               }
+                               color: 245 10 14 255;
+                       }
+                       description {
+                               state: "pause" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 0;
+                       }
+               }
+               */
+       }/*end parts*/
+       programs {
+               program {
+                       name: "recording_icon_recording";
+                       source: "prog";
+                       signal: "recording_icon,recording";
+                       script: {
+                               set_state(PART:"recording_image", "default", 0.0);
+                               //set_state(PART:"recording_text", "default", 0.0);
+                       }
+               }
+               program {
+                       name: "recording_icon_pause_portrait";
+                       source: "prog";
+                       signal: "recording_icon,pause,portrait";
+                       script: {
+                               set_state(PART:"recording_image", "pause_portrait", 0.0);
+                               //set_state(PART:"recording_text", "pause", 0.0);
+                       }
+               }
+               program {
+                       name: "recording_icon_hide";
+                       source: "prog";
+                       signal: "recording_icon,hide";
+                       script: {
+                               set_state(PART:"recording_image", "hide", 0.0);
+                       }
+               }
+       }/*end programs*/
+}/*end group : recording_icon*/
+//recording icon layout for z1
+group {
+       name: "recording_icon_WVGA";
+       parts {
+               part {
+                       name: "bg";
+                       type: RECT;
+                       scale: 1;
+                       mouse_events: 1;
+                       description{
+                               state:"default" 0.0;
+                               color: 0 0 0 0;
+                       }
+               }
+               part {
+                       name: "recording_image";
+                       type: IMAGE;
+                       scale: 1;
+                               description {
+                               state: "default" 0.0;
+                               min: 21 21;
+                               max: 30 30;
+                               align: 0.5 0.5;
+                               rel1 { relative: 0.0 0.0; to: "bg"; offset: 3 3;}
+                               rel2 { relative: 1.0 1.0; to: "bg"; offset: -3 -3;}
+                               image { normal: IMAGE_PATH"camera_icon_recording.png"; }
+                       }
+                       description {
+                               state: "pause_portrait" 0.0;
+                               inherit: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; to: "bg"; offset: 3 3;}
+                               rel2 { relative: 1.0 1.0; to: "bg"; offset: -3 -3;}
+                               image { normal: IMAGE_PATH"camera_icon_recording_pause.png"; }
+                       }
+                       description {
+                               state: "hide" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 0;
+                       }
+               }
+               /*
+               part {
+                       name: "recording_text";
+                       type: TEXT;
+                       effect: OUTLINE;
+                       mouse_events: 0;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: (RECORDING_IMAGE_W+4)/REC_ICON_AREA_W 0.0; to: "bg";}
+                               rel2 { relative: 1.0 1.0; to: "bg";}
+                               text {
+                                       size: 18;
+                                       align: 0.0 0.5;
+                                       text : "REC";
+                               }
+                               color: 245 10 14 255;
+                       }
+                       description {
+                               state: "pause" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 0;
+                       }
+               }
+               */
+       }/*end parts*/
+       programs {
+               program {
+                       name: "recording_icon_recording";
+                       source: "prog";
+                       signal: "recording_icon,recording";
+                       script: {
+                               set_state(PART:"recording_image", "default", 0.0);
+                               //set_state(PART:"recording_text", "default", 0.0);
+                       }
+               }
+               program {
+                       name: "recording_icon_pause_portrait";
+                       source: "prog";
+                       signal: "recording_icon,pause,portrait";
+                       script: {
+                               set_state(PART:"recording_image", "pause_portrait", 0.0);
+                               //set_state(PART:"recording_text", "pause", 0.0);
+                       }
+               }
+               program {
+                       name: "recording_icon_hide";
+                       source: "prog";
+                       signal: "recording_icon,hide";
+                       script: {
+                               set_state(PART:"recording_image", "hide", 0.0);
+                       }
+               }
+       }/*end programs*/
+}/*end group : recording_icon*/
+
+} //collections
diff --git a/res/images/back.png b/res/images/back.png
new file mode 100644 (file)
index 0000000..8cdf9d4
Binary files /dev/null and b/res/images/back.png differ
diff --git a/res/images/bar.png b/res/images/bar.png
new file mode 100644 (file)
index 0000000..a2bbded
Binary files /dev/null and b/res/images/bar.png differ
diff --git a/res/images/camera_btn_camcorder.png b/res/images/camera_btn_camcorder.png
new file mode 100644 (file)
index 0000000..42e8cae
Binary files /dev/null and b/res/images/camera_btn_camcorder.png differ
diff --git a/res/images/camera_btn_camcorder_press.png b/res/images/camera_btn_camcorder_press.png
new file mode 100644 (file)
index 0000000..1a6025a
Binary files /dev/null and b/res/images/camera_btn_camcorder_press.png differ
diff --git a/res/images/camera_btn_switch.png b/res/images/camera_btn_switch.png
new file mode 100644 (file)
index 0000000..140d9e8
Binary files /dev/null and b/res/images/camera_btn_switch.png differ
diff --git a/res/images/camera_btn_switch_press.png b/res/images/camera_btn_switch_press.png
new file mode 100644 (file)
index 0000000..5e3b1d8
Binary files /dev/null and b/res/images/camera_btn_switch_press.png differ
diff --git a/res/images/camera_icon_recording.png b/res/images/camera_icon_recording.png
new file mode 100755 (executable)
index 0000000..1f265b9
Binary files /dev/null and b/res/images/camera_icon_recording.png differ
diff --git a/res/images/camera_icon_recording_pause.png b/res/images/camera_icon_recording_pause.png
new file mode 100755 (executable)
index 0000000..84d8f60
Binary files /dev/null and b/res/images/camera_icon_recording_pause.png differ
diff --git a/res/images/camera_rec_pause.png b/res/images/camera_rec_pause.png
new file mode 100755 (executable)
index 0000000..47b2a76
Binary files /dev/null and b/res/images/camera_rec_pause.png differ
diff --git a/res/images/camera_rec_pause_press.png b/res/images/camera_rec_pause_press.png
new file mode 100755 (executable)
index 0000000..c0ea311
Binary files /dev/null and b/res/images/camera_rec_pause_press.png differ
diff --git a/res/images/camera_rec_recording.png b/res/images/camera_rec_recording.png
new file mode 100755 (executable)
index 0000000..5592119
Binary files /dev/null and b/res/images/camera_rec_recording.png differ
diff --git a/res/images/camera_rec_recording_press.png b/res/images/camera_rec_recording_press.png
new file mode 100755 (executable)
index 0000000..a39314c
Binary files /dev/null and b/res/images/camera_rec_recording_press.png differ
diff --git a/res/images/camera_rec_stop.png b/res/images/camera_rec_stop.png
new file mode 100755 (executable)
index 0000000..d92f17d
Binary files /dev/null and b/res/images/camera_rec_stop.png differ
diff --git a/res/images/camera_rec_stop_press.png b/res/images/camera_rec_stop_press.png
new file mode 100755 (executable)
index 0000000..1154b92
Binary files /dev/null and b/res/images/camera_rec_stop_press.png differ
diff --git a/res/images/changecamera.png b/res/images/changecamera.png
new file mode 100644 (file)
index 0000000..17744f5
Binary files /dev/null and b/res/images/changecamera.png differ
diff --git a/res/images/changecamera_press.png b/res/images/changecamera_press.png
new file mode 100644 (file)
index 0000000..aa18c0c
Binary files /dev/null and b/res/images/changecamera_press.png differ
diff --git a/res/images/none.png b/res/images/none.png
new file mode 100644 (file)
index 0000000..c63efa2
Binary files /dev/null and b/res/images/none.png differ
diff --git a/res/images/shutter.png b/res/images/shutter.png
new file mode 100644 (file)
index 0000000..4ba2ecd
Binary files /dev/null and b/res/images/shutter.png differ
diff --git a/res/images/shutter2.png b/res/images/shutter2.png
new file mode 100644 (file)
index 0000000..01691b5
Binary files /dev/null and b/res/images/shutter2.png differ
diff --git a/res/images/shutter_dim.png b/res/images/shutter_dim.png
new file mode 100755 (executable)
index 0000000..c04fc30
Binary files /dev/null and b/res/images/shutter_dim.png differ
diff --git a/res/images/timer_10.png b/res/images/timer_10.png
new file mode 100644 (file)
index 0000000..55320fe
Binary files /dev/null and b/res/images/timer_10.png differ
diff --git a/res/images/timer_10_selected.png b/res/images/timer_10_selected.png
new file mode 100644 (file)
index 0000000..32db5ef
Binary files /dev/null and b/res/images/timer_10_selected.png differ
diff --git a/res/images/timer_2.png b/res/images/timer_2.png
new file mode 100644 (file)
index 0000000..bdafb89
Binary files /dev/null and b/res/images/timer_2.png differ
diff --git a/res/images/timer_2_selected.png b/res/images/timer_2_selected.png
new file mode 100644 (file)
index 0000000..0a0ab7f
Binary files /dev/null and b/res/images/timer_2_selected.png differ
diff --git a/res/images/timer_5.png b/res/images/timer_5.png
new file mode 100644 (file)
index 0000000..2b10047
Binary files /dev/null and b/res/images/timer_5.png differ
diff --git a/res/images/timer_5_selected.png b/res/images/timer_5_selected.png
new file mode 100644 (file)
index 0000000..622fdc9
Binary files /dev/null and b/res/images/timer_5_selected.png differ
diff --git a/res/images/transparent.png b/res/images/transparent.png
new file mode 100644 (file)
index 0000000..6d146e1
Binary files /dev/null and b/res/images/transparent.png differ
diff --git a/res/sounds/sounds_count.mp3 b/res/sounds/sounds_count.mp3
new file mode 100644 (file)
index 0000000..e676d4a
Binary files /dev/null and b/res/sounds/sounds_count.mp3 differ
diff --git a/src/attach-panel-camera.c b/src/attach-panel-camera.c
new file mode 100755 (executable)
index 0000000..8c3d9f6
--- /dev/null
@@ -0,0 +1,373 @@
+/*
+* Copyright (c) 2000-2015 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.
+*
+*/
+
+#ifndef UG_MODULE_API
+#define UG_MODULE_API __attribute__ ((visibility("default")))
+#endif
+
+#include <Elementary.h>
+#include <ui-gadget-module.h>
+#include <dlog.h>
+
+#include "main-view.h"
+#include "attach-panel-camera.h"
+#define POPUP_TITLE_MAX (128)
+
+struct ug_data *g_ugd;
+
+#ifdef ENABLE_UG_CREATE_CB
+extern int ug_create_cb(void (*create_cb)(char*,char*,char*,void*), void *user_data);
+#endif
+
+bool __attachPanelCamera_get_extra_data_cb(app_control_h service, const char *key, void *user_data);
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "ATTACH_PANEL_CAMERA"
+
+struct ug_data {
+       Evas_Object *base;
+       Evas_Object *pu;
+       ui_gadget_h ug;
+       ui_gadget_h sub_ug;
+       app_control_h service;
+       bool is_caller_attach_panel;
+       unsigned long long size_limit;
+};
+
+#ifdef ENABLE_UG_CREATE_CB
+static void create_cb(char *ug, char* mem, char* parent, void* user_data)
+{
+       LOGD("ug : %s, mem : %s, parent : %s, data : %p", ug, mem, parent, user_data);
+}
+#endif
+
+static Evas_Object *__attachPanelCamera_create_content(Evas_Object *parent, struct ug_data *ugd)
+{
+       LOGD("__attachPanelCamera_create_content");
+       Evas_Object *view = main_view_add(parent, ugd->ug, ugd->size_limit);
+       return view;
+}
+
+bool __attachPanelCamera_get_extra_data_cb(app_control_h service, const char *key, void * user_data)
+{
+       char *value;
+       int ret;
+
+       ret = app_control_get_extra_data(service, key, &value);
+       if (ret) {
+               LOGE("__get_extra_data_cb: error get data(%d)\n", ret);
+               return false;
+       }
+
+       LOGD("extra data : %s, %s\n", key, value);
+       free(value);
+
+       return true;
+}
+
+static Evas_Object *__attachPanelCamera_create_fullview(Evas_Object *parent, struct ug_data *ugd)
+{
+       LOGE("__attachPanelCamera_create_fullview");
+       Evas_Object *base;
+
+       base = elm_layout_add(parent);
+       if (!base) {
+               LOGE("base not there so return null");
+               return NULL;
+       }
+       elm_layout_theme_set(base, "layout", "application", "default");
+       elm_win_indicator_mode_set(parent, ELM_WIN_INDICATOR_SHOW);
+       return base;
+}
+
+static Evas_Object *__attachPanelCamera_create_frameview(Evas_Object *parent, struct ug_data *ugd)
+{
+       Evas_Object *base;
+
+       base = elm_layout_add(parent);
+       if (!base) {
+               LOGD("Error Failed to add layout");
+               return NULL;
+       }
+       elm_layout_theme_set(base, "standard", "window", "integration");
+       edje_object_signal_emit(_EDJ(base), "elm,state,show,content", "elm");
+
+       return base;
+}
+
+static void *__attachPanelCamera_on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h service,
+                      void *priv)
+{
+       Evas_Object *parent = NULL;
+       Evas_Object *content = NULL;
+       struct ug_data *ugd = NULL;
+       char *operation = NULL;
+
+       if (!ug || !priv) {
+               LOGD("Invalid ug or priv");
+               return NULL;
+       }
+
+       LOGD("__attachPanelCamera_on_create start");
+
+       ugd = priv;
+       ugd->ug = ug;
+       ugd->service = service;
+       g_ugd = ugd;
+
+       app_control_get_operation(service, &operation);
+
+       if (operation == NULL) {
+               /* ug called by ug_create */
+               LOGD("ug called by ug_create\n");
+       } else {
+               /* ug called by service request */
+               LOGD("ug called by service request :%s\n", operation);
+               free(operation);
+       }
+
+       app_control_foreach_extra_data(service, __attachPanelCamera_get_extra_data_cb, NULL);
+
+       parent = (Evas_Object *)ug_get_parent_layout(ug);
+       if (!parent) {
+               LOGD("Invalid parent");
+               return NULL;
+       }
+
+       /* size limit */
+       char *val = NULL;
+       app_control_get_extra_data(service, "http://tizen.org/appcontrol/data/total_size", (char **)&val);
+       if (val) {
+               ugd->size_limit = atoi(val)/1024;
+       } else {
+               ugd->size_limit = 0;
+       }
+       LOGD("ugd->size_limit set to = %llu", ugd->size_limit);
+
+       char *contact_id = NULL;
+       app_control_get_extra_data(service, "__CALLER_PANEL__", &contact_id);
+       if (contact_id && !strcmp(contact_id, "attach-panel")) {
+               if (ugd) {
+                       ugd->is_caller_attach_panel = TRUE;
+               }
+       } else {
+               ugd->is_caller_attach_panel = FALSE;
+       }
+
+       mode = ug_get_mode(ug);
+       ugd->base = __attachPanelCamera_create_fullview(parent, ugd);
+       if (ugd->base) {
+               content = __attachPanelCamera_create_content(ugd->base, ugd);
+               elm_object_part_content_set(ugd->base, "elm.swallow.content", content);
+       }
+
+       return ugd->base;
+}
+
+static void __attachPanelCamera_on_start(ui_gadget_h ug, app_control_h service, void *priv)
+{
+#if 0
+       int i;
+       pthread_t p_thread[10];
+       int thr_id;
+       int status;
+       int a = 1;
+
+       for (i=0; i<10; i++) {
+               thr_id = pthread_create(&p_thread[i], NULL, __attachPanelCamera_start_t_func, (void*)&a);
+               if (thr_id < 0) {
+                       perror("thread create error: ");
+                       exit(0);
+               }
+               pthread_detach(p_thread[i]);
+       }
+#endif
+}
+
+static void __attachPanelCamera_on_pause(ui_gadget_h ug, app_control_h service, void *priv)
+{
+       LOGD("%s : called\n", __func__);
+       _main_view_app_pause();
+}
+
+static void __attachPanelCamera_on_resume(ui_gadget_h ug, app_control_h service, void *priv)
+{
+       LOGD("%s : called\n", __func__);
+       _main_view_app_resume();
+}
+
+static void __attachPanelCamera_on_destroy(ui_gadget_h ug, app_control_h service, void *priv)
+{
+       struct ug_data *ugd;
+       LOGD("%s : called\n", __func__);
+       if (!ug || !priv) {
+               LOGD("Invalid input arguments");
+               return;
+       }
+
+       ugd = priv;
+       evas_object_del(ugd->base);
+       ugd->base = NULL;
+}
+
+static void __attachPanelCamera_on_message(ui_gadget_h ug, app_control_h msg, app_control_h service,
+                     void *priv)
+{
+
+       if (!ug || !priv) {
+               LOGD("Invalid ug or priv");
+               return;
+       }
+
+       struct ug_data *ugd = NULL;
+       ugd = priv;
+       char *display_mode = NULL;
+       char *showcontent = NULL ;
+
+       if (ugd->is_caller_attach_panel) {
+               LOGD("called by attach panel ");
+               app_control_get_extra_data(msg, APP_CONTROL_DATA_SELECTION_MODE, &display_mode);
+               if (display_mode) {
+                       if(!strcmp(display_mode, "single")) {
+                               //change to compact view
+                               LOGD("compact view ");
+                               _main_view_set_cam_view_layout(CAM_COMPACT_VIEW);
+                       } else if (display_mode && !strcmp(display_mode, "multiple")) {
+                               //change to full view
+                               LOGD("full view");
+                               _main_view_set_cam_view_layout(CAM_FULL_VIEW);
+                       } else {
+                               LOGD("invalid mode: %s", display_mode);
+                       }
+               }
+
+               app_control_get_extra_data(msg, "__ATTACH_PANEL_SHOW_CONTENT_CATEGORY__", &showcontent);
+               if (showcontent) {
+                       if (!strcmp(showcontent, "true")) {
+                               _main_view_set_show_content(TRUE);
+                       } else {
+                               _main_view_set_show_content(FALSE);
+                       }
+               }
+       }
+}
+
+static void __attachPanelCamera_on_event(ui_gadget_h ug, enum ug_event event, app_control_h service,
+                   void *priv)
+{
+       struct ug_data *ugd = priv;
+
+       switch (event) {
+       case UG_EVENT_LOW_MEMORY:
+               break;
+       case UG_EVENT_LOW_BATTERY:
+               break;
+       case UG_EVENT_LANG_CHANGE:
+               break;
+       case UG_EVENT_ROTATE_PORTRAIT:
+               elm_layout_theme_set(ugd->base, "layout", "application", "default");
+               _main_view_set_target_direction(CAM_TARGET_DIRECTION_PORTRAIT);
+               break;
+       case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
+               elm_layout_theme_set(ugd->base, "layout", "application", "default");
+               _main_view_set_target_direction(CAM_TARGET_DIRECTION_PORTRAIT_INVERSE);
+               break;
+       case UG_EVENT_ROTATE_LANDSCAPE:
+               elm_layout_theme_set(ugd->base, "layout", "application", "noindicator");
+               _main_view_set_target_direction(CAM_TARGET_DIRECTION_LANDSCAPE);
+               break;
+       case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
+               elm_layout_theme_set(ugd->base, "layout", "application", "noindicator");
+               _main_view_set_target_direction(CAM_TARGET_DIRECTION_LANDSCAPE_INVERSE);
+               break;
+       case UG_EVENT_REGION_CHANGE:
+               break;
+       default:
+               break;
+       }
+
+}
+
+static void __attachPanelCamera_on_key_event(ui_gadget_h ug, enum ug_key_event event,
+                        app_control_h service, void *priv)
+{
+       if (!ug) {
+               LOGD("Invalid ug handle");
+               return;
+       }
+
+       switch (event) {
+       case UG_KEY_EVENT_END:
+               ug_destroy_me(ug);
+               break;
+       default:
+               break;
+       }
+}
+
+static void __attachPanelCamera_on_destroying(ui_gadget_h ug, app_control_h service, void *priv)
+{
+       LOGD("%s : called\n", __func__);
+       _main_view_destroy();
+}
+
+UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
+{
+       struct ug_data *ugd = NULL;
+
+       if (!ops) {
+               LOGD("Invalid ug_module_ops");
+               return -1;
+       }
+
+       ugd = calloc(1, sizeof(struct ug_data));
+       if (!ugd) {
+               LOGD("Error Failed to create ugd");
+               return -1;
+       }
+
+       ops->create = __attachPanelCamera_on_create;
+       ops->start = __attachPanelCamera_on_start;
+       ops->pause = __attachPanelCamera_on_pause;
+       ops->resume = __attachPanelCamera_on_resume;
+       ops->destroy = __attachPanelCamera_on_destroy;
+       ops->message = __attachPanelCamera_on_message;
+       ops->event = __attachPanelCamera_on_event;
+       /*ops->key_event = __attachPanelCamera_on_key_event;*/
+       ops->destroying = __attachPanelCamera_on_destroying;
+       ops->priv = ugd;
+
+       return 0;
+}
+
+UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
+{
+       struct ug_data *ugd = NULL;
+
+       if (!ops) {
+               LOGD("Invalid ug_module_ops");
+               return;
+       }
+
+       ugd = ops->priv;
+       if (ugd) {
+               free(ugd);
+       }
+}
diff --git a/src/utils/ui-utils.c b/src/utils/ui-utils.c
new file mode 100644 (file)
index 0000000..fe9f452
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2000-2015 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 "utils/logger.h"
+#include "utils/ui-utils.h"
+
+#include <Elementary.h>
+
+Evas_Object *ui_utils_navi_add(Evas_Object *parent)
+{
+    Evas_Object *navi = elm_naviframe_add(parent);
+    RETVM_IF(!navi, NULL, "elm_naviframe_add() failed");
+    elm_naviframe_prev_btn_auto_pushed_set(navi, EINA_FALSE);
+
+    return navi;
+}
+
+Evas_Object *ui_utils_layout_add(Evas_Object *parent, Evas_Object_Event_Cb destroy_cb, void *cb_data)
+{
+    Evas_Object *layout = elm_layout_add(parent);
+    RETVM_IF(!layout, NULL, "elm_layout_add() failed");
+
+    elm_layout_theme_set(layout, "layout", "application", "default");
+
+    if (destroy_cb) {
+        evas_object_event_callback_add(layout, EVAS_CALLBACK_FREE, destroy_cb, cb_data);
+    }
+
+    return layout;
+}
diff --git a/src/view/main-view.c b/src/view/main-view.c
new file mode 100755 (executable)
index 0000000..5a95b29
--- /dev/null
@@ -0,0 +1,2143 @@
+/*
+* Copyright (c) 2000-2015 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 "view/main-view.h"
+#include "view/window.h"
+#include <libexif/exif-data.h>
+#include <libexif/exif-loader.h>
+#include "utils/config.h"
+#include "utils/logger.h"
+#include "utils/ui-utils.h"
+
+#include <device/callback.h>
+#include <device/battery.h>
+#include <device/power.h>
+#include <dlog.h>
+#include <app_control.h>
+#include <media_content.h>
+
+#include <image_util.h>
+#include <media_format.h>
+#include <media_packet.h>
+
+#define COUNTER_STR_LEN 3
+#define FILE_PREFIX "IMAGE"
+#define FILE_VIDEO_PREFIX "VIDEO"
+
+#define CAM_TIME_FORMAT "u:%02u:%02u"
+#define CAM_TIME_FORMAT2 "02u:%02u"
+#define SECONDS_IN_HOUR                        (1*60*60)
+#define TIME_FORMAT_MAX_LEN            (128)
+#define _EDJ(x)  (Evas_Object *)elm_layout_edje_get(x)
+
+unsigned char* exifData = NULL;
+unsigned int exif_size = 0;
+
+#define REMOVE_TIMER(timer) \
+       if (timer != NULL) {\
+               ecore_timer_del(timer); \
+               timer = NULL; \
+       }
+
+#define IF_FREE(p) \
+       if (p != NULL) {\
+               free(p); \
+               p = NULL; \
+       }
+
+#define CAM_TIME_ARGS(t) \
+       (uint) (t / (60*60)), \
+       (uint) ((t / 60) % 60), \
+       (uint) (t % 60)
+
+#define CAM_TIME_ARGS2(t) \
+       (uint) ((t / 60) % 60), \
+       (uint) (t % 60)
+
+#define startfunc              LOGD("+-  START -------------------------");
+#define endfunc                LOGD("+-  END  --------------------------");
+#define JPEG_DATA_OFFSET               2
+#define JPEG_EXIF_OFFSET               4
+#define EXIF_MARKER_SOI_LENGTH 2
+#define EXIF_MARKER_APP1_LENGTH        2
+#define EXIF_APP1_LENGTH               2
+
+static const char *_error = "Error";
+static const char *_camera_init_failed = "Camera initialization failed.";
+static const char *_ok = "OK";
+static const char _file_prot_str[]= "file://";
+
+recorder_h grecord = NULL;
+
+media_format_h fmt;
+media_packet_h pkt = NULL;
+media_packet_h pkt_rotate = NULL;
+media_packet_h pkt_crop = NULL;
+media_packet_h pkt_resize = NULL;
+transformation_h handle = NULL;
+transformation_h handle_rotate = NULL ;
+transformation_h handle_crop = NULL ;
+transformation_h handle_resize = NULL;
+static main_view *viewhandle = NULL;
+Evas_Object *_main_view_load_edj(Evas_Object *parent, const char *file, const char *group);
+static Eina_Bool _main_view_init_camera(main_view *view, int camera_type);
+static void _main_view_register_cbs(main_view *view);
+static void _main_view_back_cb(void *data, Evas_Object *obj, void *event_info);
+static void _main_view_pause_cb(void *data, Evas_Object *obj, void *event_info);
+static void _main_view_resume_cb(void *data, Evas_Object *obj, void *event_info);
+
+static size_t _main_view_get_last_file_path(char *file_path, size_t size);
+static size_t _main_view_get_file_path(char *file_path, size_t size, CamFileType fileType);
+
+static void _main_view_capture_cb(camera_image_data_s *image,
+        camera_image_data_s *postview, camera_image_data_s *thumbnail, void *user_data);
+static void _main_view_capture_completed_cb(void *data);
+static Eina_Bool _main_view_start_camera_preview (camera_h camera);
+static Eina_Bool _main_view_stop_camera_preview (camera_h camera);
+
+static void _main_view_shutter_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source);
+static void _main_view_video_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source);
+static void _main_view_switch_camera_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source);
+static void _main_view_recorder_pause_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source);
+static void _main_view_recorder_stop_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source);
+static void _main_view_recorder_resume_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source);
+
+static void _main_view_ug_send_result(main_view *view, char *file_path);
+static bool _main_file_register(const char *filename);
+static void _main_view_recorder_rec_icon_update(main_view *view);
+static Eina_Bool _main_view_recorder_pause_icon_update(void *data);
+static void _main_view_recorder_set_recording_time(main_view *view);
+
+static int _main_view_get_image_orient_value_by_direction(void *data, CamTargetDirection target_direction);
+static int _main_view_get_image_orient_value(void *data);
+static void _main_view_show_warning_popup(Evas_Object *navi, const char *caption, const char *text, const char *button_text, void *data);
+static void _main_view_popup_close_cb(void *data, Evas_Object *obj, void *event_info);
+static void __recording_view_progressbar_create(main_view *view);
+static Eina_Bool _main_view_util_lcd_lock();
+static Eina_Bool _main_view_util_lcd_unlock();
+
+int error_type = 0;
+
+static void __cam_interrupted_cb(camera_policy_e policy, camera_state_e previous, camera_state_e current, void *data)
+{
+       main_view *view = (main_view *)data;
+       RETM_IF(!view, "mainview is null");
+
+       DBG( "policy is [%d]", policy);
+       switch (policy) {
+       case CAMERA_POLICY_SOUND:
+               break;
+       case CAMERA_POLICY_SOUND_BY_CALL:
+       case CAMERA_POLICY_SOUND_BY_ALARM:
+               //edje_object_part_text_set(_EDJ(view->cameraview_layout), "content_text", string_msg);
+               view->low_battery_layout = _main_view_load_edj(view->cameraview_layout,
+                       "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj",
+                       "battery_low_layout");
+               elm_object_part_content_set(view->cameraview_layout, "battery_low",
+                       view->low_battery_layout);
+               elm_object_domain_translatable_part_text_set(view->low_battery_layout, "low_text",
+                       CAM_PACKAGE,"IDS_CAM_POP_UNABLE_TO_START_CAMERA_DURING_CALL");
+               break;
+       default:
+               break;
+       }
+}
+static Eina_Bool _main_view_util_lcd_lock()
+{
+       int ret = 0;
+
+       ret = device_power_request_lock(POWER_LOCK_DISPLAY, 0);
+       RETVM_IF(ret != 0, FALSE, "device_power_request_lock fail [%d]", ret);
+
+       DBG( "display lock");
+
+       return TRUE;
+}
+
+static Eina_Bool _main_view_util_lcd_unlock()
+{
+       int ret = 0;
+
+       ret = device_power_release_lock(POWER_LOCK_DISPLAY);
+       RETVM_IF(ret != 0, FALSE, "device_power_release_lock fail [%d]", ret);
+
+       DBG( "display unlock");
+
+       return TRUE;
+}
+
+void toast_popup_destroy(void *data)
+{
+       RETM_IF(!data, "data is null");
+       main_view *view = data;
+
+       if (view->popup)
+               evas_object_del(view->popup);
+}
+
+void toast_popup_create(void* data,const char *msg,void (*func)(void *data, Evas_Object *obj, void *event_info))
+{
+        RETM_IF(!data, "data is null");
+        main_view *view = data;
+
+        toast_popup_destroy(view);
+
+       if (func == NULL) {
+               notification_status_message_post(msg);
+               return;
+       }
+
+       Evas_Object *popup = NULL;
+       popup = elm_popup_add(view->layout);
+
+       elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
+       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       /* custom attributes */
+       elm_object_text_set(popup, msg);
+       elm_popup_timeout_set(popup, 3.0);
+
+       evas_object_smart_callback_add(popup, "timeout", func, data);
+
+       view->popup = popup;
+
+       if(view->popup)
+               evas_object_show(popup);
+}
+
+static Eina_Bool _main_view_send_result_after_transform(void *data)
+{
+       startfunc
+       main_view *view = (main_view *)data;
+       if (view->transformtype == CAM_TRANSFORM_CROP) {
+               DBG("crop completed, Start resize");
+               _main_view_ug_send_result(view, view->filename);
+               _main_view_start_camera_preview(view->camera);
+               view->transformtype = CAM_TRANSFORM_NONE;
+       }
+       return ECORE_CALLBACK_CANCEL;
+       endfunc
+}
+
+bool __setUint16(void* data, unsigned short in)
+{
+       ((unsigned char *)data)[0] = in >> 8;
+       ((unsigned char *)data)[1] = in & 0x00ff;
+
+       return true;
+}
+
+static void _main_view_copy_exifdata_to_buffer(unsigned char* inData, unsigned int inSize, unsigned char** outData, unsigned int* outSize)
+{
+       startfunc
+       unsigned char *data = NULL;
+       unsigned int dataSize = 0;
+       unsigned int exifSize = exif_size;
+       unsigned short head[2] = {0,};
+       unsigned short headLen = 0;
+       int jpegOffset = JPEG_DATA_OFFSET;
+
+       DBG("Exif Data is : %s", exifData);
+       dataSize = EXIF_MARKER_SOI_LENGTH + EXIF_MARKER_APP1_LENGTH + EXIF_APP1_LENGTH + exif_size + (inSize - jpegOffset);
+
+       __setUint16(&head[0], 0xffd8);
+       __setUint16(&head[1], 0xffe1);
+       __setUint16(&headLen, (unsigned short)(exifSize + 2));
+
+       if (head[0] == 0 || head[1] == 0 || headLen == 0) {
+               DBG("Set header failed");
+               return false;
+       }
+
+       data = (unsigned char*)malloc(dataSize);
+       RETM_IF(!data, "data is null");
+
+       /* Complete JPEG+EXIF */
+       /* SOI marker */
+       memcpy(data, &head[0], EXIF_MARKER_SOI_LENGTH);
+
+       /*APP1 marker*/
+       memcpy(data + EXIF_MARKER_SOI_LENGTH, &head[1], EXIF_MARKER_APP1_LENGTH);
+
+       /*length of APP1*/
+       memcpy(data + EXIF_MARKER_SOI_LENGTH + EXIF_MARKER_APP1_LENGTH, &headLen, EXIF_APP1_LENGTH);
+
+       /*EXIF*/
+       memcpy(data + EXIF_MARKER_SOI_LENGTH + EXIF_MARKER_APP1_LENGTH + EXIF_APP1_LENGTH, exifData, exifSize);
+
+       /*IMAGE*/
+       memcpy(data + EXIF_MARKER_SOI_LENGTH + EXIF_MARKER_APP1_LENGTH + EXIF_APP1_LENGTH + exifSize, inData + jpegOffset, inSize - jpegOffset);
+
+       if (data != NULL) {
+               *outData = data;
+               *outSize = dataSize;
+       }
+       IF_FREE(exifData);
+       endfunc
+}
+
+void _main_view_transform_completed(media_packet_h *dst, int error_code, void *user_data)
+{
+       startfunc
+       main_view *view = (main_view *)_main_view_get_data();
+       RETM_IF(!view, "main_view is NULL");
+       int ret = 0;
+       void* src_ptr;
+       unsigned int size = 0;
+       media_format_h dst_fmt;
+       media_format_mimetype_e dst_mimetype;
+       int dst_width, dst_height, dst_avg_bps, dst_max_bps;
+       char *output_fmt = NULL;
+       if (media_packet_get_format(*dst, &dst_fmt) != MEDIA_PACKET_ERROR_NONE) {
+               DBG("media_packet_get_format failed");
+       }
+       if (media_format_get_video_info(dst_fmt, &dst_mimetype, &dst_width,
+               &dst_height, &dst_avg_bps, &dst_max_bps) != MEDIA_FORMAT_ERROR_NONE) {
+               DBG("media_format_get_video_info failed");
+       }
+
+       DBG("Result packet dst_width =%d , dst_height =%d ,", dst_width, dst_height );
+       ret = media_packet_get_buffer_size(*dst, &size);
+       if (ret != MEDIA_PACKET_ERROR_NONE) {
+               DBG("media_packet_get_buffer_size failed ret =%d", ret);
+       }
+
+       ret = media_packet_get_buffer_data_ptr(*dst, &src_ptr);
+       if (ret != MEDIA_PACKET_ERROR_NONE) {
+               DBG("media_packet_get_buffer_data_ptr failed");
+       }
+
+       if (view->transformtype == CAM_TRANSFORM_CROP) {
+               unsigned char *buffer = NULL ;
+               unsigned char *finalBuffer = NULL;
+               int bufferSize = 0 ;
+               int finalBufferSize = 0;
+
+               ret = image_util_encode_jpeg_to_memory(src_ptr,  dst_width, dst_height, IMAGE_UTIL_COLORSPACE_RGB888, 100, &buffer, (unsigned int *)&bufferSize);
+               if (ret == IMAGE_UTIL_ERROR_NONE) {
+                       _main_view_copy_exifdata_to_buffer(buffer, bufferSize, &finalBuffer, &finalBufferSize);
+                       IF_FREE(buffer);
+                       FILE *file = fopen(view->filename, "w+");
+                       if (!file) {
+                               DBG("Failed to open file");
+                               IF_FREE(finalBuffer);
+                               return;
+                       }
+
+                       size = fwrite(finalBuffer, finalBufferSize, 1, file);
+                       WARN_IF(size != 1, "failed to write file");
+                       fclose(file);
+                       file = NULL;
+                       IF_FREE(finalBuffer);
+
+                       _main_file_register(view->filename);
+                       REMOVE_TIMER(view->crop_timer);
+                       view->crop_timer= ecore_timer_add(0.01, _main_view_send_result_after_transform, (void *)view);
+               } else {
+                       DBG("image_util_encode_jpeg failed ret = %d", ret);
+               }
+       }
+       media_packet_destroy(*dst);
+       endfunc
+}
+
+int media_packet_finalize_cb_img_util(media_packet_h packet, int error_code, void *user_data)
+{
+       startfunc
+       return MEDIA_PACKET_FINALIZE;
+}
+
+static Eina_Bool cam_utils_check_battery_critical_low(void)
+{
+       int err = 0;
+       device_battery_level_e level_status = -1;
+       Eina_Bool ret = FALSE;
+
+       err = device_battery_get_level_status(&level_status);
+       if (err != DEVICE_ERROR_NONE) {
+               ERR("device_battery_get_level_status fail - [%d]", err);
+       }
+
+       DBG("level_status = [%d]", level_status);
+       if ((level_status == DEVICE_BATTERY_LEVEL_EMPTY) || (level_status == DEVICE_BATTERY_LEVEL_CRITICAL)) {
+               ret = TRUE;
+       }
+
+       return ret;
+}
+
+static void __cam_app_battery_level_changed_cb(device_callback_e type, void *value, void *user_data)
+{
+       main_view *view = (main_view *)user_data;
+       RETM_IF(!view, "main_view is NULL");
+
+       device_battery_level_e battery_level = (device_battery_level_e)value;
+       camera_state_e cur_state = CAMERA_STATE_NONE;
+       DBG("battery_level is [%d]", battery_level);
+
+       int res = camera_get_state(view->camera, &cur_state);
+       DBG("current camera state= %d", cur_state);
+
+       if (battery_level <= DEVICE_BATTERY_LEVEL_CRITICAL) {
+               view->battery_status = LOW_BATTERY_CRITICAL_STATUS;
+               _main_view_stop_camera_preview(view->camera);
+               view->low_battery_layout = _main_view_load_edj(view->cameraview_layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "battery_low_layout");
+               elm_object_part_content_set(view->cameraview_layout, "battery_low", view->low_battery_layout);
+               elm_object_domain_translatable_part_text_set(view->low_battery_layout, "low_text", CAM_PACKAGE,"IDS_CAM_TPOP_BATTERY_POWER_LOW");
+       } else if (battery_level == DEVICE_BATTERY_LEVEL_LOW) {
+               view->battery_status = LOW_BATTERY_WARNING_STATUS;
+               elm_object_part_content_unset(view->cameraview_layout, "battery_low");
+               if (CAMERA_ERROR_NONE == res) {
+                       if (cur_state != CAMERA_STATE_PREVIEW) {
+                               if (!_main_view_start_camera_preview(view->camera)) {
+                                       ERR("Failed start preview");
+                               }
+                       }
+               }
+               if (view->low_battery_layout != NULL) {
+                       evas_object_del(view->low_battery_layout);
+               }
+       } else {
+               view->battery_status = NORMAL_BATTERY_STATUS;
+               elm_object_part_content_unset(view->cameraview_layout, "battery_low");
+               if (view->low_battery_layout != NULL) {
+                       evas_object_del(view->low_battery_layout);
+               }
+               if (CAMERA_ERROR_NONE == res) {
+                       if (cur_state != CAMERA_STATE_PREVIEW) {
+                               if (!_main_view_start_camera_preview(view->camera)) {
+                                       ERR("Failed start preview");
+                               }
+                       }
+               }
+       }
+}
+
+void _main_view_media_create(char * filename, CamTransformType transformtype)
+{
+       startfunc
+       main_view *view = (main_view *)_main_view_get_data();
+       RETM_IF(!view, "main_view is NULL");
+       const image_util_colorspace_e colorspace = IMAGE_UTIL_COLORSPACE_RGB888;
+       unsigned char *img_rotate_target = NULL;
+       unsigned char *img_source = NULL;
+       int ret = 0;
+       int width = 0, height = 0;
+       unsigned int size_decode = 0;
+       unsigned int size = 0;
+       void* src_ptr;
+       int i = 0;
+       DBG("file name is %s",filename);
+       if (pkt) {
+               DBG("Destroy the media packet");
+               media_packet_destroy(pkt);
+       }
+
+       if (handle) {
+               ret = image_util_transform_destroy(handle);
+               if (ret != IMAGE_UTIL_ERROR_NONE ) {
+                       DBG("image_util_transform_destroy failed %d ", ret);
+               }
+       }
+
+       ret = image_util_decode_jpeg(filename, colorspace, &img_source, &width, &height, &size_decode);
+       if (ret != IMAGE_UTIL_ERROR_NONE ) {
+               DBG("image_util_decode_jpeg failed %d ", ret);
+       }
+       DBG("Decoded jpeg buffer width =%d ,height = %d ,size_decode = %d", width, height, size_decode);
+       if (media_format_create(&fmt) == MEDIA_FORMAT_ERROR_NONE)
+       {
+               ret = media_format_set_video_mime(fmt,  MEDIA_FORMAT_RGB888);
+               if (ret != MEDIA_FORMAT_ERROR_NONE ) {
+                       DBG("media_format_set_video_mime failed %d ", ret);
+               }
+               ret = media_format_set_video_width(fmt, width);
+               if (ret != MEDIA_FORMAT_ERROR_NONE ) {
+                       DBG("media_format_set_video_width failed %d ", ret);
+               }
+               ret = media_format_set_video_height(fmt, height);
+               if (ret != MEDIA_FORMAT_ERROR_NONE ) {
+                       DBG("media_format_set_video_height failed %d ", ret);
+               }
+               ret = media_format_set_video_avg_bps(fmt, 2000000);
+               if (ret != MEDIA_FORMAT_ERROR_NONE ) {
+                       DBG("media_format_set_video_height failed %d ", ret);
+               }
+               ret = media_format_set_video_max_bps(fmt, 15000000);
+               if (ret != MEDIA_FORMAT_ERROR_NONE ) {
+                       DBG("media_format_set_video_height failed %d ", ret);
+               }
+               ret = media_packet_create_alloc(fmt, (media_packet_finalize_cb) media_packet_finalize_cb_img_util, img_source, &pkt);
+               if (ret != MEDIA_PACKET_ERROR_NONE ) {
+                       DBG("media_packet_create_alloc failed %d ", ret);
+               }
+               media_format_unref(fmt);
+               ret = media_packet_set_buffer_size(pkt, size_decode);
+               if (ret != MEDIA_PACKET_ERROR_NONE ) {
+                       DBG("media_packet_get_buffer_size failed %d ", ret);
+               }
+               ret = media_packet_get_buffer_size(pkt, &size);
+               if (ret != MEDIA_PACKET_ERROR_NONE ) {
+                       DBG("media_packet_get_buffer_size failed %d ", ret);
+               }
+               ret = media_packet_get_buffer_data_ptr(pkt, &src_ptr);
+               if (ret != MEDIA_PACKET_ERROR_NONE ) {
+                       DBG("media_packet_get_buffer_data_ptr failed %d ", ret);
+               }
+               ret = memcpy(src_ptr, img_source, size);
+               DBG("Media packet creation success,image_util_transform_create start");
+
+               ret = image_util_transform_create(&handle);
+               if (ret != IMAGE_UTIL_ERROR_NONE ) {
+                       DBG("image_util_transform_create failed %d ", ret);
+               }
+               ret = image_util_transform_set_hardware_acceleration(handle, false);
+               if (ret != IMAGE_UTIL_ERROR_NONE ) {
+                       DBG("image_util_transform_set_hardware_acceleration failed");
+               }
+               if (transformtype == CAM_TRANSFORM_CROP) {
+                       DBG("image_util_transform_set_crop_area");
+                       if ( CAM_WIDTH == 1600) {
+                               DBG("RESOLUTION 1600X1200");
+                               //ret = image_util_transform_set_crop_area(handle, 0, 490, 1200, 1110);
+                               ret = image_util_transform_set_crop_area(handle, 500, 0, 1100, 1200);//490, 0, 1110, 1200);  // 1100,500
+                       } else {
+                               DBG("RESOLUTION 640X480");
+                               ret = image_util_transform_set_crop_area(handle, 205, 0, 435, 480);
+                       }
+                       if (ret != IMAGE_UTIL_ERROR_NONE ) {
+                               DBG("image_util_transform_set_crop_area failed %d ", ret);
+                       }
+               } else {
+                       DBG("image_util_transform_set_RESIZE");
+                       ret = image_util_transform_set_resolution(handle, CAM_WIDTH, CAM_HEIGHT);
+               }
+               DBG("image_util_transform_run START");
+               ret = image_util_transform_run(handle, pkt, (image_util_transform_completed_cb)_main_view_transform_completed, handle);//(void*)img_source);
+               if (ret != IMAGE_UTIL_ERROR_NONE ) {
+                       DBG("image_util_transform_run failed");
+               }
+       }
+       else
+       {
+          DBG("media_format_create failed");
+       }
+       endfunc
+}
+
+Evas_Object *_main_view_load_edj(Evas_Object *parent, const char *file,
+                             const char *group)
+{
+       Evas_Object *eo = NULL;
+       int r = 0;
+
+       eo = elm_layout_add(parent);
+       if (eo) {
+               r = elm_layout_file_set(eo, file, group);
+               if (!r) {
+                       evas_object_del(eo);
+                       eo = NULL;
+                       return NULL;
+               }
+
+               evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               evas_object_show(eo);
+       }
+
+       return eo;
+}
+
+void main_view_camera_view_add(main_view *view)
+{
+    startfunc
+    RETM_IF(!view, "main_view is NULL");
+
+    elm_object_part_content_unset(view->layout, "main_view");
+    if (view->recorderview_layout) {
+        evas_object_del(view->recorderview_layout);
+    }
+    double scale= elm_config_scale_get();
+    if (scale == 2.6)
+       view->cameraview_layout = _main_view_load_edj(view->layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "camera_layout");
+    else
+       view->cameraview_layout = _main_view_load_edj(view->layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "camera_layout_WVGA");
+
+    elm_object_part_content_set(view->layout, "main_view", view->cameraview_layout);
+    _main_view_register_cbs(view);
+}
+
+Evas_Object *main_view_add(Evas_Object *navi, ui_gadget_h ug_handle, unsigned long long size_limit)
+{
+    startfunc
+    main_view *view = calloc(1, sizeof(main_view));
+    RETVM_IF(!view, NULL, "failed to allocate main_view");
+    char *id = NULL;
+    view->ug_handle = ug_handle;
+    view->self_portrait = FALSE;
+    app_get_id(&id);
+    bindtextdomain(CAM_PACKAGE, CAM_LOCALESDIR);
+    DBG("app id = %s",id);
+    if (id != NULL) {
+        if ((!strcmp(id, "org.tizen.message"))||(!strcmp(id, "msg-composer-efl"))) {
+            view->is_size_limit = TRUE;
+        } else {
+            view->is_size_limit = FALSE;
+        }
+        free(id);
+        id = NULL;
+    }
+    view->layout = ui_utils_layout_add(navi, NULL, view);
+    elm_layout_file_set(view->layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "main_layout");
+    evas_object_size_hint_align_set(view->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+    view->preview_canvas = evas_object_image_filled_add(evas_object_evas_get(view->layout));
+    if (!view->preview_canvas) {
+        ERR("failed to create preview_canvas");
+        evas_object_del(view->layout);
+        return NULL;
+    }
+
+    elm_object_part_content_set(view->layout, "elm.swallow.content", view->preview_canvas);
+    double scale= elm_config_scale_get();
+    if (scale == 2.6)
+       view->cameraview_layout = _main_view_load_edj(view->layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "camera_layout");
+    else
+       view->cameraview_layout = _main_view_load_edj(view->layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "camera_layout_WVGA");
+    elm_object_part_content_set(view->layout, "main_view", view->cameraview_layout);
+
+    _main_view_set_data(view);
+    view->camera_enabled = _main_view_init_camera(view, CAMERA_DEVICE_CAMERA0);
+    if (view->camera_enabled) {
+       if (!_main_view_start_camera_preview(view->camera)) {
+               ERR("Failed start preview");
+       }
+    }
+    if (error_type == CAMERA_ERROR_SOUND_POLICY_BY_CALL) {
+       ERR("_main_view_start_preview failed");
+       //edje_object_part_text_set(_EDJ(view->cameraview_layout), "content_text", "IDS_CAM_POP_UNABLE_TO_START_CAMERA_DURING_CALL");
+       view->low_battery_layout = _main_view_load_edj(view->cameraview_layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "battery_low_layout");
+       elm_object_part_content_set(view->cameraview_layout, "battery_low", view->low_battery_layout);
+       elm_object_domain_translatable_part_text_set(view->low_battery_layout, "low_text", CAM_PACKAGE,"IDS_CAM_POP_UNABLE_TO_START_CAMERA_DURING_CALL");
+       // _main_view_show_warning_popup(navi, _error, "Unable to open camera during call", _ok, view);
+    } else if (!view->camera_enabled && !cam_utils_check_battery_critical_low()) {
+       ERR("_main_view_start_preview failed");
+       _main_view_show_warning_popup(navi, _error, _camera_init_failed, _ok, view);
+    } else {
+       // edje_object_part_text_set(_EDJ(view->cameraview_layout), "content_text", "");
+       elm_object_part_content_unset(view->cameraview_layout, "battery_low");
+       evas_object_del(view->low_battery_layout);
+    }
+
+    _main_view_register_cbs(view);
+    camera_error_e e;
+    e = camera_set_interrupted_cb(view->camera, __cam_interrupted_cb,(void *)view );
+    if (e != CAMERA_ERROR_NONE) {
+       DBG("camera_set_interrupted_cb failed - code[%x]", e);
+       return FALSE;
+    }
+    _main_view_set_data(view);
+    evas_object_show(view->layout);
+    if (view->target_direction == CAM_TARGET_DIRECTION_PORTRAIT)
+       view->cam_view_type = CAM_COMPACT_VIEW;
+    else
+       view->cam_view_type = CAM_FULL_VIEW;
+
+    if (size_limit != 0)
+       view->size_limit = size_limit;
+    else if (view->is_size_limit == TRUE)
+       view->size_limit = CAM_REC_MMS_MAX_SIZE;
+    else
+       view->size_limit = CAM_REC_NORMAL_MAX_SIZE;
+
+    DBG("view->size_limit set to = %llu", view->size_limit);
+
+    device_add_callback(DEVICE_CALLBACK_BATTERY_LEVEL, __cam_app_battery_level_changed_cb, view);
+    endfunc
+    return view->layout;
+}
+
+void _main_view_destroy()
+{
+    startfunc
+    main_view *view = (main_view *)_main_view_get_data();
+    RETM_IF(!view, "main_view is NULL");
+    int ret = 0;
+    _main_view_stop_camera_preview(view->camera);
+
+    if (grecord != NULL) {
+       recorder_destroy(grecord);
+       grecord = NULL;
+    }
+    if (pkt) {
+       media_packet_destroy(pkt);
+       DBG("Destroy the packet if already available");
+    } else {
+       DBG("packet is not available to destroy");
+    }
+    if (handle) {
+       ret = image_util_transform_destroy(handle);
+       if (ret != IMAGE_UTIL_ERROR_NONE ) {
+           DBG("image_util_transform_destroy failed");
+       } else {
+           DBG("image_util_transform_destroy success");
+       }
+    }
+    if (view->camera != NULL) {
+       camera_destroy(view->camera);
+       view->camera = NULL;
+    }
+
+    evas_object_smart_callback_del(view->layout, EVENT_PAUSE, _main_view_pause_cb);
+    evas_object_smart_callback_del(view->layout, EVENT_RESUME, _main_view_resume_cb);
+
+    elm_object_part_content_unset(view->layout, "main_view");
+    if (view->cameraview_layout != NULL) {
+        evas_object_del(view->cameraview_layout);
+    }
+
+    if (view->recorderview_layout != NULL) {
+        evas_object_del(view->recorderview_layout);
+    }
+
+    //free(view);
+       IF_FREE(exifData);
+    _main_view_set_data(NULL);
+    endfunc
+}
+
+void _main_view_set_data(void *data)
+{
+       main_view *view = (main_view *)data;
+       /*RETVM_IF(!view, NULL, "failed to allocate main_view");*/
+       viewhandle = view;
+}
+
+void*  _main_view_get_data()
+{
+       if (viewhandle) {
+               return viewhandle;
+       }
+       return NULL;
+}
+static void _main_view_recorder_set_recording_size(main_view *view)
+{
+       RETM_IF(!view, "main_view is NULL");
+
+       char str[32] = "";
+       double rec_filesize_in_mega = 0.0;
+
+       if (view->rec_filesize < 1024) {
+               snprintf(str, sizeof(str), "%lldK", view->rec_filesize);
+       } else {
+               rec_filesize_in_mega = (double)view->rec_filesize/(double)1024;
+               snprintf(str, sizeof(str), "%.1fM", rec_filesize_in_mega);
+       }
+       if (view->is_size_limit == TRUE) {
+               char str1[10] = "";
+               char str2[10] = "";
+               double pbar_position = 0.0;
+               double size_limit_in_mega = 0.0;
+
+               if (view->size_limit < 1024) {
+                       snprintf(str1, sizeof(str1), "%lldK", view->size_limit);
+               } else {
+                       size_limit_in_mega = (double)view->size_limit/(double)1024;
+                       snprintf(str1, sizeof(str1), "%.1fM", size_limit_in_mega);
+               }
+
+               edje_object_part_text_set(_EDJ(view->progressbar_layout), "right_text_val", str1);
+               edje_object_part_text_set(_EDJ(view->progressbar_layout), "left_text_val", str);
+
+               DBG("view->rec_filesize = %lld", view->rec_filesize);
+               pbar_position = view->rec_filesize/(double)view->size_limit;
+               elm_progressbar_value_set(view->progressbar, pbar_position);
+       } else {
+               edje_object_part_text_set(_EDJ(view->recorderview_layout), "recording_size", str);
+       }
+}
+
+void _main_view_recorder_update_time(main_view *view)
+{
+       RETM_IF(!view, "main_view is NULL");
+       RETM_IF(!grecord, "Invalid recorder handle");
+
+       int state = 0;
+       int ret = RECORDER_ERROR_NONE;
+
+       ret = recorder_get_state(grecord, (recorder_state_e *)&state);
+       if (ret != RECORDER_ERROR_NONE) {
+               ERR("recorder_get_state error code %d", ret);
+       }
+
+       if (state == RECORDER_STATE_RECORDING) {
+               _main_view_recorder_rec_icon_update(view);
+               _main_view_recorder_set_recording_time(view);
+               _main_view_recorder_set_recording_size(view);
+       }
+       else {
+               DBG("recorder state = %d && file size = %lld", state, view->rec_filesize);
+       }
+}
+
+static void _main_view_recording_status_cb(unsigned long long elapsed_time, unsigned long long file_size, void *user_data)
+{
+       main_view *view = (main_view*)user_data;
+       unsigned long long elapsed = elapsed_time / 1000;
+
+       if (view->rec_elapsed < elapsed) {
+               view->rec_elapsed = elapsed;
+               _main_view_recorder_update_time(view);
+       }
+
+       if (view->rec_filesize < file_size) {
+               view->rec_filesize = file_size;
+       }
+}
+
+static void _main_view_recorder_set_recording_time(main_view *view)
+{
+       RETM_IF(!view, "main_view is NULL");
+
+       char time_text[TIME_FORMAT_MAX_LEN] = "";
+       unsigned long long rec_time = view->rec_elapsed;
+
+       if (view->rec_elapsed < SECONDS_IN_HOUR) {
+               snprintf(time_text, sizeof(time_text), "%" CAM_TIME_FORMAT2 "", CAM_TIME_ARGS2(rec_time));
+       } else {
+               snprintf(time_text, sizeof(time_text), "%" CAM_TIME_FORMAT "", CAM_TIME_ARGS(rec_time));
+       }
+
+       edje_object_part_text_set(_EDJ(view->recorderview_layout), "recording_time", time_text);
+}
+
+static void _main_view_recorder_rec_icon_update(main_view *view)
+{
+       RETM_IF(!view, "main_view is NULL");
+       RETM_IF(!grecord, "Invalid recorder handle");
+
+       int state = 0;
+       int ret = RECORDER_ERROR_NONE;
+
+       ret = recorder_get_state(grecord, (recorder_state_e *)&state);
+       if (ret != RECORDER_ERROR_NONE) {
+               ERR("recorder_get_state error code %d", ret);
+       }
+
+       if (state == RECORDER_STATE_PAUSED) {
+               if (!(view->pause_time % 2) == 0) {
+                       edje_object_signal_emit(_EDJ(view->recording_icon), "recording_icon,pause,portrait", "prog");
+               } else {
+                       edje_object_signal_emit(_EDJ(view->recording_icon), "recording_icon,hide", "prog");
+               }
+       } else {
+               if ((view->rec_elapsed % 2) == 0) {
+                       edje_object_signal_emit(_EDJ(view->recording_icon), "recording_icon,recording", "prog");
+               } else {
+                       edje_object_signal_emit(_EDJ(view->recording_icon), "recording_icon,hide", "prog");
+               }
+       }
+}
+
+static void _main_view_recorder_rec_icon_create(main_view *view)
+{
+       RETM_IF(!view, "main_view is NULL");
+
+       if (view->recording_icon) {
+               elm_object_part_content_unset(view->recorderview_layout, "recording_icon");
+               evas_object_del(view->recording_icon);
+       }
+       double scale= elm_config_scale_get();
+       if (scale == 2.6)
+               view->recording_icon = _main_view_load_edj(view->recorderview_layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "recording_icon");
+       else
+               view->recording_icon = _main_view_load_edj(view->recorderview_layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "recording_icon_WVGA");
+       elm_object_part_content_set(view->recorderview_layout, "recording_icon", view->recording_icon);
+       _main_view_recorder_rec_icon_update(view);
+}
+
+static void __recording_view_progressbar_create(main_view *view)
+{
+       RETM_IF(!view, "main_view is NULL");
+       double scale = elm_config_scale_get();
+       if (scale == 2.6)
+               view->progressbar_layout = _main_view_load_edj(view->recorderview_layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "progressbar_layout");
+       else
+               view->progressbar_layout = _main_view_load_edj(view->recorderview_layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "progressbar_layout_WVGA");
+       RETM_IF(view->progressbar_layout == NULL, "edj load failed");
+       elm_object_part_content_set(view->recorderview_layout, "progressbar_area", view->progressbar_layout);
+
+       view->progressbar = elm_progressbar_add(view->progressbar_layout);
+       RETM_IF(view->progressbar == NULL, "elm_progressbar_add failed");
+       elm_progressbar_horizontal_set(view->progressbar, EINA_TRUE);
+       evas_object_size_hint_align_set(view->progressbar, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_size_hint_weight_set(view->progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_part_content_set(view->progressbar_layout, "progressbar", view->progressbar);
+       evas_object_show(view->progressbar);
+
+       char str[10] = "";
+       char str2[10] = "";
+       double size_limit_in_mega = 0.0;
+       double rec_filesize_in_mega = 0.0;
+
+       if (view->size_limit < 1024) {
+               snprintf(str, sizeof(str), "%lldK", view->size_limit);
+       } else {
+               size_limit_in_mega = (double)view->size_limit/(double)1024;
+               snprintf(str, sizeof(str), "%.1fM", size_limit_in_mega);
+       }
+
+       if (view->rec_filesize< 1024) {
+               snprintf(str2, sizeof(str2), "%lldK", view->rec_filesize);
+       } else {
+               rec_filesize_in_mega = (double)view->rec_filesize/(double)1024;
+               snprintf(str2, sizeof(str2), "%.1fM", rec_filesize_in_mega);
+       }
+
+       edje_object_part_text_set(_EDJ(view->progressbar_layout), "right_text_val", str);
+       edje_object_part_text_set(_EDJ(view->progressbar_layout), "left_text_val", str2);
+}
+
+void _main_view_recorder_view_add(main_view *view)
+{
+       startfunc
+       RETM_IF(!view, "main_view is NULL");
+
+       elm_object_part_content_unset(view->layout, "main_view");
+       evas_object_del(view->cameraview_layout);
+       _main_view_set_target_direction(view->target_direction);
+       double scale= elm_config_scale_get();
+       if (scale == 2.6)
+               view->recorderview_layout = _main_view_load_edj(view->layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "recorder_layout");
+       else
+               view->recorderview_layout = _main_view_load_edj(view->layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "recorder_layout_WVGA");
+               elm_object_part_content_set(view->layout, "main_view", view->recorderview_layout);
+       elm_object_signal_callback_add(view->recorderview_layout, "rec_stop_button_clicked", "*",
+       _main_view_recorder_stop_button_cb, view);
+       elm_object_signal_callback_add(view->recorderview_layout, "rec_pause_button_clicked", "*",
+            _main_view_recorder_pause_button_cb, view);
+       elm_object_signal_callback_add(view->recorderview_layout, "rec_resume_button_clicked", "*",
+            _main_view_recorder_resume_button_cb, view);
+
+       _main_view_recorder_rec_icon_create(view);
+       _main_view_recorder_set_recording_time(view);
+       if (view->is_size_limit == TRUE) {
+               __recording_view_progressbar_create(view);
+       }
+       evas_object_show(view->layout);
+       endfunc
+}
+
+static Eina_Bool _main_view_create_recorder(camera_h camera)
+{
+       startfunc
+       recorder_error_e re = RECORDER_ERROR_NONE;
+       re = recorder_create_videorecorder(camera, &grecord);
+       if (re != RECORDER_ERROR_NONE) {
+               ERR( "[ERROR] recorder_create - error(%d)", re);
+               recorder_destroy(grecord);
+               grecord = NULL;
+               return EINA_FALSE;
+       }
+       endfunc
+       return EINA_TRUE;
+}
+
+static Eina_Bool _main_view_start_camera_preview (camera_h camera)
+{
+    startfunc
+    main_view *view = (main_view *)_main_view_get_data();
+    RETVM_IF(!view, EINA_FALSE, "main_view is NULL");
+    camera_state_e cur_state = CAMERA_STATE_NONE;
+    int width = 0;
+    int height = 0;
+    if (cam_utils_check_battery_critical_low()) {
+               ERR("Battery critically low");
+               view->low_battery_layout = _main_view_load_edj(view->cameraview_layout, "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj", "battery_low_layout");
+               elm_object_part_content_set(view->cameraview_layout, "battery_low", view->low_battery_layout);
+               elm_object_domain_translatable_part_text_set(view->low_battery_layout, "low_text", CAM_PACKAGE, "IDS_CAM_TPOP_BATTERY_POWER_LOW");
+               return EINA_FALSE;
+    }
+
+    int res = camera_get_state(camera, &cur_state);
+    DBG("current camera state= %d", cur_state);
+    if (CAMERA_ERROR_NONE == res) {
+        if (cur_state != CAMERA_STATE_CAPTURED) {
+            camera_start_focusing(camera, TRUE);
+           res = camera_attr_enable_tag(camera, TRUE);
+            if (res != CAMERA_ERROR_NONE) {
+                ERR("camera_attr_is_enabled_tag failed - code[%x]", res);
+                return EINA_FALSE;
+            }
+            res = camera_set_capture_resolution(camera, CAM_WIDTH, CAM_HEIGHT);
+            if (res != CAMERA_ERROR_NONE) {
+                ERR("camera_set_capture_resolution failed - code[%x]", res);
+                return EINA_FALSE;
+            }
+
+            res = camera_get_recommended_preview_resolution(camera, &width, &height);
+            if (res != CAMERA_ERROR_NONE) {
+                ERR("camera_get_recommended_preview_resolution failed - code[%x]", res);
+                return EINA_FALSE;
+            }
+
+            ERR("camera_set_preview_resolution width = %d - height[%d]", width, height);
+            res = camera_set_preview_resolution(camera, width, height);
+            if (res != CAMERA_ERROR_NONE) {
+                ERR("camera_set_preview_resolution failed - code[%x]", res);
+                return EINA_FALSE;
+            }
+       }
+        if (cur_state != CAMERA_STATE_PREVIEW) {
+            res = camera_start_preview(camera);
+            if (res!=CAMERA_ERROR_NONE) {
+                error_type=res;
+                ERR("unable to open during call");
+            }  else {
+                error_type = 0;
+            }
+            _main_view_util_lcd_lock();
+            return EINA_TRUE;
+        }
+    } else {
+        ERR("Cannot get camera state. Error: %d", res);
+    }
+    endfunc
+    return EINA_FALSE;
+}
+
+static Eina_Bool _main_view_stop_camera_preview (camera_h camera)
+{
+    startfunc
+    camera_state_e cur_state = CAMERA_STATE_NONE;
+    int res = camera_get_state(camera, &cur_state);
+    if (CAMERA_ERROR_NONE == res) {
+        if (cur_state == CAMERA_STATE_PREVIEW) {
+            camera_stop_preview(camera);
+            _main_view_util_lcd_unlock();
+            return EINA_TRUE;
+        }
+    } else {
+        ERR("Cannot get camera state. Error: %d", res);
+    }
+    endfunc
+    return EINA_FALSE;
+}
+
+static Eina_Bool _main_view_init_camera(main_view *view, int camera_type)
+{
+       startfunc
+       RETVM_IF(!view, EINA_FALSE, "main_view is NULL");
+       view->device_type = camera_type;
+       int result = camera_create(camera_type, &view->camera);
+       if (CAMERA_ERROR_NONE == result) {
+               if (view->preview_canvas) {
+                       result = camera_set_display(view->camera, CAMERA_DISPLAY_TYPE_EVAS, GET_DISPLAY(view->preview_canvas));
+
+                       if (CAMERA_ERROR_NONE == result) {
+                               camera_set_display_mode(view->camera, CAMERA_DISPLAY_MODE_CROPPED_FULL);
+                               camera_set_display_visible(view->camera, true);
+                               camera_attr_set_stream_flip(view->camera, CAMERA_FLIP_NONE);
+
+                               if (camera_type == CAMERA_DEVICE_CAMERA0) {
+                                       result = camera_set_display_flip(view->camera, CAMERA_FLIP_NONE);
+                               } else {
+                                       result = camera_set_display_flip(view->camera, CAMERA_FLIP_VERTICAL);
+                               }
+                               if (CAMERA_ERROR_NONE != result) {
+                                       ERR("Failed to set display flip");
+                               }
+#ifndef CAMERA_MACHINE_I686
+                               result = camera_set_display_rotation(view->camera, CAMERA_ROTATION_270);
+#else
+                               result = camera_set_display_rotation(view->camera, CAMERA_ROTATION_NONE);
+#endif
+                               if (result != CAMERA_ERROR_NONE) {
+                                       ERR("camera_set_display_rotation failed - code[%x]", result);
+                               }
+
+                       //      return _main_view_start_camera_preview(view->camera);
+                       }
+               }
+       }
+       endfunc
+       return !result;
+}
+
+static Eina_Bool _stop_cb(void *data)
+{
+       main_view *view = data;
+       view->timer_count++;
+
+       if (view->timer_count == 1) {
+               int error_code = 0;
+               error_code = recorder_commit(grecord);
+
+               if (error_code != RECORDER_ERROR_NONE) {
+                       ERR("recorder_commit error code %d", error_code);
+               }
+
+               error_code = recorder_unprepare(grecord);
+               if (error_code != RECORDER_ERROR_NONE) {
+                       ERR("recorder_unprepare error code %d", error_code);
+               }
+
+               _main_file_register(view->filename);
+
+               if (view->pause_state == FALSE) {
+                       _main_view_ug_send_result(view, view->filename);
+               }
+
+               error_code = recorder_destroy(grecord);
+               if (error_code != RECORDER_ERROR_NONE) {
+                       ERR("recorder_destroy error code %d", error_code);
+               }
+               grecord = NULL;
+               main_view_camera_view_add(view);
+               toast_popup_create(view, "Maximum recording size reached.", NULL);
+
+               if (view->pause_state == FALSE) {
+                        _main_view_start_camera_preview (view->camera);
+               }
+               return ECORE_CALLBACK_CANCEL;
+       }
+       return ECORE_CALLBACK_RENEW;
+}
+
+static void __recording_limit_reached_cb(recorder_recording_limit_type_e type, void *user_data)
+{
+       DBG("recording limit reached - [%d]", type);
+       RETM_IF(!user_data, "data is NULL");
+       RETM_IF(!grecord, "Invalid recorder handle");
+
+       main_view *view = user_data;
+
+       _main_view_recorder_update_time(view);
+
+       view->timer_count = 0;
+       Ecore_Timer *stop_cb_delay;
+       stop_cb_delay = ecore_timer_add(1.0, _stop_cb, view);
+}
+
+static Eina_Bool _main_view_init_recorder(main_view *view)
+{
+       startfunc
+       DBG("_main_view_init_recorder");
+       RETVM_IF(!grecord, EINA_FALSE, "Invalid recorder handle");
+
+       int error_code = 0;
+       Eina_Bool ret = EINA_TRUE;
+       int video_codec = 0;
+       int audio_codec = 0;
+       int sample_rate = 0;
+       int file_format = RECORDER_FILE_FORMAT_MP4;
+       int channel = 0;
+       int a_bitrate = 0;
+       int v_bitrate = 0;
+       /* resolution */
+       int res = 0;
+       size_t size = _main_view_get_file_path(view->filename, sizeof(view->filename), CAM_FILE_VIDEO);
+       RETVM_IF(0 == size, EINA_FALSE, "failed to get file path")
+       DBG("%s", view->filename);
+
+       if (view->is_size_limit == TRUE) {
+               video_codec = RECORDER_VIDEO_CODEC_H263;
+               audio_codec = RECORDER_AUDIO_CODEC_AMR;
+               sample_rate = 8000;
+               file_format = RECORDER_FILE_FORMAT_3GP;
+               channel = 1;
+               a_bitrate = 12200;
+               v_bitrate = 96100;
+               res = CAM_RESOLUTION_QCIF;
+       } else {
+               video_codec = RECORDER_VIDEO_CODEC_MPEG4 ; /* RECORDER_VIDEO_CODEC_H264;*/
+               audio_codec = RECORDER_AUDIO_CODEC_AAC;
+               sample_rate = 48000;
+               file_format = RECORDER_FILE_FORMAT_MP4;
+               channel = 2;
+               a_bitrate = 288000;
+               v_bitrate = 3078000;
+               res = CAM_RESOLUTION_VGA;
+               DBG(" video_codec = %d ,RECORDER_VIDEO_CODEC_MPEG4 = %d" , video_codec, RECORDER_VIDEO_CODEC_MPEG4);
+               DBG("audio_codec = %d ,RECORDER_AUDIO_CODEC_AAC = %d" , audio_codec, RECORDER_AUDIO_CODEC_AAC);
+               DBG("file_format = %d ,RECORDER_FILE_FORMAT_MP4 = %d" , file_format, RECORDER_FILE_FORMAT_MP4);
+       }
+       if (view->is_size_limit == TRUE) {
+#ifdef CAMERA_MACHINE_I686
+               error_code = camera_attr_set_preview_fps(view->camera, 30);
+#else
+               error_code = camera_attr_set_preview_fps(view->camera, 25);
+#endif
+               if (error_code != CAMERA_ERROR_NONE) {
+                       ERR("camera_attr_set_preview_fps failed - code[%x]", ret);
+                       ret =  EINA_FALSE;
+               }
+               error_code = recorder_attr_set_recording_motion_rate(grecord, 1.0);
+               if (error_code != RECORDER_ERROR_NONE) {
+                       ERR("recorder_attr_set_recording_motion_rate error code %d", error_code);
+                       ret = EINA_FALSE;
+               }
+               error_code = camera_set_capture_resolution(view->camera, 640, 480);
+               if (error_code != CAMERA_ERROR_NONE) {
+                       ERR("camera_set_capture_resolution failed - code[%x]", ret);
+                       ret =  EINA_FALSE;
+               }
+               error_code = camera_set_preview_resolution(view->camera, 176, 144);
+               if (error_code != CAMERA_ERROR_NONE) {
+                       ERR("camera_set_preview_resolution failed - code[%x]", ret);
+                       ret =  EINA_FALSE;
+               }
+               error_code =recorder_set_video_resolution(grecord, CAM_RESOLUTION_W(res), CAM_RESOLUTION_H(res));
+               if (error_code != RECORDER_ERROR_NONE) {
+                       ERR("recorder_set_video_resolution error code %d", error_code);
+                       ret = EINA_FALSE;
+               }
+#ifndef CAMERA_MACHINE_I686
+               error_code = camera_attr_enable_video_stabilization(view->camera, FALSE);
+               if (error_code != CAMERA_ERROR_NONE) {
+                       ERR("camera_attr_enable_video_stabilization failed - code[%x]", error_code);
+                       ret =  EINA_FALSE;
+               }
+#endif
+               error_code = camera_set_capture_format(view->camera, CAMERA_PIXEL_FORMAT_JPEG);
+               if (error_code != CAMERA_ERROR_NONE) {
+                       ERR("camera_set_capture_format failed - code[%x]", error_code);
+                       ret =  EINA_FALSE;
+               }
+#ifdef CAMERA_MACHINE_I686
+               error_code = camera_set_preview_format(view->camera, CAMERA_PIXEL_FORMAT_I420);
+#else
+               error_code = camera_set_preview_format(view->camera, CAMERA_PIXEL_FORMAT_NV12);
+#endif
+               if (error_code != CAMERA_ERROR_NONE) {
+                       ERR("camera_set_preview_format failed - code[%x]", error_code);
+                       ret =  EINA_FALSE;
+               }
+       }
+       error_code = recorder_set_video_encoder(grecord, video_codec);
+       if (error_code != RECORDER_ERROR_NONE) {
+               ERR("recorder_set_video_encoder error code %d", error_code);
+               ret = EINA_FALSE;
+       }
+
+       error_code = recorder_set_audio_encoder(grecord, audio_codec);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_set_video_encoder error code %d", error_code);
+               ret = EINA_FALSE;
+       }
+
+       error_code = recorder_attr_set_audio_samplerate(grecord, sample_rate);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_attr_set_audio_samplerate error code %d", error_code);
+               ret = EINA_FALSE;
+       }
+
+       error_code = recorder_attr_set_audio_channel(grecord, channel);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_attr_set_audio_channel error code %d", error_code);
+               ret = EINA_FALSE;
+       }
+
+       //Set the bitrate of the video encoder
+       error_code = recorder_attr_set_video_encoder_bitrate(grecord, v_bitrate);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_attr_set_video_encoder_bitrate error code %d", error_code);
+               ret = EINA_FALSE;
+       }
+
+       error_code = recorder_attr_set_audio_encoder_bitrate(grecord, a_bitrate);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_attr_set_audio_encoder_bitrate error code %d", error_code);
+               ret = EINA_FALSE;
+       }
+
+       //Set the recording file format
+       error_code = recorder_set_file_format(grecord, file_format);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_set_file_format error code %d", error_code);
+               ret = EINA_FALSE;
+       }
+
+       // Set the file path to store the recorded data
+       error_code = recorder_set_filename(grecord, view->filename);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_set_filename error code %d", error_code);
+               ret = EINA_FALSE;
+       }
+
+       int size_limit = view->size_limit;
+       error_code = recorder_attr_set_size_limit(grecord, size_limit);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_attr_set_size_limit failed - code[%x]", error_code);
+               return EINA_FALSE;
+       }
+
+       error_code = recorder_set_recording_limit_reached_cb(grecord, __recording_limit_reached_cb, view);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_set_recording_limit_reached_cb failed - code[%x]", error_code);
+               return EINA_FALSE;
+       }
+
+       endfunc
+       return ret;
+}
+
+static void _main_view_register_cbs(main_view *view)
+{
+    /*evas_object_smart_callback_add(view->layout, EVENT_BACK, _main_view_back_cb, view);*/
+    evas_object_smart_callback_add(view->layout, EVENT_PAUSE, _main_view_pause_cb, view);
+    evas_object_smart_callback_add(view->layout, EVENT_RESUME, _main_view_resume_cb, view);
+    elm_object_signal_callback_add(view->cameraview_layout, "shutter_button_clicked", "*",
+            _main_view_shutter_button_cb, view);
+    /*elm_object_signal_callback_add(view->cameraview_layout, "video_button_clicked", "*",
+            _main_view_video_button_cb, view);*/
+#ifndef CAMERA_MACHINE_I686
+    elm_object_signal_callback_add(view->cameraview_layout, "change_camera_button_clicked", "*",
+            _main_view_switch_camera_button_cb, view);
+#endif
+}
+
+static void _main_view_back_cb(void *data, Evas_Object *obj, void *event_info)
+{
+    RETM_IF(!data, "data is NULL");
+    main_view *view = data;
+}
+
+static void _main_view_pause_cb(void *data, Evas_Object *obj, void *event_info)
+{
+    RETM_IF(!data, "data is NULL");
+    main_view *view = data;
+
+    _main_view_stop_camera_preview(view->camera);
+}
+
+static void _main_view_resume_cb(void *data, Evas_Object *obj, void *event_info)
+{
+    RETM_IF(!data, "data is NULL");
+    main_view *view = data;
+
+    if (!_main_view_start_camera_preview(view->camera)) {
+       ERR("Failed start preview");
+       return;
+    }
+}
+
+bool _main_view_check_phone_dir()
+{
+       DIR *internal_dcim_dir = NULL;
+       DIR *internal_file_dir = NULL;
+       int ret = -1;
+
+       internal_dcim_dir = opendir(INTERNAL_DCIM_PATH);
+       if (internal_dcim_dir == NULL) {
+               ret = mkdir(INTERNAL_DCIM_PATH, 0777);
+               if (ret < 0) {
+                       DBG("mkdir [%s] failed - [%d]", INTERNAL_DCIM_PATH, errno);
+                       if (errno != ENOSPC) {
+                               goto ERROR;
+                       }
+               }
+       }
+
+       internal_file_dir = opendir(CAMERA_DIRECTORY);
+       if (internal_file_dir == NULL) {
+               ret = mkdir(CAMERA_DIRECTORY, 0777);
+               if (ret < 0) {
+                       DBG("mkdir [%s] failed - [%d]", CAMERA_DIRECTORY, errno);
+                       if (errno != ENOSPC) {
+                               goto ERROR;
+                       }
+               }
+       }
+
+       if (internal_file_dir) {
+               closedir(internal_file_dir);
+               internal_file_dir = NULL;
+       }
+
+       if (internal_dcim_dir) {
+               closedir(internal_dcim_dir);
+               internal_dcim_dir = NULL;
+       }
+
+       return TRUE;
+
+ERROR:
+       if (internal_dcim_dir) {
+               closedir(internal_dcim_dir);
+               internal_dcim_dir = NULL;
+       }
+
+       return FALSE;
+}
+
+static size_t _main_view_get_file_path(char *file_path, size_t size, CamFileType fileType)
+{
+    RETVM_IF(!file_path, 0, "file_path is NULL");
+
+    struct tm localtime = {0,};
+    time_t rawtime = time(NULL);
+    main_view *view = (main_view *)_main_view_get_data();
+    RETVM_IF(!view, 0, "view is NULL");
+
+    if (_main_view_check_phone_dir() == FALSE) {
+        return 0;
+    }
+    if (localtime_r(&rawtime, &localtime) == NULL) {
+        return 0;
+    }
+       if (fileType == CAM_FILE_IMAGE) {
+           return snprintf(file_path, size, "%s/%s_%04i-%02i-%02i_%02i:%02i:%02i.jpg",
+               CAMERA_DIRECTORY, FILE_PREFIX,
+               localtime.tm_year + 1900, localtime.tm_mon + 1, localtime.tm_mday,
+               localtime.tm_hour, localtime.tm_min, localtime.tm_sec);
+       } else {
+               if (view->is_size_limit == TRUE) {
+                   return snprintf(file_path, size, "%s/%s_%04i-%02i-%02i_%02i:%02i:%02i.3gp",
+                       CAMERA_DIRECTORY, FILE_VIDEO_PREFIX,
+                       localtime.tm_year + 1900, localtime.tm_mon + 1, localtime.tm_mday,
+                       localtime.tm_hour, localtime.tm_min, localtime.tm_sec);
+               } else {
+                   return snprintf(file_path, size, "%s/%s_%04i-%02i-%02i_%02i:%02i:%02i.mp4",
+                       CAMERA_DIRECTORY, FILE_VIDEO_PREFIX,
+                       localtime.tm_year + 1900, localtime.tm_mon + 1, localtime.tm_mday,
+                       localtime.tm_hour, localtime.tm_min, localtime.tm_sec);
+               }
+       }
+}
+
+void _main_view_app_pause()
+{
+       int state = 0;
+       int ret = RECORDER_ERROR_NONE;
+       main_view *view = (main_view *)_main_view_get_data();
+       RETM_IF(!view, "view is NULL");
+
+       view->pause_state = TRUE;
+       if (grecord != NULL) {
+               ret = recorder_get_state(grecord, (recorder_state_e *)&state);
+               if (ret == RECORDER_ERROR_NONE) {
+                       ERR("recorder_get_state error code %d", ret);
+                       if ((state == RECORDER_STATE_RECORDING)
+                           || (state == RECORDER_STATE_PAUSED)) {
+                               _main_view_recorder_stop_button_cb(view, NULL, NULL, NULL);
+                       }
+               }
+       }
+       _main_view_stop_camera_preview(view->camera);
+
+       //edje_object_part_text_set(_EDJ(view->cameraview_layout), "content_text", "");
+       elm_object_part_content_unset(view->cameraview_layout, "battery_low");
+       evas_object_del(view->low_battery_layout);
+       view->pause_state = FALSE;
+}
+
+void _main_view_app_resume()
+{
+       main_view *view = (main_view *)_main_view_get_data();
+       RETM_IF(!view, "view is NULL");
+       camera_state_e cur_state = CAMERA_STATE_NONE;
+       int res = camera_get_state(view->camera, &cur_state);
+       if (cur_state != CAMERA_STATE_PREVIEW) {
+               _main_view_start_camera_preview(view->camera);
+       }
+       if (error_type == CAMERA_ERROR_SOUND_POLICY_BY_CALL) {
+               ERR("Interrupted by call");
+               view->low_battery_layout = _main_view_load_edj(view->cameraview_layout,
+                       "/usr/ug/res/edje/attach-panel-camera/attach-panel-camera.edj",
+                       "battery_low_layout");
+               elm_object_part_content_set(view->cameraview_layout, "battery_low",
+                       view->low_battery_layout);
+               elm_object_domain_translatable_part_text_set(view->low_battery_layout,
+                       "low_text", CAM_PACKAGE,"IDS_CAM_TPOP_BATTERY_POWER_LOW");
+       }
+}
+
+static void _main_view_ug_send_result(main_view *view, char *file_path)
+{
+       startfunc
+       int ret = 0;
+       app_control_h app_control = NULL;
+       char **path_array = NULL;
+
+       DBG("result filepath is %s", file_path);
+       ret = app_control_create(&app_control);
+       if (ret == APP_CONTROL_ERROR_NONE) {
+               if (file_path == NULL) {
+                       ret = app_control_add_extra_data(app_control, "__ATTACH_PANEL_FULL_MODE__", "enable");
+                       if (ret != APP_CONTROL_ERROR_NONE) {
+                               LOGD("Enabling Full mode  failed!");
+                       }
+               } else {
+                       path_array = (char**)calloc(1, sizeof(char *));
+                       if (path_array == NULL) {
+                               LOGD("Failed to allocate memory");
+                               app_control_destroy(app_control);
+                               return;
+                       }
+                       path_array[0] = strdup(file_path);
+                       ret = app_control_add_extra_data_array(app_control, APP_CONTROL_DATA_PATH, (const char **)path_array, 1);
+                       ret = app_control_add_extra_data_array(app_control, APP_CONTROL_DATA_SELECTED, (const char **)path_array, 1);
+                       if (ret != APP_CONTROL_ERROR_NONE) {
+                               LOGD("Add selected path failed!");
+                       }
+               }
+               ret = ug_send_result(view->ug_handle, app_control);
+               if (ret < 0) {
+                    LOGD("ug_send_result failed");
+               }
+               app_control_destroy(app_control);
+               if (path_array != NULL) {
+                       if (path_array[0] != NULL) {
+                               free(path_array[0]);
+                       }
+                       free(path_array);
+               }
+               /*ug_destroy_me(view->ug_handle);*/
+       } else {
+               DBG("Failed to create app control\n");
+       }
+       endfunc
+}
+
+bool _main_file_register(const char *filename)
+{
+       startfunc
+       int err_code = 0;
+       media_info_h info = NULL;
+
+       char *register_file = strdup(filename);
+       if (register_file == NULL) {
+               LOGD("Failed to allocate memory");
+       }
+
+       err_code = media_info_insert_to_db(register_file, &info);
+       if (err_code != MEDIA_CONTENT_ERROR_NONE) {
+               DBG("failed to media_file_register() : [%s], [%d]", register_file, err_code);
+               media_info_destroy(info);
+               IF_FREE(register_file);
+               return FALSE;
+       }
+
+       media_info_destroy(info);
+       IF_FREE(register_file);
+
+       endfunc
+       return TRUE;
+}
+
+static void _main_view_capture_cb(camera_image_data_s *image,
+        camera_image_data_s *postview, camera_image_data_s *thumbnail, void *user_data)
+{
+    startfunc
+    RETM_IF(!user_data, "user_data is NULL");
+    int ret = 0;
+    ExifData *exdata = NULL ;
+    main_view *view = user_data;
+
+    if (!view->camera_enabled) {
+        ERR("Camera hasn't been initialized.");
+        return;
+    }
+
+    if (image->format == CAMERA_PIXEL_FORMAT_JPEG) {
+        DBG("got JPEG data - data [%p], length [%d], width [%d], height [%d]",
+                image->data, image->size, image->width, image->height);
+
+        size_t size = _main_view_get_file_path(view->filename, sizeof(view->filename), CAM_FILE_IMAGE);
+        RETM_IF(0 == size, "_main_view_get_filename() failed");
+        DBG("%s", view->filename);
+
+        FILE *file = fopen(view->filename, "w+");
+        RETM_IF(!file, "Failed to open file");
+        /*Exif data backup from the captured image*/
+        ExifData* exif = NULL;
+        ExifLoader *exifLoader = NULL;
+        /*save exif data*/
+        exifLoader = exif_loader_new();
+        exif_loader_write(exifLoader, image->data, image->size);
+        exif = exif_loader_get_data(exifLoader);
+        exif_loader_unref(exifLoader);
+        exif_data_save_data(exif, &exifData, &exif_size);
+        DBG("Exif SIze: %d Exif data is: %s", exif_size, exifData);
+        exif_data_unref(exif);
+
+       size = fwrite(image->data, image->size, 1, file);
+       WARN_IF(size != 1, "failed to write file");
+       fclose(file);
+       file = NULL;
+       if (view->cam_view_type != CAM_COMPACT_VIEW) {
+               _main_file_register(view->filename);
+       } else {
+               _main_view_media_create(view->filename, CAM_TRANSFORM_CROP);
+       }
+    }
+    endfunc
+}
+
+static void _main_view_capture_completed_cb(void *data)
+{
+    startfunc
+    RETM_IF(!data, "data is NULL");
+    main_view *view = data;
+
+    if (!view->camera_enabled) {
+        ERR("Camera hasn't been initialized.");
+        return;
+    }
+    if (view->cam_view_type != CAM_COMPACT_VIEW) {
+        _main_view_ug_send_result(view, view->filename);
+        _main_view_start_camera_preview(view->camera);
+    }
+    endfunc
+}
+
+static int _main_view_get_image_orient_value_by_direction(void *data, CamTargetDirection target_direction)
+{
+       RETVM_IF(!data, 0, "data is NULL");
+       main_view *view = data;
+
+       int orient_value = 0;
+#ifdef CAMERA_MACHINE_I686
+       DBG(" CAMERA_ATTR_TAG_ORIENTATION_TOP_LEFT");
+       orient_value = 0;
+#else
+       switch (target_direction) {
+       case CAM_TARGET_DIRECTION_PORTRAIT:
+                       if (view->self_portrait == TRUE) {
+                               orient_value = 8;
+                       } else {
+                               orient_value = 6;
+                       }
+               break;
+       case CAM_TARGET_DIRECTION_PORTRAIT_INVERSE:
+                       if (view->self_portrait == TRUE) {
+                               orient_value = 6;
+                       } else {
+                               orient_value = 8;
+                       }
+               break;
+       case CAM_TARGET_DIRECTION_LANDSCAPE_INVERSE:
+                       orient_value = 3;
+               break;
+       case CAM_TARGET_DIRECTION_LANDSCAPE:
+                       orient_value = 1;
+               break;
+       default:
+               break;
+       }
+#endif
+       DBG("target_direction=%d orient_value=%d", target_direction, orient_value);
+
+       return orient_value;
+}
+
+void _main_view_emit_signal_layout(CamTargetDirection target_direction)
+{
+       startfunc
+       main_view *view = (main_view *)_main_view_get_data();
+       RETM_IF(!view, "view is NULL");
+       double scale= elm_config_scale_get();
+       switch (target_direction) {
+       case CAM_TARGET_DIRECTION_PORTRAIT:
+               if (scale == 2.6)
+               {
+                       edje_object_signal_emit(_EDJ(view->cameraview_layout), "portrait", "camera_layout");
+                       edje_object_signal_emit(_EDJ(view->recorderview_layout), "portrait", "recorder_layout");
+               }
+               else
+               {
+                       edje_object_signal_emit(_EDJ(view->cameraview_layout), "portrait", "camera_layout_WVGA");
+                       edje_object_signal_emit(_EDJ(view->recorderview_layout), "portrait", "recorder_layout_WVGA");
+               }
+               break;
+       case CAM_TARGET_DIRECTION_PORTRAIT_INVERSE:
+               if (scale == 2.6)
+               {
+                       edje_object_signal_emit(_EDJ(view->cameraview_layout), "portrait_inverse", "camera_layout");
+                       edje_object_signal_emit(_EDJ(view->recorderview_layout), "portrait_inverse", "recorder_layout");
+               }
+               else
+               {
+                       edje_object_signal_emit(_EDJ(view->cameraview_layout), "portrait_inverse", "camera_layout_WVGA");
+                       edje_object_signal_emit(_EDJ(view->recorderview_layout), "portrait_inverse", "recorder_layout_WVGA");
+               }
+               break;
+       case CAM_TARGET_DIRECTION_LANDSCAPE_INVERSE:
+               if (scale == 2.6)
+               {
+                       edje_object_signal_emit(_EDJ(view->cameraview_layout), "landscape_inverse", "camera_layout");
+                       edje_object_signal_emit(_EDJ(view->recorderview_layout), "landscape_inverse", "recorder_layout");
+               }
+               else
+               {
+                       edje_object_signal_emit(_EDJ(view->cameraview_layout), "landscape_inverse", "camera_layout_WVGA");
+                       edje_object_signal_emit(_EDJ(view->recorderview_layout), "landscape_inverse", "recorder_layout_WVGA");
+               }
+               break;
+       case CAM_TARGET_DIRECTION_LANDSCAPE:
+               if (scale == 2.6)
+               {
+                       edje_object_signal_emit(_EDJ(view->cameraview_layout), "landscape", "camera_layout");
+                       edje_object_signal_emit(_EDJ(view->recorderview_layout), "landscape", "recorder_layout");
+               }
+               else
+               {
+                       edje_object_signal_emit(_EDJ(view->cameraview_layout), "landscape", "camera_layout_WVGA");
+                       edje_object_signal_emit(_EDJ(view->recorderview_layout), "landscape", "recorder_layout_WVGA");
+               }
+               break;
+       default:
+               break;
+       }
+}
+
+void _main_view_set_target_direction(CamTargetDirection target_direction)
+{
+       startfunc
+       main_view *view = (main_view *)_main_view_get_data();
+       RETM_IF(!view, "view is NULL");
+       int ret = 0;
+       int rotate;
+       CamTargetDirection display_direction = CAM_TARGET_DIRECTION_INVAILD;
+       camera_rotation_e rotationVal = CAMERA_ROTATION_NONE;
+       ret = camera_get_display_rotation(view->camera, (camera_rotation_e *)&rotate);
+       if (ret == CAMERA_ERROR_NONE) {
+               switch (rotate) {
+               case CAMERA_ROTATION_NONE:
+                       display_direction = CAM_TARGET_DIRECTION_LANDSCAPE;
+                       break;
+               case CAMERA_ROTATION_90:
+                       display_direction = CAM_TARGET_DIRECTION_PORTRAIT_INVERSE;
+                       break;
+               case CAMERA_ROTATION_180:
+                       display_direction = CAM_TARGET_DIRECTION_LANDSCAPE_INVERSE;
+                       break;
+               case CAMERA_ROTATION_270:
+                       display_direction = CAM_TARGET_DIRECTION_PORTRAIT;
+                       break;
+               default:
+                       DBG("invaild type");
+                       break;
+               }
+
+#ifdef CAMERA_MACHINE_I686
+               display_direction = view->target_direction;
+#endif
+       } else {
+               DBG("camera_get_display_rotation failed - code[%x]", ret);
+               return ;
+       }
+       view->target_direction = target_direction;
+       DBG(" target direction = %d , display_direction =%d", target_direction, display_direction);
+
+       if (display_direction != view->target_direction) {
+               switch (view->target_direction) {
+               case CAM_TARGET_DIRECTION_PORTRAIT:
+#ifndef CAMERA_MACHINE_I686
+                       rotationVal = CAMERA_ROTATION_270;
+#endif
+                       ret = camera_set_display_rotation(view->camera, rotationVal);
+                       break;
+               case CAM_TARGET_DIRECTION_PORTRAIT_INVERSE:
+#ifndef CAMERA_MACHINE_I686
+                       rotationVal = CAMERA_ROTATION_90;
+#endif
+                       ret = camera_set_display_rotation(view->camera, rotationVal);
+                       break;
+               case CAM_TARGET_DIRECTION_LANDSCAPE_INVERSE:
+#ifndef CAMERA_MACHINE_I686
+                       rotationVal = CAMERA_ROTATION_180;
+#endif
+                       ret = camera_set_display_rotation(view->camera, rotationVal);
+                       break;
+               case CAM_TARGET_DIRECTION_LANDSCAPE:
+#ifndef CAMERA_MACHINE_I686
+                       rotationVal = CAMERA_ROTATION_NONE;
+#endif
+                       ret = camera_set_display_rotation(view->camera, rotationVal);
+                       break;
+               default:
+                       break;
+               }
+               if (ret != CAMERA_ERROR_NONE) {
+                       ERR("camera_set_display_rotation failed - code[%x]", ret);
+               }
+       }
+       _main_view_emit_signal_layout(view->target_direction);
+       if (view->device_type == CAMERA_DEVICE_CAMERA1) {
+               if ((target_direction == CAM_TARGET_DIRECTION_LANDSCAPE))
+               {
+                       camera_set_display_rotation(view->camera, CAMERA_ROTATION_180);
+               }
+               if ((target_direction == CAM_TARGET_DIRECTION_LANDSCAPE_INVERSE))
+               {
+                       camera_set_display_rotation(view->camera, CAMERA_ROTATION_NONE);
+               }
+       }
+       endfunc
+}
+
+static int _main_view_get_image_orient_value(void *data)
+{
+       RETVM_IF(!data, 0, "data is NULL");
+       main_view *view = data;
+
+       DBG("current device orientation %d",view->target_direction);
+       return _main_view_get_image_orient_value_by_direction(view, view->target_direction);
+}
+
+static void _main_view_shutter_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source)
+{
+    startfunc
+    RETM_IF(!data, "data is NULL");
+    main_view *view = data;
+    int orient = 0;
+    int res = 0;
+
+    if (view->cam_view_type == CAM_COMPACT_VIEW) {
+        view->transformtype = CAM_TRANSFORM_CROP;
+    }
+    orient =  _main_view_get_image_orient_value(view);
+    res = camera_attr_set_tag_orientation(view->camera, (camera_attr_tag_orientation_e)orient);
+    if (res != CAMERA_ERROR_NONE) {
+        ERR("camera_attr_set_tag_orientation failed - code[%x]", res);
+    }
+
+    if (view->camera_enabled) {
+        camera_start_capture(view->camera, _main_view_capture_cb, _main_view_capture_completed_cb, view);
+    } else {
+        ERR("Camera hasn't been initialized.");
+    }
+    endfunc
+}
+
+static void _main_view_recorder_stop_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source)
+{
+       RETM_IF(!data, "data is NULL");
+       RETM_IF(!grecord, "Invalid recorder handle");
+
+       main_view *view = data;
+       int error_code = 0;
+
+       if (view->show_content == FALSE) {
+               error_code = recorder_cancel(grecord);
+               if (error_code != RECORDER_ERROR_NONE) {
+                       ERR("recorder_cancel error code %d", error_code);
+               }
+       } else {
+               error_code = recorder_commit(grecord);
+               if (error_code != RECORDER_ERROR_NONE) {
+                       ERR("recorder_commit error code %d", error_code);
+               }
+       }
+
+       error_code = recorder_unprepare(grecord);
+       if (error_code != RECORDER_ERROR_NONE) {
+               ERR("recorder_unprepare error code %d", error_code);
+       }
+
+       if (view->show_content  == TRUE) {
+               _main_file_register(view->filename);
+
+               if (view->pause_state == FALSE) {
+                       _main_view_ug_send_result(view, view->filename);
+               }
+       }
+       error_code = recorder_destroy(grecord);
+       if (error_code != RECORDER_ERROR_NONE) {
+               ERR("recorder_destroy error code %d", error_code);
+       }
+       grecord = NULL;
+       main_view_camera_view_add(view);
+       _main_view_set_target_direction(view->target_direction);
+       if (view->pause_state == FALSE) {
+                _main_view_start_camera_preview (view->camera);
+       }
+}
+
+static Eina_Bool _main_view_recorder_pause_icon_update(void *data)
+{
+       RETVM_IF(!data, ECORE_CALLBACK_CANCEL, "data is NULL");
+       RETVM_IF(!grecord, ECORE_CALLBACK_CANCEL, "Invalid recorder handle");
+
+       int state = 0;
+       int ret = RECORDER_ERROR_NONE;
+       main_view *view = (main_view *)data;
+       view->pause_time++;
+
+       ret = recorder_get_state(grecord, (recorder_state_e *)&state);
+       if (ret != RECORDER_ERROR_NONE) {
+               ERR("recorder_get_state error code %d", ret);
+       }
+
+       if (state == RECORDER_STATE_PAUSED) {
+               if (!(view->pause_time % 2) == 0) {
+                       edje_object_signal_emit(_EDJ(view->recording_icon), "recording_icon,pause,portrait", "prog");
+                       return ECORE_CALLBACK_RENEW;
+               } else {
+                       edje_object_signal_emit(_EDJ(view->recording_icon), "recording_icon,hide", "prog");
+                       return ECORE_CALLBACK_RENEW;
+               }
+       } else {
+               return ECORE_CALLBACK_CANCEL;
+       }
+}
+
+static void _main_view_recorder_pause_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source)
+{
+       RETM_IF(!data, "data is NULL");
+       RETM_IF(!grecord, "Invalid recorder handle");
+
+       main_view *view = data;
+       int state = 0;
+       int error_code = 0;
+       int ret = RECORDER_ERROR_NONE;
+
+       ret = recorder_get_state(grecord, (recorder_state_e *)&state);
+       if (ret != RECORDER_ERROR_NONE) {
+               ERR("recorder_get_state error code %d", ret);
+       }
+
+       if (state == RECORDER_STATE_RECORDING) {
+               error_code = recorder_pause(grecord);
+               if (error_code != RECORDER_ERROR_NONE) {
+                       ERR("recorder_pause error code %d", error_code);
+               }
+       }
+       _main_view_recorder_rec_icon_update(view);
+
+       REMOVE_TIMER(view->pause_timer);
+       view->pause_timer = ecore_timer_add(1.0, _main_view_recorder_pause_icon_update, (void *)view);
+}
+
+static void _main_view_recorder_resume_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source)
+{
+       RETM_IF(!data, "data is NULL");
+       RETM_IF(!grecord, "Invalid recorder handle");
+
+       int state = 0;
+       int error_code = 0;
+       int ret = RECORDER_ERROR_NONE;
+
+       ret = recorder_get_state(grecord, (recorder_state_e *)&state);
+       if (ret != RECORDER_ERROR_NONE) {
+               ERR("recorder_get_state error code %d", ret);
+       }
+
+       if ((state == RECORDER_STATE_READY)
+           || (state == RECORDER_STATE_PAUSED)) {
+               error_code = recorder_start(grecord);
+               ERR("recorder_pause error code %d", error_code);
+       }
+}
+
+static void _main_view_switch_camera_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source)
+{
+       RETM_IF(!data, "data is NULL");
+
+       Eina_Bool ret = EINA_TRUE;
+       int error_code = 0;
+       main_view *view = (main_view *)data;
+
+       ret = _main_view_stop_camera_preview(view->camera);
+       if (ret == EINA_TRUE) {
+               camera_destroy(view->camera);
+               view->camera = NULL;
+       } else {
+               ERR("Failed to stop camera preview");
+               return;
+       }
+
+       if (grecord) {
+               ret = recorder_destroy(grecord);
+               grecord = NULL;
+       }
+
+       if (view->self_portrait == EINA_TRUE) {
+               view->self_portrait = EINA_FALSE;
+               view->camera_enabled = _main_view_init_camera(view, CAMERA_DEVICE_CAMERA0);
+               if (view->camera_enabled) {
+                       if (!_main_view_start_camera_preview(view->camera)) {
+                               ERR("Failed start preview");
+                               return;
+                       }
+               }
+               _main_view_set_target_direction(view->target_direction);
+       } else {
+               view->self_portrait = EINA_TRUE;
+               view->camera_enabled = _main_view_init_camera(view, CAMERA_DEVICE_CAMERA1);
+               if (view->camera_enabled) {
+                       if (!_main_view_start_camera_preview(view->camera)) {
+                               ERR("Failed start preview");
+                               return;
+                       }
+               }
+
+               if (view->device_type == CAMERA_DEVICE_CAMERA1) {
+                       if ((view->target_direction==CAM_TARGET_DIRECTION_LANDSCAPE))
+                       {
+                               camera_set_display_rotation(view->camera, CAMERA_ROTATION_180);
+                       }
+                       if ((view->target_direction==CAM_TARGET_DIRECTION_LANDSCAPE_INVERSE))
+                       {
+                               camera_set_display_rotation(view->camera, CAMERA_ROTATION_NONE);
+                       }
+               }
+       }
+}
+
+static void _main_view_video_button_cb(void *data, Evas_Object *obj,
+        const char *emission, const char *source)
+{
+       Eina_Bool ret = EINA_TRUE;
+       int error_code = 0;
+       RETM_IF(!data, "data is NULL");
+       main_view *view = (main_view *)data;
+
+       if (view->cam_view_type == CAM_COMPACT_VIEW) {
+               _main_view_ug_send_result(view, NULL);
+               DBG("send to attachpanel for full view");
+       }
+       ret = _main_view_create_recorder(view->camera);
+       if (!ret) {
+               ERR("recorder creation failed");
+               return;
+       }
+       _main_view_stop_camera_preview(view->camera);
+       recorder_set_recording_status_cb(grecord, _main_view_recording_status_cb, view);
+       ret = _main_view_init_recorder(view);
+       if (!ret) {
+               ERR("recorder init failed");
+       }
+
+       // Prepare the recorder, resulting in setting the recorder state to RECORDER_STATE_READY
+       error_code = recorder_prepare(grecord);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_prepare error code %d", error_code);
+               recorder_unset_recording_status_cb(grecord);
+               recorder_destroy(grecord);
+               grecord = NULL;
+               _main_view_start_camera_preview(view->camera);
+               return;
+       }
+
+       // Start the recorder
+       error_code = recorder_start(grecord);
+       if (error_code != RECORDER_ERROR_NONE) {
+               DBG("recorder_start error code %d", error_code);
+               recorder_unset_recording_status_cb(grecord);
+               recorder_unprepare(grecord);
+               recorder_destroy(grecord);
+               grecord = NULL;
+               _main_view_start_camera_preview(view->camera);
+               return;
+       }
+
+       view->rec_elapsed = 0;
+       view->rec_filesize = 0;
+       _main_view_recorder_view_add(view);
+}
+
+static void _main_view_show_warning_popup(Evas_Object *navi, const char *caption, const char *text, const char *button_text, void *data)
+{
+    RETM_IF(!data, "data is null");
+    main_view *view = data;
+
+    Evas_Object *popup = elm_popup_add(navi);
+    RETM_IF(!popup, "Failed to create popup");
+
+    elm_object_part_text_set(popup, "title,text", caption);
+    elm_object_text_set(popup, text);
+    evas_object_show(popup);
+
+    Evas_Object *button = elm_button_add(popup);
+    RETM_IF(!button, "Failed to add button");
+
+    elm_object_style_set(button, POPUP_BUTTON_STYLE);
+    elm_object_text_set(button, button_text);
+    elm_object_part_content_set(popup, POPUP_BUTTON_PART, button);
+    evas_object_smart_callback_add(button, "clicked", _main_view_popup_close_cb, view);
+
+
+    view->popup = popup;
+}
+
+static void _main_view_popup_close_cb(void *data, Evas_Object *obj, void *event_info)
+{
+    RETM_IF(!data, "data is null");
+    main_view *view = data;
+
+    if (view->popup) {
+        evas_object_del(view->popup);
+        view->popup = NULL;
+    }
+}
+
+void _main_view_set_show_content(Eina_Bool showContent)
+{
+       main_view *view = (main_view *)_main_view_get_data();
+       RETM_IF(!view, "view is NULL");
+       int ret = 0;
+       int state = 0;
+
+       DBG("show content = %d", showContent);
+       view->show_content = showContent;
+       if (showContent == FALSE) {
+               _main_view_app_pause();
+       } else {
+               _main_view_app_resume();
+       }
+       RETM_IF(!grecord, "Invalid recorder handle");
+
+       ret = recorder_get_state(grecord, (recorder_state_e *)&state);
+       if (ret == RECORDER_ERROR_NONE) {
+               if ((state == RECORDER_STATE_RECORDING)
+                   || (state == RECORDER_STATE_PAUSED)) {
+                   _main_view_recorder_stop_button_cb(view, NULL, NULL, NULL);
+               }
+       }
+}
+
+void _main_view_set_cam_view_layout(CamViewType cam_view_type)
+{
+       main_view *view = (main_view *)_main_view_get_data();
+       RETM_IF(!view, "view is NULL");
+       view->cam_view_type = cam_view_type;
+       if (view->target_direction == CAM_TARGET_DIRECTION_PORTRAIT) {
+               double scale= elm_config_scale_get();
+               if (scale == 2.6)
+               {
+                       edje_object_signal_emit(_EDJ(view->recorderview_layout), "portrait", "recorder_layout");
+                       edje_object_signal_emit(_EDJ(view->cameraview_layout), "portrait", "camera_layout");
+               } else {
+                       edje_object_signal_emit(_EDJ(view->recorderview_layout), "portrait", "recorder_layout_WVGA");
+                       edje_object_signal_emit(_EDJ(view->cameraview_layout), "portrait", "camera_layout_WVGA");
+               }
+       }
+}
+
diff --git a/src/view/window.c b/src/view/window.c
new file mode 100644 (file)
index 0000000..464cb8e
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2000-2015 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 "view/window.h"
+
+#include "utils/logger.h"
+
+#include <Elementary.h>
+
+#define APP_NAME "camera"
+
+struct _window
+{
+    Evas_Object *win;
+    Evas_Object *conform;
+};
+
+window *window_create()
+{
+    window *win = calloc(1, sizeof(window));
+    RETVM_IF(!win, NULL, "calloc() failed");
+
+    win->win = elm_win_add(NULL, APP_NAME, ELM_WIN_BASIC);
+    elm_win_indicator_mode_set(win->win, ELM_WIN_INDICATOR_HIDE);
+    elm_win_conformant_set(win->win, EINA_TRUE);
+       elm_app_base_scale_set(1.8);
+    evas_object_show(win->win);
+
+    win->conform = elm_conformant_add(win->win);
+    evas_object_size_hint_weight_set(win->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    elm_win_resize_object_add(win->win, win->conform);
+    evas_object_show(win->conform);
+
+    Evas_Object *bg = elm_bg_add(win->conform);
+    elm_object_part_content_set(win->conform, "elm.swallow.bg", bg);
+
+    return win;
+}
+
+void window_destroy(window *win)
+{
+    RETM_IF(!win, "win is NULL");
+    evas_object_del(win->win);
+    free(win);
+}
+
+void window_lower(window *win)
+{
+    RETM_IF(!win, "win is NULL");
+    elm_win_lower(win->win);
+}
+
+void window_content_set(window *win, Evas_Object *content)
+{
+    RETM_IF(!win, "win is NULL");
+    RETM_IF(!content, "content is NULL");
+    elm_object_part_content_set(win->conform, "elm.swallow.content", content);
+}
+
+Evas_Object *window_layout_get(const window *win)
+{
+    RETVM_IF(!win, NULL, "win is NULL");
+    return win->conform;
+}