Develop the VIEWER App for SDK
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 19 May 2015 11:14:50 +0000 (20:14 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 20 May 2015 08:04:13 +0000 (17:04 +0900)
Change-Id: I658a31be29c376471dc4fcdc755d146da4c9754f
Signed-off-by: Sung-jae Park <nicesj.park@samsung.com>
14 files changed:
CMakeLists.txt
packaging/libwidget_viewer.spec
packaging/org.tizen.widget_viewer_sdk.manifest [new file with mode: 0644]
widget_viewer_evas/CMakeLists.txt
widget_viewer_sdk/CMakeLists.txt [new file with mode: 0644]
widget_viewer_sdk/LICENSE [new file with mode: 0644]
widget_viewer_sdk/data/CMakeLists.txt [new file with mode: 0644]
widget_viewer_sdk/data/images/unknown.png [new file with mode: 0644]
widget_viewer_sdk/data/widget_viewer_sdk.edc [new file with mode: 0644]
widget_viewer_sdk/include/debug.h [new file with mode: 0644]
widget_viewer_sdk/include/main.h [new file with mode: 0644]
widget_viewer_sdk/org.tizen.widget_viewer_sdk.efl [new file with mode: 0644]
widget_viewer_sdk/org.tizen.widget_viewer_sdk.xml [new file with mode: 0644]
widget_viewer_sdk/src/main.c [new file with mode: 0644]

index 53bc64b..b289f6d 100644 (file)
@@ -2,5 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 ADD_SUBDIRECTORY(widget_viewer)
 ADD_SUBDIRECTORY(widget_viewer_evas)
+ADD_SUBDIRECTORY(widget_viewer_sdk)
 
 ADD_DEPENDENCIES(widget_viewer_evas widget_viewer)
+ADD_DEPENDENCIES(widget_viewer_sdk widget_viewer_evas)
index e7b6102..fb3275f 100644 (file)
@@ -8,6 +8,7 @@ Group: Applications/Core Applications
 License: Flora License, Version 1.1
 Source0: %{name}-%{version}.tar.gz
 Source1001: %{name}.manifest
+Source1002: org.tizen.widget_viewer_sdk.manifest
 BuildRequires: cmake, gettext-tools, coreutils, edje-bin
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(aul)
@@ -20,6 +21,8 @@ BuildRequires: pkgconfig(widget_service)
 BuildRequires: pkgconfig(vconf)
 BuildRequires: pkgconfig(elementary)
 BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(appcore-efl)
 
 %if %{with wayland}
 %else
@@ -27,10 +30,6 @@ BuildRequires: pkgconfig(x11)
 BuildRequires: pkgconfig(xext)
 %endif
 
-%if "%{model_build_feature_widget}" == "0"
-ExclusiveArch:
-%endif
-
 %description
 API for creating a new instance of the widget and managing its life-cycle.
 
@@ -45,19 +44,16 @@ Header and package configuration files for the widget viewer development
 %prep
 %setup -q
 cp %{SOURCE1001} .
+cp %{SOURCE1002} .
 
 %build
-%if 0%{?sec_build_binary_debug_enable}
 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
-%endif
 
-%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
 
 %if %{with wayland}
 export WAYLAND_SUPPORT=On
@@ -94,7 +90,7 @@ rm -rf %{buildroot}
 %package -n %{name}_evas
 Summary: Library for developing the widget viewer evas
 Group: Applications/Core Applications
-License: Flora
+License: Flora License, Version 1.1
 
 %description -n %{name}_evas
 Provider APIs to develop the widget viewer EFL application.
@@ -110,6 +106,21 @@ Header & package configuration files to support development of the widget viewer
 %post -n %{name}_evas -p /sbin/ldconfig
 %postun -n %{name}_evas -p /sbin/ldconfig
 
+#################################################
+# libwidget_viewer_sdk
+%package -n org.tizen.widget_viewer_sdk
+Summary: The widget viewer for development using SDK(IDE)
+Version: 0.0.1
+Group: Development/Tools
+License: Flora License, Version 1.1
+Requires: %{name}_evas
+
+%description -n org.tizen.widget_viewer_sdk
+While developing the widget applications, this viewer will load it and execute it to help you to see it on the screen.
+
+%post -n org.tizen.widget_viewer_sdk -p /sbin/ldconfig
+%postun -n org.tizen.widget_viewer_sdk -p /sbin/ldconfig
+
 %files -n %{name}_evas
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
@@ -124,4 +135,13 @@ Header & package configuration files to support development of the widget viewer
 %{_includedir}/widget_viewer_evas/widget_viewer_evas_internal.h
 %{_libdir}/pkgconfig/widget_viewer_evas.pc
 
+%files -n org.tizen.widget_viewer_sdk
+%manifest org.tizen.widget_viewer_sdk.manifest
+%defattr(-,root,root,-)
+%attr(-,app,app) %dir /opt/usr/apps/org.tizen.widget_viewer_sdk/data
+%{_datarootdir}/packages/org.tizen.widget_viewer_sdk.xml
+%{_sysconfdir}/smack/accesses.d
+%{_datarootdir}/license/org.tizen.widget_viewer_sdk
+%{_prefix}/apps/org.tizen.widget_viewer_sdk/*
+
 # End of a file
diff --git a/packaging/org.tizen.widget_viewer_sdk.manifest b/packaging/org.tizen.widget_viewer_sdk.manifest
new file mode 100644 (file)
index 0000000..04def52
--- /dev/null
@@ -0,0 +1,30 @@
+<manifest>
+       <define>
+               <domain name="org.tizen.widget_viewer_sdk" />
+       </define>
+       <request>
+               <domain name="org.tizen.widget_viewer_sdk" />
+       </request>
+       <assign>
+               <!-- Package manifest file -->
+               <filesystem path="/usr/share/packages/org.tizen.widget_viewer_sdk.xml" label="_" />
+
+               <!-- Package folder -->
+               <filesystem path="/usr/apps/org.tizen.widget_viewer_sdk" label="org.tizen.widget_viewer_sdk" />
+               <filesystem path="/usr/apps/org.tizen.widget_viewer_sdk/res" label="org.tizen.widget_viewer_sdk" />
+               <filesystem path="/usr/apps/org.tizen.widget_viewer_sdk/res/image" label="org.tizen.widget_viewer_sdk" />
+               <filesystem path="/usr/apps/org.tizen.widget_viewer_sdk/res/edje" label="org.tizen.widget_viewer_sdk" />
+               <filesystem path="/usr/apps/org.tizen.widget_viewer_sdk/author-signature.xml" label="_" />
+               <filesystem path="/usr/apps/org.tizen.widget_viewer_sdk/signature1.xml" label="_" />
+
+               <!-- Executable file -->
+               <filesystem path="/usr/apps/org.tizen.widget_viewer_sdk/bin/widget_viewer_sdk" label="org.tizen.widget_viewer_sdk" exec_label="org.tizen.widget_viewer_sdk" />
+
+               <!-- Data folder -->
+               <filesystem path="/opt/usr/apps/org.tizen.widget_viewer_sdk" label="org.tizen.widget_viewer_sdk" />
+               <filesystem path="/opt/usr/apps/org.tizen.widget_viewer_sdk/data" label="org.tizen.widget_viewer_sdk" />
+
+               <!-- Shared folder -->
+               <filesystem path="/usr/apps/org.tizen.widget_viewer_sdk/shared" label="_" type="transmutable" />
+       </assign>
+</manifest>
index 254c5d1..86637ea 100644 (file)
@@ -58,7 +58,7 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED ${BUILD_SOURCE})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
 
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${viewer_evas_LDFLAGS} "-lpthread")
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${viewer_evas_LDFLAGS} "-lpthread" widget_viewer)
 
 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc")
diff --git a/widget_viewer_sdk/CMakeLists.txt b/widget_viewer_sdk/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c799994
--- /dev/null
@@ -0,0 +1,67 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(widget_viewer_sdk C)
+
+SET(PACKAGE ${PROJECT_NAME})
+SET(VENDOR "tizen")
+SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
+SET(PREFIX "/usr/apps/${PKGNAME}")
+SET(BINDIR "${PREFIX}/bin")
+SET(RESDIR "${PREFIX}/res")
+SET(SHARED_RESDIR "${PREFIX}/shared/res")
+SET(USRDATADIR "/usr/apps/org.${VENDOR}.${PACKAGE}/data")
+SET(DATADIR "/opt/usr/apps/org.${VENDOR}.${PACKAGE}/data")
+SET(LOCALEDIR "${RESDIR}/locale")
+SET(ICONDIR "/usr/share/icons/default/small")
+SET(IMAGEDIR "${RESDIR}/images/${PACKAGE}")
+SET(SOUNDDIR "${RESDIR}/sound/${PACKAGE}")
+SET(EDJDIR "${RESDIR}/edje")
+SET(LIBEXECDIR "${PREFIX}/shared/libexec")
+
+ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
+ADD_DEFINITIONS("-DSHARED_RESDIR=\"${SHARED_RESDIR}\"")
+ADD_DEFINITIONS("-DNDEBUG")
+ADD_DEFINITIONS("-DLOG_TAG=\"WIDGET_SDK\"")
+
+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")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(sdk_pkgs REQUIRED
+       capi-appfw-application
+       appcore-efl
+       ecore-x
+       ecore
+       evas
+       edje
+       vconf
+       bundle
+    dlog
+       widget_service
+)
+
+ADD_DEFINITIONS("-DWIDGET_EVAS_RESOURCE_EDJ=\"${EDJDIR}/widget_viewer_sdk.edj\"")
+ADD_DEFINITIONS("-DWIDGET_EVAS_RESOURCE_PD=\"gbar\"")
+ADD_DEFINITIONS("-DWIDGET_EVAS_RESOURCE_LB=\"widget\"")
+ADD_DEFINITIONS("-DWIDGET_EVAS_RESOURCE_IMG=\"widget,image\"")
+ADD_DEFINITIONS(${sdk_pkgs_CFLAGS})
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../widget_viewer_evas/include)
+
+ADD_EXECUTABLE(${PROJECT_NAME} src/main.c)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${sdk_pkgs_LDFLAGS} "-lm -fpie -fPIC" widget_viewer_evas)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PKGNAME}.xml DESTINATION /usr/share/packages)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PKGNAME}.efl DESTINATION /etc/smack/accesses.d RENAME ${PKGNAME})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME ${PKGNAME})
+INSTALL(DIRECTORY DESTINATION ${DATADIR})
+
+ADD_SUBDIRECTORY(data)
+
+# End of a file
diff --git a/widget_viewer_sdk/LICENSE b/widget_viewer_sdk/LICENSE
new file mode 100644 (file)
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/widget_viewer_sdk/data/CMakeLists.txt b/widget_viewer_sdk/data/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7170a8b
--- /dev/null
@@ -0,0 +1,11 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+# install edj
+ADD_CUSTOM_TARGET(widget_viewer_sdk.edj
+               COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/images ${EDJE_CFLAGS}
+               ${CMAKE_CURRENT_SOURCE_DIR}/widget_viewer_sdk.edc widget_viewer_sdk.edj
+               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/widget_viewer_sdk.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} widget_viewer_sdk.edj)
+INSTALL(FILES widget_viewer_sdk.edj DESTINATION ${EDJDIR})
+INSTALL(FILES images/unknown.png DESTINATION ${SHARED_RESDIR}/images)
diff --git a/widget_viewer_sdk/data/images/unknown.png b/widget_viewer_sdk/data/images/unknown.png
new file mode 100644 (file)
index 0000000..535db60
Binary files /dev/null and b/widget_viewer_sdk/data/images/unknown.png differ
diff --git a/widget_viewer_sdk/data/widget_viewer_sdk.edc b/widget_viewer_sdk/data/widget_viewer_sdk.edc
new file mode 100644 (file)
index 0000000..ac5b73c
--- /dev/null
@@ -0,0 +1,244 @@
+collections {
+       styles {
+       }
+
+       group {
+               name: "layout";
+               parts {
+                       part {
+                               name: "bg";
+                               type: RECT;
+                               mouse_events: 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: "widget";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                               }
+                       }
+
+                       part {
+                               name: "widget,info,bg";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       visible: 0;
+                                       color: 100 100 100 100;
+                               }
+                               description {
+                                       state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
+
+                       part {
+                               name: "widget,info";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       visible: 0;
+                               }
+
+                               description {
+                                       state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
+
+                       part {
+                               name: "widget,id";
+                               clip_to: "widget,info";
+                               type: TEXT;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.1; }
+                                       rel2 { relative: 1.0 0.2; }
+                                       color: 255 255 255 255;
+                                       color2: 0 0 0 255;
+                                       color3: 0 0 0 255;
+                                       text {
+                                               text: "Hello";
+                                               align: 0.5 0.5;
+                                               size: 15;
+                                       }
+                               }
+                       }
+
+                       part {
+                               name: "widget,content,info";
+                               clip_to: "widget,info";
+                               type: TEXT;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.25; }
+                                       rel2 { relative: 1.0 0.35; }
+                                       color: 255 255 255 255;
+                                       color2: 0 0 0 255;
+                                       color3: 0 0 0 255;
+                                       text {
+                                               text: "Hello";
+                                               align: 0.5 0.5;
+                                               size: 15;
+                                       }
+                               }
+                       }
+
+                       part {
+                               name: "widget,title";
+                               clip_to: "widget,info";
+                               type: TEXT;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.4; }
+                                       rel2 { relative: 1.0 0.5; }
+                                       color: 255 255 255 255;
+                                       color2: 0 0 0 255;
+                                       color3: 0 0 0 255;
+                                       text {
+                                               text: "Hello";
+                                               align: 0.5 0.5;
+                                               size: 15;
+                                       }
+                               }
+                       }
+
+                       part {
+                               name: "widget,period";
+                               clip_to: "widget,info";
+                               type: TEXT;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.55; }
+                                       rel2 { relative: 1.0 0.65; }
+                                       color: 255 255 255 255;
+                                       color2: 0 0 0 255;
+                                       color3: 0 0 0 255;
+                                       text {
+                                               text: "Hello";
+                                               align: 0.5 0.5;
+                                               size: 15;
+                                       }
+                               }
+                       }
+
+                       part {
+                               name: "widget,size,list";
+                               clip_to: "widget,info";
+                               mouse_events: 1;
+                               type: SWALLOW;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.7; }
+                                       rel2 { relative: 1.0 0.95; }
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "hide" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 0;
+                               }
+                       }
+
+                       part {
+                               name: "message";
+                               mouse_events: 0;
+                               type: TEXT;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.5 0.5; }
+                                       rel2 { relative: 0.5 0.5; }
+                                       fixed: 1 1;
+                                       color: 255 255 255 255;
+                                       color2: 0 0 0 255;
+                                       color3: 0 0 0 255;
+                                       text {
+                                               text: "Hello";
+                                               align: 0.5 0.5;
+                                               size: 15;
+                                       }
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
+               } /* parts */
+
+               programs {
+                       program {
+                               name: "show,info";
+                               signal: "show";
+                               source: "info";
+                               action: STATE_SET "show" 0.0;
+                               target: "widget,info";
+                               target: "widget,info,bg";
+                       }
+
+                       program {
+                               name: "hide,info";
+                               signal: "hide";
+                               source: "info";
+                               action: STATE_SET "default" 0.0;
+                               target: "widget,info";
+                               target: "widget,info,bg";
+                       }
+
+                       program {
+                               name: "show,message";
+                               signal: "show";
+                               source: "message";
+                               action: STATE_SET "show" 0.0;
+                               target: "message";
+                       }
+
+                       program {
+                               name: "hide,message";
+                               signal: "hide";
+                               source: "message";
+                               action: STATE_SET "default" 0.0;
+                               target: "message";
+                       }
+
+                       program {
+                               name: "hide,size,list";
+                               signal: "hide";
+                               source: "size,list";
+                               action: STATE_SET "hide" 0.0;
+                               target: "widget,size,list";
+                       }
+
+                       program {
+                               name: "show,size,list";
+                               signal: "show";
+                               source: "size,list";
+                               action: STATE_SET "default" 0.0;
+                               target: "widget,size,list";
+                       }
+               }
+       }
+}
diff --git a/widget_viewer_sdk/include/debug.h b/widget_viewer_sdk/include/debug.h
new file mode 100644 (file)
index 0000000..a6563ee
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2013  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.
+ */
+
+#if !defined(FLOG)
+#define DbgPrint(format, arg...)    SECURE_LOGD(format, ##arg)
+#define ErrPrint(format, arg...)    SECURE_LOGE(format, ##arg)
+#else
+extern FILE *__file_log_fp;
+#define DbgPrint(format, arg...) do { fprintf(__file_log_fp, "[LOG] [\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
+
+#define ErrPrint(format, arg...) do { fprintf(__file_log_fp, "[ERR] [\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
+#endif
+
+
+/* End of a file */
diff --git a/widget_viewer_sdk/include/main.h b/widget_viewer_sdk/include/main.h
new file mode 100644 (file)
index 0000000..21307e2
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.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.tizenopensource.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.
+ */
+
+
+#ifndef __MAIN_H__
+#define __MAIN_H__
+
+/* Build */
+#define HAPI __attribute__((visibility("hidden")))
+#define WIDGET_APPID "widget_id"
+#define PREVIEW_DEFAULT RESDIR"/images/unknown.png"
+#define LAYOUT_EDJ RESDIR"/edje/widget_viewer_sdk.edj"
+
+#endif /* __MAIN_H__ */
+
diff --git a/widget_viewer_sdk/org.tizen.widget_viewer_sdk.efl b/widget_viewer_sdk/org.tizen.widget_viewer_sdk.efl
new file mode 100644 (file)
index 0000000..b0facbc
--- /dev/null
@@ -0,0 +1,42 @@
+org.tizen.widget_viewer_sdk device::sys_logging rw---- ------
+org.tizen.widget_viewer_sdk device::app_logging rw---- ------
+org.tizen.widget_viewer_sdk system::use_internet r----- ------
+org.tizen.widget_viewer_sdk net-config r----- ------
+org.tizen.widget_viewer_sdk xorg rw---- ------
+org.tizen.widget_viewer_sdk isf rwx--- ------
+org.tizen.widget_viewer_sdk sound_server rw---- ------
+org.tizen.widget_viewer_sdk syspopup::db rw---- ------
+org.tizen.widget_viewer_sdk dbus rwx--- ------
+org.tizen.widget_viewer_sdk pulseaudio rwxat- ------
+org.tizen.widget_viewer_sdk ail::db rw---- ------
+org.tizen.widget_viewer_sdk connman r----- ------
+org.tizen.widget_viewer_sdk system rwx--- ------
+org.tizen.widget_viewer_sdk immvibed rw---- ------
+org.tizen.widget_viewer_sdk svi-data r-x--- ------
+org.tizen.widget_viewer_sdk org.tizen.clocksetting rwx--- ------
+org.tizen.widget_viewer_sdk org.tizen.clocksetting::default-resources r-x--- ------
+org.tizen.widget_viewer_sdk e17 r-x--- ------
+org.tizen.widget_viewer_sdk system::vconf rwx--- ------
+org.tizen.widget_viewer_sdk system::vconf_setting rw---- ------
+org.tizen.widget_viewer_sdk system::vconf_inhouse rw---- ------
+org.tizen.widget_viewer_sdk system::vconf_multimedia rw---- ------
+org.tizen.widget_viewer_sdk deviced rwx--- ------
+org.tizen.widget_viewer_sdk deviced::display rw---- ------
+org.tizen.widget_viewer_sdk data-provider-master::data --x--- ------
+org.tizen.widget_viewer_sdk testmode::vconf r----- ------
+org.tizen.widget_viewer_sdk data-provider-master::db rw---- ------
+org.tizen.widget_viewer_sdk data-provider-master::share rwxat- ------
+org.tizen.widget_viewer_sdk data-provider-master::data r-x--- ------
+org.tizen.widget_viewer_sdk data-provider-master::client rw---- ------
+org.tizen.widget_viewer_sdk data-provider-master rw---- ------
+org.tizen.widget_viewer_sdk pkgmgr::db rwx--- ------
+org.tizen.widget_viewer_sdk efreet rwx--- ------
+org.tizen.widget_viewer_sdk litewhome rwx--- ------
+org.tizen.widget_viewer_sdk aul::launch --x--- ------
+org.tizen.widget_viewer_sdk aul::terminate --x--- ------
+org.tizen.widget_viewer_sdk system::media rw---- ------
+aul org.tizen.widget_viewer_sdk r-x--- ------
+dbus org.tizen.widget_viewer_sdk rwx--- ------
+system org.tizen.widget_viewer_sdk -w---- ------
+org.tizen.data-provider-slave org.tizen.widget_viewer_sdk rwx--- ------
+org.tizen.widget_viewer_sdk system::homedir rwx--- ------
diff --git a/widget_viewer_sdk/org.tizen.widget_viewer_sdk.xml b/widget_viewer_sdk/org.tizen.widget_viewer_sdk.xml
new file mode 100644 (file)
index 0000000..60eabff
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.widget_viewer_sdk" version="1.0.0" install-location="auto" root_path="/opt/apps/org.tizen.widget_viewer_sdk" appsetting="false">
+       <label>Widget Viewer SDK</label>
+       <author email="nicesj@nicesj.com" href="nicesj.com">Sungjae Park</author>
+       <description>Widget Viewer for SDK</description>
+
+       <privileges>
+       <privilege>http://tizen.org/privilege/application.launch</privilege>
+       <privilege>http://tizen.org/privilege/system</privilege>
+       </privileges>
+
+       <!-- Main application -->
+       <ui-application appid="org.tizen.widget_viewer_sdk" exec="/usr/apps/org.tizen.widget_viewer_sdk/bin/widget_viewer_sdk" nodisplay="true" multiple="false" type="capp" taskmanage="true">
+               <label>Widget Viewer for SDK</label>
+               <label xml:lang="ko-kr">위젯 뷰어 for SDK</label>
+               <icon>org.tizen.widget_viewer_sdk</icon>
+       </ui-application>
+</manifest>
diff --git a/widget_viewer_sdk/src/main.c b/widget_viewer_sdk/src/main.c
new file mode 100644 (file)
index 0000000..a4908e1
--- /dev/null
@@ -0,0 +1,494 @@
+/*
+ * Copyright 2014  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 <app.h>
+#include <unistd.h>
+#include <errno.h>
+#include <widget_errno.h>
+#include <widget_service.h>
+#include <widget_viewer_evas.h>
+#include <vconf.h>
+#include <bundle.h>
+#include <dlog.h>
+#include <string.h>
+
+int errno;
+
+#include "main.h"
+#include "debug.h"
+
+static struct info {
+       int w;
+       int h;
+       Evas_Object *win;
+       Evas_Object *bg;
+       Evas_Object *box;
+       Evas_Object *layout;
+       Ecore_Timer *long_press;
+
+       struct ctx_item {
+               char *content_info;
+               char *title;
+               double period;
+               Evas_Object *widget;
+               int *size_types;
+               int count_of_size_type;
+       } ctx;
+} s_info = {
+       .w = 0,
+       .h = 0,
+       .win = NULL,
+       .layout = NULL,
+       .long_press = NULL,
+
+       .ctx = {
+               .content_info = NULL,
+               .title = NULL,
+               .period = WIDGET_VIEWER_EVAS_DEFAULT_PERIOD, 
+               .widget = NULL,
+               .size_types = NULL,
+               .count_of_size_type = 20,
+       },
+};
+
+#define LONG_PRESS 1.0f
+
+static Eina_Bool show_widget_info_cb(void *data)
+{
+       DbgPrint("Show info panel\n");
+       elm_object_signal_emit(s_info.layout, "show", "info");
+
+       s_info.long_press = NULL;
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static void layout_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       if (s_info.long_press) {
+               ecore_timer_del(s_info.long_press);
+               s_info.long_press = NULL;
+       }
+
+       s_info.long_press = ecore_timer_add(LONG_PRESS, show_widget_info_cb, NULL);
+       if (!s_info.long_press) {
+               ErrPrint("Failed to add a timer\n");
+       }
+}
+
+static void layout_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       if (s_info.long_press) {
+               ecore_timer_del(s_info.long_press);
+               s_info.long_press = NULL;
+
+               elm_object_signal_emit(s_info.layout, "hide", "info");
+       }
+}
+
+static bool app_create(void *data)
+{
+       s_info.win = elm_win_add(NULL, "Widget Viewer (SDK)", ELM_WIN_BASIC);
+       if (!s_info.win) {
+               LOGD("Failed to create a window\n");
+               return false;
+       }
+
+       evas_object_show(s_info.win);
+
+       elm_win_screen_size_get(s_info.win, NULL, NULL, &s_info.w, &s_info.h);
+       LOGD("Window: %dx%d\n", s_info.w, s_info.h);
+
+       s_info.bg = elm_bg_add(s_info.win);
+       if (!s_info.bg) {
+               ErrPrint("Failed to add a BG\n");
+               evas_object_del(s_info.win);
+               s_info.win = NULL;
+               return false;
+       }
+
+       elm_win_resize_object_add(s_info.win, s_info.bg);
+       elm_bg_color_set(s_info.bg, 0, 0, 0);
+       evas_object_show(s_info.bg);
+
+       s_info.box = elm_box_add(s_info.win);
+       if (!s_info.box) {
+               evas_object_del(s_info.bg);
+               evas_object_del(s_info.win);
+               s_info.bg = NULL;
+               s_info.win = NULL;
+               return false;
+       }
+       elm_win_resize_object_add(s_info.win, s_info.box);
+       evas_object_show(s_info.box);
+
+       s_info.layout = elm_layout_add(s_info.win);
+       if (!s_info.layout) {
+               evas_object_del(s_info.box);
+               evas_object_del(s_info.bg);
+               evas_object_del(s_info.win);
+               s_info.box = NULL;
+               s_info.win = NULL;
+               s_info.bg = NULL;
+               return false;
+       }
+
+       elm_box_align_set(s_info.box, 0.5, 0.5);
+       evas_object_size_hint_expand_set(s_info.box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_fill_set(s_info.box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+       if (elm_layout_file_set(s_info.layout, LAYOUT_EDJ, "layout") != EINA_TRUE) {
+               LOGE("Failed to load an edje\n");
+               evas_object_del(s_info.bg);
+               evas_object_del(s_info.layout);
+               evas_object_del(s_info.win);
+               s_info.bg = NULL;
+               s_info.layout = NULL;
+               s_info.win = NULL;
+               return false;
+       }
+       evas_object_show(s_info.layout);
+
+       evas_object_event_callback_add(s_info.layout, EVAS_CALLBACK_MOUSE_DOWN, layout_down_cb, NULL);
+       evas_object_event_callback_add(s_info.layout, EVAS_CALLBACK_MOUSE_UP, layout_up_cb, NULL);
+
+       elm_box_pack_end(s_info.box, s_info.layout);
+
+       /* WIDGET init */
+       widget_viewer_evas_set_option(WIDGET_VIEWER_EVAS_DIRECT_UPDATE, 1);
+       widget_viewer_evas_set_option(WIDGET_VIEWER_EVAS_EVENT_AUTO_FEED, 1);
+
+       widget_viewer_evas_init(s_info.win);
+
+       return true;
+}
+
+static int unload_widget(void)
+{
+       const char *tmp;
+
+       if (!s_info.ctx.widget) {
+               return WIDGET_ERROR_NOT_EXIST;
+       }
+
+       elm_box_unpack(s_info.box, s_info.ctx.widget);
+
+       tmp = widget_viewer_evas_get_widget_id(s_info.ctx.widget);
+       DbgPrint("Unload previous widget: %s\n", tmp);
+
+       widget_viewer_evas_set_permanent_delete(s_info.ctx.widget, EINA_TRUE);
+       evas_object_del(s_info.ctx.widget);
+       free(s_info.ctx.title);
+       free(s_info.ctx.content_info);
+       free(s_info.ctx.size_types);
+
+       s_info.ctx.widget = NULL;
+       s_info.ctx.title = NULL;
+       s_info.ctx.content_info = NULL;
+       s_info.ctx.size_types = NULL;
+       s_info.ctx.period = WIDGET_VIEWER_EVAS_DEFAULT_PERIOD;
+       s_info.ctx.count_of_size_type = 20;
+
+       elm_object_part_text_set(s_info.layout, "widget,id", "");
+       elm_object_part_text_set(s_info.layout, "widget,content,info", "");
+       elm_object_part_text_set(s_info.layout, "widget,title", "");
+       elm_object_part_text_set(s_info.layout, "widget,period", "");
+
+       return WIDGET_ERROR_NONE;
+}
+
+static void app_terminate(void *data)
+{
+       unload_widget();
+
+       /* WIDGET fini */
+       widget_viewer_evas_fini();
+
+       if (s_info.win) {
+               evas_object_del(s_info.win);
+               s_info.win = NULL;
+       }
+}
+
+static void app_pause(void *data)
+{
+       /* WIDGET pause */
+       widget_viewer_evas_notify_paused_status_of_viewer();
+}
+
+static void app_resume(void *data)
+{
+       /* WIDGET resume */
+       widget_viewer_evas_notify_resumed_status_of_viewer();
+}
+
+static void updated_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       /* Updated */
+       DbgPrint("Widget updated\n");
+}
+
+static void list_item_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       int w;
+       int h;
+
+       if (widget_service_get_size(s_info.ctx.size_types[(int)data], &w, &h) != WIDGET_ERROR_NONE) {
+               return;
+       }
+
+//     evas_object_resize(s_info.ctx.widget, w, h);
+//     evas_object_size_hint_min_set(s_info.ctx.widget, w, h);
+
+       evas_object_resize(s_info.layout, w, h);
+       evas_object_size_hint_min_set(s_info.layout, w, h);
+}
+
+static void extra_updated_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       const char *string;
+       char *tmp;
+
+       string = widget_viewer_evas_get_title_string(obj);
+       if (string) {
+               tmp = strdup(string);
+               if (!tmp) {
+                       return;
+               }
+
+               free(s_info.ctx.title);
+               s_info.ctx.title = tmp;
+
+               elm_object_part_text_set(s_info.layout, "widget,title", s_info.ctx.title);
+       }
+
+       string = widget_viewer_evas_get_content_info(obj);
+       if (string) {
+               tmp = strdup(string);
+               if (!tmp) {
+                       return;
+               }
+
+               free(s_info.ctx.content_info);
+               s_info.ctx.content_info = tmp;
+
+               elm_object_part_text_set(s_info.layout, "widget,content,info", s_info.ctx.content_info);
+               DbgPrint("Content updated: [%s]\n", s_info.ctx.content_info);
+       }
+}
+
+static void period_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       char buffer[96];
+
+       s_info.ctx.period = widget_viewer_evas_get_period(obj);
+       snprintf(buffer, sizeof(buffer), "%lf", s_info.ctx.period);
+       elm_object_part_text_set(s_info.layout, "widget,period", buffer);
+       DbgPrint("Period updated: %s\n", buffer);
+}
+
+static int load_widget(const char *widget_id)
+{
+       int w = 0;
+       int h = 0;
+       int i;
+
+       for (i = 0; i < s_info.ctx.count_of_size_type; i++) {
+               if (widget_service_get_size(s_info.ctx.size_types[i], &w, &h) != WIDGET_ERROR_NONE || w == 0 || h == 0) {
+                       continue;
+               }
+
+               break;
+       }
+
+       if (i == s_info.ctx.count_of_size_type) {
+               ErrPrint("Failed to load a widget\n");
+               return WIDGET_ERROR_NOT_SUPPORTED;
+       }
+
+       DbgPrint("Found valid size[%X]: %dx%d\n", s_info.ctx.size_types[i], w, h);
+
+       s_info.ctx.widget = widget_viewer_evas_add_widget(s_info.win, widget_id, s_info.ctx.content_info, s_info.ctx.period);
+       if (!s_info.ctx.widget) {
+               ErrPrint("Failed to create a new widget\n");
+               return WIDGET_ERROR_FAULT;
+       }
+
+       DbgPrint("Resize the widget(%s) to [%X] %dx%d\n", widget_id, s_info.ctx.size_types[0], w, h);
+       evas_object_resize(s_info.ctx.widget, w, h);
+       evas_object_size_hint_min_set(s_info.ctx.widget, w, h);
+
+       evas_object_smart_callback_add(s_info.ctx.widget, WIDGET_SMART_SIGNAL_UPDATED, updated_cb, NULL);
+       evas_object_smart_callback_add(s_info.ctx.widget, WIDGET_SMART_SIGNAL_EXTRA_INFO_UPDATED, extra_updated_cb, NULL);
+       evas_object_smart_callback_add(s_info.ctx.widget, WIDGET_SMART_SIGNAL_PERIOD_CHANGED, period_changed_cb, NULL);
+
+       elm_object_part_text_set(s_info.layout, "widget,id", widget_id);
+       elm_object_part_content_set(s_info.layout, "widget", s_info.ctx.widget);
+
+       evas_object_resize(s_info.layout, w, h);
+       evas_object_size_hint_min_set(s_info.layout, w, h);
+
+       return WIDGET_ERROR_NONE;
+}
+
+static char *list_item_text_get_cb(void *data, Evas_Object *obj, const char *part)
+{
+       char buffer[256];
+       int ret;
+       int w;
+       int h;
+
+       ret = widget_service_get_size(s_info.ctx.size_types[(int)data], &w, &h);
+       if (ret != WIDGET_ERROR_NONE) {
+               return strdup("Invalid");
+       }
+
+       snprintf(buffer, sizeof(buffer), "%dx%d", w, h);
+       DbgPrint("Size: [%s]\n", buffer);
+       return strdup(buffer);
+}
+
+static Evas_Object *list_item_content_get_cb(void *data, Evas_Object *obj, const char *part)
+{
+       Evas_Object *icon = NULL;
+       char *icon_filename;
+       const char *widget_id;
+
+       widget_id = widget_viewer_evas_get_widget_id(s_info.ctx.widget);
+
+       icon_filename = widget_service_get_preview_image_path(widget_id, s_info.ctx.size_types[(int)data]);
+       if (icon_filename) {
+               icon = elm_icon_add(s_info.win);
+               if (icon) {
+                       elm_image_file_set(icon, icon_filename, NULL);
+                       elm_image_resizable_set(icon, EINA_FALSE, EINA_FALSE);
+                       DbgPrint("Icon: %s\n", icon_filename);
+               }
+       } else {
+               icon = NULL;
+       }
+
+       return icon;
+}
+
+static int prepare_widget(const char *widget_id)
+{
+       int ret;
+       Evas_Object *size_list;
+       Elm_Object_Item *item;
+       int i;
+       int w;
+       int h;
+       static Elm_Genlist_Item_Class class = {
+               .func = {
+                       .text_get = list_item_text_get_cb,
+                       .content_get = list_item_content_get_cb,
+                       .state_get = NULL,
+                       .del = NULL,
+               }
+       };
+
+       ret = widget_service_get_supported_size_types(widget_id, &s_info.ctx.count_of_size_type, &s_info.ctx.size_types);
+       if (ret != WIDGET_ERROR_NONE) {
+               ErrPrint("Failed to load an widget\n");
+       }
+
+       if (s_info.ctx.count_of_size_type <= 1) {
+               elm_object_signal_emit(s_info.layout, "hide", "size,list");
+               return WIDGET_ERROR_NONE;
+       } else {
+               elm_object_signal_emit(s_info.layout, "show", "size,list");
+       }
+
+       size_list = elm_object_part_content_get(s_info.layout, "widget,size,list");
+       if (size_list) {
+               elm_genlist_clear(size_list);
+       } else {
+               size_list = elm_genlist_add(s_info.win);
+               if (!size_list) {
+                       ErrPrint("Failed to create a genlist\n");
+                       return WIDGET_ERROR_FAULT;
+               }
+
+               elm_object_part_content_set(s_info.layout, "widget,size,list", size_list);
+       }
+
+       DbgPrint("========\nDump supported size types [%s]\n", widget_id);
+       for (i = 0; i < s_info.ctx.count_of_size_type; i++) {
+               if (widget_service_get_size(s_info.ctx.size_types[i], &w, &h) != WIDGET_ERROR_NONE || w == 0 || h == 0) {
+                       DbgPrint("[%X] is not supported (%dx%d)\n", s_info.ctx.size_types[i], w, h);
+                       continue;
+               }
+
+               DbgPrint("Size[%X]\n", s_info.ctx.size_types[i]);
+               item = elm_genlist_item_append(size_list, &class, (void *)i, NULL, ELM_GENLIST_ITEM_NONE, list_item_clicked_cb, (void *)i);
+               if (!item) {
+                       ErrPrint("Failed to add a new size item\n");
+               }
+       }
+       DbgPrint("========\nEnd of a dump\n");
+
+       return ret;
+}
+
+static void _app_control(app_control_h service, void *data)
+{
+       char *widget_id = NULL;
+       int ret;
+
+       ret = app_control_get_extra_data(service, WIDGET_APPID, &widget_id);
+       if (ret == APP_CONTROL_ERROR_NONE) {
+               DbgPrint("Loading a widget: [%s]\n", widget_id);
+               if (!widget_id) {
+                       return;
+               }
+
+               ret = unload_widget();
+               ret = prepare_widget(widget_id);
+               ret = load_widget(widget_id);
+               free(widget_id);
+       } else {
+               /**
+                * @note
+                * Just raise up the window and notify to resumed state
+                */
+               widget_viewer_evas_notify_resumed_status_of_viewer();
+               elm_win_activate(s_info.win);
+       }
+}
+
+int main(int argc, char *argv[])
+{
+       ui_app_lifecycle_callback_s event_callback;
+
+       event_callback.create = app_create;
+       event_callback.terminate = app_terminate;
+       event_callback.pause = app_pause;
+       event_callback.resume = app_resume;
+       event_callback.app_control = _app_control;
+
+       if (setenv("BUFMGR_LOCK_TYPE", "once", 0) < 0) {
+               LOGE("setenv(BUFMGR_LOCK_TYPE) is failed: %s", strerror(errno));
+       }
+
+       if (setenv("BUFMGR_MAP_CACHE", "true", 0) < 0) {
+               LOGE("setenv(BUFMGR_MAP_CACHE) is failed: %s", strerror(errno));
+       }
+
+       return ui_app_main(argc, argv, &event_callback, NULL);
+}
+
+/* End of a file */