Initialize Tizen 2.3 tizen_2.3 2.3a_release submit/tizen_2.3/20140531.102850
authorSehong Na <sehong.na@samsung.com>
Sat, 31 May 2014 03:55:40 +0000 (12:55 +0900)
committerSehong Na <sehong.na@samsung.com>
Sat, 31 May 2014 03:55:40 +0000 (12:55 +0900)
12 files changed:
CMakeLists.txt [new file with mode: 0755]
LICENSE.Flora [new file with mode: 0755]
NOTICE [new file with mode: 0644]
include/image-viewer.h [new file with mode: 0755]
org.tizen.image-viewer.manifest [new file with mode: 0644]
org.tizen.image-viewer.rule [new file with mode: 0755]
org.tizen.image-viewer.xml [new file with mode: 0755]
packaging/org.tizen.image-viewer.changes [new file with mode: 0644]
packaging/org.tizen.image-viewer.spec [new file with mode: 0755]
res/appicon/org.tizen.image-viewer.png [new file with mode: 0755]
res/layout/iv-main.edc [new file with mode: 0755]
src/image-viewer.c [new file with mode: 0755]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..004bb9c
--- /dev/null
@@ -0,0 +1,79 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(image-viewer C)
+
+SET(PKG_NAME org.tizen.image-viewer)
+
+SET(SRCS
+       src/image-viewer.c
+)
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
+       ${CMAKE_CURRENT_SOURCE_DIR}/include/
+)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+       utilX
+       elementary
+       ui-gadget-1
+       evas
+       ecore-x
+       ecore
+       ecore-input
+       capi-appfw-application
+       dlog
+)
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DSLP_DEBUG")
+
+#SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
+
+# install desktop file & icon
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+SET(BINDIR "${PREFIX}/bin")
+SET(RESDIR "${PREFIX}/res")
+SET(DATADIR "${PREFIX}/data")
+SET(LOCALEDIR "${RESDIR}/locale")
+SET(ICONDIR "/usr/share/icons/default/small")
+SET(EDJDIR "${RESDIR}/edje")
+
+INSTALL(FILES ${PKG_NAME}.xml DESTINATION /usr/share/packages)
+INSTALL(FILES ${PKG_NAME}.rule DESTINATION /opt/etc/smack/accesses.d)
+INSTALL(DIRECTORY DESTINATION ${DATADIR})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/appicon/${PKG_NAME}.png DESTINATION ${ICONDIR})
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+
+
+FUNCTION (BUILD_EDJ _in _out _base _dir)
+       ADD_CUSTOM_TARGET(${_out}
+               COMMAND
+                       edje_cc -id ${_base}/${_dir}
+                       ${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_in}
+                       ${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_out}
+               DEPENDS
+                       ${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_in}
+       )
+
+       ADD_DEPENDENCIES(${PROJECT_NAME} ${_out})
+       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_out} DESTINATION ${CMAKE_INSTALL_PREFIX}/res/edje/${IVUG_PACKAGE_NAME})
+ENDFUNCTION (BUILD_EDJ)
+
+
+BUILD_EDJ(iv-main.edc                  iv-main.edj                     res/layout              images)
+
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
+
+INSTALL(FILES LICENSE.Flora DESTINATION /usr/share/license RENAME ${PKG_NAME})
+
+
diff --git a/LICENSE.Flora b/LICENSE.Flora
new file mode 100755 (executable)
index 0000000..571fe79
--- /dev/null
@@ -0,0 +1,206 @@
+Flora License
+
+Version 1.1, April, 2013
+
+http://floralicense.org/license/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by
+the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and
+all other entities that control, are controlled by, or are
+under common control with that entity. For the purposes of
+this definition, "control" means (i) the power, direct or indirect,
+to cause the direction or management of such entity,
+whether by contract or otherwise, or (ii) ownership of fifty percent (50%)
+or more of the outstanding shares, or (iii) beneficial ownership of
+such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity
+exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but
+not limited to compiled object code, generated documentation,
+and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form,
+made available under the License, as indicated by a copyright notice
+that is included in or attached to the work (an example is provided
+in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this License,
+Derivative Works shall not include works that remain separable from,
+or merely link (or bind by name) to the interfaces of, the Work and
+Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original
+version of the Work and any modifications or additions to that Work or
+Derivative Works thereof, that is intentionally submitted to Licensor
+for inclusion in the Work by the copyright owner or by an individual or
+Legal Entity authorized to submit on behalf of the copyright owner.
+For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or
+its representatives, including but not limited to communication on
+electronic mailing lists, source code control systems, and issue
+tracking systems that are managed by, or on behalf of, the Licensor
+for the purpose of discussing and improving the Work, but excluding
+communication that is conspicuously marked or otherwise designated
+in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies
+with the standards set forth in the Tizen Compliance Specification
+and passes the Tizen Compliance Tests as defined from time to time
+by the Tizen Technical Steering Group and certified by the Tizen
+Association or its designated agent.
+
+2. Grant of Copyright License.  Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the
+Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.  Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+(except as stated in this section) patent license to make, have made,
+use, offer to sell, sell, import, and otherwise transfer the Work
+solely as incorporated into a Tizen Certified Platform, where such
+license applies only to those patent claims licensable by such
+Contributor that are necessarily infringed by their Contribution(s)
+alone or by combination of their Contribution(s) with the Work solely
+as incorporated into a Tizen Certified Platform to which such
+Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim
+in a lawsuit) alleging that the Work or a Contribution incorporated
+within the Work constitutes direct or contributory patent infringement,
+then any patent licenses granted to You under this License for that
+Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.  You may reproduce and distribute copies of the
+Work or Derivative Works thereof pursuant to the copyright license
+above, in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+  1. You must give any other recipients of the Work or Derivative Works
+     a copy of this License; and
+  2. You must cause any modified files to carry prominent notices stating
+     that You changed the files; and
+  3. You must retain, in the Source form of any Derivative Works that
+     You distribute, all copyright, patent, trademark, and attribution
+     notices from the Source form of the Work, excluding those notices
+     that do not pertain to any part of the Derivative Works; and
+  4. If the Work includes a "NOTICE" text file as part of its distribution,
+     then any Derivative Works that You distribute must include a readable
+     copy of the attribution notices contained within such NOTICE file,
+     excluding those notices that do not pertain to any part of
+     the Derivative Works, in at least one of the following places:
+     within a NOTICE text file distributed as part of the Derivative Works;
+     within the Source form or documentation, if provided along with the
+     Derivative Works; or, within a display generated by the Derivative Works,
+     if and wherever such third-party notices normally appear.
+     The contents of the NOTICE file are for informational purposes only
+     and do not modify the License. You may add Your own attribution notices 
+     within Derivative Works that You distribute, alongside or as an addendum 
+     to the NOTICE text from the Work, provided that such additional attribution 
+     notices cannot be construed as modifying the License. You may add Your own
+     copyright statement to Your modifications and may provide additional or
+     different license terms and conditions for use, reproduction, or
+     distribution of Your modifications, or for any such Derivative Works
+     as a whole, provided Your use, reproduction, and distribution of
+     the Work otherwise complies with the conditions stated in this License
+     and your own copyright statement or terms and conditions do not conflict
+     the conditions stated in the License including section 3.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work
+by You to the Licensor shall be under the terms and conditions of
+this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify
+the terms of any separate license agreement you may have executed
+with Licensor regarding such Contributions.
+
+6. Trademarks.  This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+agreed to in writing, Licensor provides the Work (and each
+Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied, including, without limitation, any warranties or conditions
+of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any
+risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise,
+unless required by applicable law (such as deliberate and grossly
+negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special,
+incidental, or consequential damages of any character arising as a
+result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses), even if such Contributor
+has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+the Work or Derivative Works thereof, You may choose to offer,
+and charge a fee for, acceptance of support, warranty, indemnity,
+or other liability obligations and/or rights consistent with this
+License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf
+of any other Contributor, and only if You agree to indemnify,
+defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason
+of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following
+boilerplate notice, with the fields enclosed by brackets "[]"
+replaced with your own identifying information. (Don't include
+the brackets!) The text should be enclosed in the appropriate
+comment syntax for the file format. We also recommend that a
+file or class name and description of purpose be included on the
+same "printed page" as the copyright notice for easier
+identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Flora License, Version 1.1 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://floralicense.org/license/
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..2f9d481
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,3 @@
+Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Flora.
+Please, see the LICENSE.Flora file for Flora terms and conditions.
diff --git a/include/image-viewer.h b/include/image-viewer.h
new file mode 100755 (executable)
index 0000000..fc76fca
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *       http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <Elementary.h>
+#include <dlog.h>
+
+#undef LOG_TAG
+#define LOG_TAG "IV-APP"
+
+#define IV_MSG_FATAL(fmt, arg...)      \
+       do { \
+               LOGE("[%s : %05d]" fmt "\n", __func__, __LINE__, ##arg); \
+       } while(0)
+
+#define IV_MSG_ERROR(fmt, arg...)      LOGE("[%s : %05d]" fmt "\n", __func__, __LINE__, ##arg)
+#define IV_MSG_HIGH(fmt, arg...)       LOGE("[%s : %05d]" fmt "\n", __func__, __LINE__, ##arg)
+
+#define IV_ASSERT(expr) \
+       do { \
+               if( !(expr) )                                   \
+               {                                                       \
+                       IV_MSG_FATAL("[%s] ASSERT : " #expr , __func__ );       \
+               } \
+       } while(0)
+
+
+
+#define iv_ret_if(expr) do { \
+                if(expr) { \
+                        fprintf(stderr, "(%s) -> %s:%d() return\n", #expr, __func__, __LINE__); \
+                        return; \
+                } \
+        } while (0)
+
+#define iv_retv_if(expr, val) do { \
+                if(expr) { \
+                        fprintf(stderr, "(%s) -> %s():%d return\n", #expr, __func__, __LINE__); \
+                        return (val); \
+                } \
+        } while (0)
+
+/*
+
+       win_main : elm_win
+           |--> conformant : elm_conformant
+               |--> lyBase
+               |--> lyClient : evas object which is created by ug client.
+*/
+typedef struct {
+       int win_w;
+       int win_h;
+
+       Evas *evas;
+
+       Evas_Object *win_main;
+
+       Evas_Object *conformant;
+
+       Evas_Object *black_obj;
+
+       Evas_Object *lyBase;
+
+       Evas_Object *lyClient;
+
+       ui_gadget_h iv_ug;
+
+       const char* iv_param_path;
+
+       service_h service_handle;
+
+} appdata_iv;
+
diff --git a/org.tizen.image-viewer.manifest b/org.tizen.image-viewer.manifest
new file mode 100644 (file)
index 0000000..566e8be
--- /dev/null
@@ -0,0 +1,13 @@
+<manifest>
+       <define>
+               <domain name="org.tizen.image-viewer" policy="shared"/>
+       </define>
+       <assign>
+               <filesystem path="/opt/share/icons/default/small/org.tizen.image-viewer.png" label="_"/>
+               <filesystem path="/opt/share/packages/org.tizen.image-viewer.xml" label="_"/>
+       </assign>
+       <request>
+               <domain name="org.tizen.image-viewer"/>
+       </request>
+</manifest>
+
diff --git a/org.tizen.image-viewer.rule b/org.tizen.image-viewer.rule
new file mode 100755 (executable)
index 0000000..a829e07
--- /dev/null
@@ -0,0 +1,185 @@
+org.tizen.image-viewer system::home rwxat
+org.tizen.image-viewer system::vconf rwxat
+org.tizen.image-viewer system::media rwxat
+org.tizen.image-viewer system::homedir rwxat
+org.tizen.image-viewer system::share rwxat
+org.tizen.image-viewer sys-assert::core rwxat
+org.tizen.image-viewer org.tizen.indicator rwx--
+org.tizen.image-viewer isf rwx--
+org.tizen.image-viewer org.tizen.gallery rwxa-
+org.tizen.image-viewer cbhm rwx--
+org.tizen.image-viewer sound_server rwx--
+org.tizen.image-viewer ail::db rw---
+org.tizen.image-viewer xorg rwx--
+org.tizen.image-viewer media-data::db rw---
+org.tizen.image-viewer pkgmgr r----
+org.tizen.image-viewer efreet r-x--
+org.tizen.image-viewer system-server rwxa-
+org.tizen.image-viewer pulseaudio rwxat
+org.tizen.image-viewer org.tizen.setting rwx--
+org.tizen.image-viewer dbus rwxat
+org.tizen.image-viewer org.tizen.myfile rw---
+org.tizen.image-viewer ug-image-viewer-efl rwxat
+org.tizen.image-viewer stest-service r-x--
+aul org.tizen.image-viewer rwx--
+e17 org.tizen.image-viewer rw---
+org.tizen.myfile org.tizen.image-viewer rwx--
+org.tizen.app-tray org.tizen.image-viewer r-x--
+stest-service org.tizen.image-viewer -w---
+org.tizen.image-viewer contacts-service rwx--
+org.tizen.image-viewer org.tizen.gallery-service rwx--
+org.tizen.image-viewer data-provider-master rw---
+org.tizen.image-viewer data-provider-master::shortcut rw---
+org.tizen.image-viewer data-provider-master::utility rw---
+org.tizen.image-viewer data-provider-master::notification rw---
+org.tizen.image-viewer allshare::svc rwx--
+org.tizen.image-viewer net-config r-x--
+org.tizen.image-viewer media-server rwx--
+org.tizen.image-viewer system::use_internet rwxat
+org.tizen.image-viewer deviced rwxa-
+org.tizen.image-viewer dali rwxat
+org.tizen.image-viewer csc-manager rwx--
+org.tizen.image-viewer crash-worker --x--
+org.tizen.image-viewer download-provider rw---
+org.tizen.image-viewer msg-service rwx--
+org.tizen.image-viewer cloud-content-sync::db rw---
+org.tizen.image-viewer cloud-content-sync rwx--
+org.tizen.image-viewer drmfw rw---
+org.tizen.image-viewer device::video rw---
+org.tizen.image-viewer device::hwcodec rw---
+org.tizen.image-viewer org.tizen.gallery::web-media.db rwx--
+org.tizen.image-viewer org.tizen.gallery::gallery-media.db rwx--
+org.tizen.image-viewer org.tizen.gallery::face-svc.db rwx--
+org.tizen.image-viewer ug-email-viewer-efl rwx--
+org.tizen.image-viewer email-service rwx--
+org.tizen.image-viewer ug-email-docsearch-efl --x--
+org.tizen.image-viewer camera-external-engine rw---
+org.tizen.image-viewer system::vconf_setting rwxat
+org.tizen.image-viewer system::vconf_inouse r----
+org.tizen.image-viewer system::vconf_privacy r----
+org.tizen.image-viewer system::vconf_system rw---
+org.tizen.image-viewer system::vconf_multimedia rw---
+org.tizen.image-viewer system::vconf_network rw---
+org.tizen.image-viewer system::vconf_misc r----
+isf org.tizen.image-viewer r----
+org.tizen.gallery-service org.tizen.image-viewer rwx--
+org.tizen.cluster-home ug-image-viewer-efl r-x--
+org.tizen.lockscreen ug-image-viewer-efl r-x--
+org.tizen.image-viewer xorg::screencapture r----
+org.tizen.image-viewer contacts-service::db rwx--
+org.tizen.image-viewer device::app_logging -w---
+org.tizen.image-viewer org.tizen.smemo rwx--
+org.tizen.image-viewer ims-service::db rw---
+org.tizen.image-viewer app-svc::db rw---
+org.tizen.image-viewer org.tizen.message rwx--
+org.tizen.image-viewer mdm-server rwx--
+org.tizen.image-viewer system::vconf_inhouse rwxat
+media-server org.tizen.image-viewer -w---
+org.tizen.image-viewer contacts-service::svc rw---
+org.tizen.image-viewer contacts-service::phonelog rw---
+org.tizen.image-viewer msg-service::read rw---
+org.tizen.image-viewer msg-service::write rw---
+org.tizen.image-viewer msg-service::wappush rw---
+org.tizen.image-viewer telephony_framework::api_manager r----
+org.tizen.image-viewer telephony_framework::api_modem -w---
+org.tizen.image-viewer org.tizen.contacts rwx--
+org.tizen.image-viewer org.tizen.cluster-home rwx--
+org.tizen.cluster-home org.tizen.image-viewer r-x--
+context-service org.tizen.image-viewer r-x--
+org.tizen.image-viewer smemo::db rw---
+org.tizen.image-viewer org.tizen.browser rw---
+org.tizen.image-viewer org.tizen.image-editor r----
+org.tizen.image-viewer org.tizen.email rwx--
+org.tizen.image-viewer org.tizen.calendar rwx--
+org.tizen.image-viewer calendar-service rwx--
+org.tizen.image-viewer device::sys_logging -w---
+org.tizen.image-viewer email-service::db rw---
+org.tizen.image-viewer webkit2-efl r-x--
+org.tizen.image-viewer data-provider-master::badge rw---
+org.tizen.image-viewer resman::db rw---
+org.tizen.image-viewer map-efl rwxat
+org.tizen.image-viewer ug-email-composer-efl rwxat
+org.tizen.image-viewer ui-gadget::client --x--
+org.tizen.image-viewer secure-storage::pkcs12 r----
+org.tizen.image-viewer email-service::write rw---
+org.tizen.image-viewer calendar-service::svc rw---
+org.tizen.image-viewer ug_bluetooth r-x--
+org.tizen.image-viewer syspopup::db rwx--
+org.tizen.image-viewer bt-service::admin -w---
+org.tizen.image-viewer bt-service::gap -w---
+org.tizen.image-viewer bt-service::manager -w---
+org.tizen.image-viewer system::app_logging -w---
+org.tizen.image-viewer svi-data rwxat
+org.tizen.image-viewer immvibed rwx--
+org.tizen.image-viewer libaccounts-svc::db rw---
+org.tizen.image-viewer org.tizen.volume rwx--
+org.tizen.image-viewer org.tizen.setting::default-resources r-x--
+org.tizen.image-viewer device::camera rw---
+org.tizen.image-viewer device::mdnie rw---
+org.tizen.image-viewer location_fw::client rwx--
+org.tizen.image-viewer pkgmer::db r----
+org.tizen.image-viewer power_manager rwx--
+org.tizen.image-viewer stt-server rwx--
+org.tizen.image-viewer tts-server rwx--
+org.tizen.image-viewer ug-camera-efl rwxat
+org.tizen.image-viewer vcs-server rwx--
+org.tizen.image-viewer image-filter-d::db rw---
+org.tizen.image-viewer location_fw::db rw---
+org.tizen.image-viewer pkgmgr::db rw---
+org.tizen.image-viewer org.tizen.svoice rwx--
+org.tizen.image-viewer org.tizen.dropbox r-x--
+org.tizen.image-viewer org.tizen.facebook r-x--
+org.tizen.image-viewer oma-ds-agent rwx--
+oma-ds-agent org.tizen.image-viewer rwx--
+org.tizen.image-viewer oma-ds-agent::cfg rwxat
+org.tizen.setting org.tizen.image-viewer r-x--
+org.tizen.setting oma-ds-agent::cfg rwx--
+system::use_internet oma-ds-agent rwx--
+oma-ds-agent system::use_internet rwx--
+org.tizen.image-viewer syslogd rwx--
+org.tizen.image-viewer e17 r----
+org.tizen.image-viewer dlogutil r-x--
+org.tizen.image-viewer telephony_framework r-x--
+org.tizen.image-viewer aul r-x--
+org.tizen.image-viewer ode r-x--
+org.tizen.image-viewer sensor-framework r-x--
+org.tizen.image-viewer secure-storage r-x--
+org.tizen.image-viewer starter r-x--
+org.tizen.image-viewer osp-app-service r-x--
+org.tizen.image-viewer osp-security-service r-x--
+org.tizen.image-viewer osp-channel-service r-x--
+org.tizen.image-viewer org.tizen.app-tray r-x--
+org.tizen.image-viewer org.tizen.quickpanel r-x--
+org.tizen.image-viewer connman rwx--
+org.tizen.image-viewer mobicore-daemon r-x--
+org.tizen.image-viewer alarm-server rwx--
+org.tizen.image-viewer brcm_daemon r-x--
+org.tizen.image-viewer resman r-x--
+org.tizen.image-viewer osp-connectivity-service rwx--
+org.tizen.image-viewer push-service rwx--
+org.tizen.image-viewer eas-engine rwx--
+org.tizen.image-viewer org.tizen.data-provider-slave rwx--
+org.tizen.image-viewer org.tizen.data-provider-slave rwx--
+org.tizen.image-viewer usb-server rwx--
+org.tizen.image-viewer mtp-responder rwx--
+org.tizen.image-viewer sdbd rwx--
+ui-gadget::client oma-ds-agent::svc rw---
+org.tizen.image-viewer data-provider-master::notification.client -w---
+org.tizen.image-viewer samsung-account-front r-x--
+org.tizen.image-viewer worldclock::db rw---
+org.tizen.image-viewer thumb-server r----
+org.tizen.image-viewer data-provider-master::shortcut.shortcut -w---
+org.tizen.image-viewer org.tizen.smartsearch --x--
+org.tizen.image-viewer ug-map-efl rwxat
+system::use_internet org.tizen.image-viewer -w---
+org.tizen.image-viewer obexd r-x--
+org.tizen.image-viewer phone-misc::db rw---
+org.tizen.image-viewer msg-service::db rw---
+org.tizen.image-viewer org.tizen.fileshare-service rwxat
+org.tizen.image-viewer wifi_direct_manager rw---
+org.tizen.fileshare-service org.tizen.image-viewer r-x--
+org.tizen.image-viewer nfc-manager rwx--
+org.tizen.image-viewer nfc-manager::p2p rwx--
+org.tizen.image-viewer nfc-manager::admin rwx--
+org.tizen.image-viewer ug-setting-gallery-efl rwxat
+org.tizen.image-viewer org.tizen.music-player --x--
diff --git a/org.tizen.image-viewer.xml b/org.tizen.image-viewer.xml
new file mode 100755 (executable)
index 0000000..e9e0b38
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.image-viewer" version="0.3.0-1" install-location="internal-only">
+       <label>org.tizen.image-viewer</label>
+       <author email="jcastle.ahn@samsung.com" href="www.samsung.com">Jisung Ahn</author>
+       <author email="hw4444.kim@samsung.com" href="www.samsung.com">Hyunwoo Kim</author>
+       <description>Image viewer Application</description>
+       <ui-application appid="org.tizen.image-viewer" exec="/usr/apps/org.tizen.image-viewer/bin/image-viewer" nodisplay="true" multiple="false" type="capp" taskmanage="true">
+               <icon>org.tizen.image-viewer.png</icon>
+               <label>Image viewer</label>
+               <label xml:lang="ar-ae">عرض الصور</label>
+               <label xml:lang="az-az">Şəkil göstərici</label>
+               <label xml:lang="bg-bg">Програма за преглед на изображения</label>
+               <label xml:lang="ca-es">Visor d'imatges</label>
+               <label xml:lang="cs-cz">Prohlížeč obrázků</label>
+               <label xml:lang="da-dk">Billedvisning</label>
+               <label xml:lang="de-de">Bildanzeigeprogramm</label>
+               <label xml:lang="el-gr">Προβολή εικόνων</label>
+               <label xml:lang="en-gb">Image viewer</label>
+               <label xml:lang="en-ph">Image viewer</label>
+               <label xml:lang="en-us">Image viewer</label>
+               <label xml:lang="es-es">Visor de imagenes</label>
+               <label xml:lang="es-mx">Visor de imagenes</label>
+               <label xml:lang="et-ee">Pildivaatur</label>
+               <label xml:lang="eu-es">Irudi bisorea</label>
+               <label xml:lang="fi-fi">Kuvan katseluohjelma</label>
+               <label xml:lang="fr-ca">Visualiseur d'images</label>
+               <label xml:lang="fr-fr">Visualiseur d'images</label>
+               <label xml:lang="ga-ie">Amharcoir iomhanna</label>
+               <label xml:lang="gl-es">Visor de imaxes</label>
+               <label xml:lang="hi-in">छवि व्यूअर</label>
+               <label xml:lang="hr-hr">Preglednik slika</label>
+               <label xml:lang="hu-hu">Képmegjelenítő</label>
+               <label xml:lang="hy-am">Պատկերների դիտարկիչ</label>
+               <label xml:lang="is-is">Myndbirting</label>
+               <label xml:lang="it-it">Visualizzatore immagini</label>
+               <label xml:lang="ja-jp">画像ビューア</label>
+               <label xml:lang="ka-ge">სურათის დამთვალიერებელი</label>
+               <label xml:lang="kk-kz">Сурет қарап шығу бағдарламасы</label>
+               <label xml:lang="ko-kr">이미지뷰어</label>
+               <label xml:lang="lt-lt">Vaizdų žiūryklė</label>
+               <label xml:lang="lv-lv">Attēlu skatītājs</label>
+               <label xml:lang="mk-mk">Прегледник на слики</label>
+               <label xml:lang="nb-no">Bildevisning</label>
+               <label xml:lang="nl-nl">Afbeeldingenviewer</label>
+               <label xml:lang="pl-pl">Przeglądarka obrazów</label>
+               <label xml:lang="pt-br">Visualizador de imagens</label>
+               <label xml:lang="pt-pt">Visualizador de imagens</label>
+               <label xml:lang="ro-ro">Vizualizator de imagini</label>
+               <label xml:lang="ru-ru">Просмотр изображения</label>
+               <label xml:lang="sk-sk">Zobrazovač obrázkov</label>
+               <label xml:lang="sl-si">Pregledovalnik slik</label>
+               <label xml:lang="sr-rs">Prikazivač slika</label>
+               <label xml:lang="sv-se">Bildvisare</label>
+               <label xml:lang="tr-tr">Resim goruntuleyici</label>
+               <label xml:lang="uk-ua">Перегляд зображень</label>
+               <label xml:lang="uz-uz">Rasmni ko‘rib chiqish vositasi</label>
+               <label xml:lang="zh-cn">图片浏览器</label>
+               <label xml:lang="zh-hk">圖像檢視器</label>
+               <label xml:lang="zh-sg">图片浏览器</label>
+               <label xml:lang="zh-tw">影像檢視器</label>
+               <application-service>
+                       <operation name="http://tizen.org/appcontrol/operation/view"/>
+                       <uri name="http"/>
+                       <uri name="https"/>
+                       <mime name="image/jpeg"/>
+                       <mime name="image/bmp"/>
+                       <mime name="image/png"/>
+                       <mime name="image/gif"/>
+                       <mime name="image/vnd.wap.wbmp"/>
+               </application-service>
+               <application-service>
+                       <operation name="http://tizen.org/appcontrol/operation/view"/>
+                       <mime name="image/jpeg"/>
+                       <mime name="image/bmp"/>
+                       <mime name="image/png"/>
+                       <mime name="image/gif"/>
+                       <mime name="image/vnd.wap.wbmp"/>
+               </application-service>
+               <application-service>
+                       <operation name="http://tizen.org/appcontrol/operation/crop"/>
+                       <mime name="image/jpeg"/>
+                       <mime name="image/bmp"/>
+                       <mime name="image/png"/>
+                       <mime name="image/gif"/>
+                       <mime name="image/vnd.wap.wbmp"/>
+               </application-service>
+               <application-service>
+                       <operation name="http://tizen.org/appcontrol/operation/image/crop"/>
+                       <mime name="image/jpeg"/>
+                       <mime name="image/bmp"/>
+                       <mime name="image/png"/>
+                       <mime name="image/gif"/>
+                       <mime name="image/vnd.wap.wbmp"/>
+               </application-service>
+       </ui-application>
+</manifest>
diff --git a/packaging/org.tizen.image-viewer.changes b/packaging/org.tizen.image-viewer.changes
new file mode 100644 (file)
index 0000000..0cf608a
--- /dev/null
@@ -0,0 +1,3 @@
+* Thu Jul 4 2013 Jisung Ahn <jcastle.ahn@samsung.com>
+- update smack rule
+
diff --git a/packaging/org.tizen.image-viewer.spec b/packaging/org.tizen.image-viewer.spec
new file mode 100755 (executable)
index 0000000..e73ce83
--- /dev/null
@@ -0,0 +1,59 @@
+Name:       org.tizen.image-viewer
+Summary:    Image Viewer Application v1.0
+Version:    1.0.83
+Release:    1
+Group:      misc
+License:    Flora Software License
+
+Source0:    %{name}-%{version}.tar.gz
+Requires: pkgmgr
+BuildRequires:  pkgconfig(appcore-efl)
+BuildRequires:  pkgconfig(elementary)
+BuildRequires:  pkgconfig(edje)
+BuildRequires:  pkgconfig(evas)
+BuildRequires:  pkgconfig(ecore)
+BuildRequires:  pkgconfig(ecore-x)
+BuildRequires:  pkgconfig(ecore-input)
+BuildRequires:  pkgconfig(bundle)
+BuildRequires:  pkgconfig(sensor)
+BuildRequires:  pkgconfig(ui-gadget-1)
+BuildRequires:  pkgconfig(utilX)
+BuildRequires:  pkgconfig(appsvc)
+BuildRequires:  pkgconfig(vconf)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(capi-appfw-application)
+
+BuildRequires:  cmake
+BuildRequires:  edje-bin
+BuildRequires:  embryo-bin
+
+%description
+Image Viewer Application v1.0.
+
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+
+%build
+
+cmake . -DCMAKE_INSTALL_PREFIX="/usr/apps/org.tizen.image-viewer" -DRESDIR="/usr/apps/org.tizen.image-viewer/res" -DDATADIR="/opt/usr/apps/org.tizen.image-viewer/data"
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+mkdir -p %{buildroot}/usr/share/license
+
+
+%files
+%defattr(-,root,root,-)
+%manifest org.tizen.image-viewer.manifest
+/opt/etc/smack/accesses.d/org.tizen.image-viewer.rule
+/usr/apps/org.tizen.image-viewer/*
+/usr/share/icons/default/small/org.tizen.image-viewer.png
+/usr/share/packages/org.tizen.image-viewer.xml
+
+/usr/share/license/%{name}
+
diff --git a/res/appicon/org.tizen.image-viewer.png b/res/appicon/org.tizen.image-viewer.png
new file mode 100755 (executable)
index 0000000..e20bd23
Binary files /dev/null and b/res/appicon/org.tizen.image-viewer.png differ
diff --git a/res/layout/iv-main.edc b/res/layout/iv-main.edc
new file mode 100755 (executable)
index 0000000..f3a2fbf
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *       http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+// main view
+
+collections {
+group {
+       name: "mainview";
+
+       parts {
+
+               part { name: "background";
+                       type: RECT;
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               color: 0 0 0 255;
+                               visible: 1;
+                               rel1 { relative: 0.0 0.0;}
+                               rel2 { relative: 1.0 1.0;}
+                       }
+               }
+
+               part {
+                       name: "elm.swallow.content";
+                       type: SWALLOW;
+                       scale: 1;
+                       mouse_events: 1;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                               visible: 1;
+                       }
+               }
+
+       }
+}
+}              // end of collection
diff --git a/src/image-viewer.c b/src/image-viewer.c
new file mode 100755 (executable)
index 0000000..3e63db0
--- /dev/null
@@ -0,0 +1,824 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *       http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdbool.h>
+
+#include <Elementary.h>
+#include <app.h>
+
+#include <utilX.h>
+#include <Evas.h>
+#include <Ecore_X.h>
+
+#include <ui-gadget-module.h>
+#include <ui-gadget.h>
+
+#include "image-viewer.h"
+
+#define PACKAGE "image-viewer"
+#define LOCALEDIR "/usr/apps/com.image-viewer/res/locale"
+
+#define UG_MODE_SINGLE "SINGLE"
+#define UG_STANDALONE_VALUE "TRUE"
+
+#define UG_BUNDLE_KEY_VIEW_MODE                "View Mode"
+#define UG_BUNDLE_KEY_PATH                             "Path"
+#define UG_BUNDLE_KEY_SETAS_TYPE               "Setas type"
+#define UG_BUNDLE_KEY_STANDALONE               "Standalone"
+
+#define UG_BUNDLE_VALUE_VIEW_MODE_SLIDESHOW   "SLIDESHOW"
+
+#define SERVICE_OPERATION_CROP "http://tizen.org/appcontrol/operation/crop"
+#define SERVICE_OPERATION_IMAGE_CROP "http://tizen.org/appcontrol/operation/image/crop"
+
+static const char *_conver_error(int err)
+{
+       switch(err)
+       {
+               case SERVICE_ERROR_NONE:
+                       return "Successful";
+               case SERVICE_ERROR_INVALID_PARAMETER:
+                       return "Invalid parameter";
+               case SERVICE_ERROR_KEY_NOT_FOUND:
+                       return "Specified key not found";
+               case SERVICE_ERROR_OUT_OF_MEMORY:
+                       return "Out of memory";
+               case SERVICE_ERROR_INVALID_DATA_TYPE:
+                       return "Invalid data type";
+               default:
+               {
+                       static char error[128];
+                       sprintf(error, "Unknow Error : %d(0x%08x)", err, err);
+                       return error;
+               }
+       }
+       return NULL;
+}
+
+
+
+static void dump_obj(Evas_Object *obj, int lvl, int max)
+{
+       Eina_List *list = evas_object_smart_members_get(obj);
+
+       if ( lvl == 0 )
+       {
+               int x, y, w, h;
+
+               evas_object_geometry_get(obj, &x, &y, &w, &h);
+               Eina_Bool repeat = evas_object_repeat_events_get(obj);
+               Eina_Bool pass = evas_object_pass_events_get(obj);
+               Eina_Bool visible = evas_object_visible_get(obj);
+               Eina_Bool propagate = evas_object_propagate_events_get(obj);
+
+               IV_MSG_HIGH("Obj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", evas_object_name_get(obj), evas_object_type_get(obj), obj, x, y, w, h, pass, repeat, visible, propagate);
+               lvl++;
+       }
+
+       Evas_Object *data;
+       Eina_List *l;
+
+       for (l = list, data = (Evas_Object *)eina_list_data_get(l); l; l = eina_list_next(l), data = (Evas_Object *)eina_list_data_get(l))
+       {
+               int x, y, w, h;
+
+               evas_object_geometry_get(data, &x, &y, &w, &h);
+               Eina_Bool repeat = evas_object_repeat_events_get(data);
+               Eina_Bool pass = evas_object_pass_events_get(data);
+               Eina_Bool visible = evas_object_visible_get(data);
+               Eina_Bool propagate = evas_object_propagate_events_get(data);
+
+               if ( lvl == 0 )
+               {
+                       IV_MSG_HIGH("Obj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", evas_object_name_get(data), evas_object_type_get(data), data,  x, y, w, h, pass, repeat, visible, propagate);
+               }
+               else
+               {
+                       char *space = (char *)malloc(sizeof(char) * lvl*2+1 );
+                       int i;
+                       for ( i = 0; i < lvl*2; i++)
+                       {
+                               space[i] = ' ';
+                       }
+
+                       space[lvl*2] = '\0';
+
+                       IV_MSG_HIGH("%sObj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", space, evas_object_name_get(data), evas_object_type_get(data), data, x, y, w, h, pass, repeat, visible, propagate);
+
+                       free(space);
+               }
+
+               if ( lvl < max )
+               {
+                       dump_obj(data, lvl+1, max);
+               }
+
+       }
+}
+
+
+static Eina_Bool _exit_timer_cb(void *data)
+{
+       IV_MSG_HIGH("%s is called", __func__);
+
+       elm_exit();             // will tirgger app_terminated
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_rot_changed_cb(void *data, Evas_Object *obj, void *event)
+{
+       appdata_iv *ap = (appdata_iv *)data;
+
+       int changed_ang;
+
+       changed_ang = elm_win_rotation_get(obj);
+
+       IV_MSG_HIGH("Rotation is changed. %d", changed_ang);
+#if 0
+       if (changed_ang != current_ang)
+       {
+       current_ang = changed_ang;
+       // Perform an UI update according to the given rotation angle.
+       // Do not call elm_win_rotation_set / elm_win_rotation_with_resize_set.
+       // ecore_evas has already called elm_win_rotation_set / elm_win_rotation_with_resize_set function.
+       ...
+       }
+#endif
+       int degree = 0;
+       enum ug_event evt = UG_EVENT_NONE;
+
+       switch(changed_ang)
+       {
+               case 0:
+              degree = 0;
+              evt = UG_EVENT_ROTATE_PORTRAIT;
+              break;
+               case 90:
+              degree = 90;
+              evt = UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN;
+              break;
+
+               case 180:
+              degree = 180;
+              evt = UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN;
+              break;
+
+               case 270:
+              evt = UG_EVENT_ROTATE_LANDSCAPE;
+              degree = 270;
+              break;
+               default:
+                       IV_MSG_ERROR("Unknown rotation degree. %d", changed_ang);
+                       return;
+                       break;
+       }
+
+       ug_send_event( evt );
+
+}
+
+
+/**
+* @brief       The win delete function
+*
+* @param data
+* @param obj
+* @param event_info
+*/
+static void _win_del(void *data, Evas_Object *obj, void *event_info)
+{
+       IV_MSG_HIGH("%s is called", __func__);
+       elm_exit();
+}
+
+
+/**
+* @brief       Create the main window
+*
+* @param name  The title of the window
+*
+* @return  the win on sucess
+*/
+static Evas_Object* _create_win(const char *name)
+{
+       iv_retv_if(name == NULL, NULL);
+       Evas_Object *eo;
+
+       eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
+       if (eo)
+       {
+               elm_win_title_set(eo, name);
+               evas_object_smart_callback_add(eo, "delete,request", _win_del, NULL);
+               int w, h;
+               ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+               IV_MSG_HIGH("x_window_size %d, %d", w, h);
+               evas_object_resize (eo, w, h);
+       }
+
+       return eo;
+}
+
+Evas_Object* _create_bg(Evas_Object* parent, int r, int g, int b)
+{
+    IV_ASSERT(parent != NULL);
+
+       Evas_Object *bg = elm_bg_add(parent);
+       evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+       elm_win_resize_object_add(parent, bg);
+
+       elm_bg_color_set(bg, r,  g, b);
+
+       evas_object_show(bg);
+
+       return bg;
+}
+
+/**
+* @brief The layout callback after ug created
+*
+* @param ug    The ug created
+* @param mode  The UG mode, FULLVIEW or FRAMEVIEW
+* @param priv  The privite data
+*/
+void _ug_layout_cb(ui_gadget_h ug, enum ug_mode mode, void* priv)
+{
+       IV_MSG_HIGH("ug Layout CB. UG=0x%08x Priv=0x%08x Mode=%d", ug, priv, mode);
+
+       if (!ug || !priv)
+       {
+               IV_MSG_ERROR("Abnormal value. UG=0x%08x Priv=0x%08x Mode=%d", ug, priv, mode);
+               return;
+       }
+
+       appdata_iv *ap = (appdata_iv *)priv;
+
+       Evas_Object *win = ap->win_main;
+       IV_ASSERT(win != NULL);
+
+       ap->lyClient = ug_get_layout(ug);
+
+       if (ap->lyClient == NULL)
+       {
+               IV_MSG_ERROR( "ug_get_layout is failed");
+               return;
+       }
+
+       if(ap->lyBase == NULL)
+       {
+               ap->lyBase = elm_layout_add(ap->conformant);
+
+               evas_object_name_set(ap->lyBase, "IV Base");
+
+               IV_MSG_HIGH("Load edj : %s", PREFIX"/res/edje/iv-main.edj");
+               elm_layout_file_set(ap->lyBase, PREFIX"/res/edje/iv-main.edj", "mainview");
+       }
+
+       elm_object_part_content_set(ap->lyBase, "elm.swallow.content", ap->lyClient);
+
+// Set client contents.
+
+       switch (mode)
+       {
+               case UG_MODE_FULLVIEW:
+                       ug_disable_effect(ug);
+
+                               elm_win_conformant_set(win, EINA_TRUE);
+
+                               evas_object_size_hint_weight_set(ap->conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+                       elm_object_content_set(ap->conformant, ap->lyBase);
+
+                               elm_win_resize_object_add(win, ap->conformant);
+
+                               evas_object_show(ap->conformant);
+
+//                     dump_obj(ap->conformant, 0, 10);
+                       break;
+               default:
+                       IV_MSG_ERROR("Unknow UG mode : %d", mode);
+                       break;
+       }
+
+       if(ap->black_obj)
+       {
+               evas_object_del(ap->black_obj);
+               ap->black_obj = NULL;
+       }
+}
+
+/**
+* @brief       The return callback on ug send result
+*
+* @param ug    The ug created
+* @param result        The result received from ug
+* @param priv  The privite data
+*/
+void _ug_result_cb(ui_gadget_h ug, service_h reply, void *priv)
+{
+       IV_MSG_HIGH("UG Result CB.");
+
+       if (!ug || !priv)
+       {
+               IV_MSG_ERROR("Abnormal value. UG=0x%08x Priv=0x%08x", ug, priv);
+               return;
+       }
+
+       appdata_iv *ap = (appdata_iv *)priv;
+
+       int ret = service_reply_to_launch_request(reply, ap->service_handle, SERVICE_RESULT_SUCCEEDED);
+       if (ret != SERVICE_ERROR_NONE)
+       {
+               IV_MSG_ERROR("service_reply_to_launch_request failed! [%s]", _conver_error(ret));
+       }
+}
+
+/**
+* @brief The close callback on ug destroy
+*
+* @param ug    The ug created
+* @param priv  The privite data
+*/
+void _ug_destroy_cb(ui_gadget_h ug, void *priv)
+{
+       IV_MSG_HIGH("UG will destroy");
+
+       if (!ug || !priv)
+       {
+               IV_MSG_ERROR("Abnormal value. UG=0x%08x Priv=0x%08x", ug, priv);
+               return;
+       }
+
+       appdata_iv *ap = (appdata_iv *)priv;
+
+       if(ap->iv_ug)
+       {
+               ug_destroy(ap->iv_ug);
+               ap->iv_ug = NULL;
+       }
+
+       elm_exit();
+
+// Enable only when find memory leak
+//     ecore_timer_add(0.5, _exit_timer_cb, NULL);
+}
+
+/**
+* @brief       Create the image-viewer-ug
+*
+* @param data  The app data
+*
+* @return  ug on sucess, NULL on fail
+*/
+ui_gadget_h _create_ug(void* data)
+{
+       iv_retv_if(data == NULL, NULL);
+
+       appdata_iv *ap = (appdata_iv *)data;
+
+       ui_gadget_h ug;
+       struct ug_cbs cbs = {0,};
+
+       cbs.layout_cb = _ug_layout_cb;
+       cbs.result_cb = _ug_result_cb;
+       cbs.destroy_cb = _ug_destroy_cb;
+       cbs.priv = ap;
+
+       IV_MSG_HIGH("UG Create : Begin");
+
+       ug = ug_create(NULL, "image-viewer-efl", UG_MODE_FULLVIEW, ap->service_handle, &cbs);
+
+       IV_MSG_HIGH("UG Create : End");
+       return ug;
+}
+
+
+static bool _iter_extra_data_cb(service_h service, const char *key, void *user_data)
+{
+       char *value = NULL;
+
+       IV_MSG_HIGH("  Key=%s Value=%s", key, value);
+
+       int ret = service_get_extra_data(service, key, &value);
+       if (ret != SERVICE_ERROR_NONE)
+       {
+               IV_MSG_ERROR("service_get_extra_data %s failed, [%s]", key, _conver_error(ret));
+               return false;
+       }
+
+       free(value);
+
+       return true;
+}
+
+
+static bool _app_create(void *user_data)
+{
+// Hook to take necessary actions before main event loop starts
+// Initialize UI resources and application's data
+// If this function returns true, the main loop of application starts
+// If this function returns false, the application is terminated
+       IV_ASSERT(user_data != NULL);
+
+       IV_MSG_HIGH("App Create");
+
+       elm_config_preferred_engine_set("opengl_x11");  //enabling the OpenGL as the backend of the EFL.
+
+       appdata_iv *ap = (appdata_iv *) user_data;
+
+       Evas_Object *win = _create_win(PACKAGE);
+       if ( win == NULL )
+       {
+               IV_MSG_ERROR("Cannot create app. pkg=%s", PACKAGE);
+               return false;
+       }
+
+       ap->win_main = win;
+
+       UG_INIT_EFL(ap->win_main, UG_OPT_INDICATOR_ENABLE);     // Init UG module
+
+       if (elm_win_wm_rotation_supported_get(win) == EINA_TRUE)
+       {
+               int rots[4] = { 0, 90, 180, 270 };
+               elm_win_wm_rotation_available_rotations_set(win, &rots, 4);
+       }
+       else
+       {
+               IV_MSG_HIGH("Rotation is not supported. ");
+       }
+
+       evas_object_smart_callback_add(win, "wm,rotation,changed", _rot_changed_cb, user_data);
+
+       //create conformant
+       ap->conformant = elm_conformant_add(win);
+       evas_object_name_set(ap->conformant, "conformant");
+
+       return true;
+}
+
+static void _app_service(service_h service, void *user_data)
+{
+// How to get Alarm service????
+       appdata_iv *ap = (appdata_iv *)user_data;
+
+       IV_MSG_HIGH("%s", __func__);
+
+       char *operation = NULL;
+       char *uri = NULL;
+
+       int ret = service_get_operation(service, &operation);
+       if (ret != SERVICE_ERROR_NONE)
+       {
+               IV_MSG_ERROR("service_get_operation failed, [%s]", _conver_error(ret));
+               goto EXIT;
+       }
+
+       if ( operation == NULL )
+       {
+               IV_MSG_ERROR("Operation cannot be NULL.");
+               goto EXIT;
+       }
+
+       ret = service_foreach_extra_data(service, _iter_extra_data_cb, NULL);
+       if (ret != SERVICE_ERROR_NONE)
+       {
+               IV_MSG_ERROR("service_foreach_extra_data failed, [%s]", _conver_error(ret));
+               goto EXIT;
+       }
+
+       ret = service_get_uri(service, &uri);
+       if (ret != SERVICE_ERROR_NONE)
+       {
+               IV_MSG_ERROR("service_get_uri failed, [%s]", _conver_error(ret));
+               goto EXIT;
+       }
+
+       IV_MSG_HIGH( "Operation=%s URI=%s", operation, uri);
+
+       ret = service_clone(&ap->service_handle, service);
+       if (ret != SERVICE_ERROR_NONE)
+       {
+               IV_MSG_ERROR("service_clone failed, [%s]", _conver_error(ret));
+               goto EXIT;
+       }
+
+       if( strcmp(operation, SERVICE_OPERATION_VIEW) == 0 || strcmp(operation, SERVICE_OPERATION_DEFAULT) == 0)
+       {
+               if(uri) // uri can entered through argv[1]
+               {
+                       ap->iv_param_path = uri;
+               }
+               if ( ap->iv_param_path == NULL )
+               {
+                       IV_MSG_ERROR("Entered path is NULL");
+                       goto EXIT;
+               }
+
+               IV_MSG_HIGH("*****************************");
+               IV_MSG_HIGH("image-viewer : Case View");
+               IV_MSG_HIGH("  URI path  : %s", ap->iv_param_path);
+               IV_MSG_HIGH("*****************************");
+
+               free(operation);
+
+               //disable launch effect at slide show
+               char* szMode = NULL;
+               service_get_extra_data (service, UG_BUNDLE_KEY_VIEW_MODE, &szMode);
+               if (szMode != NULL)
+               {
+                       if(strncmp(szMode, UG_BUNDLE_VALUE_VIEW_MODE_SLIDESHOW, strlen(UG_BUNDLE_VALUE_VIEW_MODE_SLIDESHOW)) == 0)
+                       {
+                               IV_MSG_HIGH("Disabe effect for slideshow");
+                               utilx_set_window_effect_style((Display*)ecore_x_display_get(), elm_win_xwindow_get(ap->win_main),
+                                       UTILX_EFFECT_TYPE_MAP, UTILX_EFFECT_STYLE_NONE);
+                               utilx_set_window_effect_style((Display*)ecore_x_display_get(), elm_win_xwindow_get(ap->win_main),
+                                       UTILX_EFFECT_TYPE_UNMAP, UTILX_EFFECT_STYLE_NONE);
+                       }
+                       free(szMode);
+               }
+       }
+       else if( strcmp(operation, SERVICE_OPERATION_CROP) == 0 || strcmp(operation, SERVICE_OPERATION_IMAGE_CROP) == 0)
+       {
+               char *value = NULL;             // Will freed on terminate
+
+               if(uri) // uri can entered through argv[1]
+               {
+                       ap->iv_param_path = uri;
+               }
+               if ( ap->iv_param_path == NULL )
+               {
+                       IV_MSG_ERROR("Entered path is NULL");
+                       goto EXIT;
+               }
+
+               service_add_extra_data(ap->service_handle, UG_BUNDLE_KEY_VIEW_MODE, "SETAS");
+
+               service_get_extra_data(ap->service_handle, UG_BUNDLE_KEY_SETAS_TYPE, &value);
+               if(value == NULL)
+               {
+                       service_add_extra_data(ap->service_handle, UG_BUNDLE_KEY_SETAS_TYPE, "Crop");
+               }
+
+               IV_MSG_HIGH("*****************************");
+               IV_MSG_HIGH("image-viewer : Case Crop");
+               IV_MSG_HIGH("  URI path  : %s", ap->iv_param_path);
+               IV_MSG_HIGH("*****************************");
+
+               free(operation);
+       }
+       else
+       {
+               IV_MSG_ERROR("Unknown operation. %s", operation);
+               free(operation);
+
+               if ( ap->iv_param_path == NULL )
+               {
+                       IV_MSG_ERROR("Entered path is NULL");
+                       goto EXIT;
+               }
+       }
+
+       if(ap->iv_param_path == NULL)
+       {
+               IV_MSG_ERROR("File path is NULL. cannot create UG");
+               goto EXIT;
+       }
+
+       elm_win_activate(ap->win_main);
+
+       evas_object_show(ap->win_main);
+
+       if(ap->iv_ug != NULL)
+       {
+               // Create Previous UG if exist
+               IV_MSG_HIGH("Removing previous UG=0x%08x", ap->iv_ug);
+
+               service_h s = NULL;
+               service_create(&s);
+
+               service_add_extra_data(s, "Destroy", "OK");
+
+               ug_send_message(ap->iv_ug, s);
+               service_destroy(s);
+
+               ug_destroy(ap->iv_ug);
+               ap->iv_ug = NULL;
+       }
+
+       char *view_mode = NULL;
+       service_get_extra_data(ap->service_handle, UG_BUNDLE_KEY_VIEW_MODE, &view_mode);
+       if(view_mode == NULL)
+       {
+               service_add_extra_data(ap->service_handle, UG_BUNDLE_KEY_VIEW_MODE, UG_MODE_SINGLE);
+       }
+
+       service_add_extra_data(ap->service_handle, UG_BUNDLE_KEY_PATH, ap->iv_param_path);
+
+       service_add_extra_data(ap->service_handle, UG_BUNDLE_KEY_STANDALONE, UG_STANDALONE_VALUE);
+
+       ap->iv_ug = _create_ug(ap);
+       if(ap->iv_ug == NULL)
+       {
+               IV_MSG_HIGH("create_ug failed. Terminated");
+               elm_exit();
+               return;
+       }
+
+       return;
+
+EXIT:
+       if(ap->service_handle)
+               service_destroy(ap->service_handle);
+       ap->service_handle = NULL;
+       elm_exit();
+       return;
+
+}
+
+
+void _app_pause(void *user_data)
+{
+// Take necessary actions when application becomes invisible.
+       IV_MSG_HIGH("%s", __func__);
+
+       appdata_iv *ap = (appdata_iv *)user_data;
+
+       if(ap->black_obj == NULL)
+       {
+               ap->black_obj = evas_object_rectangle_add(evas_object_evas_get(ap->conformant));
+               evas_object_color_set(ap->black_obj, 0, 0, 0, 255); /* black bg */
+       }
+
+       ap->lyBase = elm_object_content_unset(ap->conformant);
+
+       ap->lyClient = elm_object_part_content_unset(ap->lyBase, "elm.swallow.content");
+
+       elm_object_part_content_set(ap->lyBase, "elm.swallow.content", ap->black_obj);
+       evas_object_show(ap->black_obj);
+
+       evas_object_hide(ap->lyClient);
+
+       ug_pause();
+}
+
+void _app_resume(void *user_data)
+{
+// Take necessary actions when application becomes visible.
+       IV_MSG_HIGH("%s", __func__);
+
+       appdata_iv *ap = (appdata_iv *)user_data;
+
+       elm_object_part_content_set(ap->lyBase, "elm.swallow.content", ap->lyClient);
+
+       elm_object_content_set(ap->conformant, ap->lyBase);
+
+       evas_object_show(ap->lyClient);
+
+       if(ap->black_obj)
+       {
+               evas_object_del(ap->black_obj);
+               ap->black_obj = NULL;
+       }
+
+       ug_resume();
+}
+
+void _app_terminate(void *user_data)
+{
+// Release all resources
+       IV_MSG_HIGH("%s", __func__);
+
+       appdata_iv *ap = (appdata_iv *)user_data;
+
+       if(ap->black_obj)
+       {
+               evas_object_del(ap->black_obj);
+               ap->black_obj = NULL;
+       }
+
+       if(ap->service_handle) {
+               service_destroy(ap->service_handle);
+               ap->service_handle = NULL;
+       }
+
+       if(ap->iv_ug)
+       {
+               ug_destroy(ap->iv_ug);
+               ap->iv_ug = NULL;
+       }
+
+       if(ap->lyClient)
+       {
+               evas_object_del(ap->lyClient);
+               ap->lyClient = NULL;
+       }
+
+       if(ap->lyBase)
+       {
+               evas_object_del(ap->lyBase);
+               ap->lyBase = NULL;
+       }
+
+       if(ap->conformant)
+       {
+               evas_object_del(ap->conformant);
+               ap->conformant = NULL;
+       }
+
+       IV_MSG_HIGH("%s terminated.", __func__);
+}
+
+void _region_changed(void *user_data)
+{
+       IV_MSG_HIGH("%s", __func__);
+       // Not used yet.
+}
+
+void _low_battery(void *user_data)
+{
+       IV_MSG_HIGH("%s", __func__);
+       ug_send_event( UG_EVENT_LOW_BATTERY );
+}
+
+void _low_memory(void *user_data)
+{
+       IV_MSG_HIGH("%s", __func__);
+       ug_send_event( UG_EVENT_LOW_MEMORY );
+
+}
+
+void _lang_changed(void *user_data)
+{
+       IV_MSG_HIGH("%s", __func__);
+       ug_send_event( UG_EVENT_LANG_CHANGE );
+
+}
+
+
+/**
+* @brief The main function
+*
+* @param argc  The number of arguments
+* @param argv[] The arguments
+*
+* @return 0 on sucess, others on fail
+*/
+int main(int argc, char *argv[])
+{
+       //setenv("ELM_ENGINE", "gl", 1); //changed to elm_config_preferred_engine_set("opengl_x11") at _app_create
+
+       appdata_iv ad = {0,};
+
+       app_event_callback_s event_callback = {0,};
+
+       event_callback.create = _app_create;
+       event_callback.terminate = _app_terminate;
+       event_callback.pause = _app_pause;
+       event_callback.resume = _app_resume;
+       event_callback.service = _app_service;
+
+       event_callback.low_memory = _low_memory;
+       event_callback.low_battery = _low_battery;
+
+//     event_callback.device_orientation = _orient_changed;
+
+       event_callback.language_changed = _lang_changed;                /* Currently, Application will terminated when change language */
+       event_callback.region_format_changed = NULL;
+
+       if ( argc == 2 )                // For command line options.
+       {
+               IV_MSG_HIGH("Parsing from cmd line. file=%s", argv[1]);
+               ad.iv_param_path = strdup(argv[1]);
+       }
+
+       int ret = APP_ERROR_NONE;
+
+       ret = app_efl_main(&argc, &argv, &event_callback, &ad);
+
+       if ( ret != APP_ERROR_NONE )
+       {
+               IV_MSG_ERROR("app_efl_main() is failed. err=%d", ret);
+               // Go through
+       }
+
+       return ret;
+
+}
+