apply FSL(Flora Software License)
authorKim Kibum <kb0929.kim@samsung.com>
Fri, 8 Jun 2012 05:54:00 +0000 (14:54 +0900)
committerKim Kibum <kb0929.kim@samsung.com>
Fri, 8 Jun 2012 05:54:00 +0000 (14:54 +0900)
49 files changed:
CMakeLists.txt [new file with mode: 0755]
LICENSE [new file with mode: 0755]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/desktop [new file with mode: 0644]
debian/install [new file with mode: 0644]
debian/rules [new file with mode: 0755]
include/draglock-bg.h [new file with mode: 0644]
include/draglock-slide.h [new file with mode: 0644]
include/draglock-time.h [new file with mode: 0644]
include/draglock-ui.h [new file with mode: 0644]
include/draglock-util.h [new file with mode: 0644]
include/draglock.h [new file with mode: 0644]
packaging/org.tizen.draglock.spec [new file with mode: 0755]
res/CMakeLists.txt [new file with mode: 0755]
res/edje/draglock-slide.edc [new file with mode: 0644]
res/edje/draglock-time.edc [new file with mode: 0644]
res/edje/draglock-ui.edc [new file with mode: 0644]
res/edje/draglock.edc [new file with mode: 0644]
res/icons/default/small/icon_application.png [new file with mode: 0644]
res/images/RB07_Unlock_bg.png [new file with mode: 0644]
res/images/RB07_Unlock_bg_press.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_01.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_02.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_arrow.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_arrow_press.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_01.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_02.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_03.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_04.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_05.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_06.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_07.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_08.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_09.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_10.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_11.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_12.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_13.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_14.png [new file with mode: 0644]
res/images/RB07_icon_Unlock_press_15.png [new file with mode: 0644]
src/draglock-bg.c [new file with mode: 0644]
src/draglock-slide.c [new file with mode: 0644]
src/draglock-time.c [new file with mode: 0644]
src/draglock-ui.c [new file with mode: 0644]
src/draglock-util.c [new file with mode: 0644]
src/draglock.c [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..aafa2ae
--- /dev/null
@@ -0,0 +1,92 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(draglock C)
+
+SET(SRCS
+       ./src/draglock.c
+       ./src/draglock-ui.c
+       ./src/draglock-util.c
+       ./src/draglock-bg.c
+       ./src/draglock-slide.c
+       ./src/draglock-time.c
+)
+
+SET(VENDOR "tizen")
+SET(PACKAGE ${PROJECT_NAME})
+SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "${PREFIX}/bin")
+SET(RESDIR "${PREFIX}/res")
+SET(DATADIR "${PREFIX}/data")
+SET(LOCALEDIR "${RESDIR}/locale")
+SET(IMAGEDIR "${RESDIR}/images")
+SET(ICONDIR "${RESDIR}/icons/default/small")
+SET(EDJEDIR "${RESDIR}/edje")
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+       SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+       icu-i18n
+       elementary
+       ecore
+       ecore-file
+       ecore-input
+       ecore-x
+       edje
+       eina
+       evas
+       dlog
+       capi-appfw-application
+       capi-system-power
+       capi-system-runtime-info
+       vconf
+)
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(CMAKE_C_FLAGS_RELEASE "-O2")
+
+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")
+
+ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
+ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
+ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-DIMAGEDIR=\"${IMAGEDIR}\"")
+ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
+ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-lm")
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+
+# install desktop file
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/debian/desktop ${CMAKE_BINARY_DIR}/${PKGNAME}.desktop)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/${PKGNAME}.desktop DESTINATION /opt/share/applications)
+
+#install application HOME directory
+INSTALL(DIRECTORY DESTINATION ${DATADIR})
+
+#install etc
+ADD_SUBDIRECTORY(res)
+
diff --git a/LICENSE b/LICENSE
new file mode 100755 (executable)
index 0000000..7ccb5b5
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,75 @@
+Flora License
+
+Version 1.0, May, 2012
+
+http://www.tizenopensource.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 Compatibility Definition Document and passes the Compatibility Test Suite 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.
+
+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.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.
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..86349d8
--- /dev/null
@@ -0,0 +1,7 @@
+draglock (0.1.5-1) unstable; urgency=low
+
+  * Fixed problem printing time with wrong format
+  * Git: pkgs/d/draglock
+  * Tag: draglock_0.1.5-1
+
+ -- youngsub ko <ys4610.ko@samsung.com>  Mon, 16 Apr 2012 17:38:10 +0900
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7813681
--- /dev/null
@@ -0,0 +1 @@
+5
\ No newline at end of file
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..58c14a0
--- /dev/null
@@ -0,0 +1,17 @@
+Source: draglock
+Section: devel
+Priority: extra
+Maintainer: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, youngsub ko <ys4610.ko@samsung.com>
+Build-Depends: debhelper (>= 5), libelm-dev, capi-appfw-application-dev, capi-system-power-dev, capi-system-runtime-info-dev, dlog-dev, libslp-setting-dev, libicu-dev
+Standards-Version: 1.0.0
+
+Package: org.tizen.draglock
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: plain lock screen
+
+Package: org.tizen.draglock-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, org.tizen.draglock (= ${Source-Version})
+Description: draglock (unstripped)
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/debian/desktop b/debian/desktop
new file mode 100644 (file)
index 0000000..fd0a3fd
--- /dev/null
@@ -0,0 +1,9 @@
+name=draglock
+exec=/opt/apps/org.tizen.draglock/bin/draglock
+icon=/opt/apps/org.tizen.draglock/res/icons/default/small/icon_application.png
+type=Application
+Nodisplay=True
+Categories=lock-screen
+
+X-TIZEN-TaskManage=False
+X-TIZEN-Removable=False
diff --git a/debian/install b/debian/install
new file mode 100644 (file)
index 0000000..9b431a2
--- /dev/null
@@ -0,0 +1 @@
+opt/*
\ No newline at end of file
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..4c6a36d
--- /dev/null
@@ -0,0 +1,114 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS ?= -Wall -g
+LDFLAGS ?=
+PREFIX ?= /opt/apps/org.tizen.draglock
+RESDIR ?= /opt/apps/org.tizen.draglock/res
+DATADIR ?= /opt/apps/org.tizen.draglock/data
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+
+LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
+
+CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+       mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
+       CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX="$(PREFIX)"
+
+       touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp
+       dh_testdir
+
+       # Add here commands to compile the package.
+       cd $(CMAKE_BUILD_DIR) && $(MAKE)
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               cat $$f > $${f%.in}; \
+               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
+               sed -i -e "s#@RESDIR@#$(RESDIR)#g" $${f%.in}; \
+               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
+       done
+
+       touch $@
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       rm -rf $(CMAKE_BUILD_DIR)
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               rm -f $${f%.in}; \
+       done
+
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+#      dh_installdirs
+
+       # Add here commands to install the package into debian/wavplayer.
+       cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+#      dh_installchangelogs
+#      dh_installdocs
+#      dh_installexamples
+       dh_install --sourcedir=debian/tmp
+#      dh_installmenu
+#      dh_installdebconf
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+       dh_strip --dbg-package=org.tizen.draglock-dbg
+       dh_compress
+       dh_fixperms
+#      dh_perl
+       dh_makeshlibs
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/include/draglock-bg.h b/include/draglock-bg.h
new file mode 100644 (file)
index 0000000..cdf4dba
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+  * 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 DRAGLOCK_BG_H_
+#define DRAGLOCK_BG_H_
+
+Evas_Object *draglock_bg_get_image(Evas_Object *parent);
+
+#endif /* DRAGLOCK_BG_H_ */
diff --git a/include/draglock-slide.h b/include/draglock-slide.h
new file mode 100644 (file)
index 0000000..734dc6f
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+  * 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 DRAGLOCK_SLIDE_H_
+#define DRAGLOCK_SLIDE_H_
+
+Evas_Object *draglock_slide_get_slider(Evas_Object *parent);
+
+#endif /* DRAGLOCK_SLIDE_H_ */
diff --git a/include/draglock-time.h b/include/draglock-time.h
new file mode 100644 (file)
index 0000000..2cdabef
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+  * 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 DRAGLOCK_TIME_H_
+#define DRAGLOCK_TIME_H_
+
+Evas_Object *draglock_time_get_time(void *data);
+
+#endif /* DRAGLOCK_TIME_H_ */
diff --git a/include/draglock-ui.h b/include/draglock-ui.h
new file mode 100644 (file)
index 0000000..9cfbea8
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+  * 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 DRAGLOCK_UI_H_
+#define DRAGLOCK_UI_H_
+
+int draglock_ui_create(void *data);
+int draglock_ui_destroy(void *data);
+
+#endif /* DRAGLOCK_UI_H_ */
diff --git a/include/draglock-util.h b/include/draglock-util.h
new file mode 100644 (file)
index 0000000..34c9add
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  * 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 __DRAGLOCK_UTIL_H__
+#define __DRAGLOCK_UTIL_H__
+
+Evas_Object *draglock_util_add_window(const char *name);
+Evas_Object *draglock_util_add_bg(Evas_Object *window);
+Evas_Object *draglock_util_add_layout(Evas_Object *parent, const char *file,
+               const char *group);
+
+#endif /* __DRAGLOCK_UTIL_H__ */
diff --git a/include/draglock.h b/include/draglock.h
new file mode 100644 (file)
index 0000000..6fc1edb
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+  * 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 __DRAGLOCK_H__
+#define __DRAGLOCK_H__
+
+#include <Elementary.h>
+#include <power.h>
+
+#ifdef  LOG_TAG
+#undef  LOG_TAG
+#endif
+#define LOG_TAG "DRAGLOCK"
+
+#include <dlog.h>
+
+#define DRAGLOCK_ERR(fmt, arg...)  LOGE("["LOG_TAG"%s:%d:E] : %s "fmt, __FILE__, __LINE__, __func__, ##arg)
+#define DRAGLOCK_DBG(fmt, arg...)  LOGD("["LOG_TAG"%s:%d:D] : %s "fmt, __FILE__, __LINE__, __func__, ##arg)
+#define DRAGLOCK_WARN(fmt, arg...) LOGW("["LOG_TAG"%s:%d:D] : %s "fmt, __FILE__, __LINE__, __func__, ##arg)
+
+#if !defined(PACKAGE)
+#define PACKAGE "draglock"
+#endif
+
+#if !defined(PKGNAME)
+#define PKGNAME "org.tizen."PACKAGE
+#endif
+
+#if !defined(EDJEDIR)
+#define EDJEDIR "/opt/apps/"PKGNAME"/res/edje"
+#endif
+
+#define EDJEFILE EDJEDIR"/"PACKAGE".edj"
+
+#define _EDJ(x)        elm_layout_edje_get(x)
+
+#define DEFAULT_WIN_WIDTH 720
+#define DEFAULT_SLIDE_HEIGHT 114
+#define DEFAULT_SLIDE_Y 1116
+#define SLIDE_RATIO_H 0.089
+#define SLIDE_RATIO_Y 0.872
+
+struct appdata {
+       Evas_Object *win;
+
+       int win_w;
+       int win_h;
+
+       double scale;
+
+       Evas_Object *ui_layout;
+       Evas_Object *time_layout;
+       Evas_Object *slide_layout;
+
+       Ecore_Timer *clock_timer;
+
+       int slide_status; // 0 : invalid 1 : valid
+       int slide_step;
+
+       Evas_Coord_Rectangle slide_rel1;
+       Evas_Coord_Rectangle slide_rel2;
+
+       power_state_e power_state;
+};
+
+#endif /* __DRAGLOCK_H__ */
diff --git a/packaging/org.tizen.draglock.spec b/packaging/org.tizen.draglock.spec
new file mode 100755 (executable)
index 0000000..56a19b3
--- /dev/null
@@ -0,0 +1,60 @@
+%define PREFIX /opt/apps/org.tizen.draglock
+
+Name:       org.tizen.draglock
+Summary:    Lock screen application
+Version: 0.1.5
+Release:    1
+Group:      TBD
+License:    Flora Software License
+Source0:    %{name}-%{version}.tar.gz
+BuildRequires: pkgconfig(icu-i18n)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(ecore)
+BuildRequires: pkgconfig(ecore-file)
+BuildRequires: pkgconfig(ecore-input)
+BuildRequires: pkgconfig(ecore-x)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(eina)
+BuildRequires: pkgconfig(evas)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-system-power)
+BuildRequires: pkgconfig(capi-system-runtime-info)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: cmake
+BuildRequires: gettext
+BuildRequires: edje-tools
+Requires(post):   /sbin/ldconfig
+Requires(post):   /usr/bin/vconftool
+requires(postun): /sbin/ldconfig
+%description
+Lock screen application.
+
+
+%prep
+%setup -q
+
+%build
+LDFLAGS+="-Wl,--rpath=%{PREFIX}/lib -Wl,--as-needed";export LDFLAGS
+cmake . -DCMAKE_INSTALL_PREFIX=%{PREFIX}
+make %{?jobs:-j%jobs}
+
+%install
+%make_install
+mkdir -p %{buildroot}/opt/apps/org.tizen.draglock/data
+
+%post
+/sbin/ldconfig
+chown -R 5000:5000 /opt/apps/org.tizen.draglock/data
+
+GOPTION="-g 6514"
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%dir /opt/apps/org.tizen.draglock/data
+/opt/apps/org.tizen.draglock/bin/draglock
+/opt/apps/org.tizen.draglock/res/edje/draglock.edj
+/opt/share/applications/org.tizen.draglock.desktop
+
diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..08f87a5
--- /dev/null
@@ -0,0 +1,8 @@
+ADD_CUSTOM_TARGET(draglock.edj
+               COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/images
+               ${CMAKE_CURRENT_SOURCE_DIR}/edje/draglock.edc ${CMAKE_BINARY_DIR}/draglock.edj
+               DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edje/draglock.edc
+)
+
+ADD_DEPENDENCIES(${PROJECT_NAME} draglock.edj)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/draglock.edj DESTINATION ${EDJEDIR})
diff --git a/res/edje/draglock-slide.edc b/res/edje/draglock-slide.edc
new file mode 100644 (file)
index 0000000..1b54f3d
--- /dev/null
@@ -0,0 +1,431 @@
+/*
+  * 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.
+  */
+
+
+#define DRAGLOCK_ARROW_RECT(pname, rel1x, rel2x)\
+       part {\
+               name: "rect."#pname;\
+               type: RECT;\
+               scale: 1;\
+               description {\
+                       state: "default" 0.0;\
+                       rel1 {\
+                               relative: rel1x 0.0;\
+                               to: "rect.arrow";\
+                       }\
+                       rel2 {\
+                               relative: rel2x 1.0;\
+                               to: "rect.arrow";\
+                       }\
+                       visible: 0;\
+               }\
+       }\
+
+#define DRAGLOCK_ARROW_IMAGE(pname, rname)\
+       part {\
+               name: "arrow."#pname;\
+               type: IMAGE;\
+               scale: 1;\
+               description {\
+                       state: "default" 0.0;\
+                       min: 23 29;\
+                       align: 0.5 0.5;\
+                       rel1 {\
+                               relative: 0.5 0.5;\
+                               to: "rect."#rname;\
+                       }\
+                       rel2 {\
+                               relative: 0.5 0.5;\
+                               to: "rect."#rname;\
+                       }\
+                       image.normal: "RB07_icon_Unlock_arrow.png";\
+                       visible: 0;\
+               }\
+               description {\
+                       state: "press" 0.0;\
+                       inherit: "default" 0.0;\
+                       image.normal: "RB07_icon_Unlock_arrow_press.png";\
+                       visible: 1;\
+               }\
+       }\
+
+#define DRAGLOCK_LOCK_PRESS_DESC(pstate, file)\
+       description {\
+               state: #pstate 0.0;\
+               inherit: "default" 0.0;\
+               image.normal: #file;\
+               visible: 1;\
+       }\
+
+#define DRAGLOCK_LOCK_PRESS_PROC(pname)\
+       program{\
+               name: #pname".lock.r";\
+               signal: #pname;\
+               source: "lock.image.r";\
+               action: STATE_SET #pname 0.0;\
+               target: "lock.image.r";\
+       }\
+
+group {
+       name: "draglock-slide";
+
+       images {
+               image: "RB07_Unlock_bg.png" COMP;
+               image: "RB07_Unlock_bg_press.png" COMP;
+               image: "RB07_icon_Unlock_01.png" COMP;
+               image: "RB07_icon_Unlock_02.png" COMP;
+               image: "RB07_icon_Unlock_arrow.png" COMP;
+               image: "RB07_icon_Unlock_arrow_press.png" COMP;
+               image: "RB07_icon_Unlock_press_01.png" COMP;
+               image: "RB07_icon_Unlock_press_02.png" COMP;
+               image: "RB07_icon_Unlock_press_03.png" COMP;
+               image: "RB07_icon_Unlock_press_04.png" COMP;
+               image: "RB07_icon_Unlock_press_05.png" COMP;
+               image: "RB07_icon_Unlock_press_06.png" COMP;
+               image: "RB07_icon_Unlock_press_07.png" COMP;
+               image: "RB07_icon_Unlock_press_08.png" COMP;
+               image: "RB07_icon_Unlock_press_09.png" COMP;
+               image: "RB07_icon_Unlock_press_10.png" COMP;
+               image: "RB07_icon_Unlock_press_11.png" COMP;
+               image: "RB07_icon_Unlock_press_12.png" COMP;
+               image: "RB07_icon_Unlock_press_13.png" COMP;
+               image: "RB07_icon_Unlock_press_14.png" COMP;
+               image: "RB07_icon_Unlock_press_15.png" COMP;
+       }
+
+       parts {
+               part {
+                       name: "bg";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 0 114;
+                               color: 0 0 0 0;
+                       }
+               }
+
+               part {
+                       name: "image.bg";
+                       type: IMAGE;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+
+                               rel1 {
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       to: "bg";
+                               }
+                               image.normal: "RB07_Unlock_bg.png";
+                               visible: 0;
+                       }
+                       description {
+                               state: "press" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: "RB07_Unlock_bg_press.png";
+                               visible: 1;
+                       }
+               }
+
+               part {
+                       name: "lock.padding.l";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 47 0;
+                               align: 0.0 0.0;
+
+                               rel1 {
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       relative: 0.0 1.0;
+                                       to: "bg";
+                               }
+                               visible: 0;
+                       }
+               }
+
+               part {
+                       name: "lock.padding.r";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 46 0;
+                               align: 1.0 0.0;
+
+                               rel1 {
+                                       relative: 1.0 0.0;
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       to: "bg";
+                               }
+                               visible: 0;
+                       }
+               }
+
+               part {
+                       name: "lock.wrapper.image.l";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 119 119;
+                               align: 0.5 0.5;
+
+                               rel1 {
+                                       relative: 0.5 0.5;
+                                       to: "lock.image.l";
+                               }
+                               rel2 {
+                                       relative: 0.5 0.5;
+                                       to: "lock.image.l";
+                               }
+                               color: 0 0 0 0;
+                       }
+               }
+
+               part {
+                       name: "lock.image.l";
+                       type: IMAGE;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 76 76;
+                               align: 0.0 0.5;
+
+                               rel1 {
+                                       relative: 1.0 0.5;
+                                       to_x: "lock.padding.l";
+                                       to_y: "bg";
+                               }
+                               rel2 {
+                                       relative: 1.0 0.5;
+                                       to_x: "lock.padding.l";
+                                       to_y: "bg";
+                               }
+                               image.normal: "RB07_icon_Unlock_01.png";
+                       }
+                       description {
+                               state: "press" 0.0;
+                               inherit: "default" 0.0;
+                               image.normal: "RB07_icon_Unlock_press_01.png";
+                       }
+               }
+
+               part {
+                       name: "lock.image.r";
+                       type: IMAGE;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 76 76;
+                               align: 1.0 0.5;
+
+                               rel1 {
+                                       relative: 0.0 0.5;
+                                       to_x: "lock.padding.r";
+                                       to_y: "bg";
+                               }
+                               rel2 {
+                                       relative: 0.0 0.5;
+                                       to_x: "lock.padding.r";
+                                       to_y: "bg";
+                               }
+                               image.normal: "RB07_icon_Unlock_02.png";
+                               visible: 0;
+                       }
+                       DRAGLOCK_LOCK_PRESS_DESC(press02, RB07_icon_Unlock_press_02.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press03, RB07_icon_Unlock_press_03.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press04, RB07_icon_Unlock_press_04.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press05, RB07_icon_Unlock_press_05.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press06, RB07_icon_Unlock_press_06.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press07, RB07_icon_Unlock_press_07.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press08, RB07_icon_Unlock_press_08.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press09, RB07_icon_Unlock_press_09.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press10, RB07_icon_Unlock_press_10.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press11, RB07_icon_Unlock_press_11.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press12, RB07_icon_Unlock_press_12.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press13, RB07_icon_Unlock_press_13.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press14, RB07_icon_Unlock_press_14.png);
+                       DRAGLOCK_LOCK_PRESS_DESC(press15, RB07_icon_Unlock_press_15.png);
+               }
+
+               part {
+                       name: "lock.wrapper.image.r";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 122 114;
+                               align: 1.0 0.0;
+
+                               rel1 {
+                                       relative: 1.0 0.0;
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       to: "bg";
+                               }
+                               color: 0 0 0 0;
+                       }
+               }
+
+               part {
+                       name: "arrow.padding.l";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 126 0;
+                               align: 0.0 0.0;
+
+                               rel1 {
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       relative: 0.0 1.0;
+                                       to: "bg";
+                               }
+                               visible: 0;
+                       }
+               }
+
+               part {
+                       name: "arrow.padding.r";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 126 0;
+                               align: 1.0 0.0;
+
+                               rel1 {
+                                       relative: 1.0 0.0;
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       to: "bg";
+                               }
+                               visible: 0;
+                       }
+               }
+
+               part {
+                       name: "rect.arrow";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+
+                               rel1 {
+                                       relative: 1.0 0.0;
+                                       to: "arrow.padding.l";
+                               }
+                               rel2 {
+                                       relative: 0.0 1.0;
+                                       to: "arrow.padding.r";
+                               }
+                               visible: 0;
+                       }
+               }
+
+               DRAGLOCK_ARROW_RECT(arrow1, 0.0, 1/6);
+               DRAGLOCK_ARROW_RECT(arrow2, 1/6, 2/6);
+               DRAGLOCK_ARROW_RECT(arrow3, 2/6, 3/6);
+               DRAGLOCK_ARROW_RECT(arrow4, 3/6, 4/6);
+               DRAGLOCK_ARROW_RECT(arrow5, 4/6, 5/6);
+               DRAGLOCK_ARROW_RECT(arrow6, 5/6, 6/6);
+
+               DRAGLOCK_ARROW_IMAGE(image1, arrow1);
+               DRAGLOCK_ARROW_IMAGE(image2, arrow2);
+               DRAGLOCK_ARROW_IMAGE(image3, arrow3);
+               DRAGLOCK_ARROW_IMAGE(image4, arrow4);
+               DRAGLOCK_ARROW_IMAGE(image5, arrow5);
+               DRAGLOCK_ARROW_IMAGE(image6, arrow6);
+       }
+
+       programs {
+               program{
+                       name: "press.lock.l";
+                       signal: "press";
+                       source: "lock.image.l";
+                       action: STATE_SET "press" 0.0;
+                       target: "lock.image.l";
+                       target: "arrow.image1";
+                       target: "arrow.image2";
+                       target: "arrow.image3";
+                       target: "arrow.image4";
+                       target: "arrow.image5";
+                       target: "arrow.image6";
+                       target: "image.bg";
+               }
+
+               program{
+                       name: "release.lock.l";
+                       signal: "release";
+                       source: "lock.image.l";
+                       action: STATE_SET "default" 0.0;
+                       target: "lock.image.l";
+                       target: "arrow.image1";
+                       target: "arrow.image2";
+                       target: "arrow.image3";
+                       target: "arrow.image4";
+                       target: "arrow.image5";
+                       target: "arrow.image6";
+                       target: "image.bg";
+               }
+
+               DRAGLOCK_LOCK_PRESS_PROC(press02);
+               DRAGLOCK_LOCK_PRESS_PROC(press03);
+               DRAGLOCK_LOCK_PRESS_PROC(press04);
+               DRAGLOCK_LOCK_PRESS_PROC(press05);
+               DRAGLOCK_LOCK_PRESS_PROC(press06);
+               DRAGLOCK_LOCK_PRESS_PROC(press07);
+               DRAGLOCK_LOCK_PRESS_PROC(press08);
+               DRAGLOCK_LOCK_PRESS_PROC(press09);
+               DRAGLOCK_LOCK_PRESS_PROC(press10);
+               DRAGLOCK_LOCK_PRESS_PROC(press11);
+               DRAGLOCK_LOCK_PRESS_PROC(press12);
+               DRAGLOCK_LOCK_PRESS_PROC(press13);
+               DRAGLOCK_LOCK_PRESS_PROC(press14);
+               DRAGLOCK_LOCK_PRESS_PROC(press15);
+
+               program{
+                       name: "release.lock.r";
+                       signal: "release";
+                       source: "lock.image.r";
+                       action: STATE_SET "default" 0.0;
+                       target: "lock.image.r";
+               }
+       }
+}
diff --git a/res/edje/draglock-time.edc b/res/edje/draglock-time.edc
new file mode 100644 (file)
index 0000000..587852f
--- /dev/null
@@ -0,0 +1,248 @@
+/*
+  * 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.
+  */
+
+
+group {
+       name: "draglock-time";
+
+       styles {
+               style {
+                       name: "style_time";
+                       base: "font=SLP:style=Medium font_size=140 color=#f9f9f9ff align=right valign=top";
+               }
+               style {
+                       name: "style_time_period";
+                       base: "font=HelveticaNeue:style=Medium font_size=38 color=#f9f9f9ff align=right";
+               }
+       }
+
+       parts {
+               part {
+                       name: "bg";
+                       type: RECT;
+
+                       description {
+                               state: "default" 0.0;
+                               color: 0 0 0 143;
+                       }
+               }
+
+               part {
+                       name: "padding.r";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 22 0;
+                               align: 1.0 0.0;
+
+                               rel1 {
+                                       relative: 1.0 0.0;
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       to: "bg";
+                               }
+                               visible: 0;
+                       }
+               }
+
+               part {
+                       name: "padding.top";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 0 12;
+                               align: 0.0 0.0;
+
+                               rel1 {
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       relative: 0.0 0.0;
+                                       to_x: "padding.r";
+                                       to_y: "bg";
+                               }
+                               visible: 0;
+                       }
+               }
+
+               part {
+                       name: "rect.date";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 0 40;
+                               align: 1.0 0.0;
+
+                               rel1 {
+                                       relative: 0.0 1.0;
+                                       to_x: "bg";
+                                       to_y: "padding.top";
+                               }
+                               rel2 {
+                                       relative: 0.0 1.0;
+                                       to_x: "padding.r";
+                                       to_y: "padding.top";
+                               }
+                               visible: 0;
+                       }
+               }
+
+               part {
+                       name: "text.date";
+                       type: TEXT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               text {
+                                       font: "SLP:style=Medium";
+                                       size: 34;
+                                       min: 0 0;
+                                       align: 1.0 0.5;
+                               }
+                               color: 249 249 249 255;
+                               rel1 {
+                                       to: "rect.date";
+                               }
+                               rel2 {
+                                       to: "rect.date";
+                               }
+                       }
+               }
+
+               part {
+                       name: "rect.time";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 0 140;
+                               align: 1.0 0.0;
+
+                               rel1 {
+                                       relative: 0.0 1.0;
+                                       to_x: "bg";
+                                       to_y: "rect.date";
+                               }
+                               rel2 {
+                                       relative: 0.0 1.0;
+                                       to_x: "padding.r";
+                                       to_y: "rect.date";
+                               }
+                               visible: 0;
+                       }
+               }
+
+               part {
+                       name: "text.time";
+                       type: TEXTBLOCK;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               text {
+                                       style: "style_time";
+                               }
+                               color: 249 249 249 255;
+                               rel1 {
+                                       to: "rect.time";
+                               }
+                               rel2 {
+                                       to: "rect.time";
+                               }
+                       }
+               }
+
+               part {
+                       name: "rect.time.period";
+                       type: RECT;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 314 13;
+                               align: 1.0 1.0;
+
+                               rel1 {
+                                       relative: 1.0 1.0;
+                                       to_x: "bg";
+                                       to_y: "rect.time";
+                               }
+                               rel2 {
+                                       relative: 1.0 1.0;
+                                       to_x: "bg";
+                                       to_y: "rect.time";
+                               }
+                               visible: 0;
+                       }
+                       description {
+                               state: "stretch" 0.0;
+                               inherit: "default" 0.0;
+                               min: 392 13;
+                       }
+               }
+
+               part {
+                       name: "text.time.period";
+                       type: TEXTBLOCK;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               min: 0 38;
+                               align: 1 1;
+
+                               text {
+                                       style: "style_time_period";
+                               }
+                               rel1 {
+                                       relative: 0.0 0.0;
+                                       to_x: "bg";
+                                       to_y: "rect.time.period";
+                               }
+                               rel2 {
+                                       relative: 0.0 0.0;
+                                       to: "rect.time.period";
+                               }
+                       }
+               }
+       }
+
+       programs {
+               program{
+                       name: "period.default";
+                       signal: "period.default";
+                       source: "rect.time.period";
+                       action: STATE_SET "default" 0.0;
+                       target: "rect.time.period";
+               }
+               program{
+                       name: "period.stretch";
+                       signal: "period.stretch";
+                       source: "rect.time.period";
+                       action: STATE_SET "stretch" 0.0;
+                       target: "rect.time.period";
+               }
+       }
+}
diff --git a/res/edje/draglock-ui.edc b/res/edje/draglock-ui.edc
new file mode 100644 (file)
index 0000000..90d1ad8
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+  * 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.
+  */
+
+
+group {
+       name: "draglock-ui";
+
+       parts {
+               part {
+                       name: "bg";
+                       type: RECT;
+
+                       description {
+                               state: "default" 0.0;
+                               color: 0 0 0 255;
+                       }
+               }
+
+               part {
+                       name: "sw.bg";
+                       type: SWALLOW;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               rel1 {
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       to: "bg";
+                               }
+                       }
+               }
+
+               part {
+                       name: "sw.time";
+                       type: SWALLOW;
+                       scale: 1;
+
+                       description {
+                               state: "default" 0.0;
+                               align: 0.0 1.0;
+                               min: 0 356;
+                               rel1 {
+                                       relative: 0.0 1.0;
+                                       to: "bg";
+                               }
+                               rel2 {
+                                       to: "bg";
+                               }
+                       }
+               }
+       }
+}
diff --git a/res/edje/draglock.edc b/res/edje/draglock.edc
new file mode 100644 (file)
index 0000000..bc6df7d
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+  * 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.
+  */
+
+
+collections {
+       #include "draglock-ui.edc"
+       #include "draglock-time.edc"
+       #include "draglock-slide.edc"
+}
diff --git a/res/icons/default/small/icon_application.png b/res/icons/default/small/icon_application.png
new file mode 100644 (file)
index 0000000..b35c72b
Binary files /dev/null and b/res/icons/default/small/icon_application.png differ
diff --git a/res/images/RB07_Unlock_bg.png b/res/images/RB07_Unlock_bg.png
new file mode 100644 (file)
index 0000000..0e0a6ea
Binary files /dev/null and b/res/images/RB07_Unlock_bg.png differ
diff --git a/res/images/RB07_Unlock_bg_press.png b/res/images/RB07_Unlock_bg_press.png
new file mode 100644 (file)
index 0000000..17caba0
Binary files /dev/null and b/res/images/RB07_Unlock_bg_press.png differ
diff --git a/res/images/RB07_icon_Unlock_01.png b/res/images/RB07_icon_Unlock_01.png
new file mode 100644 (file)
index 0000000..c868560
Binary files /dev/null and b/res/images/RB07_icon_Unlock_01.png differ
diff --git a/res/images/RB07_icon_Unlock_02.png b/res/images/RB07_icon_Unlock_02.png
new file mode 100644 (file)
index 0000000..01329e4
Binary files /dev/null and b/res/images/RB07_icon_Unlock_02.png differ
diff --git a/res/images/RB07_icon_Unlock_arrow.png b/res/images/RB07_icon_Unlock_arrow.png
new file mode 100644 (file)
index 0000000..7b5f9ab
Binary files /dev/null and b/res/images/RB07_icon_Unlock_arrow.png differ
diff --git a/res/images/RB07_icon_Unlock_arrow_press.png b/res/images/RB07_icon_Unlock_arrow_press.png
new file mode 100644 (file)
index 0000000..972cedc
Binary files /dev/null and b/res/images/RB07_icon_Unlock_arrow_press.png differ
diff --git a/res/images/RB07_icon_Unlock_press_01.png b/res/images/RB07_icon_Unlock_press_01.png
new file mode 100644 (file)
index 0000000..61bd43b
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_01.png differ
diff --git a/res/images/RB07_icon_Unlock_press_02.png b/res/images/RB07_icon_Unlock_press_02.png
new file mode 100644 (file)
index 0000000..68a1c3c
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_02.png differ
diff --git a/res/images/RB07_icon_Unlock_press_03.png b/res/images/RB07_icon_Unlock_press_03.png
new file mode 100644 (file)
index 0000000..41787ca
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_03.png differ
diff --git a/res/images/RB07_icon_Unlock_press_04.png b/res/images/RB07_icon_Unlock_press_04.png
new file mode 100644 (file)
index 0000000..35f459f
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_04.png differ
diff --git a/res/images/RB07_icon_Unlock_press_05.png b/res/images/RB07_icon_Unlock_press_05.png
new file mode 100644 (file)
index 0000000..cae5dd3
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_05.png differ
diff --git a/res/images/RB07_icon_Unlock_press_06.png b/res/images/RB07_icon_Unlock_press_06.png
new file mode 100644 (file)
index 0000000..9a8370f
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_06.png differ
diff --git a/res/images/RB07_icon_Unlock_press_07.png b/res/images/RB07_icon_Unlock_press_07.png
new file mode 100644 (file)
index 0000000..2ee6dfe
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_07.png differ
diff --git a/res/images/RB07_icon_Unlock_press_08.png b/res/images/RB07_icon_Unlock_press_08.png
new file mode 100644 (file)
index 0000000..b39f220
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_08.png differ
diff --git a/res/images/RB07_icon_Unlock_press_09.png b/res/images/RB07_icon_Unlock_press_09.png
new file mode 100644 (file)
index 0000000..7f00111
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_09.png differ
diff --git a/res/images/RB07_icon_Unlock_press_10.png b/res/images/RB07_icon_Unlock_press_10.png
new file mode 100644 (file)
index 0000000..3b1f99f
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_10.png differ
diff --git a/res/images/RB07_icon_Unlock_press_11.png b/res/images/RB07_icon_Unlock_press_11.png
new file mode 100644 (file)
index 0000000..4342186
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_11.png differ
diff --git a/res/images/RB07_icon_Unlock_press_12.png b/res/images/RB07_icon_Unlock_press_12.png
new file mode 100644 (file)
index 0000000..48b4501
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_12.png differ
diff --git a/res/images/RB07_icon_Unlock_press_13.png b/res/images/RB07_icon_Unlock_press_13.png
new file mode 100644 (file)
index 0000000..521bf03
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_13.png differ
diff --git a/res/images/RB07_icon_Unlock_press_14.png b/res/images/RB07_icon_Unlock_press_14.png
new file mode 100644 (file)
index 0000000..2b41e5a
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_14.png differ
diff --git a/res/images/RB07_icon_Unlock_press_15.png b/res/images/RB07_icon_Unlock_press_15.png
new file mode 100644 (file)
index 0000000..57dec32
Binary files /dev/null and b/res/images/RB07_icon_Unlock_press_15.png differ
diff --git a/src/draglock-bg.c b/src/draglock-bg.c
new file mode 100644 (file)
index 0000000..bc07967
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+  * 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.
+  */
+
+
+#include <app.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+#include "draglock.h"
+#include "draglock-bg.h"
+
+#define DEFAULT_BG_PATH "/opt/share/settings/Wallpapers/Home_default.jpg"
+
+Evas_Object *draglock_bg_get_image(Evas_Object *parent) {
+       Evas_Object *bg;
+       char *file = NULL;
+
+       Eina_Bool eina_ret = EINA_FALSE;
+       int ret = 0;
+
+       if (parent == NULL) {
+               return NULL;
+       }
+
+       if ((file = vconf_get_str(VCONFKEY_IDLE_LOCK_BGSET)) != NULL) {
+
+        } else if ((file = vconf_get_str(VCONFKEY_BGSET)) != NULL) {
+
+        }
+
+       DRAGLOCK_DBG("file path : %s", file);
+
+       bg = elm_image_add(parent);
+
+       if (file != NULL) {
+               eina_ret = elm_image_file_set(bg, file, NULL);
+               if (eina_ret == EINA_FALSE) {
+                       elm_image_file_set(bg, DEFAULT_BG_PATH, NULL);
+               }
+               free(file);
+       } else {
+               elm_image_file_set(bg, DEFAULT_BG_PATH, NULL);
+       }
+
+       return bg;
+}
diff --git a/src/draglock-slide.c b/src/draglock-slide.c
new file mode 100644 (file)
index 0000000..b47108f
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+  * 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.
+  */
+
+
+#include "draglock.h"
+#include "draglock-util.h"
+
+Evas_Object *draglock_slide_get_slider(Evas_Object *parent) {
+       Evas_Object *layout = NULL;
+
+       if (parent == NULL) {
+               DRAGLOCK_DBG("parent is null");
+               return NULL;
+       }
+
+       layout = draglock_util_add_layout(parent, EDJEFILE, "draglock-slide");
+
+       if (layout == NULL) {
+               return NULL;
+       }
+
+       return layout;
+}
diff --git a/src/draglock-time.c b/src/draglock-time.c
new file mode 100644 (file)
index 0000000..cbdc247
--- /dev/null
@@ -0,0 +1,243 @@
+/*
+  * 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.
+  */
+
+
+#include <time.h>
+#include <runtime_info.h>
+#include <unicode/uloc.h>
+#include <unicode/udat.h>
+#include <unicode/udatpg.h>
+#include <unicode/ustring.h>
+
+#include "draglock.h"
+#include "draglock-util.h"
+
+#define DRAGLOCK_SUPPORT_ICU
+
+static Eina_Bool _draglock_get_time(struct tm *st, char *data, int len,
+               int *is_24hour) {
+
+       int r = -1, hour = 0;
+       char temp[32] = { 0, };
+       bool is_24hour_enabled = 0;
+
+       if (st == NULL) {
+               DRAGLOCK_ERR("st is NULL");
+               return EINA_FALSE;
+       }
+       if (data == NULL || len <= 0) {
+               DRAGLOCK_ERR("data is NULL");
+               return EINA_FALSE;
+       }
+       if (is_24hour == NULL) {
+               DRAGLOCK_ERR("is_24hour is NULL");
+               return EINA_FALSE;
+       }
+
+       r = runtime_info_get_value_bool(
+                       RUNTIME_INFO_KEY_24HOUR_CLOCK_FORMAT_ENABLED, &is_24hour_enabled);
+
+       DRAGLOCK_DBG("r:%d, is_24hour_enabled:%d bufSize:%d",
+                       r, is_24hour_enabled, sizeof(data));
+
+       if (r == RUNTIME_INFO_ERROR_NONE && is_24hour_enabled == 1) {
+               strftime(data, len, "%H:%M", st);
+       } else {
+               /* if %l is 1 ~9, it has blank space in front. Trim it using atoi function */
+               strftime(temp, sizeof(temp), "%l", st);
+               hour = atoi(temp);
+               strftime(temp, sizeof(temp), ":%M", st);
+
+               snprintf(data, len, "%d%s", hour, temp);
+       }
+
+       *is_24hour = is_24hour_enabled;
+       DRAGLOCK_DBG("data = %s", data);
+
+       return EINA_TRUE;
+}
+
+static Eina_Bool _draglock_get_date(time_t tt, char *data) {
+       UErrorCode status = U_ZERO_ERROR;
+       UDateTimePatternGenerator *generator;
+       UDateFormat *formatter;
+       UChar skeleton[40] = { 0 }, pattern[40] = { 0 }, formatted[40] = { 0 };
+       int32_t patternCapacity, formattedCapacity;
+       int32_t skeletonLength, patternLength, formattedLength;
+       UDate date;
+       const char *locale;
+       const char customSkeleton[] = UDAT_MONTH_WEEKDAY_DAY;
+
+       /* set UDate  from time_t */
+       date = (UDate) tt * 1000;
+
+       /* get default locale  */
+       uloc_setDefault(__secure_getenv("LC_TIME"), &status); /* for thread saftey  */
+       locale = uloc_getDefault();
+
+       /* open datetime pattern generator */
+       generator = udatpg_open(locale, &status);
+       if (generator == NULL)
+               return EINA_FALSE;
+
+       /* calculate pattern string capacity */
+       patternCapacity = (int32_t)(sizeof(pattern) / sizeof((pattern)[0]));
+
+       /* ascii to unicode for input skeleton */
+       u_uastrcpy(skeleton, customSkeleton);
+
+       /* get skeleton length */
+       skeletonLength = strlen(customSkeleton);
+
+       /* get best pattern using skeleton */
+       patternLength = udatpg_getBestPattern(generator, skeleton, skeletonLength,
+                       pattern, patternCapacity, &status);
+
+       /* open datetime formatter using best pattern */
+       formatter = udat_open(UDAT_IGNORE, UDAT_DEFAULT, locale, NULL, -1, pattern,
+                       patternLength, &status);
+       if (formatter == NULL) {
+               udatpg_close(generator);
+               return EINA_FALSE;
+       }
+
+       /* calculate formatted string capacity */
+       formattedCapacity = (int32_t)(sizeof(formatted) / sizeof((formatted)[0]));
+
+       /* formatting date using formatter by best pattern */
+       formattedLength = udat_format(formatter, date, formatted, formattedCapacity,
+                       NULL, &status);
+
+       /* unicode to ascii to display */
+       u_austrcpy(data, formatted);
+       DRAGLOCK_DBG("formatted string=%s", data);
+
+       /* close datetime pattern generator */
+       udatpg_close(generator);
+
+       /* close datetime formatter */
+       udat_close(formatter);
+
+       return EINA_TRUE;
+}
+
+static Eina_Bool _draglock_time_set_date(void *data) {
+       struct appdata *ad = (struct appdata *) data;
+
+       if (ad == NULL || ad->time_layout == NULL) {
+               return ECORE_CALLBACK_CANCEL;
+       }
+
+       int is_24hour = 0;
+       struct tm st;
+       time_t tt;
+       char buf[128] = { 0, };
+
+       tt = time(NULL);
+       localtime_r(&tt, &st);
+
+       if (ad->clock_timer != NULL) {
+               ecore_timer_del(ad->clock_timer);
+               ad->clock_timer = NULL;
+       }
+
+       ad->clock_timer = ecore_timer_add(60 - st.tm_sec, _draglock_time_set_date,
+                       ad);
+
+#ifdef DRAGLOCK_SUPPORT_ICU
+       if (_draglock_get_date(tt, buf) == EINA_TRUE)
+               elm_object_part_text_set(ad->time_layout, "text.date", buf);
+#else
+       strftime(buf, sizeof(buf), "%b %d, %A", &st);
+       elm_object_part_text_set(ad->time_layout, "text.date", buf);
+#endif
+
+       if (_draglock_get_time(&st, buf, sizeof(buf), &is_24hour) == EINA_TRUE) {
+
+               if (is_24hour == 0) {
+                       if ((st.tm_hour >= 22 && st.tm_hour <= 23)
+                                       || (st.tm_hour >= 10 && st.tm_hour <= 12)
+                                       || (st.tm_hour == 0)) {
+                               edje_object_signal_emit(_EDJ(ad->time_layout), "period.stretch",
+                                               "rect.time.period");
+                       } else {
+                               edje_object_signal_emit(_EDJ(ad->time_layout), "period.default",
+                                               "rect.time.period");
+                       }
+
+                       if (st.tm_hour >= 0 && st.tm_hour < 12) {
+                               elm_object_part_text_set(ad->time_layout, "text.time.period",
+                                               "AM");
+                       } else {
+                               elm_object_part_text_set(ad->time_layout, "text.time.period",
+                                               "PM");
+                       }
+               } else {
+                       elm_object_part_text_set(ad->time_layout, "text.time.period", "");
+               }
+               elm_object_part_text_set(ad->time_layout, "text.time", buf);
+       }
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
+static void _draglock_power_changed_cb(power_state_e state, void *user_data) {
+       power_state_e current_power_state;
+       struct appdata *ad = (struct appdata *) user_data;
+
+       if (ad == NULL) {
+               DRAGLOCK_DBG("ad or ad->ui_layout is null");
+               return;
+       }
+
+       current_power_state = power_get_state();
+
+       DRAGLOCK_DBG("prev p-state:%d cur p-state:%d",
+                       ad->power_state, current_power_state);
+
+       if (ad->power_state == POWER_STATE_SCREEN_OFF
+                       && (current_power_state == POWER_STATE_SCREEN_DIM
+                                       || current_power_state == POWER_STATE_NORMAL)) {
+               _draglock_time_set_date(user_data);
+               DRAGLOCK_DBG("(after sleep)time updated");
+       }
+
+       ad->power_state = current_power_state;
+}
+
+Evas_Object *draglock_time_get_time(void *data) {
+       struct appdata *ad = (struct appdata *) data;
+       Evas_Object *layout = NULL;
+
+       if (ad == NULL || ad->ui_layout == NULL) {
+               DRAGLOCK_DBG("ad or ad->ui_layout is null");
+               return NULL;
+       }
+
+       layout = draglock_util_add_layout(ad->ui_layout, EDJEFILE, "draglock-time");
+       ad->time_layout = layout;
+
+       if (layout == NULL) {
+               return NULL;
+       }
+
+       _draglock_time_set_date(ad);
+
+       ad->power_state = power_get_state();
+       power_set_changed_cb(_draglock_power_changed_cb, ad);
+
+       return layout;
+}
diff --git a/src/draglock-ui.c b/src/draglock-ui.c
new file mode 100644 (file)
index 0000000..0bf2e05
--- /dev/null
@@ -0,0 +1,251 @@
+/*
+  * 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.
+  */
+
+
+#include <app.h>
+#include "draglock.h"
+#include "draglock-util.h"
+#include "draglock-bg.h"
+#include "draglock-time.h"
+#include "draglock-slide.h"
+
+static void _draglock_ui_down_cb(void *data, Evas *evas, Evas_Object *obj,
+               void *event_info) {
+       Evas_Event_Mouse_Down *ev = event_info;
+       struct appdata *ad = (struct appdata *) data;
+
+       if (ad == NULL) {
+               DRAGLOCK_ERR("appdata is NULL");
+               return;
+       }
+
+       if (ev == NULL) {
+               DRAGLOCK_ERR("event_info is NULL");
+               return;
+       }
+
+       if (ad->slide_rel1.x <= ev->canvas.x && ad->slide_rel1.y <= ev->canvas.y
+                       && (ad->slide_rel1.x + ad->slide_rel1.w) >= ev->canvas.x
+                       && (ad->slide_rel1.y + ad->slide_rel1.h) >= ev->canvas.y) {
+               ad->slide_status = TRUE;
+
+               edje_object_signal_emit(_EDJ(ad->slide_layout), "press",
+                               "lock.image.l");
+               edje_object_signal_emit(_EDJ(ad->slide_layout), "press02",
+                               "lock.image.r");
+       } else {
+               DRAGLOCK_DBG("sliding is canceled");
+               ad->slide_status = FALSE;
+       }
+}
+
+static void _draglock_ui_move_cb(void *data, Evas *evas, Evas_Object *obj,
+               void *event_info) {
+       Evas_Event_Mouse_Move *ev = event_info;
+       struct appdata *ad = (struct appdata *) data;
+       int step_width = 0;
+       int step_number = 0;
+       int alpha = 0;
+
+       if (ad == NULL) {
+               DRAGLOCK_ERR("appdata is NULL");
+               return;
+       }
+
+       if (ev == NULL) {
+               DRAGLOCK_ERR("event_info is NULL");
+               return;
+       }
+
+       if (ad->slide_status == FALSE)
+       {
+               return;
+       }
+
+       if (ad->slide_rel1.x <= ev->cur.canvas.x
+                       && ad->slide_rel1.y <= ev->cur.canvas.y
+                       && (ad->slide_rel2.x + ad->slide_rel2.w) >= ev->cur.canvas.x
+                       && (ad->slide_rel2.y + ad->slide_rel2.h) >= ev->cur.canvas.y) {
+               ad->slide_status = TRUE;
+
+               step_width = (ad->slide_rel2.x + ad->slide_rel2.w - ad->slide_rel1.x)
+                               / 14;
+               step_number = (ev->cur.canvas.x - ad->slide_rel1.x) / step_width;
+
+               alpha = 255 - (2.55 * step_number * 3);
+
+               if (step_number < 1) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press02",
+                                       "lock.image.r");
+               } else if (step_number < 2) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press03",
+                                       "lock.image.r");
+               } else if (step_number < 3) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press04",
+                                       "lock.image.r");
+               } else if (step_number < 4) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press05",
+                                       "lock.image.r");
+               } else if (step_number < 5) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press06",
+                                       "lock.image.r");
+               } else if (step_number < 6) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press07",
+                                       "lock.image.r");
+               } else if (step_number < 7) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press08",
+                                       "lock.image.r");
+               } else if (step_number < 8) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press09",
+                                       "lock.image.r");
+               } else if (step_number < 9) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press10",
+                                       "lock.image.r");
+               } else if (step_number < 10) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press11",
+                                       "lock.image.r");
+               } else if (step_number < 11) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press12",
+                                       "lock.image.r");
+               } else if (step_number < 12) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press13",
+                                       "lock.image.r");
+               } else if (step_number < 13) {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press14",
+                                       "lock.image.r");
+               } else {
+                       edje_object_signal_emit(_EDJ(ad->slide_layout), "press15",
+                                       "lock.image.r");
+               }
+               evas_object_color_set(ad->ui_layout, alpha, alpha, alpha, alpha);
+       } else {
+               DRAGLOCK_DBG("sliding is canceled");
+               ad->slide_status = FALSE;
+
+               evas_object_color_set(ad->ui_layout, 255, 255, 255, 255);
+
+               edje_object_signal_emit(_EDJ(ad->slide_layout), "release",
+                               "lock.image.l");
+               edje_object_signal_emit(_EDJ(ad->slide_layout), "release",
+                               "lock.image.r");
+       }
+}
+
+static void _draglock_ui_up_cb(void *data, Evas *evas, Evas_Object *obj,
+               void *event_info) {
+       Evas_Event_Mouse_Up *ev = event_info;
+       struct appdata *ad = (struct appdata *) data;
+
+       if (ad == NULL) {
+               DRAGLOCK_ERR("appdata is NULL");
+               return;
+       }
+
+       if (ev == NULL) {
+               DRAGLOCK_ERR("event_info is NULL");
+               return;
+       }
+
+       if (ad->slide_status == TRUE && ad->slide_rel2.x <= ev->canvas.x
+                       && ad->slide_rel2.y <= ev->canvas.y
+                       && (ad->slide_rel2.x + ad->slide_rel2.w) >= ev->canvas.x
+                       && (ad->slide_rel2.y + ad->slide_rel2.h) >= ev->canvas.y) {
+               ad->slide_status = TRUE;
+       } else {
+               DRAGLOCK_DBG("sliding is canceled");
+               ad->slide_status = FALSE;
+       }
+
+       edje_object_signal_emit(_EDJ(ad->slide_layout), "release", "lock.image.l");
+       edje_object_signal_emit(_EDJ(ad->slide_layout), "release", "lock.image.r");
+
+       if (ad->slide_status == TRUE) {
+               DRAGLOCK_DBG("unlock the lock-screen");
+               app_efl_exit();
+       }
+
+       evas_object_color_set(ad->ui_layout, 255, 255, 255, 255);
+
+       ad->slide_status = FALSE;
+}
+
+int draglock_ui_create(void *data) {
+       struct appdata *ad = (struct appdata *) data;
+       Evas_Object *layout = NULL;
+       Evas_Object *image = NULL;
+       Evas_Object *time = NULL;
+       Evas_Object *slide = NULL;
+
+       if (ad == NULL) {
+               return FALSE;
+       }
+
+       layout = draglock_util_add_layout(ad->win, EDJEFILE, "draglock-ui");
+       evas_object_resize(layout, ad->win_w, ad->win_h);
+
+       if (layout == NULL) {
+               return FALSE;
+       }
+       ad->ui_layout = layout;
+
+       image = draglock_bg_get_image(layout);
+       elm_object_part_content_set(layout, "sw.bg", image);
+
+       time = draglock_time_get_time(ad);
+       elm_object_part_content_set(layout, "sw.time", time);
+
+       slide = draglock_slide_get_slider(layout);
+       evas_object_resize(slide, ad->win_w, SLIDE_RATIO_H * ad->win_h);
+       evas_object_move(slide, 0, SLIDE_RATIO_Y * ad->win_h);
+
+       ad->slide_layout = slide;
+
+       evas_object_geometry_get(
+                       edje_object_part_object_get(_EDJ(slide), "lock.wrapper.image.l"),
+                       &ad->slide_rel1.x, &ad->slide_rel1.y, &ad->slide_rel1.w,
+                       &ad->slide_rel1.h);
+
+       evas_object_geometry_get(
+                       edje_object_part_object_get(_EDJ(slide), "lock.wrapper.image.r"),
+                       &ad->slide_rel2.x, &ad->slide_rel2.y, &ad->slide_rel2.w,
+                       &ad->slide_rel2.h);
+
+       evas_object_event_callback_add(slide, EVAS_CALLBACK_MOUSE_MOVE,
+                       _draglock_ui_move_cb, ad);
+       evas_object_event_callback_add(slide, EVAS_CALLBACK_MOUSE_DOWN,
+                       _draglock_ui_down_cb, ad);
+       evas_object_event_callback_add(slide, EVAS_CALLBACK_MOUSE_UP,
+                       _draglock_ui_up_cb, ad);
+
+       evas_object_show(layout);
+
+       return TRUE;
+}
+
+int draglock_ui_destroy(void *data) {
+       struct appdata *ad = (struct appdata *) data;
+
+       if (ad == NULL) {
+               return FALSE;
+       }
+
+       if (ad->clock_timer != NULL) {
+               ecore_timer_del(ad->clock_timer);
+               ad->clock_timer = NULL;
+       }
+
+       return TRUE;
+}
diff --git a/src/draglock-util.c b/src/draglock-util.c
new file mode 100644 (file)
index 0000000..6234f43
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+  * 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.
+  */
+
+
+#include <app.h>
+#include <Ecore_X.h>
+#include "draglock.h"
+
+static void _draglock_util_window_deleted_cb(void *data, Evas_Object *obj,
+               void *event) {
+       app_efl_exit();
+}
+
+Evas_Object *draglock_util_add_window(const char *name) {
+       Evas_Object *obj_window = NULL;
+       int width = 0, height = 0;
+
+       obj_window = elm_win_add(NULL, name, ELM_WIN_BASIC);
+       if (obj_window != NULL) {
+               elm_win_title_set(obj_window, name);
+               elm_win_borderless_set(obj_window, EINA_TRUE);
+               evas_object_smart_callback_add(obj_window, "delete,request",
+                               _draglock_util_window_deleted_cb, NULL);
+               ecore_x_window_size_get(ecore_x_window_root_first_get(), &width,
+                               &height);
+               evas_object_resize(obj_window, width, height);
+               elm_win_indicator_mode_set(obj_window, ELM_WIN_INDICATOR_SHOW);
+               elm_win_alpha_set(obj_window, EINA_TRUE);
+       }
+
+       return obj_window;
+}
+
+Evas_Object *draglock_util_add_bg(Evas_Object *window) {
+       Evas_Object *obj_background = NULL;
+
+       if (window == NULL) {
+               return NULL;
+       }
+
+       obj_background = elm_bg_add(window);
+
+       if (obj_background != NULL) {
+               evas_object_size_hint_weight_set(obj_background, EVAS_HINT_EXPAND,
+                               EVAS_HINT_EXPAND);
+               elm_object_style_set(obj_background, "transparent");
+
+               elm_win_resize_object_add(window, obj_background);
+
+               evas_object_show(obj_background);
+       }
+
+       return obj_background;
+}
+
+Evas_Object *draglock_util_add_layout(Evas_Object *parent, const char *file,
+               const char *group) {
+       Evas_Object *layout = NULL;
+       Eina_Bool ret = EINA_FALSE;
+
+       if (parent == NULL) {
+               DRAGLOCK_ERR("parent is NULL");
+               return NULL;
+       }
+
+       layout = elm_layout_add(parent);
+       if (layout == NULL) {
+               DRAGLOCK_ERR("layout is NULL");
+               return NULL;
+       }
+
+       ret = elm_layout_file_set(layout, file, group);
+       DRAGLOCK_DBG("File:%s, Group:%s", file, group);
+       if (ret != EINA_TRUE) {
+               DRAGLOCK_DBG("File:%s, Group:%s", file, group);
+               evas_object_del(layout);
+               return NULL;
+       }
+       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
+                       EVAS_HINT_EXPAND);
+       evas_object_show(layout);
+
+       return layout;
+}
diff --git a/src/draglock.c b/src/draglock.c
new file mode 100644 (file)
index 0000000..ee36913
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+  * 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.
+  */
+
+
+#include <stdio.h>
+#include <app.h>
+#include <Ecore_X.h>
+#include "draglock.h"
+#include "draglock-ui.h"
+#include "draglock-util.h"
+
+static void device_orientation(app_device_orientation_e orientation,
+               void *user_data) {
+       struct appdata *ad = (struct appdata *) user_data;
+
+       if (ad == NULL || ad->win == NULL)
+               return;
+}
+
+static bool app_create(void *user_data) {
+       struct appdata *ad = (struct appdata *) user_data;
+       Evas_Object *win;
+       Evas_Object *bg;
+       char *name;
+
+       DRAGLOCK_DBG("launching draglock");
+
+       if (ad == NULL) {
+               return FALSE;
+       }
+
+       ecore_x_window_size_get(ecore_x_window_root_first_get(), &ad->win_w,
+                       &ad->win_h);
+       DRAGLOCK_DBG("window size(%d,%d)", ad->win_w, ad->win_h);
+
+       /* create window */
+       app_get_name(&name);
+
+       win = draglock_util_add_window(name);
+       if (win == NULL)
+               return FALSE;
+       ad->win = win;
+
+       evas_object_show(win);
+
+       ad->scale = elm_scale_get();
+
+       bg = draglock_util_add_bg(win);
+
+       draglock_ui_create(ad);
+
+       free(name);
+
+       return TRUE;
+}
+
+static void app_terminate(void *user_data) {
+       struct appdata *ad = (struct appdata *) user_data;
+
+       if (ad == NULL) {
+               return;
+       }
+
+       draglock_ui_destroy(ad);
+
+       if (ad->win)
+               evas_object_del(ad->win);
+}
+
+static void app_pause(void *user_data) {
+       struct appdata *ad = (struct appdata *) user_data;
+       (void) ad;
+}
+
+static void app_resume(void *user_data) {
+       struct appdata *ad = (struct appdata *) user_data;
+       (void) ad;
+}
+
+static void app_service(service_h service, void *user_data) {
+       struct appdata *ad = (struct appdata *) user_data;
+
+       if (ad == NULL) {
+               return;
+       }
+
+       if (ad->win)
+               elm_win_activate(ad->win);
+}
+
+int main(int argc, char *argv[]) {
+       struct appdata ad;
+
+       app_event_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.service = app_service;
+       event_callback.low_memory = NULL;
+       event_callback.low_battery = NULL;
+       event_callback.device_orientation = device_orientation;
+       event_callback.language_changed = NULL;
+       event_callback.region_format_changed = NULL;
+
+       memset(&ad, 0x0, sizeof(struct appdata));
+
+       return app_efl_main(&argc, &argv, &event_callback, &ad);
+}