--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(boot-animation C)
+
+SET(SRCS
+ src/boot-animation.c
+ src/animation.c
+)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+ elementary
+ avsystem
+ audio-session-mgr
+ utilX
+ vconf
+ ecore-x
+ evas
+ ecore-evas
+ edje
+ x11
+)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+
+ADD_CUSTOM_COMMAND(OUTPUT poweroff.edj
+ COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/data/image
+ ${CMAKE_SOURCE_DIR}/data/poweroff.edc ${CMAKE_BINARY_DIR}/poweroff.edj
+ DEPENDS ${CMAKE_SOURCE_DIR}/data/poweroff.edc
+ ${CMAKE_SOURCE_DIR}/data/poweroff_image.h
+ ${CMAKE_SOURCE_DIR}/data/poweroff_part.h
+)
+ADD_CUSTOM_COMMAND(OUTPUT poweron.edj
+ COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/data/image
+ ${CMAKE_SOURCE_DIR}/data/poweron.edc ${CMAKE_BINARY_DIR}/poweron.edj
+ DEPENDS ${CMAKE_SOURCE_DIR}/data/poweron.edc
+ ${CMAKE_SOURCE_DIR}/data/poweron_image.h
+ ${CMAKE_SOURCE_DIR}/data/poweron_part.h
+)
+ADD_CUSTOM_TARGET(edj_build DEPENDS poweron.edj poweroff.edj)
+ADD_DEPENDENCIES(${PROJECT_NAME} edj_build)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/poweron.edj DESTINATION share/edje)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/poweroff.edj DESTINATION share/edje)
+
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/boot-ani DESTINATION /etc/init.d
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+
--- /dev/null
+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.
--- /dev/null
+INCLUDES=include
+SRC+=test.c
+SRC+=src/wav_parser.c
+CFLAGS+=-D_DEBUG
+CFLAGS+=-I${INCLUDES}
+all: test.c src/wav_parser.c
+ @gcc ${CFLAGS} ${SRC} `pkg-config avsysaudio --cflags --libs` -o test
--- /dev/null
+#!/bin/sh
+
+i=0
+while [ ! -f /tmp/.X0-lock ];
+do
+ let i++
+ echo -ne "Waiting X $i\r"
+ sleep 0.1
+done
+
+j=0
+while [ ! -f /tmp/.wm_ready ];
+do
+ let j++
+ echo -ne "Waiting wm_ready $j\r"
+ sleep 0.1
+done
+
+if [ ! -e /tmp/restart ]; then
+ if [ -x /usr/bin/boot-animation ]; then
+ /usr/bin/boot-animation --start &
+ sleep 1
+ fi
+fi
--- /dev/null
+#!/bin/sh
+
+case "$1" in
+ poweron)
+ IMG_H=$1_image.h
+ PART_H=$1_part.h
+ ;;
+ poweroff)
+ IMG_H=$1_image.h
+ PART_H=$1_part.h
+ ;;
+ *)
+ echo "usage) $0 {poweron|poweroff}"
+ echo " ex) # $0 poweron"
+ exit 1
+ ;;
+esac
+
+if [ -e $IMG_H ]; then
+ mv $IMG_H $IMG_H.old
+fi
+touch $IMG_H
+
+if [ -e $PART_H ]; then
+ mv $PART_H $PART_H.old
+fi
+touch part.$$
+
+LASTIMG=
+
+cd image
+
+for file in ./$1/*.png; do
+ echo "image: \"$file\" LOSSY 85;" >> ../$IMG_H
+ echo "tween: \"$file\";" >> ../part.$$
+ LASTIMG=$file
+done
+
+cd ..
+
+echo "normal: \"$LASTIMG\";" > $PART_H
+cat part.$$ >> $PART_H
+rm part.$$
+
--- /dev/null
+/*
+ * 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.
+ */
+
+
+images {
+#include "poweroff_image.h"
+}
+
+collections {
+ group { name: "poweroff";
+
+ parts {
+ part { name: "poweroff";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ image {
+#include "poweroff_part.h"
+ }
+ visible: 1;
+ }
+ }
+ }
+
+ programs {
+ program {
+ name: "poweroff";
+ signal: "show";
+ action: STATE_SET "default" 0.0;
+ target: "poweroff";
+ transition: LINEAR 2;
+ after: "poweroff_end";
+ }
+
+ program {
+ name: "poweroff_end";
+ action: SIGNAL_EMIT "end" "animation";
+ }
+ }
+ }
+}
+
--- /dev/null
+/*
+ * 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.
+ */
+
+
+ image:"HD/power_off_720_1280/power_off_720_1280__00000.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00001.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00002.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00003.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00004.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00005.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00006.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00007.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00008.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00009.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00010.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00011.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00012.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00013.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00014.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00015.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00016.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00017.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00018.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00019.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00020.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00021.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00022.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00023.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00024.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00025.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00026.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00027.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00028.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00029.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00030.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00031.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00032.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00033.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00034.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00035.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00036.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00037.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00038.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00039.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00040.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00041.png" LOSSY 85;
+ image:"HD/power_off_720_1280/power_off_720_1280__00042.png" LOSSY 85;
+
--- /dev/null
+/*
+ * 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.
+ */
+
+
+ normal:"HD/power_off_720_1280/power_off_720_1280__00042.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00000.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00001.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00002.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00003.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00004.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00005.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00006.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00007.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00008.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00009.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00010.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00011.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00012.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00013.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00014.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00015.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00016.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00017.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00018.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00019.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00020.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00021.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00022.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00023.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00024.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00025.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00026.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00027.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00028.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00029.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00030.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00031.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00032.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00033.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00034.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00035.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00036.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00037.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00038.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00039.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00040.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00041.png";
+ tween:"HD/power_off_720_1280/power_off_720_1280__00042.png";
--- /dev/null
+/*
+ * 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.
+ */
+
+
+images {
+#include "poweron_image.h"
+}
+
+collections {
+ group {
+ name: "poweron";
+
+ parts {
+ part {
+ name: "poweron";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ image {
+#include "poweron_part.h"
+ }
+ visible: 1;
+ }
+ }
+ }
+
+ programs {
+ program {
+ name: "poweron";
+ signal: "show";
+ action: STATE_SET "default" 0.0;
+ target: "poweron";
+ transition: LINEAR 4;
+ after: "poweron_end";
+ }
+ program {
+ name: "poweron_end";
+ action: SIGNAL_EMIT "end" "animation";
+ }
+ }
+ }
+}
+
--- /dev/null
+/*
+ * 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.
+ */
+
+
+ image:"HD/power_on_720_1280/power_on_720_1280__00000.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00001.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00002.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00003.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00004.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00005.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00006.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00007.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00008.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00009.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00010.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00011.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00012.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00013.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00014.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00015.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00016.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00017.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00018.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00019.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00020.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00021.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00022.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00023.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00024.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00025.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00026.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00027.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00028.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00029.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00030.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00031.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00032.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00033.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00034.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00035.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00036.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00037.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00038.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00039.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00040.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00041.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00042.png" LOSSY 85;
+ image:"HD/power_on_720_1280/power_on_720_1280__00043.png" LOSSY 85;
+
--- /dev/null
+/*
+ * 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.
+ */
+
+
+ normal:"HD/power_on_720_1280/power_on_720_1280__00000.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00000.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00001.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00002.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00003.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00004.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00005.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00006.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00007.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00008.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00009.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00010.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00011.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00012.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00013.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00014.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00015.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00016.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00017.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00018.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00019.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00020.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00021.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00022.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00023.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00024.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00025.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00026.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00027.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00028.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00029.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00030.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00031.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00032.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00033.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00034.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00035.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00036.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00037.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00038.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00039.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00040.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00041.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00042.png";
+ tween:"HD/power_on_720_1280/power_on_720_1280__00043.png";
+
\ No newline at end of file
--- /dev/null
+@PREFIX@/bin/*
+@PREFIX@/share/*
+/etc/init.d/*
--- /dev/null
+#!/bin/sh
+
+ln -s /etc/init.d/boot-ani /etc/rc.d/rc3.d/S41boot-ani
+
+vconftool $GOPTION -i set -t string memory/boot-animation/restart start:start
+
+sync
--- /dev/null
+boot-animation (0.3.1-1) unstable; urgency=low
+
+ * apply exclusive in power off with msg
+ * Git: pkgs/b/boot-animation
+ * Tag: boot-animation_0.3.1-1
+
+ -- Seungtaek Chung <seungtaek.chung@samsung.com> Mon, 16 Apr 2012 15:22:20 +0900
--- /dev/null
+Source: boot-animation
+Section: devel
+Priority: extra
+Maintainer: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+Build-Depends: debhelper (>= 5), libelm-dev, libavsystem-dev, libslp-utilx-dev, libvconf-dev, libaudiosessionmgr-dev
+Standards-Version: 3.7.2
+
+Package: boot-animation
+Section: devel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libelm, libavsystem-0, libslp-utilx-0, libvconf-0, libaudiosessionmgr-0
+Description: booting animation
--- /dev/null
+#!/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 -Werror
+CXXFLAGS ?= -Wall -g
+LDFLAGS ?=
+PREFIX ?= /usr
+DATADIR ?= /usr/share
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+ CXXFLAGS += -O0
+else
+ CFLAGS += -O2
+ CXXFLAGS += -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)" CXXFLAGS="$(CXXFLAGS)" 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)
+ #docbook-to-man debian/wavplayer.sgml > wavplayer.1
+
+ 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#@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
+ 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
--- /dev/null
+/*
+ * 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.
+ */
+
+
+extern int init_animation(int state, const char *msg);
+extern int fini_animation(void);
+extern void restart_animation(int state, const char *msg);
--- /dev/null
+/*
+ * 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 PREFIX
+#define PREFIX "/usr"
+#endif
+
+#define EDJ_OFF PREFIX"/share/edje/poweroff.edj"
+#define EDJ_ON PREFIX"/share/edje/poweron.edj"
+#define GRP_OFF "poweroff"
+#define GRP_ON "poweron"
+
+#define NICE_VALUE -20
+
+#define TITLE "Password Application"
+
+#define BA_DEFAULT_WINDOW_H 800
+#define BA_DEFAULT_WINDOW_W 1280
+
+enum {
+ TYPE_UNKNOWN,
+ TYPE_ON,
+ TYPE_OFF,
+ TYPE_OFF_NOEXIT,
+ TYPE_OFF_WITH_MSG,
+};
+
+#if defined(_DEBUG)
+
+static int _func_depth;
+
+#define ENTER_FUNCTION() \
+ do { \
+ _func_depth++; \
+ printf("%*.c \e[32m[%s:%d]\e[0m\n", _func_depth*4, '-', __func__, __LINE__); \
+ } while (0)
+#define LEAVE_FUNCTION() \
+ do { \
+ _func_depth--; \
+ } while (0)
+
+inline static void dump_riff_header(RIFFChunk * riff)
+{
+ ENTER_FUNCTION();
+ fprintf(stderr, "%*.c Type ID: %.4s\n", _func_depth * 4, '-',
+ riff->type);
+ LEAVE_FUNCTION();
+}
+
+inline static void dump_format_header(FormatChunk * format)
+{
+ ENTER_FUNCTION();
+ fprintf(stderr, "%*.c Format tag: %d\n", _func_depth * 4, '-',
+ format->wFormatTag);
+ fprintf(stderr, "%*.c Channel : %d\n", _func_depth * 4, '-',
+ format->wChannels);
+ fprintf(stderr, "%*.c Samples per sec : %lu\n", _func_depth * 4, '-',
+ format->dwSamplesPerSec);
+
+ fprintf(stderr, "%*.c Byte per sec : %lu\n", _func_depth * 4, '-',
+ format->dwAvBytesPerSec);
+
+ fprintf(stderr, "%*.c Block align : %d\n", _func_depth * 4, '-',
+ format->wBlockAlign);
+ fprintf(stderr, "%*.c Size of a sample frame : %d bytes\n",
+ _func_depth * 4, '-',
+ format->wChannels * (format->wBitsPerSample / 8));
+ fprintf(stderr, "%*.c Bits per sample : %d\n", _func_depth * 4, '-',
+ format->wBitsPerSample);
+ LEAVE_FUNCTION();
+}
+
+#define DbgPrint(fmt, arg...) fprintf(stderr, "%*.c "fmt, _func_depth*4, '-', ##arg);
+
+#else
+#define DbgPrint(fmt, ...)
+#define ENTER_FUNCTION()
+#define LEAVE_FUNCTION()
+
+#define dump_riff_header(riff)
+#define dump_format_header(format)
+#endif
--- /dev/null
+Name: boot-animation
+Version: 0.3.1
+Release: 1
+Summary: Boot animation
+Source: %{name}-%{version}.tar.gz
+License: Flora Software License
+Group: TO_BE/FILLED_IN
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+BuildRequires: cmake
+BuildRequires: edje, edje-bin, embryo, embryo-bin
+BuildRequires: pkgconfig(ecore)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(libexif)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(utilX)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(avsystem)
+BuildRequires: pkgconfig(audio-session-mgr)
+
+
+Requires(post): /usr/bin/vconftool
+
+%description
+Shows an animation and plays a sound when the device is booted or shutdown.
+
+%prep
+%setup -q
+#%patch0 -p1
+
+
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+
+%build
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%clean
+make clean
+
+%docs_package
+
+
+%post
+ln -s /etc/init.d/boot-ani /etc/rc.d/rc3.d/S41boot-ani
+
+vconftool -i set -t string memory/boot-animation/restart start:start
+
+
+%files
+/etc/init.d/boot-ani
+/usr/share/edje/poweroff.edj
+/usr/share/edje/poweron.edj
+/usr/bin/boot-animation
--- /dev/null
+/*
+ * 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 <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <utilX.h>
+#include <vconf.h>
+
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include <Ecore_X_Atoms.h>
+
+#include <boot-animation.h>
+#include <animation.h>
+
+static struct animation {
+ Ecore_X_Window focus_win;
+ Ecore_X_Window root_win;
+ Evas_Object *win;
+ Ecore_Window xwin;
+ Evas_Coord w;
+ Evas_Coord h;
+ int t;
+ Evas *evas;
+ Ecore_Evas *ee;
+ Evas_Object *layout;
+ int state;
+ Evas_Object *txt;
+} s_animation = {
+.txt = NULL,};
+
+static void win_del(void *data, Evas_Object * obj, void *event_info)
+{
+ fprintf(stderr, "Window delete event received\n");
+ elm_exit();
+}
+
+static void _edje_cb(void *d, Evas_Object * obj, const char *e, const char *s)
+{
+ fprintf(stderr, "edje calback is invoked\n");
+
+ if (vconf_set_int("memory/boot-animation/finished", 1) != 0) {
+ fprintf(stderr, "Failed to set finished set\n");
+ }
+
+ if (s_animation.state == TYPE_OFF || s_animation.state == TYPE_ON) {
+ elm_exit();
+ } else if (s_animation.state == TYPE_OFF_WITH_MSG) {
+ if (s_animation.txt) {
+ Evas_Coord w;
+ Evas_Coord h;
+
+ evas_object_size_hint_weight_set(s_animation.txt,
+ EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_fill_set(s_animation.txt,
+ EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
+ evas_object_resize(s_animation.txt, s_animation.w,
+ s_animation.h);
+ evas_object_color_set(s_animation.txt, 255, 255, 255,
+ 255);
+ evas_object_text_font_set(s_animation.txt,
+ "SLP:style=medium", 30);
+ evas_object_geometry_get(s_animation.txt, NULL, NULL,
+ &w, &h);
+ evas_object_move(s_animation.txt,
+ (s_animation.w - w) >> 1,
+ (s_animation.h - h) >> 1);
+ evas_object_show(s_animation.txt);
+ }
+ }
+}
+
+static
+int init_layout(const char *msg)
+{
+ s_animation.layout = elm_layout_add(s_animation.win);
+ if (!s_animation.layout) {
+ fprintf(stderr, "Failed to create layout\n");
+ return EXIT_FAILURE;
+ }
+
+ if (s_animation.state == TYPE_ON) {
+ elm_layout_file_set(s_animation.layout, EDJ_ON, GRP_ON);
+ } else {
+ elm_layout_file_set(s_animation.layout, EDJ_OFF, GRP_OFF);
+ }
+
+ evas_object_size_hint_weight_set(s_animation.layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ printf("[Boot-ani] Start animation: %d mode\n", s_animation.state);
+ elm_win_resize_object_add(s_animation.win, s_animation.layout);
+ edje_object_signal_callback_add(elm_layout_edje_get(s_animation.layout),
+ "end", "animation", _edje_cb, NULL);
+ evas_object_show(s_animation.layout);
+
+ Ecore_X_Window xwin;
+ xwin = elm_win_xwindow_get(s_animation.win);
+ ecore_x_icccm_hints_set(xwin, 0, 0, 0, 0, 0, 0, 0);
+
+
+ if (msg) {
+ if (!s_animation.txt) {
+ s_animation.txt =
+ evas_object_text_add(s_animation.evas);
+ if (!s_animation.txt) {
+ fprintf(stderr, "Failed to add text\n");
+ evas_object_del(s_animation.layout);
+ return EXIT_FAILURE;
+ }
+ }
+
+ evas_object_text_text_set(s_animation.txt, msg);
+ evas_object_hide(s_animation.txt);
+ }
+
+ if (vconf_set_int("memory/boot-animation/finished", 0) != 0) {
+ fprintf(stderr, "Failed to set finished value to 0\n");
+ }
+
+ return EXIT_SUCCESS;
+}
+
+static
+void fini_layout(void)
+{
+ if (s_animation.layout) {
+ evas_object_del(s_animation.layout);
+ }
+
+ if (s_animation.txt) {
+ evas_object_del(s_animation.txt);
+ s_animation.txt = NULL;
+ }
+}
+
+void restart_animation(int state, const char *msg)
+{
+ fini_layout();
+
+ s_animation.state = state;
+
+ init_layout(msg);
+
+ evas_object_show(s_animation.win);
+}
+
+static
+int create_window(void)
+{
+ s_animation.win = elm_win_add(NULL, "", ELM_WIN_BASIC);
+ if (!s_animation.win) {
+ fprintf(stderr, "Failed to create a new window\n");
+ return EXIT_FAILURE;
+ }
+ evas_object_smart_callback_add(s_animation.win, "delete-request",
+ win_del, NULL);
+ evas_object_resize(s_animation.win, s_animation.w, s_animation.h);
+
+ s_animation.evas = evas_object_evas_get(s_animation.win);
+ if (!s_animation.evas) {
+ evas_object_del(s_animation.win);
+ fprintf(stderr, "Failed to get the evas object\n");
+ return EXIT_FAILURE;
+ }
+ elm_win_borderless_set(s_animation.win, 1);
+ evas_object_move(s_animation.win, 0, 0);
+
+ if (s_animation.w > s_animation.h) {
+ int t;
+ elm_win_rotation_with_resize_set(s_animation.win, 90);
+ t = s_animation.w;
+ s_animation.w = s_animation.h;
+ s_animation.h = t;
+ }
+ evas_object_show(s_animation.win);
+
+ s_animation.ee = ecore_evas_ecore_evas_get(s_animation.evas);
+ if (!s_animation.ee) {
+ evas_object_del(s_animation.win);
+ fprintf(stderr, "Failed to get the ecore evas object\n");
+ return EXIT_FAILURE;
+ }
+
+ s_animation.xwin = ecore_evas_window_get(s_animation.ee);
+ ecore_x_netwm_window_type_set(s_animation.xwin,
+ ECORE_X_WINDOW_TYPE_NOTIFICATION);
+ utilx_set_system_notification_level(ecore_x_display_get(),
+ s_animation.xwin,
+ UTILX_NOTIFICATION_LEVEL_HIGH);
+
+ return EXIT_SUCCESS;
+}
+
+int init_animation(int state, const char *msg)
+{
+ s_animation.focus_win = ecore_x_window_focus_get();
+ s_animation.root_win = ecore_x_window_root_get(s_animation.focus_win);
+ s_animation.state = state;
+ ecore_x_window_size_get(s_animation.root_win, &s_animation.w,
+ &s_animation.h);
+
+ if (create_window() == EXIT_FAILURE) {
+ fprintf(stderr, "Failed to create a new window\n");
+ return EXIT_FAILURE;
+ }
+
+ if (init_layout(msg) == EXIT_FAILURE) {
+ fprintf(stderr, "Failed to init the layout object\n");
+ if (msg)
+ evas_object_del(s_animation.txt);
+ evas_object_del(s_animation.win);
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
+
+int fini_animation(void)
+{
+ fini_layout();
+ evas_object_del(s_animation.win);
+ return EXIT_SUCCESS;
+}
--- /dev/null
+/*
+ * 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 <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <pthread.h>
+#include <utilX.h>
+
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include <Ecore_X_Atoms.h>
+#include <audio-session-manager.h>
+
+#include <getopt.h>
+#include <boot-animation.h>
+#include <animation.h>
+
+#include <vconf.h>
+
+extern char *optarg;
+extern int optind, opterr, optopt;
+
+struct args {
+ int argc;
+ char **argv;
+ char *msg;
+};
+
+static void print_usages(char *argv0)
+{
+ printf("Usage) %s {--start|--stop}\n"
+ " Ex:\n"
+ " # %s --start\n"
+ " # %s --stop\n"
+ " # %s --off\n"
+ " # %s --offmsg YOUR_MESSAGE\n", argv0, argv0, argv0, argv0,
+ argv0);
+}
+
+static
+void restart_cb(keynode_t * node, void *user_data)
+{
+ char *str;
+ char cmd[128];
+ char msg[256];
+ int type = TYPE_UNKNOWN;
+
+ if (!node) {
+ fprintf(stderr, "Invalid node\n");
+ return;
+ }
+
+ str = vconf_keynode_get_str(node);
+ if (!str) {
+ fprintf(stderr, "Failed to get string\n");
+ return;
+ }
+
+ if (sscanf(str, "%127[^:]:%255s", cmd, msg) != 2) {
+ fprintf(stderr, "Invalid format [%s]\n", str);
+ free(str);
+ return;
+ }
+ free(str);
+
+ if (!strcasecmp(cmd, "start")) {
+ type = TYPE_ON;
+ } else if (!strcasecmp(cmd, "stop")) {
+ type = TYPE_OFF;
+ } else if (!strcasecmp(cmd, "off")) {
+ type = TYPE_OFF_NOEXIT;
+ } else if (!strcasecmp(cmd, "offmsg")) {
+ type = TYPE_OFF_WITH_MSG;
+ } else {
+ fprintf(stderr, "Unknown command %s\n", cmd);
+ }
+
+ restart_animation(type, msg);
+}
+
+static
+void xready_cb(keynode_t * node, void *user_data)
+{
+ int c;
+ int argc;
+ char **argv;
+ int option_index = 0;
+ int type = TYPE_UNKNOWN;
+ int errorcode = -1;
+ int asm_handle;
+ struct args *args = user_data;
+ static struct option long_options[] = {
+ {"start", 0, 0, 's'},
+ {"stop", 0, 0, 'p'},
+ {"off", 0, 0, 'o'},
+ {"offmsg", 1, 0, 'm'},
+ {0, 0, 0, 0},
+ };
+ static int invoked_flag = 0;
+
+ if (invoked_flag == 1) {
+ fprintf(stderr, "Already launched.\n");
+ return;
+ }
+
+ invoked_flag = 1;
+
+ argc = args->argc;
+ argv = args->argv;
+
+ nice(NICE_VALUE);
+
+ while (1) {
+ c = getopt_long(argc, argv, "spom:", long_options,
+ &option_index);
+ if (c < 0) {
+ break;
+ } else if (c == 0) {
+ c = long_options[option_index].val;
+ }
+
+ switch (c) {
+ case 's':
+ type = TYPE_ON;
+ break;
+ case 'p':
+ type = TYPE_OFF;
+ break;
+ case 'o':
+ type = TYPE_OFF_NOEXIT;
+ break;
+ case 'm':
+ type = TYPE_OFF_WITH_MSG;
+ args->msg = strdup(optarg);
+ if (!args->msg)
+ perror("strdup");
+ break;
+ default:
+ type = TYPE_UNKNOWN;
+ break;
+ }
+ }
+
+ if (type == TYPE_UNKNOWN) {
+ fprintf(stderr, "[Boot-ani] unknown arg [%s]\n", argv[1]);
+ return;
+ }
+
+ init_animation(type, args->msg);
+ if ((type == TYPE_OFF) || (type == TYPE_OFF_WITH_MSG)) {
+ if (!ASM_register_sound
+ (-1, &asm_handle, ASM_EVENT_EXCLUSIVE_AVSYSTEM,
+ ASM_STATE_PLAYING, NULL, NULL, ASM_RESOURCE_NONE,
+ &errorcode)) {
+ fprintf(stderr, "ASM_register_sound() failed 0x%x\n",
+ errorcode);
+ return;
+ }
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ struct args args;
+
+ if (argc < 2) {
+ print_usages(argv[0]);
+ return EXIT_FAILURE;
+ }
+
+ args.argc = argc;
+ args.argv = argv;
+ args.msg = NULL;
+
+ elm_init(argc, argv);
+
+ vconf_notify_key_changed("memory/boot-animation/restart", restart_cb,
+ NULL);
+ xready_cb(NULL, &args);
+
+ elm_run();
+
+ fini_animation();
+
+ if (args.msg)
+ free(args.msg);
+ elm_shutdown();
+ return 0;
+}