summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjongmyeong.ko <jongmyeong.ko@samsung.com>2014-10-29 10:36:07 +0900
committerjongmyeong.ko <jongmyeong.ko@samsung.com>2014-10-29 10:36:07 +0900
commitdb35f3dae45f6bdd892bb78b28efa6ea212b86eb (patch)
treeb9bbd084bef87386960f2585a14b7daaed1da6d9
parent9a74462000fbaf906d4f82e181cc70792d926898 (diff)
parent394ec539e3d99af09e6739a7f8160cae7e85d718 (diff)
downloadshortcut-db35f3dae45f6bdd892bb78b28efa6ea212b86eb.tar.gz
shortcut-db35f3dae45f6bdd892bb78b28efa6ea212b86eb.tar.bz2
shortcut-db35f3dae45f6bdd892bb78b28efa6ea212b86eb.zip
merge mobile code
-rw-r--r--CMakeLists.txt6
-rw-r--r--TC/_export_env.sh10
-rw-r--r--TC/_export_target_env.sh9
-rwxr-xr-xTC/build.sh16
-rw-r--r--TC/clean.sh11
-rw-r--r--TC/config3
-rwxr-xr-xTC/push.sh13
-rw-r--r--TC/results/0001c/journal26
-rw-r--r--TC/results/0004c/journal26
-rw-r--r--TC/results/0006c/journal18
-rw-r--r--TC/results/0008c/journal21
-rwxr-xr-xTC/results/build-tar-result-1388117141.html94
-rw-r--r--TC/results/build-tar-result-1388117141.journal24
-rwxr-xr-xTC/results/build-tar-result-1388117277.html94
-rw-r--r--TC/results/build-tar-result-1388117277.journal24
-rwxr-xr-xTC/results/build-tar-result-1388117423.html90
-rw-r--r--TC/results/build-tar-result-1388117423.journal16
-rwxr-xr-xTC/results/build-tar-result-1388117533.html93
-rw-r--r--TC/results/build-tar-result-1388117533.journal19
-rwxr-xr-xTC/results/exec-tar-result-1388117150.html61
-rw-r--r--TC/results/exec-tar-result-1388117150.journal15
-rwxr-xr-xTC/run.sh15
-rw-r--r--TC/testcase/Makefile26
-rw-r--r--TC/testcase/tet_captured6
-rw-r--r--TC/testcase/tslist2
-rwxr-xr-xTC/testcase/utc_shortcut.c375
-rw-r--r--TC/tet_scen7
-rw-r--r--TC/tet_tmp_dir/23996aa/testcase/Makefile26
-rw-r--r--TC/tet_tmp_dir/23996aa/testcase/tet_lock/23996aa0
-rw-r--r--TC/tet_tmp_dir/23996aa/testcase/tslist2
-rwxr-xr-xTC/tet_tmp_dir/23996aa/testcase/utc_dynamicbox_service.c732
-rw-r--r--TC/tetbuild.cfg5
-rw-r--r--TC/tetclean.cfg5
-rw-r--r--TC/tetexec.cfg5
-rw-r--r--doc/image/BuildShortcutList.pngbin0 -> 27801 bytes
-rw-r--r--doc/image/JumpToApp.pngbin0 -> 192737 bytes
-rw-r--r--doc/image/ShortcutApp.pngbin0 -> 210668 bytes
-rw-r--r--doc/image/ShortcutUG.pngbin0 -> 209846 bytes
-rwxr-xr-xdoc/shortcut_doc.h171
-rwxr-xr-xdoc_prod/shortcut_doc.h171
-rwxr-xr-xlib/CMakeLists.txt55
-rw-r--r--lib/LICENSE204
-rw-r--r--lib/include/dlist.h43
-rwxr-xr-xlib/include/shortcut.h441
-rwxr-xr-xlib/include/shortcut_manager.h168
-rwxr-xr-xlib/include/shortcut_private.h204
-rwxr-xr-xlib/include/shortcut_product.h224
-rwxr-xr-xlib/shortcut.pc.in11
-rw-r--r--lib/src/dlist.c189
-rwxr-xr-xlib/src/icon.c816
-rwxr-xr-xlib/src/main.c887
-rw-r--r--packaging/libshortcut.manifest22
-rwxr-xr-xpackaging/libshortcut.spec82
-rw-r--r--pkgmgr_shortcut/CMakeLists.txt31
-rw-r--r--pkgmgr_shortcut/include/dlist.h44
-rw-r--r--pkgmgr_shortcut/src/dlist.c189
-rw-r--r--pkgmgr_shortcut/src/service_register.c1244
-rw-r--r--sample.xml62
-rw-r--r--test/Makefile4
-rwxr-xr-xtest/application.c57
-rw-r--r--test/homescreen.c40
-rwxr-xr-xtest/icon.c91
-rw-r--r--test/shortcut.c41
-rwxr-xr-xtest_db_builder.sh80
64 files changed, 7466 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..ea60a32
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,6 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+set(CMAKE_SKIP_BUILD_RPATH true)
+
+ADD_SUBDIRECTORY("pkgmgr_shortcut")
+ADD_SUBDIRECTORY("lib")
diff --git a/TC/_export_env.sh b/TC/_export_env.sh
new file mode 100644
index 0000000..7a317f8
--- /dev/null
+++ b/TC/_export_env.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+source ./config
+
+export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path
+#export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-simulator # tetware target path
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+export TET_ROOT=$TET_TARGET_PATH
diff --git a/TC/_export_target_env.sh b/TC/_export_target_env.sh
new file mode 100644
index 0000000..3fd8e3f
--- /dev/null
+++ b/TC/_export_target_env.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+. ./config
+
+export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to path
+#export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-simulator
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+export TET_ROOT=$TET_TARGET_PATH
diff --git a/TC/build.sh b/TC/build.sh
new file mode 100755
index 0000000..72aad6c
--- /dev/null
+++ b/TC/build.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. ./_export_env.sh # setting environment variables
+
+export TET_SUITE_ROOT=`pwd`
+FILE_NAME_EXTENSION=`date +%s`
+
+RESULT_DIR=results
+HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir -p $RESULT_DIR
+
+tcc -c -p ./
+tcc -b -j $JOURNAL_RESULT -p ./
+grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/clean.sh b/TC/clean.sh
new file mode 100644
index 0000000..29743e0
--- /dev/null
+++ b/TC/clean.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+. ./_export_env.sh # setting environment variables
+
+export TET_SUITE_ROOT=`pwd`
+RESULT_DIR=results
+
+tcc -c -p ./ # executing tcc, with clean option (-c)
+rm -r $RESULT_DIR
+rm -r tet_tmp_dir
+rm testcase/tet_captured
diff --git a/TC/config b/TC/config
new file mode 100644
index 0000000..3aebc04
--- /dev/null
+++ b/TC/config
@@ -0,0 +1,3 @@
+PKG_NAME=shortcut
+TET_INSTALL_HOST_PATH=/var/tmp/dts_fw/TC/TETware
+TET_INSTALL_TARGET_PATH=/opt/home/$PKG_NAME/TETware
diff --git a/TC/push.sh b/TC/push.sh
new file mode 100755
index 0000000..5eb9510
--- /dev/null
+++ b/TC/push.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+. ./config
+
+TC_PATH=/opt/home/$PKG_NAME
+
+echo $TC_PATH
+
+sdb shell "mkdir -p $TC_PATH"
+
+sdb push . $TC_PATH
+
+
diff --git a/TC/results/0001c/journal b/TC/results/0001c/journal
new file mode 100644
index 0000000..f5bb574
--- /dev/null
+++ b/TC/results/0001c/journal
@@ -0,0 +1,26 @@
+0|3.7-lite 04:05:41 20131227|User: root (0) TCC Start, Command line: /var/tmp/dts_fw/TETware/tetware-target/bin/tcc -c -p ./
+5|Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l|System Information
+20|/var/tmp/dts_fw/./tetclean.cfg 2|Config Start
+30||TET_OUTPUT_CAPTURE=True
+30||TET_CLEAN_TOOL= make clean
+30||TET_CLEAN_FILE= Makefile
+30||TET_API_COMPLIANT=True
+30||TET_PASS_TC_NAME=True
+30||TET_VERSION=3.7-lite
+40||Config End
+300|0 /testcase/utc_livebox_service 04:05:41|Clean Start, scenario ref 1-0
+100|0|rm -f utc_livebox_service
+100|0|make: Nothing to be done for `Makefile'.
+100|0|cc -o utc_livebox_service utc_livebox_service.c -I. `pkg-config --cflags livebox glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs livebox glib-2.0` /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -ltcm_s -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -lapi_s
+100|0|Package livebox was not found in the pkg-config search path.
+100|0|Perhaps you should add the directory containing `livebox.pc'
+100|0|to the PKG_CONFIG_PATH environment variable
+100|0|No package 'livebox' found
+100|0|Package livebox was not found in the pkg-config search path.
+100|0|Perhaps you should add the directory containing `livebox.pc'
+100|0|to the PKG_CONFIG_PATH environment variable
+100|0|No package 'livebox' found
+100|0|cc: error: /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o: No such file or directory
+100|0|make: *** [utc_livebox_service] Error 1
+320|0 2 04:05:42|Clean End, scenario ref 1-0
+900|04:05:42|TCC End
diff --git a/TC/results/0004c/journal b/TC/results/0004c/journal
new file mode 100644
index 0000000..bc40ce8
--- /dev/null
+++ b/TC/results/0004c/journal
@@ -0,0 +1,26 @@
+0|3.7-lite 04:07:57 20131227|User: root (0) TCC Start, Command line: /var/tmp/dts_fw/TETware/tetware-target/bin/tcc -c -p ./
+5|Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l|System Information
+20|/var/tmp/dts_fw/./tetclean.cfg 2|Config Start
+30||TET_OUTPUT_CAPTURE=True
+30||TET_CLEAN_TOOL= make clean
+30||TET_CLEAN_FILE= Makefile
+30||TET_API_COMPLIANT=True
+30||TET_PASS_TC_NAME=True
+30||TET_VERSION=3.7-lite
+40||Config End
+300|0 /testcase/utc_livebox_service 04:07:57|Clean Start, scenario ref 1-0
+100|0|rm -f utc_livebox_service
+100|0|make: Nothing to be done for `Makefile'.
+100|0|cc -o utc_livebox_service utc_livebox_service.c -I. `pkg-config --cflags livebox glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs livebox glib-2.0` /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -ltcm_s -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -lapi_s
+100|0|Package livebox was not found in the pkg-config search path.
+100|0|Perhaps you should add the directory containing `livebox.pc'
+100|0|to the PKG_CONFIG_PATH environment variable
+100|0|No package 'livebox' found
+100|0|Package livebox was not found in the pkg-config search path.
+100|0|Perhaps you should add the directory containing `livebox.pc'
+100|0|to the PKG_CONFIG_PATH environment variable
+100|0|No package 'livebox' found
+100|0|cc: error: /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o: No such file or directory
+100|0|make: *** [utc_livebox_service] Error 1
+320|0 2 04:07:58|Clean End, scenario ref 1-0
+900|04:07:58|TCC End
diff --git a/TC/results/0006c/journal b/TC/results/0006c/journal
new file mode 100644
index 0000000..9684e35
--- /dev/null
+++ b/TC/results/0006c/journal
@@ -0,0 +1,18 @@
+0|3.7-lite 04:10:23 20131227|User: root (0) TCC Start, Command line: /var/tmp/dts_fw/TETware/tetware-target/bin/tcc -c -p ./
+5|Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l|System Information
+20|/var/tmp/dts_fw/./tetclean.cfg 2|Config Start
+30||TET_OUTPUT_CAPTURE=True
+30||TET_CLEAN_TOOL= make clean
+30||TET_CLEAN_FILE= Makefile
+30||TET_API_COMPLIANT=True
+30||TET_PASS_TC_NAME=True
+30||TET_VERSION=3.7-lite
+40||Config End
+300|0 /testcase/utc_livebox_service 04:10:23|Clean Start, scenario ref 1-0
+100|0|rm -f utc_livebox_service
+100|0|make: Nothing to be done for `Makefile'.
+100|0|cc -o utc_livebox_service utc_livebox_service.c -I. `pkg-config --cflags livebox-service glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs livebox-service glib-2.0` /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -ltcm_s -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -lapi_s
+100|0|cc: error: /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o: No such file or directory
+100|0|make: *** [utc_livebox_service] Error 1
+320|0 2 04:10:24|Clean End, scenario ref 1-0
+900|04:10:24|TCC End
diff --git a/TC/results/0008c/journal b/TC/results/0008c/journal
new file mode 100644
index 0000000..293043f
--- /dev/null
+++ b/TC/results/0008c/journal
@@ -0,0 +1,21 @@
+0|3.7-lite 04:12:13 20131227|User: root (0) TCC Start, Command line: /var/tmp/dts_fw/TETware/tetware-target/bin/tcc -c -p ./
+5|Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l|System Information
+20|/var/tmp/dts_fw/./tetclean.cfg 2|Config Start
+30||TET_OUTPUT_CAPTURE=True
+30||TET_CLEAN_TOOL= make clean
+30||TET_CLEAN_FILE= Makefile
+30||TET_API_COMPLIANT=True
+30||TET_PASS_TC_NAME=True
+30||TET_VERSION=3.7-lite
+40||Config End
+300|0 /testcase/utc_livebox_service 04:12:13|Clean Start, scenario ref 1-0
+100|0|rm -f utc_livebox_service
+100|0|make: Nothing to be done for `Makefile'.
+100|0|cc -o utc_livebox_service utc_livebox_service.c -I. `pkg-config --cflags livebox-service glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs livebox-service glib-2.0`
+100|0|utc_livebox_service.c:18:21: fatal error: tet_api.h: No such file or directory
+100|0| #include <tet_api.h>
+100|0| ^
+100|0|compilation terminated.
+100|0|make: *** [utc_livebox_service] Error 1
+320|0 2 04:12:14|Clean End, scenario ref 1-0
+900|04:12:14|TCC End
diff --git a/TC/results/build-tar-result-1388117141.html b/TC/results/build-tar-result-1388117141.html
new file mode 100755
index 0000000..bbd1b16
--- /dev/null
+++ b/TC/results/build-tar-result-1388117141.html
@@ -0,0 +1,94 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+<title>TETware Test Run Report</title>
+</head>
+<body bgcolor="white">
+<p><table border="1" width="100%" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading1"><center><h1>
+TETware Test Run Report</h1></center></td></tr></table></p>
+<p><table border="0" cellpadding="2" cellspacing="1">
+<tr>
+<td align="left" class="noborder">TETware version:</td>
+<td align="left" class="noborder">3.7-lite</td>
+</tr>
+<tr>
+<td align="left" class="noborder">System Information:</td>
+<td align="left" class="noborder">Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l</td>
+</tr>
+<tr>
+<td align="left" class="noborder">Date of test run:</td>
+<td align="left" class="noborder">2013-12-27</td>
+</tr>
+<tr>
+<td align="left" class="noborder">Start time:</td>
+<td align="left" class="noborder">04:05:42</td>
+</tr>
+</table></p>
+
+<hr>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Build mode summary</b></font></td></tr></table></p>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="center" bgcolor="#cccccc" class="neutral"><b>Result</b></td>
+<td align="center" bgcolor="#cccccc" class="neutral"><b>Count</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#33cc33" class="success">Success</td>
+<td align="right" bgcolor="#33cc33" class="success">0</td>
+</tr>
+<tr>
+<td align="left" bgcolor="#ff5555" class="failure">Failure</td>
+<td align="right" bgcolor="#ff5555" class="failure">1</td>
+</tr>
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Total</b></td>
+<td align="right" bgcolor="#cccccc" class="neutral"><b>1</b></td>
+</tr>
+</table></p>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Execute mode summary</b></font></td></tr></table></p>
+<p><table border="0" cellpadding="2" cellspacing="1">
+<tr>
+<td align="left" class="noborder"><i>No results</i></td>
+</tr>
+</table></p>
+
+<hr>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Inline report</b></font></td></tr></table></p>
+<h3>/testcase/utc_dynamicbox_service [build]</h3>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Captured Output</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><ul>
+<li>cc -o utc_dynamicbox_service utc_dynamicbox_service.c -I. `pkg-config --cflags dynamicbox glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs dynamicbox glib-2.0` /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -ltcm_s -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -lapi_s
+<li>Package dynamicbox was not found in the pkg-config search path.
+<li>Perhaps you should add the directory containing `dynamicbox.pc'
+<li>to the PKG_CONFIG_PATH environment variable
+<li>No package 'dynamicbox' found
+<li>cc: error: /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o: No such file or directory
+<li>make: *** [utc_dynamicbox_service] Error 1
+</ul>
+</td>
+</tr>
+</table></p>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Test Status</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#ff5555" class="failure">Failure (2)</td>
+</tr>
+</table></p>
+
+<hr>
+</body>
+</html>
diff --git a/TC/results/build-tar-result-1388117141.journal b/TC/results/build-tar-result-1388117141.journal
new file mode 100644
index 0000000..cf1e19c
--- /dev/null
+++ b/TC/results/build-tar-result-1388117141.journal
@@ -0,0 +1,24 @@
+0|3.7-lite 04:05:42 20131227|User: root (0) TCC Start, Command line: /var/tmp/dts_fw/TETware/tetware-target/bin/tcc -b -j results/build-tar-result-1388117141.journal -p ./
+5|Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l|System Information
+20|/var/tmp/dts_fw/./tetbuild.cfg 0|Config Start
+30||TET_OUTPUT_CAPTURE=True
+30||TET_BUILD_TOOL=make
+30||TET_BUILD_FILE=-f Makefile
+30||TET_API_COMPLIANT=True
+30||TET_PASS_TC_NAME=True
+30||TET_VERSION=3.7-lite
+40||Config End
+110|0 /testcase/utc_livebox_service 04:05:42|Build Start, scenario ref 1-0
+100|0|cc -o utc_livebox_service utc_livebox_service.c -I. `pkg-config --cflags livebox glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs livebox glib-2.0` /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -ltcm_s -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -lapi_s
+100|0|Package livebox was not found in the pkg-config search path.
+100|0|Perhaps you should add the directory containing `livebox.pc'
+100|0|to the PKG_CONFIG_PATH environment variable
+100|0|No package 'livebox' found
+100|0|Package livebox was not found in the pkg-config search path.
+100|0|Perhaps you should add the directory containing `livebox.pc'
+100|0|to the PKG_CONFIG_PATH environment variable
+100|0|No package 'livebox' found
+100|0|cc: error: /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o: No such file or directory
+100|0|make: *** [utc_livebox_service] Error 1
+130|0 2 04:05:43|Build End, scenario ref 1-0
+900|04:05:43|TCC End
diff --git a/TC/results/build-tar-result-1388117277.html b/TC/results/build-tar-result-1388117277.html
new file mode 100755
index 0000000..50f6aba
--- /dev/null
+++ b/TC/results/build-tar-result-1388117277.html
@@ -0,0 +1,94 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+<title>TETware Test Run Report</title>
+</head>
+<body bgcolor="white">
+<p><table border="1" width="100%" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading1"><center><h1>
+TETware Test Run Report</h1></center></td></tr></table></p>
+<p><table border="0" cellpadding="2" cellspacing="1">
+<tr>
+<td align="left" class="noborder">TETware version:</td>
+<td align="left" class="noborder">3.7-lite</td>
+</tr>
+<tr>
+<td align="left" class="noborder">System Information:</td>
+<td align="left" class="noborder">Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l</td>
+</tr>
+<tr>
+<td align="left" class="noborder">Date of test run:</td>
+<td align="left" class="noborder">2013-12-27</td>
+</tr>
+<tr>
+<td align="left" class="noborder">Start time:</td>
+<td align="left" class="noborder">04:07:58</td>
+</tr>
+</table></p>
+
+<hr>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Build mode summary</b></font></td></tr></table></p>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="center" bgcolor="#cccccc" class="neutral"><b>Result</b></td>
+<td align="center" bgcolor="#cccccc" class="neutral"><b>Count</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#33cc33" class="success">Success</td>
+<td align="right" bgcolor="#33cc33" class="success">0</td>
+</tr>
+<tr>
+<td align="left" bgcolor="#ff5555" class="failure">Failure</td>
+<td align="right" bgcolor="#ff5555" class="failure">1</td>
+</tr>
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Total</b></td>
+<td align="right" bgcolor="#cccccc" class="neutral"><b>1</b></td>
+</tr>
+</table></p>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Execute mode summary</b></font></td></tr></table></p>
+<p><table border="0" cellpadding="2" cellspacing="1">
+<tr>
+<td align="left" class="noborder"><i>No results</i></td>
+</tr>
+</table></p>
+
+<hr>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Inline report</b></font></td></tr></table></p>
+<h3>/testcase/utc_dynamicbox_service [build]</h3>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Captured Output</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><ul>
+<li>cc -o utc_dynamicbox_service utc_dynamicbox_service.c -I. `pkg-config --cflags dynamicbox glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs dynamicbox glib-2.0` /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -ltcm_s -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -lapi_s
+<li>Package dynamicbox was not found in the pkg-config search path.
+<li>Perhaps you should add the directory containing `dynamicbox.pc'
+<li>to the PKG_CONFIG_PATH environment variable
+<li>No package 'dynamicbox' found
+<li>cc: error: /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o: No such file or directory
+<li>make: *** [utc_dynamicbox_service] Error 1
+</ul>
+</td>
+</tr>
+</table></p>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Test Status</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#ff5555" class="failure">Failure (2)</td>
+</tr>
+</table></p>
+
+<hr>
+</body>
+</html>
diff --git a/TC/results/build-tar-result-1388117277.journal b/TC/results/build-tar-result-1388117277.journal
new file mode 100644
index 0000000..74f41dd
--- /dev/null
+++ b/TC/results/build-tar-result-1388117277.journal
@@ -0,0 +1,24 @@
+0|3.7-lite 04:07:58 20131227|User: root (0) TCC Start, Command line: /var/tmp/dts_fw/TETware/tetware-target/bin/tcc -b -j results/build-tar-result-1388117277.journal -p ./
+5|Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l|System Information
+20|/var/tmp/dts_fw/./tetbuild.cfg 0|Config Start
+30||TET_OUTPUT_CAPTURE=True
+30||TET_BUILD_TOOL=make
+30||TET_BUILD_FILE=-f Makefile
+30||TET_API_COMPLIANT=True
+30||TET_PASS_TC_NAME=True
+30||TET_VERSION=3.7-lite
+40||Config End
+110|0 /testcase/utc_livebox_service 04:07:58|Build Start, scenario ref 1-0
+100|0|cc -o utc_livebox_service utc_livebox_service.c -I. `pkg-config --cflags livebox glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs livebox glib-2.0` /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -ltcm_s -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -lapi_s
+100|0|Package livebox was not found in the pkg-config search path.
+100|0|Perhaps you should add the directory containing `livebox.pc'
+100|0|to the PKG_CONFIG_PATH environment variable
+100|0|No package 'livebox' found
+100|0|Package livebox was not found in the pkg-config search path.
+100|0|Perhaps you should add the directory containing `livebox.pc'
+100|0|to the PKG_CONFIG_PATH environment variable
+100|0|No package 'livebox' found
+100|0|cc: error: /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o: No such file or directory
+100|0|make: *** [utc_livebox_service] Error 1
+130|0 2 04:07:59|Build End, scenario ref 1-0
+900|04:07:59|TCC End
diff --git a/TC/results/build-tar-result-1388117423.html b/TC/results/build-tar-result-1388117423.html
new file mode 100755
index 0000000..8b9fd51
--- /dev/null
+++ b/TC/results/build-tar-result-1388117423.html
@@ -0,0 +1,90 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+<title>TETware Test Run Report</title>
+</head>
+<body bgcolor="white">
+<p><table border="1" width="100%" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading1"><center><h1>
+TETware Test Run Report</h1></center></td></tr></table></p>
+<p><table border="0" cellpadding="2" cellspacing="1">
+<tr>
+<td align="left" class="noborder">TETware version:</td>
+<td align="left" class="noborder">3.7-lite</td>
+</tr>
+<tr>
+<td align="left" class="noborder">System Information:</td>
+<td align="left" class="noborder">Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l</td>
+</tr>
+<tr>
+<td align="left" class="noborder">Date of test run:</td>
+<td align="left" class="noborder">2013-12-27</td>
+</tr>
+<tr>
+<td align="left" class="noborder">Start time:</td>
+<td align="left" class="noborder">04:10:24</td>
+</tr>
+</table></p>
+
+<hr>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Build mode summary</b></font></td></tr></table></p>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="center" bgcolor="#cccccc" class="neutral"><b>Result</b></td>
+<td align="center" bgcolor="#cccccc" class="neutral"><b>Count</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#33cc33" class="success">Success</td>
+<td align="right" bgcolor="#33cc33" class="success">0</td>
+</tr>
+<tr>
+<td align="left" bgcolor="#ff5555" class="failure">Failure</td>
+<td align="right" bgcolor="#ff5555" class="failure">1</td>
+</tr>
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Total</b></td>
+<td align="right" bgcolor="#cccccc" class="neutral"><b>1</b></td>
+</tr>
+</table></p>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Execute mode summary</b></font></td></tr></table></p>
+<p><table border="0" cellpadding="2" cellspacing="1">
+<tr>
+<td align="left" class="noborder"><i>No results</i></td>
+</tr>
+</table></p>
+
+<hr>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Inline report</b></font></td></tr></table></p>
+<h3>/testcase/utc_dynamicbox_service [build]</h3>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Captured Output</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><ul>
+<li>cc -o utc_dynamicbox_service utc_dynamicbox_service.c -I. `pkg-config --cflags dynamicbox-service glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs dynamicbox-service glib-2.0` /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -ltcm_s -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -lapi_s
+<li>cc: error: /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o: No such file or directory
+<li>make: *** [utc_dynamicbox_service] Error 1
+</ul>
+</td>
+</tr>
+</table></p>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Test Status</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#ff5555" class="failure">Failure (2)</td>
+</tr>
+</table></p>
+
+<hr>
+</body>
+</html>
diff --git a/TC/results/build-tar-result-1388117423.journal b/TC/results/build-tar-result-1388117423.journal
new file mode 100644
index 0000000..06cf896
--- /dev/null
+++ b/TC/results/build-tar-result-1388117423.journal
@@ -0,0 +1,16 @@
+0|3.7-lite 04:10:24 20131227|User: root (0) TCC Start, Command line: /var/tmp/dts_fw/TETware/tetware-target/bin/tcc -b -j results/build-tar-result-1388117423.journal -p ./
+5|Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l|System Information
+20|/var/tmp/dts_fw/./tetbuild.cfg 0|Config Start
+30||TET_OUTPUT_CAPTURE=True
+30||TET_BUILD_TOOL=make
+30||TET_BUILD_FILE=-f Makefile
+30||TET_API_COMPLIANT=True
+30||TET_PASS_TC_NAME=True
+30||TET_VERSION=3.7-lite
+40||Config End
+110|0 /testcase/utc_livebox_service 04:10:24|Build Start, scenario ref 1-0
+100|0|cc -o utc_livebox_service utc_livebox_service.c -I. `pkg-config --cflags livebox-service glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs livebox-service glib-2.0` /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -ltcm_s -L/var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3 -lapi_s
+100|0|cc: error: /var/tmp/dts_fw/TC/TETware/tetware-target/lib/tet3/tcm_s.o: No such file or directory
+100|0|make: *** [utc_livebox_service] Error 1
+130|0 2 04:10:25|Build End, scenario ref 1-0
+900|04:10:25|TCC End
diff --git a/TC/results/build-tar-result-1388117533.html b/TC/results/build-tar-result-1388117533.html
new file mode 100755
index 0000000..7758fad
--- /dev/null
+++ b/TC/results/build-tar-result-1388117533.html
@@ -0,0 +1,93 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+<title>TETware Test Run Report</title>
+</head>
+<body bgcolor="white">
+<p><table border="1" width="100%" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading1"><center><h1>
+TETware Test Run Report</h1></center></td></tr></table></p>
+<p><table border="0" cellpadding="2" cellspacing="1">
+<tr>
+<td align="left" class="noborder">TETware version:</td>
+<td align="left" class="noborder">3.7-lite</td>
+</tr>
+<tr>
+<td align="left" class="noborder">System Information:</td>
+<td align="left" class="noborder">Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l</td>
+</tr>
+<tr>
+<td align="left" class="noborder">Date of test run:</td>
+<td align="left" class="noborder">2013-12-27</td>
+</tr>
+<tr>
+<td align="left" class="noborder">Start time:</td>
+<td align="left" class="noborder">04:12:14</td>
+</tr>
+</table></p>
+
+<hr>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Build mode summary</b></font></td></tr></table></p>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="center" bgcolor="#cccccc" class="neutral"><b>Result</b></td>
+<td align="center" bgcolor="#cccccc" class="neutral"><b>Count</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#33cc33" class="success">Success</td>
+<td align="right" bgcolor="#33cc33" class="success">0</td>
+</tr>
+<tr>
+<td align="left" bgcolor="#ff5555" class="failure">Failure</td>
+<td align="right" bgcolor="#ff5555" class="failure">1</td>
+</tr>
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Total</b></td>
+<td align="right" bgcolor="#cccccc" class="neutral"><b>1</b></td>
+</tr>
+</table></p>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Execute mode summary</b></font></td></tr></table></p>
+<p><table border="0" cellpadding="2" cellspacing="1">
+<tr>
+<td align="left" class="noborder"><i>No results</i></td>
+</tr>
+</table></p>
+
+<hr>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Inline report</b></font></td></tr></table></p>
+<h3>/testcase/utc_dynamicbox_service [build]</h3>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Captured Output</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><ul>
+<li>cc -o utc_dynamicbox_service utc_dynamicbox_service.c -I. `pkg-config --cflags dynamicbox-service glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs dynamicbox-service glib-2.0`
+<li>utc_dynamicbox_service.c:18:21: fatal error: tet_api.h: No such file or directory
+<li> #include &lt;tet_api.h&gt;
+<li> ^
+<li>compilation terminated.
+<li>make: *** [utc_dynamicbox_service] Error 1
+</ul>
+</td>
+</tr>
+</table></p>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Test Status</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#ff5555" class="failure">Failure (2)</td>
+</tr>
+</table></p>
+
+<hr>
+</body>
+</html>
diff --git a/TC/results/build-tar-result-1388117533.journal b/TC/results/build-tar-result-1388117533.journal
new file mode 100644
index 0000000..64d38a7
--- /dev/null
+++ b/TC/results/build-tar-result-1388117533.journal
@@ -0,0 +1,19 @@
+0|3.7-lite 04:12:14 20131227|User: root (0) TCC Start, Command line: /var/tmp/dts_fw/TETware/tetware-target/bin/tcc -b -j results/build-tar-result-1388117533.journal -p ./
+5|Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l|System Information
+20|/var/tmp/dts_fw/./tetbuild.cfg 0|Config Start
+30||TET_OUTPUT_CAPTURE=True
+30||TET_BUILD_TOOL=make
+30||TET_BUILD_FILE=-f Makefile
+30||TET_API_COMPLIANT=True
+30||TET_PASS_TC_NAME=True
+30||TET_VERSION=3.7-lite
+40||Config End
+110|0 /testcase/utc_livebox_service 04:12:14|Build Start, scenario ref 1-0
+100|0|cc -o utc_livebox_service utc_livebox_service.c -I. `pkg-config --cflags livebox-service glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs livebox-service glib-2.0`
+100|0|utc_livebox_service.c:18:21: fatal error: tet_api.h: No such file or directory
+100|0| #include <tet_api.h>
+100|0| ^
+100|0|compilation terminated.
+100|0|make: *** [utc_livebox_service] Error 1
+130|0 2 04:12:15|Build End, scenario ref 1-0
+900|04:12:15|TCC End
diff --git a/TC/results/exec-tar-result-1388117150.html b/TC/results/exec-tar-result-1388117150.html
new file mode 100755
index 0000000..3558e97
--- /dev/null
+++ b/TC/results/exec-tar-result-1388117150.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+<title>TETware Test Run Report</title>
+</head>
+<body bgcolor="white">
+<p><table border="1" width="100%" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading1"><center><h1>
+TETware Test Run Report</h1></center></td></tr></table></p>
+<p><table border="0" cellpadding="2" cellspacing="1">
+<tr>
+<td align="left" class="noborder">TETware version:</td>
+<td align="left" class="noborder">3.7-lite</td>
+</tr>
+<tr>
+<td align="left" class="noborder">System Information:</td>
+<td align="left" class="noborder">Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l</td>
+</tr>
+<tr>
+<td align="left" class="noborder">Date of test run:</td>
+<td align="left" class="noborder">2013-12-27</td>
+</tr>
+<tr>
+<td align="left" class="noborder">Start time:</td>
+<td align="left" class="noborder">04:05:50</td>
+</tr>
+</table></p>
+
+<hr>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Execute mode summary</b></font></td></tr></table></p>
+<p><table border="0" cellpadding="2" cellspacing="1">
+<tr>
+<td align="left" class="noborder"><i>No results</i></td>
+</tr>
+</table></p>
+
+<hr>
+<p><table border="1" cellpadding="3" cellspacing="0">
+<tr><td bgcolor="#ccccff" class="heading2"><font size="+2"><b>
+Inline report</b></font></td></tr></table></p>
+<h3>/testcase/utc_dynamicbox_service [execute]</h3>
+<p><table border="0" cellpadding="5" cellspacing="4">
+<tr>
+<td align="left" bgcolor="#cccccc" class="neutral"><b>Test Status</b></td>
+</tr>
+<tr>
+<td align="left" bgcolor="#ff5555" class="failure">Failure (-1)</td>
+</tr>
+</table></p>
+<h3>Scenario Information</h3>
+<ul>
+<li>[TCC] (exec.c, 131): can't exec /var/tmp/dts_fw/./tet_tmp_dir/23996aa/testcase/utc_dynamicbox_service, reply code = ER_NOENT
+<li>[TCC] (copysave.c, 405): can't change directory to /opt/home/dynamicbox/TETware/tetware-target: No such file or directory
+</ul>
+
+<hr>
+</body>
+</html>
diff --git a/TC/results/exec-tar-result-1388117150.journal b/TC/results/exec-tar-result-1388117150.journal
new file mode 100644
index 0000000..a5d1845
--- /dev/null
+++ b/TC/results/exec-tar-result-1388117150.journal
@@ -0,0 +1,15 @@
+0|3.7-lite 04:05:50 20131227|User: root (0) TCC Start, Command line: /var/tmp/dts_fw/TETware/tetware-target/bin/tcc -e -j results/exec-tar-result-1388117150.journal -p ./
+5|Linux nclinux 3.1.0-rc6 #5 SMP Sun Jan 20 00:39:54 KST 2013 armv7l|System Information
+20|/var/tmp/dts_fw/./tetexec.cfg 1|Config Start
+30||TET_OUTPUT_CAPTURE=True
+30||TET_EXEC_TOOL=
+30||TET_EXEC_FILE=
+30||TET_API_COMPLIANT=True
+30||TET_PASS_TC_NAME=True
+30||TET_VERSION=3.7-lite
+40||Config End
+10|0 /testcase/utc_livebox_service 04:05:50|TC Start, scenario ref 1-0
+50||(exec.c, 131): can't exec /var/tmp/dts_fw/./tet_tmp_dir/23996aa/testcase/utc_livebox_service, reply code = ER_NOENT
+80|0 -1 04:05:50|TC End, scenario ref 1-0
+50||(copysave.c, 405): can't change directory to /opt/home/livebox/TETware/tetware-target: No such file or directory
+900|04:05:50|TCC End
diff --git a/TC/run.sh b/TC/run.sh
new file mode 100755
index 0000000..cec5778
--- /dev/null
+++ b/TC/run.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+source ./_export_target_env.sh
+
+export TET_SUITE_ROOT=`pwd`
+FILE_NAME_EXTENSION=`date +%s`
+
+RESULT_DIR=results
+HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir -p $RESULT_DIR
+
+tcc -e -j $JOURNAL_RESULT -p ./
+grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/testcase/Makefile b/TC/testcase/Makefile
new file mode 100644
index 0000000..811d781
--- /dev/null
+++ b/TC/testcase/Makefile
@@ -0,0 +1,26 @@
+include ../config
+
+CC ?= gcc
+
+C_FILES = $(shell ls *.c)
+
+PKGS = $(PKG_NAME)
+PKGS += glib-2.0
+LDFLAGS = `pkg-config --libs $(PKGS)`
+LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
+
+CFLAGS = -I. `pkg-config --cflags $(PKGS)`
+CFLAGS += -I$(TET_ROOT)/inc/tet3
+CFLAGS += -Wall
+
+TCS := $(shell ls -1 *.c | cut -d. -f1)
+
+all: $(TCS)
+
+%: %.c
+ $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+
+clean:
+ rm -f $(TCS)
diff --git a/TC/testcase/tet_captured b/TC/testcase/tet_captured
new file mode 100644
index 0000000..55af6bb
--- /dev/null
+++ b/TC/testcase/tet_captured
@@ -0,0 +1,6 @@
+cc -o utc_livebox_service utc_livebox_service.c -I. `pkg-config --cflags livebox-service glib-2.0` -I/var/tmp/dts_fw/TC/TETware/tetware-target/inc/tet3 -Wall `pkg-config --libs livebox-service glib-2.0`
+utc_livebox_service.c:18:21: fatal error: tet_api.h: No such file or directory
+ #include <tet_api.h>
+ ^
+compilation terminated.
+make: *** [utc_livebox_service] Error 1
diff --git a/TC/testcase/tslist b/TC/testcase/tslist
new file mode 100644
index 0000000..39522fe
--- /dev/null
+++ b/TC/testcase/tslist
@@ -0,0 +1,2 @@
+/testcase/utc_shortcut
+
diff --git a/TC/testcase/utc_shortcut.c b/TC/testcase/utc_shortcut.c
new file mode 100755
index 0000000..a28745b
--- /dev/null
+++ b/TC/testcase/utc_shortcut.c
@@ -0,0 +1,375 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <tet_api.h>
+#include <stdlib.h>
+
+#include <shortcut.h>
+
+#define MUSIC_APP "com.samsung.music-player"
+#define MUSIC_DYNAMICBOX MUSIC_APP ".dynamicbox"
+#define MUSIC_EASYBOX "com.samsung.music-player.easymode.dynamicbox"
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+static struct test_info {
+ struct shortcut_icon *handle;
+} s_info = {
+ .handle = NULL,
+};
+
+static void startup(void)
+{
+ /* start of TC */
+ tet_printf("\n TC start");
+}
+
+
+static void cleanup(void)
+{
+ /* end of TC */
+ tet_printf("\n TC end");
+}
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_shortcut_set_request_cb_n(void)
+{
+ /*!
+ * \note
+ * Unable to test negative case
+ */
+ dts_pass("shortcut_set_request_cb", "pass negative test");
+}
+
+static int shortcut_request_cb(const char *appid, const char *name, int type, const char *content_info, const char *icon, int pid, double period, int allow_duplicate, void *data)
+{
+ if (appid) {
+ if (!strcmp(appid, "fail")) {
+ return SHORTCUT_ERROR_UNSUPPORTED;
+ } else if (!strcmp(appid, "success")) {
+ return SHORTCUT_ERROR_NONE;
+ }
+ }
+
+ return SHORTCUT_ERROR_NONE;
+}
+
+static void utc_shortcut_set_request_cb_p(void)
+{
+ int ret;
+ ret = shortcut_set_request_cb(shortcut_request_cb, NULL);
+ dts_check_eq("shortcut_set_request_cb", ret, SHORTCUT_ERROR_NONE, "success");
+}
+
+static int response_cb(int ret, int pid, void *data)
+{
+ if ((int)data == 1) {
+ dts_check_eq("add_to_home_shortcut", ret, SHORTCUT_ERROR_UNSUPPORTED, "success");
+ } else if ((int)data == 2) {
+ dts_check_eq("add_to_home_shortcut", ret, SHORTCUT_ERROR_NONE, "success");
+ }
+
+ return 0;
+}
+
+static void utc_add_to_home_shortcut_n(void)
+{
+ int ret;
+ ret = add_to_home_shortcut("fail", NULL, LAUNCH_BY_PACKAGE, NULL, NULL, 1, response_cb, (void *)1);
+ if (ret != SHORTCUT_ERROR_NONE) {
+ dts_check_eq("add_to_home_shortcut", ret, SHORTCUT_ERROR_NONE, "success");
+ }
+}
+
+static void utc_add_to_home_shortcut_p(void)
+{
+ int ret;
+ ret = add_to_home_shortcut("success", NULL, LAUNCH_BY_PACKAGE, NULL, NULL, 1, response_cb, (void *)2);
+ if (ret != SHORTCUT_ERROR_NONE) {
+ dts_check_eq("add_to_home_shortcut", ret, SHORTCUT_ERROR_NONE, "success");
+ }
+}
+
+static void utc_shortcut_get_list_n(void)
+{
+ /*!
+ * \note
+ * Unable to test negative case
+ */
+ dts_pass("shortcut_get_list", "negative test");
+}
+
+static int shortcut_list_cb(const char *appid, const char *icon, const char *name, const char *extra_key, const char *extra_data, void *data)
+{
+ return 0;
+}
+
+static void utc_shortcut_get_list_p(void)
+{
+ int ret;
+ ret = shortcut_get_list(NULL, shortcut_list_cb, NULL);
+ dts_check_ge("shortcut_get_list", ret, 0, "get_list");
+}
+
+static void utc_add_to_home_dynamicbox_n(void)
+{
+ int ret;
+ ret = add_to_home_dynamicbox("fail", NULL, DYNAMICBOX_TYPE_1x1, NULL, NULL, -1.0f, 1, response_cb, (void *)1);
+ if (ret != SHORTCUT_ERROR_NONE) {
+ dts_check_eq("add_to_home_dynamicbox", ret, SHORTCUT_ERROR_NONE, "success");
+ }
+}
+
+static void utc_add_to_home_dynamicbox_p(void)
+{
+ int ret;
+ ret = add_to_home_dynamicbox("success", NULL, DYNAMICBOX_TYPE_1x1, NULL, NULL, -1.0f, 1, response_cb, (void *)2);
+ if (ret != SHORTCUT_ERROR_NONE) {
+ dts_check_eq("add_to_home_dynamicbox", ret, SHORTCUT_ERROR_NONE, "success");
+ }
+}
+
+static void utc_add_to_home_remove_shortcut_n(void)
+{
+ int ret;
+ ret = add_to_home_remove_shortcut("fail", NULL, NULL, response_cb, (void *)1);
+ if (ret != SHORTCUT_ERROR_NONE) {
+ dts_check_eq("add_to_home_remove_shortcut", ret, SHORTCUT_ERROR_INVALID_PARAMETER, "Invalid");
+ }
+}
+
+static void utc_add_to_home_remove_shortcut_p(void)
+{
+ int ret;
+ ret = add_to_home_remove_shortcut("success", NULL, NULL, response_cb, (void *)2);
+ if (ret != SHORTCUT_ERROR_NONE) {
+ dts_check_eq("add_to_home_remove_shortcut", ret, SHORTCUT_ERROR_INVALID_PARAMETER, "Invalid");
+ }
+}
+
+static void utc_add_to_home_remove_dynamicbox_n(void)
+{
+ int ret;
+ ret = add_to_home_remove_dynamicbox("fail", NULL, response_cb, (void *)1);
+ if (ret != SHORTCUT_ERROR_NONE) {
+ dts_check_eq("add_to_home_remove_shortcut", ret, SHORTCUT_ERROR_INVALID_PARAMETER, "Invalid");
+ }
+}
+
+static void utc_add_to_home_remove_dynamicbox_p(void)
+{
+ int ret;
+ ret = add_to_home_remove_dynamicbox("success", NULL, response_cb, (void *)2);
+ if (ret != SHORTCUT_ERROR_NONE) {
+ dts_check_eq("add_to_home_remove_shortcut", ret, SHORTCUT_ERROR_INVALID_PARAMETER, "Invalid");
+ }
+}
+
+static void utc_shortcut_icon_service_init_n(void)
+{
+ /*!
+ * \note
+ * Unable to test negative case
+ */
+ dts_pass("shortcut_icon_service_init", "negative test");
+}
+
+static int icon_service_cb(int status, void *data)
+{
+ dts_check_eq("shortcut_icon_service_init", status, SHORTCUT_ERROR_NONE);
+ return 0;
+}
+
+static void utc_shortcut_icon_service_init_p(void)
+{
+ int ret;
+
+ ret = shortcut_icon_service_init(icon_service_cb, NULL);
+ if (ret != SHORTCUT_ERROR_NONE) {
+ dts_check_eq("shortcut_icon_service_init", ret, SHORTCUT_ERROR_NONE);
+ }
+}
+
+static void utc_shortcut_icon_service_fini_n(void)
+{
+ /*!
+ * \note
+ * Unable to test negative case
+ */
+ dts_pass("shortcut_icon_service_fini", "negative test");
+}
+
+static void utc_shortcut_icon_service_fini_p(void)
+{
+ int ret;
+ ret = shortcut_icon_service_fini();
+ dts_check_eq("shortcut_icon_service_fini", ret, SHORTCUT_ERROR_NONE, "success");
+}
+
+static void utc_shortcut_icon_request_create_n(void)
+{
+ dts_pass("shortcut_icon_request_create", "negative test");
+}
+
+static void utc_shortcut_icon_request_create_p(void)
+{
+ s_info.handle = shortcut_icon_request_create();
+ dts_check_ne("shortcut_icon_request_create", s_info.handle, NULL, "success");
+}
+
+static void utc_shortcut_icon_request_set_info_n(void)
+{
+ int ret;
+ ret = shortcut_icon_request_set_info(NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ dts_check_ne("shortcut_icon_request_set_info", ret, SHORTCUT_ERROR_INVALID_PARAMETER, "invalid handle");
+}
+
+static void utc_shortcut_icon_request_set_info_p(void)
+{
+ int ret;
+
+ if (!s_info.handle) {
+ dts_pass("shortcut_icon_request_set_info", "handle is not initialized");
+ return;
+ }
+
+ ret = shortcut_icon_request_set_info(s_info.handle, NULL, SHORTCUT_ICON_TYPE_IMAGE, "icon,part", "/opt/usr/share/icon.png", NULL, NULL);
+ dts_check_ge("shortcut_icon_request_set_info", ret, 0, "set_info");
+}
+
+static void utc_shortcut_icon_request_send_n(void)
+{
+ int ret;
+
+ ret = shortcut_icon_request_send(NULL, DYNAMICBOX_TYPE_1x1, NULL, NULL, NULL, NULL, NULL);
+ dts_check_eq("shortcut_icon_request_send", ret, SHORTCUT_ERROR_INVALID_PARAMETER, "success");
+}
+
+static int result_cb(struct shortcut_icon *handle, int ret, void *data)
+{
+ return 0;
+}
+
+static void utc_shortcut_icon_request_send_p(void)
+{
+ int ret;
+
+ if (!s_info.handle) {
+ dts_pass("shortcut_icon_request_set_info", "handle is not initialized");
+ return;
+ }
+
+ ret = shortcut_icon_request_send(s_info.handle, DYNAMICBOX_TYPE_1x1, NULL, NULL, "/tmp/icon.png", result_cb, NULL);
+ dts_check_eq("shortcut_icon_request_send", ret, 0, "success");
+}
+
+static void utc_shortcut_icon_request_destroy_n(void)
+{
+ int ret;
+
+ ret = shortcut_icon_request_destroy(NULL);
+ dts_check_eq("shortcut_icon_request_destroy", ret, SHORTCUT_ERROR_INVALID_PARAMETER, "invalid");
+}
+
+static void utc_shortcut_icon_request_destroy_p(void)
+{
+ int ret;
+
+ if (!s_info.handle) {
+ dts_pass("shortcut_icon_request_set_info", "handle is not initialized");
+ return;
+ }
+
+ ret = shortcut_icon_request_destroy(s_info.handle);
+ dts_check_eq("shortcut_icon_request_destroy", ret, SHORTCUT_ERROR_NONE, "Destroy");
+ s_info.handle = NULL;
+}
+
+static void utc_shortcut_icon_request_set_data_n(void)
+{
+ int ret;
+ ret = shortcut_icon_request_set_data(NULL, NULL);
+ dts_check_eq("shortcut_icon_request_set_data", ret, SHORTCUT_ERROR_INVALID_PARAMETER, "invalid");
+}
+
+static void utc_shortcut_icon_request_set_data_p(void)
+{
+ int ret;
+
+ if (!s_info.handle) {
+ dts_pass("shortcut_icon_request_set_data", "failed to set data");
+ return;
+ }
+
+ ret = shortcut_icon_request_set_data(s_info.handle, (void *)1);
+ dts_check_eq("shortcut_icon_request_set_data", ret, SHORTCUT_ERROR_NONE, "success");
+}
+
+static void utc_shortcut_icon_request_data_n(void)
+{
+ dts_pass("shortcut_icon_request_data", "get_data");
+}
+
+static void utc_shortcut_icon_request_data_p(void)
+{
+ void *data;
+ if (!s_info.handle) {
+ dts_pass("shortcut_icon_request_data", "invalid handle");
+ return;
+ }
+
+ data = shortcut_icon_request_data(s_info.handle);
+ dts_check_eq("shortcut_icon_request_data", data, (void *)1, "success");
+}
+
+struct tet_testlist tet_testlist[] = {
+ { utc_shortcut_set_request_cb_n, NEGATIVE_TC_IDX },
+ { utc_shortcut_set_request_cb_p, POSITIVE_TC_IDX },
+ { utc_add_to_home_shortcut_n, NEGATIVE_TC_IDX },
+ { utc_add_to_home_shortcut_p, POSITIVE_TC_IDX },
+ { utc_shortcut_get_list_n, NEGATIVE_TC_IDX },
+ { utc_shortcut_get_list_p, POSITIVE_TC_IDX },
+ { utc_add_to_home_dynamicbox_n, NEGATIVE_TC_IDX },
+ { utc_add_to_home_dynamicbox_p, POSITIVE_TC_IDX },
+ { utc_add_to_home_remove_shortcut_n, NEGATIVE_TC_IDX },
+ { utc_add_to_home_remove_shortcut_p, POSITIVE_TC_IDX },
+ { utc_add_to_home_remove_dynamicbox_n, NEGATIVE_TC_IDX },
+ { utc_add_to_home_remove_dynamicbox_p, POSITIVE_TC_IDX },
+ { utc_shortcut_icon_service_init_n, NEGATIVE_TC_IDX },
+ { utc_shortcut_icon_service_init_p, POSITIVE_TC_IDX },
+ { utc_shortcut_icon_request_create_n, NEGATIVE_TC_IDX },
+ { utc_shortcut_icon_request_create_p, POSITIVE_TC_IDX },
+ { utc_shortcut_icon_request_set_info_n, NEGATIVE_TC_IDX },
+ { utc_shortcut_icon_request_set_info_p, POSITIVE_TC_IDX },
+ { utc_shortcut_icon_request_send_n, NEGATIVE_TC_IDX },
+ { utc_shortcut_icon_request_send_p, POSITIVE_TC_IDX },
+ { utc_shortcut_icon_request_set_data_n, NEGATIVE_TC_IDX },
+ { utc_shortcut_icon_request_set_data_p, POSITIVE_TC_IDX },
+ { utc_shortcut_icon_request_data_n, NEGATIVE_TC_IDX },
+ { utc_shortcut_icon_request_data_p, POSITIVE_TC_IDX },
+ { utc_shortcut_icon_request_destroy_n, NEGATIVE_TC_IDX },
+ { utc_shortcut_icon_request_destroy_p, POSITIVE_TC_IDX },
+ { utc_shortcut_icon_service_fini_n, NEGATIVE_TC_IDX }, // Must be tested as the last TC
+ { utc_shortcut_icon_service_fini_p, POSITIVE_TC_IDX },
+ { NULL, 0 },
+};
+
diff --git a/TC/tet_scen b/TC/tet_scen
new file mode 100644
index 0000000..03f029a
--- /dev/null
+++ b/TC/tet_scen
@@ -0,0 +1,7 @@
+all
+ ^TEST
+##### Scenarios for TEST #####
+
+# Test scenario
+TEST
+ :include:/testcase/tslist
diff --git a/TC/tet_tmp_dir/23996aa/testcase/Makefile b/TC/tet_tmp_dir/23996aa/testcase/Makefile
new file mode 100644
index 0000000..811d781
--- /dev/null
+++ b/TC/tet_tmp_dir/23996aa/testcase/Makefile
@@ -0,0 +1,26 @@
+include ../config
+
+CC ?= gcc
+
+C_FILES = $(shell ls *.c)
+
+PKGS = $(PKG_NAME)
+PKGS += glib-2.0
+LDFLAGS = `pkg-config --libs $(PKGS)`
+LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
+
+CFLAGS = -I. `pkg-config --cflags $(PKGS)`
+CFLAGS += -I$(TET_ROOT)/inc/tet3
+CFLAGS += -Wall
+
+TCS := $(shell ls -1 *.c | cut -d. -f1)
+
+all: $(TCS)
+
+%: %.c
+ $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+
+clean:
+ rm -f $(TCS)
diff --git a/TC/tet_tmp_dir/23996aa/testcase/tet_lock/23996aa b/TC/tet_tmp_dir/23996aa/testcase/tet_lock/23996aa
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TC/tet_tmp_dir/23996aa/testcase/tet_lock/23996aa
diff --git a/TC/tet_tmp_dir/23996aa/testcase/tslist b/TC/tet_tmp_dir/23996aa/testcase/tslist
new file mode 100644
index 0000000..6537934
--- /dev/null
+++ b/TC/tet_tmp_dir/23996aa/testcase/tslist
@@ -0,0 +1,2 @@
+/testcase/utc_livebox_service
+
diff --git a/TC/tet_tmp_dir/23996aa/testcase/utc_dynamicbox_service.c b/TC/tet_tmp_dir/23996aa/testcase/utc_dynamicbox_service.c
new file mode 100755
index 0000000..73f999c
--- /dev/null
+++ b/TC/tet_tmp_dir/23996aa/testcase/utc_dynamicbox_service.c
@@ -0,0 +1,732 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <tet_api.h>
+#include <stdlib.h>
+
+#include <dynamicbox-service.h>
+#include <dynamicbox-errno.h>
+
+#define MUSIC_APP "com.samsung.music-player"
+#define MUSIC_DYNAMICBOX MUSIC_APP ".dynamicbox"
+#define MUSIC_EASYBOX "com.samsung.music-player.easymode.dynamicbox"
+
+enum {
+ POSITIVE_TC_IDX = 0x01,
+ NEGATIVE_TC_IDX,
+};
+
+static void startup(void)
+{
+ /* start of TC */
+ tet_printf("\n TC start");
+
+ // Create DB file for testing
+}
+
+
+static void cleanup(void)
+{
+ /* end of TC */
+ tet_printf("\n TC end");
+ // Delete DB file for testing
+}
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_dynamicbox_service_get_size_n(void)
+{
+ int ret;
+ int w;
+ int h;
+
+ ret = dynamicbox_service_get_size(LB_SIZE_TYPE_UNKNOWN, &w, &h);
+ dts_check_eq("dynamicbox_service_get_size", ret, LB_STATUS_ERROR_INVALID, "invalid size should returns LB_STATUS_ERROR_INVALID\n");
+}
+
+static void utc_dynamicbox_service_get_size_p(void)
+{
+ int ret;
+ int w;
+ int h;
+ ret = dynamicbox_service_get_size(LB_SIZE_TYPE_1x1, &w, &h);
+ dts_check_eq("dynamicbox_service_get_size", ret, LB_STATUS_SUCCESS, "valid size should returns LB_STATUS_SUCCES\n");
+}
+
+static void utc_dynamicbox_service_size_type_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_size_type(1, 1);
+ dts_check_eq("dynamicbox_service_size_type", ret, LB_SIZE_TYPE_UNKNOWN, "invalid size should returns LB_SIZE_TYPE_UNKNOWN\n");
+}
+
+static void utc_dynamicbox_service_size_type_p(void)
+{
+ int ret;
+ int w;
+ int h;
+ int old;
+
+ old = dynamicbox_service_get_size(LB_SIZE_TYPE_1x1, &w, &h);
+
+ ret = dynamicbox_service_size_type(w, h);
+ dts_check_eq("dynamicbox_service_size_type", ret, LB_SIZE_TYPE_1x1, "LB_SIZE_TYPE_1x1 should returns\n");
+}
+
+static void utc_dynamicbox_service_mouse_event_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_mouse_event(NULL);
+ dts_check_eq("dynamicbox_service_mouse_event", ret, 0, "Invalid package name returns 0\n");
+}
+
+static void utc_dynamicbox_service_mouse_event_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_mouse_event(MUSIC_EASYBOX);
+ dts_check_eq("dynamicbox_service_mouse_event", ret, 1, "music player returns 1\n");
+}
+
+static void utc_dynamicbox_service_touch_effect_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_touch_effect(NULL, LB_SIZE_TYPE_1x1);
+ dts_check_eq("dynamicbox_service_touch_effect", ret, 1, "Default touch effect is 1\n");
+}
+
+static void utc_dynamicbox_service_touch_effect_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_touch_effect(MUSIC_DYNAMICBOX, LB_SIZE_TYPE_1x1);
+ dts_check_eq("dynamicbox_service_touch_effect", ret, 1, "Default touch effect is 1\n");
+}
+
+static void utc_dynamicbox_service_need_frame_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_need_frame(NULL, LB_SIZE_TYPE_1x1);
+ dts_check_eq("dynamicbox_service_need_frame", ret, 0, "Default need_frame is 0\n");
+}
+
+static void utc_dynamicbox_service_need_frame_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_need_frame(MUSIC_DYNAMICBOX, LB_SIZE_TYPE_1x1);
+ dts_check_eq("dynamicbox_service_need_frame", ret, 0, "Default need_frame is 0\n");
+}
+
+static void utc_dynamicbox_service_trigger_update_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_trigger_update(NULL, NULL, NULL, NULL, 0);
+ dts_check_eq("dynamicbox_service_trigger_update", ret, LB_STATUS_ERROR_INVALID, "Invalid dynamicbox\n");
+}
+
+static void utc_dynamicbox_service_trigger_update_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_trigger_update(MUSIC_DYNAMICBOX, NULL, NULL, NULL, 0);
+ dts_check_eq("dynamicbox_service_trigger_update", ret, LB_STATUS_SUCCESS, "Invalid dynamicbox\n");
+}
+
+static void utc_dynamicbox_service_trigger_update_with_content_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_trigger_update_with_content(NULL, NULL, NULL, NULL, NULL, 0);
+ dts_check_eq("dynamicbox_service_trigger_update_with_content", ret, LB_STATUS_ERROR_INVALID, "Invalid dynamicbox\n");
+}
+
+static void utc_dynamicbox_service_trigger_update_with_content_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_trigger_update_with_content(MUSIC_DYNAMICBOX, NULL, NULL, NULL, NULL, 0);
+ dts_check_eq("dynamicbox_service_trigger_update_with_content", ret, LB_STATUS_ERROR_INVALID, "Invalid dynamicbox\n");
+}
+
+static void utc_dynamicbox_service_change_period_n(void)
+{
+ int ret;
+
+ ret = dynamicbox_service_change_period(NULL, NULL, 0.0f);
+ dts_check_eq("dynamicbox_service_change_period", ret, LB_STATUS_ERROR_INVALID, "Invalid dynamicbox\n");
+}
+
+static void utc_dynamicbox_service_change_period_p(void)
+{
+ int ret;
+
+ ret = dynamicbox_service_change_period(MUSIC_DYNAMICBOX, NULL, 1.0f);
+ dts_check_eq("dynamicbox_service_change_period", ret, LB_STATUS_SUCCESS, "Invalid dynamicbox\n");
+}
+
+static int get_pkglist_cb(const char *pkgid, const char *lbid, int is_prime, void *data)
+{
+}
+
+static void utc_dynamicbox_service_get_pkglist_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_get_pkglist(NULL, NULL);
+ dts_check_eq("dynamicbox_service_get_pkglist", ret, LB_STATUS_ERROR_INVALID, "Invalid callback\n");
+}
+
+static void utc_dynamicbox_service_get_pkglist_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_get_pkglist(get_pkglist_cb, NULL);
+ dts_check_eq("dynamicbox_service_get_pkglist", ret, LB_STATUS_SUCCESS, "Valid callback\n");
+}
+
+static void utc_dynamicbox_service_get_applist_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_get_applist(NULL, NULL, NULL);
+ dts_check_eq("dynamicbox_service_get_applist", ret, LB_STATUS_ERROR_INVALID, "LB_STATUS_ERROR_INVALID\n");
+}
+
+static void app_list_cb(const char *lbid, const char *appid, void *data)
+{
+}
+
+static void utc_dynamicbox_service_get_applist_p(void)
+{
+ int ret;
+
+ // Getting the UI-App list
+ ret = dynamicbox_service_get_applist(MUSIC_DYNAMICBOX, app_list_cb, NULL);
+ dts_check_eq("dynamicbox_service_get_applist", ret, LB_STATUS_SUCCESS, "LB_STATUS_ERROR_INVALID\n");
+}
+
+static void utc_dynamicbox_service_mainappid_n(void)
+{
+ const char *appid;
+ appid = dynamicbox_service_mainappid(NULL);
+ dts_check_eq("dynamicbox_service_mainappid", appid, NULL, "\"NULL\" should be returned\n");
+}
+
+static void utc_dynamicbox_service_mainappid_p(void)
+{
+ const char *appid;
+ appid = dynamicbox_service_mainappid(MUSIC_DYNAMICBOX);
+ dts_check_str_eq("dynamicbox_service_mainappid", appid, MUSIC_APP, "\"com.samsung.music-player\" should be returned\n");
+}
+
+static void utc_dynamicbox_service_get_pkglist_by_pkgid_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_get_pkglist_by_pkgid(NULL, list_cb, NULL);
+ dts_check_eq("dynamicbox_service_get_pkglist_by_pkgid", ret, LB_STATUS_ERROR_INVALID, "INVALID should be returned");
+}
+
+static void utc_dynamicbox_service_get_pkglist_by_pkgid_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_get_pkglist_by_pkgid(MUSIC_APP, list_cb, NULL);
+ dts_check_ge("dynamicbox_service_get_pkglist_by_pkgid", ret, 0, "greater than or equal to 0");
+}
+
+static void utc_dynamicbox_service_pkgname_n(void)
+{
+ char *pkgname;
+ pkgname = dynamicbox_service_pkgname(NULL);
+ dts_check_eq("dynamicbox_service_pkgname", pkgname, NULL, "lbid is not exists");
+}
+
+static void utc_dynamicbox_service_pkgname_p(void)
+{
+ char *pkgname;
+ pkgname = dynamicbox_service_pkgname(MUSIC_APP);
+ dts_check_str_eq("dynamicbox_service_pkgname", pkgname, MUSIC_DYNAMICBOX, "dynamicbox music-player");
+}
+
+static void utc_dynamicbox_service_is_primary_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_is_primary(NULL);
+ dts_check_str_eq("dynamicbox_service_is_primary", ret, 0, "\"NULL\" is not primary(0)\n");
+}
+
+static void utc_dynamicbox_service_is_primary_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_is_primary(MUSIC_DYNAMICBOX);
+ dts_check_str_eq("dynamicbox_service_is_primary", ret, 1, "\"com.samsung.music-player\" is primary(1)\n");
+}
+
+static void utc_dynamicbox_service_provider_name_n(void)
+{
+//static char *dynamicbox_service_provider_name(const char *lbid);
+ char *provider;
+ provider = dynamicbox_service_provider_name(NULL);
+ dts_check_eq("dynamicbox_service_provider_name", provider, NULL, "returns NULL");
+}
+
+static void utc_dynamicbox_service_provider_name_p(void)
+{
+ char *provider;
+ provider = dynamicbox_service_provider_name(MUSIC_DYNAMICBOX);
+ dts_check_str_eq("dynamicbox_service_provider_name", provider, MUSIC_DYNAMICBOX, "inhouse dynamicbox");
+}
+
+static void utc_dynamicbox_service_setup_appid_n(void)
+{
+//static char *dynamicbox_service_setup_appid(const char *lbid);
+ char *setup;
+ setup = dynamicbox_service_setup_appid(NULL);
+ dts_check_eq("dynamicbox_service_setup_appid", setup, NULL, "setup is NULL");
+}
+
+static void utc_dynamicbox_service_setup_appid_p(void)
+{
+ char *setup;
+ setup = dynamicbox_service_setup_appid(MUSIC_DYNAMICBOX);
+ dts_check_eq("dynamicbox_service_setup_appid", setup, MUSIC_DYNAMICBOX, "setup app");
+}
+
+static void utc_dynamicbox_service_appid_n(void)
+{
+ char *appid;
+ appid = dynamicbox_service_appid(NULL);
+ dts_check_eq("dynamicbox_service_appid", appid, NULL, "appid is NULL");
+}
+
+static void utc_dynamicbox_service_appid_p(void)
+{
+ char *appid;
+ appid = dynamicbox_service_appid(MUSIC_DYNAMICBOX);
+ dts_check_str_eq("dynamicbox_service_appid", appid, MUSIC_APP, "appid is com.samsung.music-player");
+}
+
+static void utc_dynamicbox_service_i18n_name_n(void)
+{
+ char *name;
+ name = dynamicbox_service_i18n_name(NULL, NULL);
+ dts_check_eq("dynamicbox_service_i18n_name", name, NULL, "name is NULL");
+}
+
+static void utc_dynamicbox_service_i18n_name_p(void)
+{
+ char *name;
+ name = dynamicbox_service_i18n_name(MUSIC_DYNAMICBOX, NULL);
+ dts_check_ne("dynamicbox_service_i18n_name", name, NULL, "name is not NULL");
+}
+
+static void utc_dynamicbox_service_privew_n(void)
+{
+ char *preview;
+ preview = dynamicbox_service_preview(MUSIC_DYNAMICBOX, LB_SIZE_TYPE_1x1);
+ dts_check_eq("dynamicbox_service_preview", preview, NULL, "preview is NULL");
+}
+
+static void utc_dynamicbox_service_preview_p(void)
+{
+ char *preview;
+ preview = dynamicbox_service_preview(MUSIC_DYNAMICBOX, LB_SIZE_TYPE_1x1);
+ dts_check_ne("dynamicbox_service_preview", preview, NULL, "preview is not NULL");
+}
+
+static void utc_dynamicbox_service_content_n(void)
+{
+ char *content;
+ content = dynamicbox_service_content(NULL);
+ dts_check_eq("dynamicbox_service_content", content, NULL, "content is NULL");
+}
+
+static void utc_dynamicbox_service_content_p(void)
+{
+ char *content;
+ content = dynamicbox_service_content(MUSIC_DYNAMICBOX);
+ dts_check_ne("dynamicbox_service_content", content, NULL, "content is not NULL");
+}
+
+static void utc_dynamicbox_service_i18n_icon_p(void)
+{
+ char *icon;
+
+ icon = dynamicbox_service_i18n_icon(NULL, NULL);
+ dts_check_eq("dynamicbox_service_i18n_icon", icon, NULL, "icon is NULL");
+}
+
+static void utc_dynamicbox_service_i18n_icon_n(void)
+{
+ char *icon;
+
+ icon = dynamicbox_service_i18n_icon(MUSIC_DYNAMICBOX, NULL);
+ dts_check_ne("dynamicbox_service_i18n_icon", icon, NULL, "icon is not NULL");
+}
+
+static void utc_dynamicbox_service_libexec_p(void)
+{
+ char *libexec;
+ libexec = dynamicbox_service_libexec(NULL);
+ dts_check_eq("dynamicbox_service_libexec", libexec, NULL, "libexec is NULL");
+}
+
+static void utc_dynamicbox_service_libexec_n(void)
+{
+ char *libexec;
+ libexec = dynamicbox_service_libexec(MUSIC_DYNAMICBOX);
+ dts_check_ne("dynamicbox_service_libexec", libexec, NULL, "libexec is not NULL");
+}
+
+static void utc_dynamicbox_service_nodisplay_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_nodisplay(NULL);
+ dts_check_eq("dynamicbox_service_nodisplay", ret, 0, "nodisplay is false");
+}
+
+static void utc_dynamicbox_service_nodisplay_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_nodisplay(MUSIC_DYNAMICBOX);
+ dts_check_eq("dynamicbox_service_nodisplay", ret, 0, "nodisplay is false");
+}
+
+static void utc_dynamicbox_service_abi_p(void)
+{
+ char *abi;
+ abi = dynamicbox_service_abi(NULL);
+ dts_check_eq("dynamicbox_service_abi", abi, NULL, "abi is NULL");
+}
+
+static void utc_dynamicbox_service_abi_n(void)
+{
+ char *abi;
+ abi = dynamicbox_service_abi(MUSIC_DYNAMICBOX);
+ dts_check_ne("dynamicbox_service_abi", abi, NULL, "abi is not NULL");
+}
+
+static void utc_dynamicbox_service_is_enabled_n(void)
+{
+ /*!
+ * static int dynamicbox_service_is_enabled(const char *lbid);
+ * - Not implemented
+ */
+}
+
+static void utc_dynamicbox_service_is_enabled_p(void)
+{
+ /*!
+ * static int dynamicbox_service_is_enabled(const char *lbid);
+ * - Not implemented
+ */
+}
+
+static void utc_dynamicbox_service_lb_script_path_n(void)
+{
+ char *lb_path;
+ lb_path = dynamicbox_service_lb_script_path(NULL);
+ dts_check_eq("dynamicbox_service_lb_script_path", lb_path, NULL, "lb_path is NULL");
+}
+
+static void utc_dynamicbox_service_lb_script_path_p(void)
+{
+ char *lb_path;
+ lb_path = dynamicbox_service_lb_script_path(MUSIC_DYNAMICBOX);
+ dts_check_ne("dynamicbox_service_lb_script_path", lb_path, NULL, "lb_path is NULL");
+}
+
+static void utc_dynamicbox_service_lb_script_group_n(void)
+{
+ char *lb_group;
+ lb_group = dynamicbox_service_lb_script_group(NULL);
+ dts_check_ne("dynamicbox_service_lb_script_group", lb_group, NULL, "lb_group is NULL");
+}
+
+static void utc_dynamicbox_service_lb_script_group_p(void)
+{
+ char *lb_group;
+ lb_group = dynamicbox_service_lb_script_group(MUSIC_DYNAMICBOX);
+ dts_check_ne("dynamicbox_service_lb_script_group", lb_group, NULL, "lb_group is NULL");
+}
+
+static void utc_dynamicbox_service_pd_script_path_n(void)
+{
+ char *pd_script;
+ pd_script = dynamicbox_service_pd_script_path(NULL);
+ dts_check_eq("dynamicbox_service_pd_script_path", pd_script, NULL, "pd_script is NULL");
+}
+
+static void utc_dynamicbox_service_pd_script_path_p(void)
+{
+ char *pd_script;
+ pd_script = dynamicbox_service_pd_script_path(MUSIC_DYNAMICBOX);
+ dts_check_ne("dynamicbox_service_pd_script_path", pd_script, NULL, "pd_script is NULL");
+}
+
+static void utc_dynamicbox_service_pd_script_group_p(void)
+{
+ char *pd_group;
+ pd_group = dynamicbox_service_pd_script_group(MUSIC_DYNAMICBOX);
+ dts_check_ne("dynamicbox_service_pd_script_group", pd_group, NULL, "pd_script is NULL");
+}
+
+static void utc_dynamicbox_service_pd_script_group_n(void)
+{
+ char *pd_group;
+ pd_group = dynamicbox_service_pd_script_group(MUSIC_DYNAMICBOX);
+ dts_check_eq("dynamicbox_service_pd_script_group", pd_group, NULL, "pd_script is NULL");
+}
+
+static void utc_dynamicbox_service_get_supported_sizes_n(void)
+{
+ int cnt = NR_OF_SIZE_LIST;
+ int w[NR_OF_SIZE_LIST];
+ int h[NR_OF_SIZE_LIST];
+ int ret;
+
+ ret = dynamicbox_service_get_supported_sizes(NULL, &cnt, w, h);
+ dts_check_eq("dynamicbox_service_get_supported_sizes", ret, LB_STATUS_ERROR_INVALID, "supported sizes is 0");
+}
+
+static void utc_dynamicbox_service_get_supported_sizes_p(void)
+{
+ int cnt = NR_OF_SIZE_LIST;
+ int w[NR_OF_SIZE_LIST];
+ int h[NR_OF_SIZE_LIST];
+ int ret;
+
+ ret = dynamicbox_service_get_supported_sizes(MUSIC_DYNAMICBOX, &cnt, w, h);
+ dts_check_eq("dynamicbox_service_get_supported_sizes", ret, 0, "supported sizes is 0");
+}
+
+static void utc_dynamicbox_service_get_supported_size_types_n(void)
+{
+ int cnt = NR_OF_SIZE_LIST;
+ int sizes[NR_OF_SIZE_LIST];
+ int ret;
+
+ ret = dynamicbox_service_get_supported_size_types(NULL, &cnt, sizes);
+ dts_check_eq("dynamicbox_service_get_supported_sizes", ret, LB_STATUS_ERROR_INVALID, "supported sizes is 0");
+}
+
+static void utc_dynamicbox_service_get_supported_size_types_p(void)
+{
+ int cnt = NR_OF_SIZE_LIST;
+ int sizes[NR_OF_SIZE_LIST];
+ int ret;
+
+ ret = dynamicbox_service_get_supported_size_types(MUSIC_DYNAMICBOX, &cnt, sizes);
+ dts_check_eq("dynamicbox_service_get_supported_sizes", ret, 0, "supported sizes is 0");
+}
+
+static int category_cb(const char *cluster, const char *category, void *data)
+{
+ return 0;
+}
+
+static void utc_dynamicbox_service_enumerate_category_list_n(void)
+{
+ int ret;
+ ret = dynamicbox_service_enumerate_category_list(NULL, NULL, NULL);
+ dts_check_eq("dynamicbox_service_enumerate_category_list", ret, LB_STATUS_ERROR_INVALID, "invalid argument");
+}
+
+static void utc_dynamicbox_service_enumerate_category_list_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_enumerate_category_list("default", category_cb, NULL);
+ dts_check_eq("dynamicbox_service_enumerate_category_list", ret, LB_STATUS_ERROR_INVALID, "invalid argument");
+}
+
+static void utc_dynamicbox_service_enumerate_cluster_list_n(void)
+{
+//static int dynamicbox_service_enumerate_cluster_list(int (*cb)(const char *cluster, void *data), void *data);
+ int ret;
+ ret = dynamicbox_service_enumerate_cluster_list(NULL, NULL);
+ dts_check_eq("dynamicbox_service_enumerate_cluster_list", ret, LB_STATUS_ERROR_INVALID, "invalid argument");
+}
+
+static void utc_dynamicbox_service_enumerate_cluster_list_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_enumerate_cluster_list(cluster_cb, NULL);
+ dts_check_ne("dynamicbox_service_enumerate_cluster_list", ret, 0, "invalid argument");
+}
+
+static void utc_dynamicbox_service_init_n(void)
+{
+ /*!
+ * \note
+ * Unable to test initialize function
+ */
+}
+
+static void utc_dynamicbox_service_init_p(void)
+{
+ int ret;
+
+ ret = dynamicbox_service_init();
+ dts_check_eq("dynamicbox_service_init", ret, LB_STATUS_SUCCESS, "Success");
+}
+
+static void utc_dynamicbox_service_fini_n(void)
+{
+ /*!
+ * \note
+ * Unable to test finalize function
+ */
+}
+
+static void utc_dynamicbox_service_fini_p(void)
+{
+ int ret;
+ ret = dynamicbox_service_fini();
+ dts_check_eq("dynamicbox_service_fini", ret, LB_STATUS_SUCCESS, "Success");
+}
+
+static void utc_dynamicbox_service_pkglist_create_n(void)
+{
+ /*!
+ * \note
+ * Unable to test finalize function
+ */
+}
+
+static void utc_dynamicbox_service_pkglist_create_p(void)
+{
+ struct pkglist_handle *handle;
+
+ handle = dynamicbox_service_pkglist_create(NULL, NULL);
+ dts_check_ne("dynamicbox_service_pkglist_create", handle, NULL, "Success");
+}
+
+static void utc_dynamicbox_service_get_pkglist_item_n(void)
+{
+ char *lbid;
+ char *pkgname;
+ int prime;
+ int ret;
+
+ ret = dynamicbox_service_get_pkglist_item(NULL, &lbid, &pkgname, &prime);
+ dts_check_eq("dynamicbox_service_get_pkglist_item", ret, LB_STATUS_ERROR_INVALID, "Invalid");
+}
+
+static void utc_dynamicbox_service_get_pkglist_item_p(void)
+{
+ struct pkglist_handle *handle;
+ char *lbid;
+ char *pkgname;
+ int prime;
+ int ret;
+
+ handle = dynamicbox_service_pkglist_create(NULL, NULL);
+ ret = dynamicbox_service_get_pkglist_item(handle, &lbid, &pkgname, &prime);
+ dts_check_eq("dynamicbox_service_get_pkglist_item", ret, LB_STATUS_SUCCESS, "Success");
+}
+
+static void utc_dynamicbox_service_pkglist_destroy_n(void)
+{
+ int ret;
+
+ ret = dynamicbox_service_pkglist_destroy(NULL);
+ dts_check_eq("dynamicbox_service_pkglist_destroy", ret, LB_STATUS_ERROR_INVALID, "Invalid");
+}
+
+static void utc_dynamicbox_service_pkglist_destroy_p(void)
+{
+ struct pkglist_handle *handle;
+ int ret;
+
+ handle = dynamicbox_service_pkglist_create(NULL, NULL);
+ ret = dynamicbox_service_pkglist_destroy(handle);
+ dts_check_eq("dynamicbox_service_pkglist_destroy", ret, LB_STATUS_ERROR_INVALID, "Invalid");
+}
+
+struct tet_testlist tet_testlist[] = {
+ { utc_dynamicbox_service_get_size_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_get_size_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_size_type_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_size_type_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_mouse_event_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_mouse_event_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_touch_effect_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_touch_effect_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_need_frame_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_need_frame_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_trigger_update_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_trigger_update_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_trigger_update_with_content_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_trigger_update_with_content_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_change_period_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_change_period_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_get_pkglist_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_get_pkglist_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_get_applist_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_get_applist_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_mainappid_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_mainappid_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_get_pkglist_by_pkgid_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_get_pkglist_by_pkgid_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_pkgname_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_pkgname_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_is_primary_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_is_primary_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_provider_name_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_provider_name_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_setup_appid_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_setup_appid_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_appid_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_appid_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_i18n_name_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_i18n_name_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_privew_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_preview_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_content_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_content_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_content_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_i18n_icon_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_i18n_icon_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_libexec_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_libexec_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_nodisplay_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_nodisplay_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_abi_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_abi_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_is_enabled_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_is_enabled_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_lb_script_path_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_lb_script_path_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_lb_script_group_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_lb_script_group_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_pd_script_path_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_pd_script_path_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_pd_script_group_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_pd_script_group_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_get_supported_sizes_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_get_supported_sizes_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_get_supported_size_types_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_get_supported_size_types_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_enumerate_category_list_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_enumerate_category_list_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_enumerate_cluster_list_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_enumerate_cluster_list_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_init_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_init_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_fini_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_fini_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_pkglist_create_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_pkglist_create_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_get_pkglist_item_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_get_pkglist_item_p, POSITIVE_TC_IDX },
+ { utc_dynamicbox_service_pkglist_destroy_n, NEGATIVE_TC_IDX },
+ { utc_dynamicbox_service_pkglist_destroy_p, POSITIVE_TC_IDX },
+ { NULL, 0 },
+};
+
diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg
new file mode 100644
index 0000000..f7eda55
--- /dev/null
+++ b/TC/tetbuild.cfg
@@ -0,0 +1,5 @@
+TET_OUTPUT_CAPTURE=True # capture option for build operation checking
+TET_BUILD_TOOL=make # build with using make command
+TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build
+TET_API_COMPLIANT=True # use TET API in Test Case ?
+TET_PASS_TC_NAME=True # report passed TC name in Journal file?
diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg
new file mode 100644
index 0000000..02d7030
--- /dev/null
+++ b/TC/tetclean.cfg
@@ -0,0 +1,5 @@
+TET_OUTPUT_CAPTURE=True # capture option
+TET_CLEAN_TOOL= make clean # clean tool
+TET_CLEAN_FILE= Makefile # file for clean
+TET_API_COMPLIANT=True # TET API useage
+TET_PASS_TC_NAME=True # showing name , passed TC
diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg
new file mode 100644
index 0000000..ef3e452
--- /dev/null
+++ b/TC/tetexec.cfg
@@ -0,0 +1,5 @@
+TET_OUTPUT_CAPTURE=True # capturing execution or not
+TET_EXEC_TOOL= # ex) exec : execution tool set up/ Optional
+TET_EXEC_FILE= # ex) exectool : execution file/ Optional
+TET_API_COMPLIANT=True # Test case or Tool usesTET API?
+TET_PASS_TC_NAME=True # showing Passed TC name ?
diff --git a/doc/image/BuildShortcutList.png b/doc/image/BuildShortcutList.png
new file mode 100644
index 0000000..b40db50
--- /dev/null
+++ b/doc/image/BuildShortcutList.png
Binary files differ
diff --git a/doc/image/JumpToApp.png b/doc/image/JumpToApp.png
new file mode 100644
index 0000000..5a51d2b
--- /dev/null
+++ b/doc/image/JumpToApp.png
Binary files differ
diff --git a/doc/image/ShortcutApp.png b/doc/image/ShortcutApp.png
new file mode 100644
index 0000000..a4cd97e
--- /dev/null
+++ b/doc/image/ShortcutApp.png
Binary files differ
diff --git a/doc/image/ShortcutUG.png b/doc/image/ShortcutUG.png
new file mode 100644
index 0000000..80b92ee
--- /dev/null
+++ b/doc/image/ShortcutUG.png
Binary files differ
diff --git a/doc/shortcut_doc.h b/doc/shortcut_doc.h
new file mode 100755
index 0000000..6469494
--- /dev/null
+++ b/doc/shortcut_doc.h
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __SHORTCUT_DOC_H__
+#define __SHORTCUT_DOC_H__
+
+/**
+ * @defgroup SHORTCUT_MODULE Shortcut
+ * @brief To enhance the Add to home feature. Two types of API sets are supported.
+ * - One for the homescreen developers.
+ * - The other for the application developers who should implement the Add to home feature.
+ * @ingroup CAPI_APPLICATION_FRAMEWORK
+ * @section SHORTCUT_MODULE_HEADER Required Header
+ * \#include <shortcut.h>
+ * @section SHORTCUT_MODULE_OVERVIEW Overview
+<H1>1. Shortcut</H1>
+Tizen is supporting the "add shortcut or add to home" for various applications.
+Developers may use the shortcut library (libshortcut) to implement features like sending (applications) and receiving (possibly home screen) shortcuts.
+If home screen implements the shortcut service using the library, the applications are good to go for adding their shortcuts to the home screen(, and vice versa.)
+
+<H1>2. How to add a new shortcut to the home screen</H1>
+<H2>2.1 Add to home (From the app to home)</H2>
+
+The following are two separate APIs to support the "add to home" feature.
+
+\code
+typedef int (*result_cb_t)(int ret, void *data)
+
+extern int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, const char *icon, int allow_duplicate, result_cb_t result_cb, void *data)
+\endcode
+
+Currently, our home screen can contain two different types of contents (that are pure shortcuts).
+
+To add a pure shortcut i.e., simply for launching an app, developers can use the "shortcut_add_to_home" API to deliver their shortcuts to a home screen.
+
+<TABLE>
+<TR><TH>Parameters</TH><TH>Comment</TH></TR>
+<TR><TD>name</TD><TD>Application name which will be displayed on the screen</TD></TR>
+<TR><TD>type</TD><TD>Basically it describes launching options whether to use a package name or URI. LAUNCH_BY_APP or LAUNCH_BY_URI</TD></TR>
+<TR><TD>content</TD><TD>
+Application data used for creating a pure shortcut
+
+ Shortcut
+
+1. If the type is Launch by app: None
+
+2. If the type is Launch by URI: Put the URI in the content
+
+<H3>2.1.1 Supported types</H3>
+shortcut.h Enumeration values for type of shortcuts
+
+<H2>2.2 Add shortcut (Home screen retrieves shortcuts from the app)</H2>
+"Add shortcut " service enables home screen to retrieve all shortcuts that applications promised to support and request an app to send their shortcuts to home directly, as opposed to "add to home".
+
+It is initiated by the home screen as opposed to "add to home" which is initiated by an application.The "Add shortcut" service enables the home screen to retrieve all shortcuts that applications promised to support and request an app to send their shortcuts to home directly, as opposed to "add to home".
+
+It is initiated by the home screen as opposed to "add to home" which is initiated by an application.
+
+<H3>2.2.1 Build the shortcut list DB</H3>
+\image html BuildShortcutList.png
+
+To recognize how many and what kinds of shortcuts have been registered, each application who wants to support the "add shortcut" service needs to install the XML file that defines "shortcut" information.
+The following table describes the format and information necessary to define the shortcuts application can support.
+Then, the information will be shown and used in home screen when a user selects "add shortcut" service.
+
+<TABLE>
+<caption>Syntax of the shortcut manifest file</caption>
+<TR><TD>
+\code
+<manifest xmlns="http://tizen.org/ns/packages" package="com.samsung.APP_PKGNAME">
+...
+ <shortcut-list>
+ <shortcut appid="com.samsung.myapp" extra_key="key_string" extra_data="data_string_for_key">
+ <icon>/opt/share/icons/default/small/com.samsung.myapp-shortcut.png</icon>
+ <label>Default name</label>
+ <label xml:lang="en-us">Name en</label>
+ <label xml:lang="nl-nl">Name nl</label>
+ <label xml:lang="de-de">Name de</label>
+ <label xml:lang="zh-hk">Name hk</label>
+ <label xml:lang="zh-cn">Name cn</label>
+ <label xml:lang="ru-ru">Name ru</label>
+ <label xml:lang="zh-tw">Name tw</label>
+ <label xml:lang="ja-jp">Name jp</label>
+ <label xml:lang="es-es">Name es</label>
+ <label xml:lang="el-gr">Name gr</label>
+ <label xml:lang="it-it">Name it</label>
+ <label xml:lang="tr-tr">Name tr</label>
+ <label xml:lang="pt-pt">Name pt</label>
+ <label xml:lang="fr-fr">Name fr</label>
+ <label xml:lang="ko-kr">Name kr</label>
+ </shortcut>
+ <shortcut appid="com.samsung.myapp" extra_key="key_string" extra_data="data_string_for_key">
+ <label>Default name</label>
+ </shortcut>
+ ...
+ <shortcut appid="com.samsung.myapp" extra_key="key_string" extra_data="data_string_for_key">
+ <label>Default name</label>
+ <icon>/opt/share/icons/default/small/com.samsung.myapp2.png</icon>
+ </shortcut>
+ </shortcut-list>
+...
+</manifest>
+\endcode
+</TD></TR>
+</TABLE>
+
+Install this XML file to /opt/share/packages/YOUR_PKGNAME.xml (Note: After manifest has been applied to the binary, simply copy the content to your manifest file.)
+The shortcut listing application will list up these items on its screen and each item will be displayed using the string in the label field.
+When selected, it will launch the selected app using app service with "appid" and a bundle holding data in the pair of extra_key and extra-data fields.
+Obviously, icon will be used to display visual information for given shortcut type.(that said the icon could be other than the application's default icon)
+
+<H3>2.2.2 Jump to the APP</H3>
+\image html JumpToApp.png
+
+The shortcut listing application will launch your application using app-svc with package name and param attributes.
+It will use the pkgname and param attrbute to launch your application.
+The shortcut list view will launch your "[App] Shortcut list" using the following code.
+
+When your app is launched, the app should send a selected item as a shortcut to the home screen using "shortcut_add" series functions mentioned above.
+
+<H3>2.2.3 What each app has to do</H3>
+You can implement your shortcut list view using App or UG.
+
+Who is going to handle the shortcut
+
+<UL>
+<LI>Handled by App
+ <LI>App should prepare a shortcut-add view as guided</LI>
+</LI>
+<LI>Handeld by UG
+ <LI>UG should be launched as an app and provide the shortcut-add view</LI>
+</LI>
+</UL>
+
+In your shortcut list view, you just call the "shortcut_add_to_home" which is described in the section 2.1
+
+<H4>2.2.3.1 Handled by App</H4>
+\image html ShortcutApp.png
+When your application is launched by the shortcut list application (displayed on the left most of above figure).
+Your application should go back to the normal view when you receive the PAUSE event.
+If you didn't change the view of your application, the user will see this shortcut list view again even if the user
+launches your application from the app-tray(or homescreen).
+So you have to change the view from the shortcut list to the normal(or previous) view when you get the PAUSE event.
+
+<H4>2.2.3.2 Handled by UG</H4>
+\image html ShortcutUG.png
+In this case, the Shortcut List application will launch your UG as a process.
+When you receive PAUSE event, or need to change to other view (not in the same UG), you should destroy current UG.
+If you didn't destroy it, it will be reside on the process list. and it will not be destroyed automatically.
+
+Currently, the UG container process only supports multiple instance for a process.
+So if the user tries to add a new shortcut again from the shortcut list application, your UG will be launched again if you didn't
+terminate previous UG process (when you got PAUSE event).
+ *
+ */
+
+#endif /* __SHORTCUT_DOC_H__ */
diff --git a/doc_prod/shortcut_doc.h b/doc_prod/shortcut_doc.h
new file mode 100755
index 0000000..6469494
--- /dev/null
+++ b/doc_prod/shortcut_doc.h
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __SHORTCUT_DOC_H__
+#define __SHORTCUT_DOC_H__
+
+/**
+ * @defgroup SHORTCUT_MODULE Shortcut
+ * @brief To enhance the Add to home feature. Two types of API sets are supported.
+ * - One for the homescreen developers.
+ * - The other for the application developers who should implement the Add to home feature.
+ * @ingroup CAPI_APPLICATION_FRAMEWORK
+ * @section SHORTCUT_MODULE_HEADER Required Header
+ * \#include <shortcut.h>
+ * @section SHORTCUT_MODULE_OVERVIEW Overview
+<H1>1. Shortcut</H1>
+Tizen is supporting the "add shortcut or add to home" for various applications.
+Developers may use the shortcut library (libshortcut) to implement features like sending (applications) and receiving (possibly home screen) shortcuts.
+If home screen implements the shortcut service using the library, the applications are good to go for adding their shortcuts to the home screen(, and vice versa.)
+
+<H1>2. How to add a new shortcut to the home screen</H1>
+<H2>2.1 Add to home (From the app to home)</H2>
+
+The following are two separate APIs to support the "add to home" feature.
+
+\code
+typedef int (*result_cb_t)(int ret, void *data)
+
+extern int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, const char *icon, int allow_duplicate, result_cb_t result_cb, void *data)
+\endcode
+
+Currently, our home screen can contain two different types of contents (that are pure shortcuts).
+
+To add a pure shortcut i.e., simply for launching an app, developers can use the "shortcut_add_to_home" API to deliver their shortcuts to a home screen.
+
+<TABLE>
+<TR><TH>Parameters</TH><TH>Comment</TH></TR>
+<TR><TD>name</TD><TD>Application name which will be displayed on the screen</TD></TR>
+<TR><TD>type</TD><TD>Basically it describes launching options whether to use a package name or URI. LAUNCH_BY_APP or LAUNCH_BY_URI</TD></TR>
+<TR><TD>content</TD><TD>
+Application data used for creating a pure shortcut
+
+ Shortcut
+
+1. If the type is Launch by app: None
+
+2. If the type is Launch by URI: Put the URI in the content
+
+<H3>2.1.1 Supported types</H3>
+shortcut.h Enumeration values for type of shortcuts
+
+<H2>2.2 Add shortcut (Home screen retrieves shortcuts from the app)</H2>
+"Add shortcut " service enables home screen to retrieve all shortcuts that applications promised to support and request an app to send their shortcuts to home directly, as opposed to "add to home".
+
+It is initiated by the home screen as opposed to "add to home" which is initiated by an application.The "Add shortcut" service enables the home screen to retrieve all shortcuts that applications promised to support and request an app to send their shortcuts to home directly, as opposed to "add to home".
+
+It is initiated by the home screen as opposed to "add to home" which is initiated by an application.
+
+<H3>2.2.1 Build the shortcut list DB</H3>
+\image html BuildShortcutList.png
+
+To recognize how many and what kinds of shortcuts have been registered, each application who wants to support the "add shortcut" service needs to install the XML file that defines "shortcut" information.
+The following table describes the format and information necessary to define the shortcuts application can support.
+Then, the information will be shown and used in home screen when a user selects "add shortcut" service.
+
+<TABLE>
+<caption>Syntax of the shortcut manifest file</caption>
+<TR><TD>
+\code
+<manifest xmlns="http://tizen.org/ns/packages" package="com.samsung.APP_PKGNAME">
+...
+ <shortcut-list>
+ <shortcut appid="com.samsung.myapp" extra_key="key_string" extra_data="data_string_for_key">
+ <icon>/opt/share/icons/default/small/com.samsung.myapp-shortcut.png</icon>
+ <label>Default name</label>
+ <label xml:lang="en-us">Name en</label>
+ <label xml:lang="nl-nl">Name nl</label>
+ <label xml:lang="de-de">Name de</label>
+ <label xml:lang="zh-hk">Name hk</label>
+ <label xml:lang="zh-cn">Name cn</label>
+ <label xml:lang="ru-ru">Name ru</label>
+ <label xml:lang="zh-tw">Name tw</label>
+ <label xml:lang="ja-jp">Name jp</label>
+ <label xml:lang="es-es">Name es</label>
+ <label xml:lang="el-gr">Name gr</label>
+ <label xml:lang="it-it">Name it</label>
+ <label xml:lang="tr-tr">Name tr</label>
+ <label xml:lang="pt-pt">Name pt</label>
+ <label xml:lang="fr-fr">Name fr</label>
+ <label xml:lang="ko-kr">Name kr</label>
+ </shortcut>
+ <shortcut appid="com.samsung.myapp" extra_key="key_string" extra_data="data_string_for_key">
+ <label>Default name</label>
+ </shortcut>
+ ...
+ <shortcut appid="com.samsung.myapp" extra_key="key_string" extra_data="data_string_for_key">
+ <label>Default name</label>
+ <icon>/opt/share/icons/default/small/com.samsung.myapp2.png</icon>
+ </shortcut>
+ </shortcut-list>
+...
+</manifest>
+\endcode
+</TD></TR>
+</TABLE>
+
+Install this XML file to /opt/share/packages/YOUR_PKGNAME.xml (Note: After manifest has been applied to the binary, simply copy the content to your manifest file.)
+The shortcut listing application will list up these items on its screen and each item will be displayed using the string in the label field.
+When selected, it will launch the selected app using app service with "appid" and a bundle holding data in the pair of extra_key and extra-data fields.
+Obviously, icon will be used to display visual information for given shortcut type.(that said the icon could be other than the application's default icon)
+
+<H3>2.2.2 Jump to the APP</H3>
+\image html JumpToApp.png
+
+The shortcut listing application will launch your application using app-svc with package name and param attributes.
+It will use the pkgname and param attrbute to launch your application.
+The shortcut list view will launch your "[App] Shortcut list" using the following code.
+
+When your app is launched, the app should send a selected item as a shortcut to the home screen using "shortcut_add" series functions mentioned above.
+
+<H3>2.2.3 What each app has to do</H3>
+You can implement your shortcut list view using App or UG.
+
+Who is going to handle the shortcut
+
+<UL>
+<LI>Handled by App
+ <LI>App should prepare a shortcut-add view as guided</LI>
+</LI>
+<LI>Handeld by UG
+ <LI>UG should be launched as an app and provide the shortcut-add view</LI>
+</LI>
+</UL>
+
+In your shortcut list view, you just call the "shortcut_add_to_home" which is described in the section 2.1
+
+<H4>2.2.3.1 Handled by App</H4>
+\image html ShortcutApp.png
+When your application is launched by the shortcut list application (displayed on the left most of above figure).
+Your application should go back to the normal view when you receive the PAUSE event.
+If you didn't change the view of your application, the user will see this shortcut list view again even if the user
+launches your application from the app-tray(or homescreen).
+So you have to change the view from the shortcut list to the normal(or previous) view when you get the PAUSE event.
+
+<H4>2.2.3.2 Handled by UG</H4>
+\image html ShortcutUG.png
+In this case, the Shortcut List application will launch your UG as a process.
+When you receive PAUSE event, or need to change to other view (not in the same UG), you should destroy current UG.
+If you didn't destroy it, it will be reside on the process list. and it will not be destroyed automatically.
+
+Currently, the UG container process only supports multiple instance for a process.
+So if the user tries to add a new shortcut again from the shortcut list application, your UG will be launched again if you didn't
+terminate previous UG process (when you got PAUSE event).
+ *
+ */
+
+#endif /* __SHORTCUT_DOC_H__ */
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
new file mode 100755
index 0000000..4444b43
--- /dev/null
+++ b/lib/CMakeLists.txt
@@ -0,0 +1,55 @@
+PROJECT(shortcut C)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/include)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "\${prefix}")
+SET(LIBDIR "\${exec_prefix}/lib")
+SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
+SET(VERSION_MAJOR 0)
+SET(VERSION "${VERSION_MAJOR}.0.1")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(svc_pkgs REQUIRED
+ dlog
+ sqlite3
+ libxml-2.0
+ glib-2.0
+ db-util
+ com-core
+ vconf
+ capi-base-common
+)
+
+FOREACH(flag ${svc_pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall -Werror")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DLOG_TAG=\"SHORTCUT\"")
+ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET")
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED
+ src/main.c
+ src/icon.c
+ src/dlist.c
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${svc_pkgs_LDFLAGS})
+
+CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc")
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib/include/shortcut.h DESTINATION include/${PROJECT_NAME})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib/include/shortcut_product.h DESTINATION include/${PROJECT_NAME})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib/include/shortcut_private.h DESTINATION include/${PROJECT_NAME})
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib/include/shortcut_manager.h DESTINATION include/${PROJECT_NAME})
+INSTALL(FILES ${CMAKE_BINARY_DIR}/lib/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}")
+
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
diff --git a/lib/LICENSE b/lib/LICENSE
new file mode 100644
index 0000000..3b739e3
--- /dev/null
+++ b/lib/LICENSE
@@ -0,0 +1,204 @@
+Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/lib/include/dlist.h b/lib/include/dlist.h
new file mode 100644
index 0000000..cd1a421
--- /dev/null
+++ b/lib/include/dlist.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2013 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define dlist_remove_data(list, data) do { \
+ struct dlist *l; \
+ l = dlist_find_data(list, data); \
+ list = dlist_remove(list, l); \
+} while (0)
+
+#define dlist_foreach(list, l, data) \
+ for ((l) = (list); (l) && ((data) = dlist_data(l)); (l) = dlist_next(l))
+
+#define dlist_foreach_safe(list, l, n, data) \
+ for ((l) = (list), (n) = dlist_next(l); \
+ (l) && ((data) = dlist_data(l)); \
+ (l) = (n), (n) = dlist_next(l))
+
+struct dlist;
+
+extern struct dlist *dlist_append(struct dlist *list, void *data);
+extern struct dlist *dlist_prepend(struct dlist *list, void *data);
+extern struct dlist *dlist_remove(struct dlist *list, struct dlist *l);
+extern struct dlist *dlist_find_data(struct dlist *list, void *data);
+extern void *dlist_data(struct dlist *l);
+extern struct dlist *dlist_next(struct dlist *l);
+extern struct dlist *dlist_prev(struct dlist *l);
+extern int dlist_count(struct dlist *l);
+extern struct dlist *dlist_nth(struct dlist *l, int nth);
+
+/* End of a file */
diff --git a/lib/include/shortcut.h b/lib/include/shortcut.h
new file mode 100755
index 0000000..17671de
--- /dev/null
+++ b/lib/include/shortcut.h
@@ -0,0 +1,441 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#ifndef __SHORTCUT_H__
+#define __SHORTCUT_H__
+
+#include <tizen.h>
+#include <shortcut_manager.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file shortcut.h
+ * @brief This file declares the API of the libshortcut library.
+ */
+
+/**
+ * @addtogroup SHORTCUT_MODULE
+ * @{
+ */
+
+/**
+ * @internal
+ * @brief Called to the add_to_home request.
+ * @details The homescreen should define a callback as this type and implement the service code
+ * for adding a new application shortcut.
+ * @since_tizen 2.3
+ * @param[in] appid The shortcut that is added for this package
+ * @param[in] name The name of the created shortcut icon
+ * @param[in] type One of the three defined types
+ * @param[in] content_info The specific information for creating a new shortcut
+ * @param[in] icon The absolute path of an icon file for this shortcut
+ * @param[in] pid The process ID of who request add_to_home
+ * @param[in] allow_duplicate @c 1 if the shortcut can be duplicated,
+ * otherwise a shourtcut should exist only once
+ * @param[in] data The callback data
+ * @return The result of handling a shortcut creation request\n
+ * This returns @c 0 if the add_to_home request is handled successfully,
+ * otherwise it returns a proper errno.
+ * @see shortcut_set_request_cb()
+ */
+typedef int (*request_cb_t)(const char *appid, const char *name, int type, const char *content_info, const char *icon, int pid, double period, int allow_duplicate, void *data);
+
+/**
+ * @brief Called to receive the result of add_to_home_shortcut().
+ * @since_tizen 2.3
+ * @param[in] ret The result value, it could be @c 0 if it succeeds to add a shortcut,
+ * otherwise it returns an errno
+ * @param[in] pid The process ID of who handle this add_to_home request
+ * @param[in] data The callback data
+ * @return int @c 0 if there is no error,
+ otherwise errno
+ * @see add_to_home_shortcut()
+ */
+typedef int (*result_internal_cb_t)(int ret, int pid, void *data);
+
+/**
+ * @brief Enumeration for shortcut types.
+ * @details Basically, three types of shortcuts are defined.
+ * Every homescreen developer should support these types of shortcuts.
+ * Or return a proper errno to figure out why the application failed to add a shortcut.
+ * #LAUNCH_BY_PACKAGE is used for adding a package itself as a shortcut.
+ * #LAUNCH_BY_URI is used for adding a shortcut for "uri" data.
+ * @since_tizen 2.3
+ */
+enum shortcut_internal_type {
+ /**< Deprecated type */
+ SHORTCUT_PACKAGE = 0x00000000, /**< Launch the package using the given package name */
+ SHORTCUT_DATA = 0x00000001, /**< Launch the related package with the given data(content_info) */
+ SHORTCUT_FILE = 0x00000002, /**< Launch the related package with the given filename(content_info) */
+
+ LAUNCH_BY_PACKAGE = 0x00000000,
+
+ SHORTCUT_REMOVE = 0x40000000, /**< Remove a shortcut */
+ DYNAMICBOX_REMOVE = 0x80000000, /**< Remove a dynamicbox */
+
+ DYNAMICBOX_TYPE_DEFAULT = 0x10000000, /**< Type mask for the default dynamicbox */
+ DYNAMICBOX_TYPE_EASY_DEFAULT = 0x30000000, /**< Type mask for the easy mode dynamicbox */
+ DYNAMICBOX_TYPE_1x1 = 0x10010000, /**< 1x1 */
+ DYNAMICBOX_TYPE_2x1 = 0x10020000, /**< 2x1 */
+ DYNAMICBOX_TYPE_2x2 = 0x10040000, /**< 2x2 */
+ DYNAMICBOX_TYPE_4x1 = 0x10080000, /**< 4x1 */
+ DYNAMICBOX_TYPE_4x2 = 0x10100000, /**< 4x2 */
+ DYNAMICBOX_TYPE_4x3 = 0x10200000, /**< 4x3 */
+ DYNAMICBOX_TYPE_4x4 = 0x10400000, /**< 4x4 */
+ DYNAMICBOX_TYPE_4x5 = 0x11000000, /**< 4x5 */
+ DYNAMICBOX_TYPE_4x6 = 0x12000000, /**< 4x6 */
+ DYNAMICBOX_TYPE_EASY_1x1 = 0x30010000, /**< Easy mode 1x1 */
+ DYNAMICBOX_TYPE_EASY_3x1 = 0x30020000, /**< Easy mode 3x2 */
+ DYNAMICBOX_TYPE_EASY_3x3 = 0x30040000, /**< Easy mode 3x3 */
+ DYNAMICBOX_TYPE_UNKNOWN = 0x1FFF0000, /**< Error */
+};
+
+/**
+ * @brief Enumeration for values of shortcut response types.
+ * @since_tizen 2.3
+ */
+enum shortcut_internal_error_e {
+ SHORTCUT_ERROR = 0x80000000, /**< MSB(1). Check this using the #SHORTCUT_STATUS_IS_ERROR macro */
+
+ SHORTCUT_STATUS_CARED = 0x08000000, /**< Shortcut status is already cared. Check this using the #SHORTCUT_STATUS_IS_CARED macro */
+
+ SHORTCUT_ERROR_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Receiver is busy, try again later */
+ SHORTCUT_ERROR_UNSUPPORTED = SHORTCUT_ERROR | 0x0400 /**< Shortcut is not supported */
+};
+
+/**
+ * @brief Definition for a macro to check type.
+ * @since_tizen 2.3
+ * @param[in] type The type of box
+ * @return bool
+ * @retval true(1) If it is a dynamicbox
+ * @retval false(0) If it is not a dynamicbox
+ * @see shortcut_type
+ */
+#define ADD_TO_HOME_IS_DYNAMICBOX(type) (!!((type) & 0x10000000))
+
+/**
+ * @brief Definition for a macro to check the request status.
+ * @since_tizen 2.3
+ * @param[in] type The status
+ * @return bool
+ * @retval true(1) Error
+ * @retval false(0) Not an error
+ * @see shortcut_error_e
+ */
+#define SHORTCUT_STATUS_IS_ERROR(type) (!!((type) & SHORTCUT_ERROR))
+
+/**
+ * @brief Definition for a macro to check the request status.
+ * @since_tizen 2.3
+ * @param[in] type The status
+ * @return bool
+ * @retval true(1) Shortcut request is already handled by the requestee (homescreen, viewer, ...)
+ * @retval false(0) Request result should be cared by the requestor
+ * @see shortcut_error_e
+ */
+#define SHORTCUT_STATUS_IS_CARED(type) (!!((type) & SHORTCUT_STATUS_CARED))
+
+/**
+ * @brief Definition for filtering the pure error code from the given status.
+ * @since_tizen 2.3
+ * @param[in] status The status
+ * @return The status code (error)
+ * @see shortcut_error_e
+ */
+#define SHORTCUT_ERROR_CODE(status) ((status) & ~SHORTCUT_STATUS_CARED)
+
+/**
+ *
+ * @internal
+ *
+ * @brief Supports the shortcut creating request.
+ *
+ * @details
+ * Sync (or) Async:
+ * This is an asynchronous API.
+ *
+ * Important Notes: \n
+ * Should be used from the homescreen.\n
+ * Should check the return value of this function.
+ *
+ * Prospective Clients:
+ * Homescreen.
+ *
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/shortcut
+ *
+ * @param[in] request_cb The callback function pointer that is invoked when add_to_home is requested
+ * @param[in] data The callback data to deliver to the callback function
+ *
+ * @return The return type (int)
+ * @retval 0 Callback function is successfully registered
+ * @retval <0 Failed to register the callback function for the request
+ *
+ * @pre You have to prepare a callback function.
+ *
+ * @post If a request is sent from the application, the registered callback will be invoked.
+ *
+ * @see request_cb_t
+ * @par Example
+ * @code
+ * #include <shortcut.h>
+ *
+ * static int request_cb(const char *appid, const char *name, int type, const char *content_info, const char *icon, int pid, void *data)
+ * {
+ * printf("Package name: %s\n", appid);
+ * printf("Name: %s\n", name);
+ * printf("Type: %d\n", type);
+ * printf("Content: %s\n", content_info);
+ * printf("Icon: %s\n", icon);
+ * printf("Requested from: %d\n", pid);
+ * printf("CBDATA: %p\n", data);
+ * return 0; // returns success.
+ * }
+ *
+ * static int app_create(void *data)
+ * {
+ * shortcut_set_request_cb(request_cb, NULL);
+ * return 0;
+ * }
+ *
+ * int main(int argc, char *argv[])
+ * {
+ * appcore....
+ * }
+ *
+ * @endcode
+ */
+extern int shortcut_set_request_cb(request_cb_t request_cb, void *data);
+
+/**
+ *
+ * @brief Supports the add_to_home feature, should invoke this.
+ *
+ * @details
+ * Sync (or) Async:
+ * This is an asynchronous API.
+ *
+ * Important Notes:\n
+ * Application must check the return value of this function.\n
+ * Application must check the return status from the callback function.\n
+ * Application should set the callback function to get the result of this request.
+ *
+ * Prospective Clients:
+ * Inhouse Apps.
+ *
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/shortcut
+ *
+ * @remarks If a homescreen does not support this feature, you will get a proper error code.
+ * @param[in] appid The package name of the owner of this shortcut
+ * @param[in] name The name of the created shortcut icon
+ * @param[in] type The type of shortcuts (dynamicbox or shortcut, and its size if it is for the dynamicbox)
+ * @param[in] content_info The specific information for delivering to the viewer for creating a shortcut
+ * @param[in] icon The absolute path of an icon file
+ * @param[in] allow_duplicate @c 1 if it accepts the duplicated shortcut,
+ * otherwise @c 0
+ * @param[in] result_cb The address of the callback function that is called when the result comes back from the viewer
+ * @param[in] data The callback data that is used in the callback function
+ *
+ * @return The return type (int)
+ * @retval 0 Succeeded to send the request
+ * @retval #SHORTCUT_ERROR_FAULT Unrecoverable error
+ * @retval #SHORTCUT_ERROR_INVALID_PARAMETER Shortcut request is not valid, invalid parameter or invalid argument value
+ * @retval #SHORTCUT_ERROR_COMM Connection is not estabilished. or there is a problem in the communication
+ * @retval #SHORTCUT_ERROR_OUT_OF_MEMORY Memory is not enough to handle a new request
+ * @retval #SHORTCUT_ERROR_IO_ERROR Unable to access the file or DB. Check your resource files
+ * @retval #SHORTCUT_ERROR_PERMISSION_DENIED Has no permission to add a shortcut
+ * @retval #SHORTCUT_ERROR_NOT_SUPPORTED Shortcut is not supported
+ *
+ * @pre You have to prepare the callback function.
+ *
+ * @post You have to check the return status from the callback function which is passed by the argument.
+ *
+ * @see result_internal_cb_t
+ *
+ * @par Example
+ * @code
+ *
+ * #include <stdio.h>
+ * #include <shortcut.h>
+ *
+ * static int result_cb(int ret, int pid, void *data)
+ * {
+ * if (ret < 0)
+ * printf("Failed to add a shortcut: %s\n", perror(ret));
+ *
+ * printf("Processed by the %d\n", pid);
+ * return 0;
+ * }
+ *
+ * static int app_create(void *data)
+ * {
+ * add_to_home_shortcut("com.samsung.gallery", "With friends",
+ * LAUNCH_BY_URI, "gallery:0000-0000",
+ * "/opt/media/Pictures/Friends.jpg", 0, result_cb, NULL);
+ * return 0;
+ * }
+ *
+ * int main(int argc, char *argv[])
+ * {
+ * appcore....
+ * }
+ *
+ * @endcode
+ */
+extern int add_to_home_shortcut(const char *appid, const char *name, int type, const char *content_info, const char *icon, int allow_duplicate, result_internal_cb_t result_cb, void *data);
+
+/**
+ *
+ * @internal
+ *
+ * @brief Gets the installed shortcut view list.
+ *
+ * @details
+ * Sync (or) Async:
+ * This is a synchronous API.
+ *
+ * Important Notes:\n
+ * Application must check the return value of this function.\n
+ * Application must check the return status from the callback function.\n
+ * Application should set the callback function to get the result of this request.
+ *
+ * Prospective Clients:
+ * Inhouse Apps.
+ *
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/shortcut
+ *
+ * @remarks If a homescreen does not support this feature, you will get a proper error code.
+ * @param[in] appid The package name
+ * @param[in] cb The callback function to get the shortcut item information
+ * @param[in] data The callback data that is used in the callback function
+ *
+ * @return The return type (int)
+ * @retval @c N Number of items (call count of the callback function)
+ * @retval #SHORTCUT_ERROR_FAULT Unrecoverable error
+ * @retval #SHORTCUT_ERROR_IO_ERROR Unable to access the file or DB. Check your resource files
+ *
+ * @pre You have to prepare the callback function.
+ *
+ * @post You have to check the return status from the callback function which is passed by the argument.
+ *
+ * @see result_internal_cb_t
+ */
+extern int shortcut_get_list(const char *appid, int (*cb)(const char *appid, const char *icon, const char *name, const char *extra_key, const char *extra_data, void *data), void *data);
+
+/**
+ *
+ *
+ * @brief Supports the add_to_home feature, should invoke this.
+ *
+ * @details
+ * Sync (or) Async:
+ * This is an asynchronous API.
+ *
+ * Important Notes:\n
+ * Application must check the return value of this function.\n
+ * Application must check the return status from the callback function.\n
+ * Application should set the callback function to get the result of this request.
+ *
+ * Prospective Clients:
+ * Inhouse Apps.
+ *
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/shortcut
+ *
+ * @remarks If a homescreen does not support this feature, you will get a proper error code.
+ * @param[in] appid The package name of the owner of this shortcut
+ * @param[in] name The name of the created shortcut icon
+ * @param[in] type The type of shortcuts (dynamicbox or shortcut, and its size if it is for the dynamicbox)
+ * @param[in] content_info The specific information for delivering to the viewer for creating a shortcut
+ * @param[in] icon The absolute path of an icon file
+ * @param[in] period The update period
+ * @param[in] allow_duplicate @c 1 if it accepts the duplicated shortcut,
+ * otherwise @c 0
+ * @param[in] result_cb The address of the callback function that is called when the result comes back from the viewer
+ * @param[in] data The callback data that is used in the callback function
+ *
+ * @return The return type (int)
+ * @retval 0 Succeeded to send the request
+ * @retval #SHORTCUT_ERROR_FAULT Unrecoverable error
+ * @retval #SHORTCUT_ERROR_INVALID_PARAMETER Shortcut request is not valid, invalid parameter or invalid argument value
+ * @retval #SHORTCUT_ERROR_COMM Connection is not established or there is a problem in the communication
+ * @retval #SHORTCUT_ERROR_OUT_OF_MEMORY Memory is not enough to handle a new request
+ * @retval #SHORTCUT_ERROR_IO_ERROR Unable to access the file or DB Check your resource files
+ * @retval #SHORTCUT_ERROR_PERMISSION_DENIED Has no permission to add a shortcut
+ * @retval #SHORTCUT_ERROR_NOT_SUPPORTED Shortcut is not supported
+ *
+ * @pre You have to prepare the callback function.
+ *
+ * @post You have to check the return status from the callback function which is passed by the argument.
+ *
+ * @see result_internal_cb_t
+ *
+ * @par Example
+ * @code
+ *
+ * #include <stdio.h>
+ * #include <shortcut.h>
+ *
+ * static int result_cb(int ret, int pid, void *data)
+ * {
+ * if (ret < 0)
+ * printf("Failed to add a shortcut: %s\n", perror(ret));
+ *
+ * printf("Processed by the %d\n", pid);
+ * return 0;
+ * }
+ *
+ * static int app_create(void *data)
+ * {
+ * add_to_home_dynamicbox("com.samsung.gallery.dynamicbox", "With friends",
+ * LAUNCH_BY_URI, "gallery:0000-0000",
+ * "/opt/media/Pictures/Friends.jpg", -1.0f, 0, result_cb, NULL);
+ * return 0;
+ * }
+ *
+ * int main(int argc, char *argv[])
+ * {
+ * appcore....
+ * }
+ *
+ * @endcode
+ */
+extern int add_to_home_dynamicbox(const char *appid, const char *name, int type, const char *content, const char *icon, double period, int allow_duplicate, result_internal_cb_t result_cb, void *data);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/lib/include/shortcut_manager.h b/lib/include/shortcut_manager.h
new file mode 100755
index 0000000..685e7b5
--- /dev/null
+++ b/lib/include/shortcut_manager.h
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#ifndef __SHORTCUT_MANAGER_H__
+#define __SHORTCUT_MANAGER_H__
+
+#include <tizen.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file shortcut_manager.h
+ * @brief This file declares the API of the libshortcut library.
+ */
+
+/**
+ * @addtogroup SHORTCUT_MODULE
+ * @{
+ */
+
+/**
+ * @brief Called to receive the result of shortcut_add_to_home().
+ * @since_tizen 2.3
+ * @param[in] ret The result value, it could be @c 0 if it succeeds to add a shortcut,
+ * otherwise it returns an errno
+ * @param[in] data The callback data
+ * @return int @c 0 if there is no error,
+ otherwise errno
+ * @see shortcut_add_to_home()
+ */
+typedef int (*result_cb_t)(int ret, void *data);
+
+/**
+ * @brief Enumeration for shortcut types.
+ * @details Basically, three types of shortcuts are defined.
+ * Every homescreen developer should support these types of shortcuts.
+ * Or return a proper errno to figure out why the application failed to add a shortcut.
+ * #LAUNCH_BY_APP is used for adding a package itself as a shortcut.
+ * #LAUNCH_BY_URI is used for adding a shortcut for "uri" data.
+ * @since_tizen 2.3
+ */
+typedef enum _shortcut_type {
+ /**< Use these */
+ LAUNCH_BY_APP = 0x00000000, /**< Launch the application itself */
+ LAUNCH_BY_URI = 0x00000001, /**< Launch the application with the given data(URI) */
+} shortcut_type;
+
+/**
+ * @brief Enumeration for values of shortcut response types.
+ * @since_tizen 2.3
+ */
+enum shortcut_error_e {
+ SHORTCUT_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successfully handled */
+ SHORTCUT_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Shortcut request is not valid, invalid parameter or invalid argument value */
+ SHORTCUT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Memory is not enough to handle a new request */
+ SHORTCUT_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< Unable to access the file or DB. Check your resource files */
+ SHORTCUT_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Has no permission to add a shortcut */
+ SHORTCUT_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported shortcut */
+ SHORTCUT_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Receiver is busy, try again later */
+ SHORTCUT_ERROR_NO_SPACE = TIZEN_ERROR_SHORTCUT | 0x0001, /**< There is no space to add a new shortcut */
+ SHORTCUT_ERROR_EXIST = TIZEN_ERROR_SHORTCUT | 0x0002, /**< Shortcut is already added */
+ SHORTCUT_ERROR_FAULT = TIZEN_ERROR_SHORTCUT | 0x0004, /**< Failed to add a shortcut. Unrecoverable error */
+ SHORTCUT_ERROR_COMM = TIZEN_ERROR_SHORTCUT | 0x0040 /**< Connection is not established. or there is a problem in the communication */
+};
+
+/**
+ *
+ * @brief Supports the add_to_home feature, should invoke this.
+ *
+ * @details
+ * Sync (or) Async:
+ * This is an asynchronous API.
+ *
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/shortcut
+ *
+ * @remarks Application must check the return value of this function.\n
+ * Application must check the return status from the callback function.\n
+ * Application should set the callback function to get the result of this request.
+ * @remarks If a homescreen does not support this feature, you will get a proper error code.
+ *
+ * @param[in] name The name of the created shortcut icon
+ * @param[in] type The type of shortcuts
+ * @param[in] uri The specific information for delivering to the viewer for creating a shortcut
+ * @param[in] icon The absolute path of an icon file
+ * @param[in] allow_duplicate @c 1 if it accepts the duplicated shortcut,
+ * otherwise @c 0
+ * @param[in] result_cb The address of the callback function that is called when the result comes back from the viewer
+ * @param[in] data The callback data that is used in the callback function
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #SHORTCUT_ERROR_NONE Successful
+ * @retval #SHORTCUT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #SHORTCUT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #SHORTCUT_ERROR_IO_ERROR I/O error
+ * @retval #SHORTCUT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #SHORTCUT_ERROR_NOT_SUPPORTED Not supported
+ * @retval #SHORTCUT_ERROR_BUSY Device or resource busy
+ * @retval #SHORTCUT_ERROR_NO_SPACE No space
+ * @retval #SHORTCUT_ERROR_EXIST Already exist
+ * @retval #SHORTCUT_ERROR_FAULT Unrecoverable error
+ * @retval #SHORTCUT_ERROR_COMM Connection failed
+ *
+ * @pre You have to prepare the callback function.
+ *
+ * @post You have to check the return status from the callback function which is passed by the argument.
+ *
+ * @see result_cb_t
+ *
+ * @par Example
+ * @code
+ *
+ * #include <stdio.h>
+ * #include <shortcut.h>
+ *
+ * static int result_cb(int ret, int pid, void *data)
+ * {
+ * if (ret < 0)
+ * printf("Failed to add a shortcut: %s\n", perror(ret));
+ *
+ * printf("Processed by the %d\n", pid);
+ * return 0;
+ * }
+ *
+ * static int app_create(void *data)
+ * {
+ * shortcut_add_to_home("With friends",
+ * LAUNCH_BY_URI, "gallery:0000-0000",
+ * "/opt/media/Pictures/Friends.jpg", 0, result_cb, NULL);
+ * return 0;
+ * }
+ *
+ * int main(int argc, char *argv[])
+ * {
+ * appcore....
+ * }
+ *
+ * @endcode
+ */
+extern int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, const char *icon, int allow_duplicate, result_cb_t result_cb, void *data);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/lib/include/shortcut_private.h b/lib/include/shortcut_private.h
new file mode 100755
index 0000000..096e7b6
--- /dev/null
+++ b/lib/include/shortcut_private.h
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#if !defined(FLOG)
+#define DbgPrint(format, arg...) SECURE_LOGD(format, ##arg)
+#define ErrPrint(format, arg...) SECURE_LOGE(format, ##arg)
+#else
+extern FILE *__file_log_fp;
+#define DbgPrint(format, arg...) do { fprintf(__file_log_fp, "[LOG] [%s/%s:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
+
+#define ErrPrint(format, arg...) do { fprintf(__file_log_fp, "[ERR] [%s/%s:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
+#endif
+
+#if !defined(EAPI)
+#define EAPI __attribute__((visibility("default")))
+#endif
+
+#if !defined(VCONFKEY_MASTER_STARTED)
+#define VCONFKEY_MASTER_STARTED "memory/data-provider-master/started"
+#endif
+
+#define DEFAULT_ICON_LAYOUT ""
+#define DEFAULT_ICON_GROUP ""
+
+/**
+ * @brief Definition for a macro to check the request type.
+ * @since_tizen 2.3
+ * @param[in] type Request type
+ * @return bool
+ * @retval true(1) Shortcut remove request
+ * @retval false(0) Not a remove request
+ * @see shortcut_type
+ */
+#define ADD_TO_HOME_IS_REMOVE_SHORTCUT(type) (!!((type) & SHORTCUT_REMOVE))
+
+/**
+ * @brief Definition for a macro to check the request type.
+ * @since_tizen 2.3
+ * @param[in] type Request type
+ * @return bool
+ * @retval true(1) Dynamicbox remove request
+ * @retval false(0) Not a remove request
+ * @see shortcut_type
+ */
+#define ADD_TO_HOME_IS_REMOVE_DYNAMICBOX(type) (!!((type) & DYNAMICBOX_REMOVE))
+
+/**
+ *
+ *
+ * @brief The application, which supporting the add_to_home feature, should invoke this.
+ *
+ * @details
+ * Sync (or) Async:
+ * This is an asynchronous API.
+ *
+ * Important Notes:\n
+ * Application must check the return value of this function.\n
+ * Application must check the return status from the callback function\n
+ * Application should set the callback function to get the result of this request.
+ *
+ * Prospective Clients:
+ * Inhouse Apps.
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks - If a homescreen does not support this feature, you will get proper error code.
+ * @param[in] appid Package name of owner of this shortcut.
+ * @param[in] name Name for created shortcut icon.
+ * @param[in] content_info Specific information for delivering to the viewer for creating a shortcut.
+ * @param[in] result_cb Address of callback function which will be called when the result comes back from the viewer.
+ * @param[in] data Callback data which will be used in callback function
+ *
+ * @return Return Type (int)
+ * \retval 0 Succeed to send the request
+ * \retval #SHORTCUT_ERROR_FAULT Unrecoverable error
+ * \retval #SHORTCUT_ERROR_INVALID_PARAMETER Shortcut request is not valid, invalid parameter or invalid argument value
+ * \retval #SHORTCUT_ERROR_COMM Connection is not estabilished. or there is a problem of communication
+ * \retval #SHORTCUT_ERROR_OUT_OF_MEMORY Memory is not enough to handle new request
+ * \retval #SHORTCUT_ERROR_IO_ERROR Unable to access file or DB. Check your resource files
+ * \retval #SHORTCUT_ERROR_PERMISSION_DENIED Has no permission to add a shortcut
+ *
+ * @pre You have to prepare the callback function
+ *
+ * @post You have to check the return status from callback function which is passed by argument.
+ *
+ * @see result_internal_cb_t
+ *
+ * @par Example
+ * @code
+ *
+ * #include <stdio.h>
+ * #include <shortcut.h>
+ *
+ * static int result_cb(int ret, int pid, void *data)
+ * {
+ * if (ret < 0)
+ * printf("Failed to add a shortcut: %s\n", perror(ret));
+ *
+ * printf("Processed by the %d\n", pid);
+ * return 0;
+ * }
+ *
+ * static int app_create(void *data)
+ * {
+ * add_to_home_remove_shortcut("com.samsung.gallery.dynamicbox", "With friends",
+ * "gallery:0000-0000",
+ * result_cb, NULL);
+ * return 0;
+ * }
+ *
+ * int main(int argc, char *argv[])
+ * {
+ * appcore....
+ * }
+ *
+ * @endcode
+ */
+extern int add_to_home_remove_shortcut(const char *appid, const char *name, const char *content_info, result_internal_cb_t result_cb, void *data);
+
+/**
+ *
+ *
+ * @brief The application, which supporting the add_to_home feature, should invoke this.
+ *
+ * @details
+ * Sync (or) Async:
+ * This is an asynchronous API.
+ *
+ * Important Notes:\n
+ * Application must check the return value of this function.\n
+ * Application must check the return status from the callback function\n
+ * Application should set the callback function to get the result of this request.
+ *
+ * Prospective Clients:
+ * Inhouse Apps.
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks - If a homescreen does not support this feature, you will get proper error code.
+ * @param[in] appid Package name of owner of this shortcut.
+ * @param[in] name Name for created shortcut icon.
+ * @param[in] result_cb Address of callback function which will be called when the result comes back from the viewer.
+ * @param[in] data Callback data which will be used in callback function
+ *
+ * @return Return Type (int)
+ * \retval 0 Succeed to send the request
+ * \retval #SHORTCUT_ERROR_FAULT Unrecoverable error
+ * \retval #SHORTCUT_ERROR_INVALID_PARAMETER Shortcut request is not valid, invalid parameter or invalid argument value
+ * \retval #SHORTCUT_ERROR_COMM Connection is not estabilished. or there is a problem of communication
+ * \retval #SHORTCUT_ERROR_OUT_OF_MEMORY Memory is not enough to handle new request
+ * \retval #SHORTCUT_ERROR_IO_ERROR Unable to access file or DB. Check your resource files
+ * \retval #SHORTCUT_ERROR_PERMISSION_DENIED Has no permission to add a shortcut
+ *
+ * @pre You have to prepare the callback function
+ *
+ * @post You have to check the return status from callback function which is passed by argument.
+ *
+ * @see result_internal_cb_t
+ *
+ * @par Example
+ * @code
+ *
+ * #include <stdio.h>
+ * #include <shortcut.h>
+ *
+ * static int result_cb(int ret, int pid, void *data)
+ * {
+ * if (ret < 0)
+ * printf("Failed to add a shortcut: %s\n", perror(ret));
+ *
+ * printf("Processed by the %d\n", pid);
+ * return 0;
+ * }
+ *
+ * static int app_create(void *data)
+ * {
+ * add_to_home_remove_dynamicbox("com.samsung.gallery.dynamicbox", "With friends", result_cb, NULL);
+ * return 0;
+ * }
+ *
+ * int main(int argc, char *argv[])
+ * {
+ * appcore....
+ * }
+ *
+ * @endcode
+ */
+extern int add_to_home_remove_dynamicbox(const char *appid, const char *name, result_internal_cb_t result_cb, void *data);
+
+/* End of a file */
diff --git a/lib/include/shortcut_product.h b/lib/include/shortcut_product.h
new file mode 100755
index 0000000..4f4932b
--- /dev/null
+++ b/lib/include/shortcut_product.h
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#if !defined(__SHORTCUT_PRODUCT_H__)
+#define __SHORTCUT_PRODUCT_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file shortcut_product.h
+ * @brief This file declares API of libshortcut library (platform only)
+ */
+
+/**
+ * @addtogroup SHORTCUT_ICON_MODULE
+ * @{
+ */
+
+/**
+ * \note
+ * Example)
+ *
+ * \code
+ * static int init_cb(int status, void *data)
+ * {
+ * printf("Initializer returns: %d\n", status);
+ * if (status == 0) {
+ * printf("Succeed to initialize\n");
+ * } else {
+ * printf("Failed to initialize: %d\n", status);
+ * }
+ * }
+ *
+ * int main(int argc, char *argv[])
+ * {
+ * // Initialize the service request
+ * int ret;
+ *
+ * // After the init_cb is called, you can use below functions.
+ * struct shortcut_icon *handle;
+ *
+ * ret = shortcut_icon_init(init_cb, NULL);
+ * if (ret < 0) {
+ * ...
+ *
+ * // Create request for creating shortcut icon.
+ * handle = shortcut_icon_create();
+ * if (!handle) {
+ * ...
+ * }
+ *
+ * // Send the request to the shortcut service
+ * ret = shortcut_icon_request_set_info(handle, NULL, SHORTCUT_ICON_TYPE_IMAGE, "icon, "/usr/share/.../icon.png", NULL, NULL);
+ * if (ret < 0) {
+ * ...
+ * }
+ *
+ * ret = shortcut_icon_request_set_info(handle, NULL, SHORTCUT_ICON_TYPE_TEXT, "text, "app icon", NULL, NULL);
+ * if (ret < 0) {
+ * ...
+ * }
+ *
+ * ret = shortcut_icon_request_send(handle, LB_SIZE_TYPE_1x1, NULL, NULL, "/opt/usr/apps/com.samsung.cluster-home/data/out.png", result_cb, NULL);
+ * if (ret < 0) {
+ * ...
+ * }
+ *
+ * ret = shortcut_icon_request_destroy(handle);
+ * if (ret < 0) {
+ * ...
+ * }
+ *
+ * // Don't finalize the icon service if you don't get result callbacks of all requests
+ * ret = shortcut_icon_fini();
+ * if (ret < 0) {
+ * ...
+ * }
+ *
+ * return 0;
+ * }
+ * \endcode
+ */
+
+struct shortcut_icon;
+
+/**
+ * @brief Called when send a request to create a icon snapshot image.
+ * @details This callback will be called with its result.
+ * @param[in] handle Handle of requestor
+ * @param[in] ret status of request
+ * @param[in] data Callback data
+ * @return int result state of callback call
+ * @retval 0 If it is successfully completed
+ * @see shortcut_icon_request_send()
+ */
+typedef int (*icon_request_cb_t)(struct shortcut_icon *handle, int ret, void *data);
+
+#define DEFAULT_ICON_PART "icon"
+#define DEFAULT_NAME_PART "name"
+#define SHORTCUT_ICON_TYPE_IMAGE "image"
+#define SHORTCUT_ICON_TYPE_TEXT "text"
+#define SHORTCUT_ICON_TYPE_SCRIPT "script"
+
+/**
+ * @brief Initializes the icon creation service.
+ * @param[in] init_cb Initialized result will be delievered via this callback
+ * @param[in] data Callback data
+ * @return int value
+ * @retval #SHORTCUT_ERROR_INVALID_PARAMETER Already initialized
+ * @retval #SHORTCUT_ERROR_NONE Successfully initialized
+ * @see shortcut_icon_service_fini()
+ */
+extern int shortcut_icon_service_init(int (*init_cb)(int status, void *data), void *data);
+
+/**
+ * @brief Finalizes the icon creation service.
+ * @return int value
+ * @retval #SHORTCUT_ERROR_NONE Successfully initialized
+ * @retval #SHORTCUT_ERROR_INVALID_PARAMETER icon service is not initialized
+ * @see shortcut_icon_service_init()
+ */
+extern int shortcut_icon_service_fini(void);
+
+/**
+ * @brief Creates a request object to create a new icon image.
+ * @return struct shortcut_icon * value
+ * @retval @c NULL If it fails to create a new handle
+ * @retval pointer Handle address
+ * @see shortcut_icon_request_destroy()
+ */
+extern struct shortcut_icon *shortcut_icon_request_create(void);
+
+/**
+ * @brief Sets information for creating icon image.
+ * @param[in] handle Request handle
+ * @param[in] id Target ID to be affected by this data
+ * @param[in] type SHORTCUT_ICON_TYPE_IMAGE, SHORTCUT_ICON_TYPE_TEXT, SHORTCUT_ICON_TYPE_SCRIPT can be used
+ * @param[in] part Target part to be affect by this data
+ * @param[in] data type == IMAGE ? Image file path : type == TEXT ? text string : type == SCRIPT ? script file path : N/A
+ * @param[in] option Image load option or group name of script file to be loaded
+ * @param[in] subid ID for script. this ID will be used as "id"
+ * @return int value
+ * @retval index Index of data set
+ * @retval #SHORTCUT_ERROR_INVALID_PARAMETER Invalid handle
+ * @retval #SHORTCUT_ERROR_OUT_OF_MEMORY Out of memory
+ * @see shortcut_icon_request_create()
+ */
+extern int shortcut_icon_request_set_info(struct shortcut_icon *handle, const char *id, const char *type, const char *part, const char *data, const char *option, const char *subid);
+
+/**
+ * @brief Sends requests to create an icon image.
+ * @param[in] handle Icon request handle
+ * @param[in] size_type Size type to be created
+ * @param[in] layout Layout filename (edje filename)
+ * @param[in] group Group name
+ * @param[in] outfile Output image filename
+ * @param[in] result_cb Result callback
+ * @param[in] data Callback data
+ * @return int value
+ * @retval #SHORTCUT_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #SHORTCUT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #SHORTCUT_ERROR_FAULT Failed to send a request
+ * @retval #SHORTCUT_ERROR_NONE Successfully sent
+ * @see shortcut_icon_service_fini()
+ */
+extern int shortcut_icon_request_send(struct shortcut_icon *handle, int size_type, const char *layout, const char *group, const char *outfile, icon_request_cb_t result_cb, void *data);
+
+/**
+ * @brief Destroys handle of creating shortcut icon request.
+ * @param[in] handle Shortcut request handle
+ * @return int value
+ * @retval #SHORTCUT_ERROR_INVALID_PARAMETER Invalid handle
+ * @retval #SHORTCUT_ERROR_NONE Successfully destroyed
+ * @see shortcut_icon_service_fini()
+ */
+extern int shortcut_icon_request_destroy(struct shortcut_icon *handle);
+
+
+/**
+ * @brief Sets private data to the handle to carry it with a handle.
+ * @param[in] handle Handle to be used for carrying a data
+ * @param[in] data Private data
+ * @return int value
+ * @retval #SHORTCUT_ERROR_INVALID_PARAMETER Invalid handle
+ * @retval #SHORTCUT_ERROR_NONE Successfully done
+ * @see shortcut_icon_service_fini()
+ */
+extern int shortcut_icon_request_set_data(struct shortcut_icon *handle, void *data);
+
+/**
+ * @brief Gets the private data from handle.
+ * @param[in] handle
+ * @return int value
+ * @retval @c NULL If there is no data
+ * @retval pointer data pointer
+ * @see shortcut_icon_request_set_data()
+ */
+extern void *shortcut_icon_request_data(struct shortcut_icon *handle);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif \ No newline at end of file
diff --git a/lib/shortcut.pc.in b/lib/shortcut.pc.in
new file mode 100755
index 0000000..060e119
--- /dev/null
+++ b/lib/shortcut.pc.in
@@ -0,0 +1,11 @@
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
+
+Name: shortcut
+Description: shortcut server platform library
+Version: @VERSION@
+Requires: capi-base-common
+Libs: -L${libdir} -lshortcut
+Cflags: -I${includedir}
diff --git a/lib/src/dlist.c b/lib/src/dlist.c
new file mode 100644
index 0000000..3ae571b
--- /dev/null
+++ b/lib/src/dlist.c
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2013 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "dlist.h"
+
+/*!
+ * \brief
+ * This dlist is called Modified Doubly Linked List.
+ *
+ * Noramlly, The dobule linked list contains address of previous and next element.
+ * This dlist also contains them, but the tail element only contains prev address.
+ *
+ * The head element's prev pointer indicates the last element.
+ * But the last element's next pointer indicates NIL.
+ *
+ * So we can find the last element while crawling this DList
+ * But we have to remember the address of the head element.
+ */
+
+struct dlist {
+ struct dlist *next;
+ struct dlist *prev;
+ void *data;
+};
+
+struct dlist *dlist_append(struct dlist *list, void *data)
+{
+ struct dlist *item;
+
+ item = malloc(sizeof(*item));
+ if (!item) {
+ return NULL;
+ }
+
+ item->next = NULL;
+ item->data = data;
+
+ if (!list) {
+ item->prev = item;
+
+ list = item;
+ } else {
+ item->prev = list->prev;
+ item->prev->next = item;
+ list->prev = item;
+ }
+
+ assert(!list->prev->next && "item NEXT");
+
+ return list;
+}
+
+struct dlist *dlist_prepend(struct dlist *list, void *data)
+{
+ struct dlist *item;
+
+ item = malloc(sizeof(*item));
+ if (!item) {
+ return NULL;
+ }
+
+ item->data = data;
+
+ if (!list) {
+ item->prev = item;
+ item->next = NULL;
+ } else {
+ if (list->prev->next) {
+ list->prev->next = item;
+ }
+
+ item->prev = list->prev;
+ item->next = list;
+
+ list->prev = item;
+
+ }
+
+ return item;
+}
+
+struct dlist *dlist_remove(struct dlist *list, struct dlist *l)
+{
+ if (!list || !l) {
+ return NULL;
+ }
+
+ if (l == list) {
+ list = l->next;
+ } else {
+ l->prev->next = l->next;
+ }
+
+ if (l->next) {
+ l->next->prev = l->prev;
+ }
+ /*!
+ * \note
+ * If the removed entry 'l' has no next element, it is the last element.
+ * In this case, check the existence of the list first,
+ * and if the list is not empty, update the 'prev' of the list (which is a head element of the list)
+ *
+ * If we didn't care about this, the head element(list) can indicates the invalid element.
+ */
+ else if (list) {
+ list->prev = l->prev;
+ }
+
+ free(l);
+ return list;
+}
+
+struct dlist *dlist_find_data(struct dlist *list, void *data)
+{
+ struct dlist *l;
+ void *_data;
+
+ dlist_foreach(list, l, _data) {
+ if (data == _data) {
+ return l;
+ }
+ }
+
+ return NULL;
+}
+
+void *dlist_data(struct dlist *l)
+{
+ return l ? l->data : NULL;
+}
+
+struct dlist *dlist_next(struct dlist *l)
+{
+ return l ? l->next : NULL;
+}
+
+struct dlist *dlist_prev(struct dlist *l)
+{
+ return l ? l->prev : NULL;
+}
+
+int dlist_count(struct dlist *l)
+{
+ register int i;
+ struct dlist *n;
+ void *data;
+
+ i = 0;
+ dlist_foreach(l, n, data) {
+ i++;
+ }
+
+ return i;
+}
+
+struct dlist *dlist_nth(struct dlist *l, int nth)
+{
+ register int i;
+ struct dlist *n;
+
+ i = 0;
+ for (n = l; n; n = n->next) {
+ if (i == nth) {
+ return n;
+ }
+ i++;
+ }
+
+ return NULL;
+}
+
+/* End of a file */
diff --git a/lib/src/icon.c b/lib/src/icon.c
new file mode 100755
index 0000000..1825df5
--- /dev/null
+++ b/lib/src/icon.c
@@ -0,0 +1,816 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <libgen.h>
+#include <sys/time.h>
+#include <time.h>
+
+#include <dlog.h>
+#include <glib.h>
+#include <db-util.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+
+#include <packet.h>
+#include <com-core.h>
+#include <com-core_packet.h>
+
+#include "shortcut_product.h"
+#include "shortcut.h"
+#include "dlist.h"
+#include "shortcut_private.h"
+
+
+
+#define CREATED 0x00BEEF00
+#define DESTROYED 0x00DEAD00
+
+static struct info {
+ int fd;
+ int (*init_cb)(int status, void *data);
+ void *cbdata;
+ int initialized;
+
+ const char *utility_socket;
+
+ struct dlist *pending_list;
+#if defined(_USE_ECORE_TIME_GET)
+ clockid_t type;
+#endif
+} s_info = {
+ .fd = -1,
+ .init_cb = NULL,
+ .cbdata = NULL,
+ .initialized = 0,
+
+ .utility_socket = "/tmp/.utility.service",
+ .pending_list = NULL,
+#if defined(_USE_ECORE_TIME_GET)
+ .type = CLOCK_MONOTONIC,
+#endif
+};
+
+
+
+struct request_item {
+ struct shortcut_icon *handle;
+ icon_request_cb_t result_cb;
+ void *data;
+};
+
+
+
+struct pending_item {
+ struct request_item *item;
+ struct packet *packet;
+};
+
+
+
+struct block {
+ unsigned int idx;
+
+ char *type;
+ char *part;
+ char *data;
+ char *option;
+ char *id;
+ char *target_id;
+};
+
+
+
+struct shortcut_icon {
+ unsigned int state;
+ struct shortcut_desc *desc;
+ int refcnt;
+ void *data;
+};
+
+
+
+struct shortcut_desc {
+ int for_pd;
+
+ unsigned int last_idx;
+
+ struct dlist *block_list;
+};
+
+
+
+static inline void delete_block(struct block *block)
+{
+ DbgPrint("Release block: %p\n", block);
+ free(block->type);
+ free(block->part);
+ free(block->data);
+ free(block->option);
+ free(block->id);
+ free(block->target_id);
+ free(block);
+}
+
+
+
+static inline int shortcut_icon_desc_close(struct shortcut_desc *handle)
+{
+ struct dlist *l;
+ struct dlist *n;
+ struct block *block;
+
+ dlist_foreach_safe(handle->block_list, l, n, block) {
+ handle->block_list = dlist_remove(handle->block_list, l);
+ delete_block(block);
+ }
+
+ free(handle);
+ return 0;
+}
+
+
+
+static inline struct shortcut_icon *shortcut_icon_request_unref(struct shortcut_icon *handle)
+{
+ handle->refcnt--;
+ DbgPrint("Handle: refcnt[%d]\n", handle->refcnt);
+
+ if (handle->refcnt == 0) {
+ handle->state = DESTROYED;
+ shortcut_icon_desc_close(handle->desc);
+ free(handle);
+ handle = NULL;
+ }
+
+ return handle;
+}
+
+
+
+static inline struct shortcut_icon *shortcut_icon_request_ref(struct shortcut_icon *handle)
+{
+ handle->refcnt++;
+ DbgPrint("Handle: refcnt[%d]\n", handle->refcnt);
+ return handle;
+}
+
+
+
+static int disconnected_cb(int handle, void *data)
+{
+ if (s_info.fd != handle) {
+ return 0;
+ }
+
+ ErrPrint("Disconnected\n");
+ s_info.fd = -1;
+ s_info.init_cb = NULL;
+ s_info.cbdata = NULL;
+ s_info.initialized = 0;
+ return 0;
+}
+
+
+
+static inline struct shortcut_desc *shortcut_icon_desc_open(void)
+{
+ struct shortcut_desc *handle;
+
+ handle = calloc(1, sizeof(*handle));
+ if (!handle) {
+ ErrPrint("Error: %s\n", strerror(errno));
+ return NULL;
+ }
+
+ return handle;
+}
+
+
+
+static inline int shortcut_icon_desc_save(struct shortcut_desc *handle, const char *filename)
+{
+ struct dlist *l;
+ struct dlist *n;
+ struct block *block;
+ FILE *fp;
+
+ if (!handle) {
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ fp = fopen(filename, "w+t");
+ if (!fp) {
+ ErrPrint("Error: %s\n", strerror(errno));
+ return SHORTCUT_ERROR_IO_ERROR;
+ }
+
+ DbgPrint("Close and flush\n");
+ dlist_foreach_safe(handle->block_list, l, n, block) {
+ DbgPrint("{\n");
+ fprintf(fp, "{\n");
+ if (block->type) {
+ fprintf(fp, "type=%s\n", block->type);
+ DbgPrint("type=%s\n", block->type);
+ }
+
+ if (block->part) {
+ fprintf(fp, "part=%s\n", block->part);
+ DbgPrint("part=%s\n", block->part);
+ }
+
+ if (block->data) {
+ fprintf(fp, "data=%s\n", block->data);
+ DbgPrint("data=%s\n", block->data);
+ }
+
+ if (block->option) {
+ fprintf(fp, "option=%s\n", block->option);
+ DbgPrint("option=%s\n", block->option);
+ }
+
+ if (block->id) {
+ fprintf(fp, "id=%s\n", block->id);
+ DbgPrint("id=%s\n", block->id);
+ }
+
+ if (block->target_id) {
+ fprintf(fp, "target=%s\n", block->target_id);
+ DbgPrint("target=%s\n", block->target_id);
+ }
+
+ fprintf(fp, "}\n");
+ DbgPrint("}\n");
+ }
+
+ if (fclose(fp) != 0) {
+ ErrPrint("fclose: %s\n", strerror(errno));
+ }
+ return SHORTCUT_ERROR_NONE;
+}
+
+
+
+static inline struct block *find_block(struct shortcut_desc *handle, const char *id, const char *part)
+{
+ struct block *block;
+ struct dlist *l;
+
+ dlist_foreach(handle->block_list, l, block) {
+ if (!strcmp(block->part, part) && (!id || !strcmp(block->id, id))) {
+ return block;
+ }
+ }
+
+ return NULL;
+}
+
+
+
+static inline int update_block(struct block *block, const char *data, const char *option)
+{
+ char *_data = NULL;
+ char *_option = NULL;
+
+ if (data) {
+ _data = strdup(data);
+ if (!_data) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+ }
+
+ if (option) {
+ _option = strdup(option);
+ if (!_option) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ free(_data);
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+ }
+
+ free(block->data);
+ free(block->option);
+
+ block->data = _data;
+ block->option = _option;
+ return 0;
+}
+
+
+
+/*!
+ * \return idx
+ */
+
+
+
+static inline int shortcut_icon_desc_add_block(struct shortcut_desc *handle, const char *id, const char *type, const char *part, const char *data, const char *option, const char *target_id)
+{
+ struct block *block;
+
+ if (!handle || !type) {
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if (!part) {
+ part = "";
+ }
+
+ if (!data) {
+ data = "";
+ }
+
+ if (target_id) {
+ if (strcmp(type, SHORTCUT_ICON_TYPE_SCRIPT)) {
+ ErrPrint("target id only can be used for script type\n");
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+ }
+
+ block = find_block(handle, id, part);
+ if (!block) {
+ block = calloc(1, sizeof(*block));
+ if (!block) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+
+ block->type = strdup(type);
+ if (!block->type) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ free(block);
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+
+ block->part = strdup(part);
+ if (!block->part) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ free(block->type);
+ free(block);
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+
+ block->data = strdup(data);
+ if (!block->data) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ free(block->type);
+ free(block->part);
+ free(block);
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+
+ if (option) {
+ block->option = strdup(option);
+ if (!block->option) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ free(block->data);
+ free(block->type);
+ free(block->part);
+ free(block);
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+ }
+
+ if (id) {
+ block->id = strdup(id);
+ if (!block->id) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ free(block->option);
+ free(block->data);
+ free(block->type);
+ free(block->part);
+ free(block);
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+ }
+
+ if (target_id) {
+ block->target_id = strdup(target_id);
+ if (!block->target_id) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ free(block->id);
+ free(block->option);
+ free(block->data);
+ free(block->type);
+ free(block->part);
+ free(block);
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+ }
+
+ block->idx = handle->last_idx++;
+ handle->block_list = dlist_append(handle->block_list, block);
+ } else {
+ if (strcmp(block->type, type)) {
+ ErrPrint("type is not valid (%s, %s)\n", block->type, type);
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if ((block->target_id && !target_id) || (!block->target_id && target_id)) {
+ ErrPrint("type is not valid (%s, %s)\n", block->type, type);
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if (block->target_id && target_id && strcmp(block->target_id, target_id)) {
+ ErrPrint("type is not valid (%s, %s)\n", block->type, type);
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ update_block(block, data, option);
+ }
+
+ return block->idx;
+}
+
+
+
+static int icon_request_cb(pid_t pid, int handle, const struct packet *packet, void *data)
+{
+ struct request_item *item = data;
+ int ret;
+
+ if (!packet) {
+ ret = -EFAULT;
+ DbgPrint("Disconnected?\n");
+ } else {
+ if (packet_get(packet, "i", &ret) != 1) {
+ DbgPrint("Invalid packet\n");
+ ret = -EINVAL;
+ }
+ }
+
+ if (item->result_cb) {
+ item->result_cb(item->handle, ret, item->data);
+ }
+
+ (void)shortcut_icon_request_unref(item->handle);
+ free(item);
+ return 0;
+}
+
+
+
+static inline int make_connection(void)
+{
+ int ret;
+ static struct method service_table[] = {
+ {
+ .cmd = NULL,
+ .handler = NULL,
+ },
+ };
+
+ s_info.fd = com_core_packet_client_init(s_info.utility_socket, 0, service_table);
+ if (s_info.fd < 0) {
+ ret = SHORTCUT_ERROR_COMM;
+
+ if (s_info.init_cb) {
+ s_info.init_cb(ret, s_info.cbdata);
+ }
+ } else {
+ struct dlist *l;
+ struct dlist *n;
+ struct pending_item *pend;
+
+ if (s_info.init_cb) {
+ s_info.init_cb(SHORTCUT_ERROR_NONE, s_info.cbdata);
+ }
+
+ dlist_foreach_safe(s_info.pending_list, l, n, pend) {
+ s_info.pending_list = dlist_remove(s_info.pending_list, l);
+
+ ret = com_core_packet_async_send(s_info.fd, pend->packet, 0.0f, icon_request_cb, pend->item);
+ packet_destroy(pend->packet);
+ if (ret < 0) {
+ ErrPrint("ret: %d\n", ret);
+ if (pend->item->result_cb) {
+ pend->item->result_cb(pend->item->handle, ret, pend->item->data);
+ }
+ free(pend->item);
+ }
+
+ free(pend);
+ }
+
+ ret = SHORTCUT_ERROR_NONE;
+ }
+
+ return ret;
+}
+
+
+
+static void master_started_cb(keynode_t *node, void *user_data)
+{
+ int state = 0;
+
+ if (vconf_get_bool(VCONFKEY_MASTER_STARTED, &state) < 0) {
+ ErrPrint("Unable to get \"%s\"\n", VCONFKEY_MASTER_STARTED);
+ }
+
+ if (state == 1 && make_connection() == SHORTCUT_ERROR_NONE) {
+ (void)vconf_ignore_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb);
+ }
+}
+
+
+
+EAPI int shortcut_icon_service_init(int (*init_cb)(int status, void *data), void *data)
+{
+ int ret;
+
+ if (s_info.fd >= 0) {
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if (s_info.initialized) {
+ s_info.initialized = 1;
+ com_core_add_event_callback(CONNECTOR_DISCONNECTED, disconnected_cb, NULL);
+ }
+
+ s_info.init_cb = init_cb;
+ s_info.cbdata = data;
+
+ ret = vconf_notify_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb, NULL);
+ if (ret < 0) {
+ ErrPrint("Failed to add vconf for service state [%d]\n", ret);
+ } else {
+ DbgPrint("vconf is registered\n");
+ }
+
+ master_started_cb(NULL, NULL);
+ return SHORTCUT_ERROR_NONE;
+}
+
+
+
+EAPI int shortcut_icon_service_fini(void)
+{
+ struct dlist *l;
+ struct dlist *n;
+ struct pending_item *pend;
+
+ if (s_info.initialized) {
+ com_core_del_event_callback(CONNECTOR_DISCONNECTED, disconnected_cb, NULL);
+ s_info.initialized = 0;
+ }
+
+ if (s_info.fd < 0) {
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ com_core_packet_client_fini(s_info.fd);
+ s_info.init_cb = NULL;
+ s_info.cbdata = NULL;
+ s_info.fd = -1;
+
+ dlist_foreach_safe(s_info.pending_list, l, n, pend) {
+ s_info.pending_list = dlist_remove(s_info.pending_list, l);
+ packet_unref(pend->packet);
+ if (pend->item->result_cb) {
+ pend->item->result_cb(pend->item->handle, SHORTCUT_ERROR_COMM, pend->item->data);
+ }
+ free(pend->item);
+ free(pend);
+ }
+ return SHORTCUT_ERROR_NONE;
+}
+
+
+
+EAPI struct shortcut_icon *shortcut_icon_request_create(void)
+{
+ struct shortcut_icon *handle;
+
+ handle = malloc(sizeof(*handle));
+ if (!handle) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ return NULL;
+ }
+
+ handle->desc = shortcut_icon_desc_open();
+ if (!handle->desc) {
+ ErrPrint("Uanble to open desc\n");
+ free(handle);
+ return NULL;
+ }
+
+ handle->state = CREATED;
+ handle->refcnt = 1;
+ return handle;
+}
+
+
+EAPI int shortcut_icon_request_set_data(struct shortcut_icon *handle, void *data)
+{
+ if (!handle || handle->state != CREATED) {
+ ErrPrint("Handle is not valid\n");
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ handle->data = data;
+ return SHORTCUT_ERROR_NONE;
+}
+
+
+
+EAPI void *shortcut_icon_request_data(struct shortcut_icon *handle)
+{
+ if (!handle || handle->state != CREATED) {
+ ErrPrint("Handle is not valid\n");
+ return NULL;
+ }
+
+ return handle->data;
+}
+
+
+
+EAPI int shortcut_icon_request_set_info(struct shortcut_icon *handle, const char *id, const char *type, const char *part, const char *data, const char *option, const char *subid)
+{
+ if (!handle || handle->state != CREATED) {
+ ErrPrint("Handle is not valid\n");
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ return shortcut_icon_desc_add_block(handle->desc, id, type, part, data, option, subid);
+}
+
+
+
+EAPI int shortcut_icon_request_destroy(struct shortcut_icon *handle)
+{
+ if (!handle || handle->state != CREATED) {
+ ErrPrint("Handle is not valid\n");
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ (void)shortcut_icon_request_unref(handle);
+ return SHORTCUT_ERROR_NONE;
+}
+
+
+
+EAPI int shortcut_icon_request_send(struct shortcut_icon *handle, int size_type, const char *layout, const char *group, const char *outfile, icon_request_cb_t result_cb, void *data)
+{
+ int ret;
+ struct packet *packet;
+ struct request_item *item;
+ char *filename;
+ int len;
+
+ if (!handle || handle->state != CREATED) {
+ ErrPrint("Handle is not valid\n");
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if (!layout) {
+ layout = DEFAULT_ICON_LAYOUT;
+ }
+
+ if (!group) {
+ group = DEFAULT_ICON_GROUP;
+ }
+
+ len = strlen(outfile) + strlen(".desc") + 1 + 30; /* 30 == strlen(tv.tv_sec) + strlen(tv.tv_usec) + 10 (reserved) */
+ filename = malloc(len);
+ if (!filename) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+
+#if defined(_USE_ECORE_TIME_GET)
+ struct timespec ts;
+ double tv;
+ do {
+ if (clock_gettime(s_info.type, &ts) == 0) {
+ tv = ts.tv_sec + ts.tv_nsec / 1000000000.0f;
+ break;
+ }
+
+ ErrPrint("%d: %s\n", s_info.type, strerror(errno));
+ if (s_info.type == CLOCK_MONOTONIC) {
+ s_info.type = CLOCK_REALTIME;
+ } else if (s_info.type == CLOCK_REALTIME) {
+ struct timeval _tv;
+ if (gettimeofday(&_tv, NULL) < 0) {
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ _tv.tv_sec = rand();
+ _tv.tv_usec = rand();
+ }
+
+ tv = (double)_tv.tv_sec + (double)_tv.tv_usec / 1000000.0f;
+ break;
+ }
+ } while (1);
+ ret = snprintf(filename, len, "%s.%lf.desc", outfile, tv);
+#else
+ struct timeval tv;
+ if (gettimeofday(&tv, NULL) != 0) {
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ tv.tv_sec = rand();
+ tv.tv_usec = rand();
+ }
+
+ ret = snprintf(filename, len, "%s.%lu.%lu.desc", outfile, tv.tv_sec, tv.tv_usec);
+#endif
+ if (ret < 0) {
+ ErrPrint("snprintf: %s\n", strerror(errno));
+ goto out;
+ }
+
+ ret = shortcut_icon_desc_save(handle->desc, filename);
+ if (ret < 0) {
+ goto out;
+ }
+
+ item = malloc(sizeof(*item));
+ if (!item) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ if (unlink(filename) < 0) {
+ ErrPrint("Unlink: %s\n", strerror(errno));
+ }
+ ret = SHORTCUT_ERROR_OUT_OF_MEMORY;
+ goto out;
+ }
+
+ item->result_cb = result_cb;
+ item->data = data;
+ item->handle = shortcut_icon_request_ref(handle);
+
+ packet = packet_create("icon_create", "sssis", layout, group, filename, size_type, outfile);
+ if (!packet) {
+ ErrPrint("Failed to create a packet\n");
+ if (unlink(filename) < 0) {
+ ErrPrint("Unlink: %s\n", strerror(errno));
+ }
+ free(item);
+ (void)shortcut_icon_request_unref(handle);
+ ret = SHORTCUT_ERROR_FAULT;
+ goto out;
+ }
+
+ if (s_info.fd >= 0 && !s_info.pending_list) {
+ ret = com_core_packet_async_send(s_info.fd, packet, 0.0f, icon_request_cb, item);
+ packet_destroy(packet);
+ if (ret < 0) {
+ ErrPrint("ret: %d\n", ret);
+ if (unlink(filename) < 0) {
+ ErrPrint("Unlink: %s\n", strerror(errno));
+ }
+ free(item);
+ (void)shortcut_icon_request_unref(handle);
+ }
+ DbgPrint("Request is sent\n");
+ } else {
+ struct pending_item *pend;
+
+ pend = malloc(sizeof(*pend));
+ if (!pend) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ packet_destroy(packet);
+ free(item);
+ if (unlink(filename) < 0) {
+ ErrPrint("Unlink: %s\n", strerror(errno));
+ }
+ (void)shortcut_icon_request_unref(handle);
+ ret = SHORTCUT_ERROR_OUT_OF_MEMORY;
+ goto out;
+ }
+
+ pend->packet = packet;
+ pend->item = item;
+
+ s_info.pending_list = dlist_append(s_info.pending_list, pend);
+ DbgPrint("Request is pended\n");
+
+ ret = SHORTCUT_ERROR_NONE;
+ }
+
+out:
+ free(filename);
+ return ret;
+}
+
+/* End of a file */
diff --git a/lib/src/main.c b/lib/src/main.c
new file mode 100755
index 0000000..23dbe83
--- /dev/null
+++ b/lib/src/main.c
@@ -0,0 +1,887 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <libgen.h>
+
+#include <dlog.h>
+#include <glib.h>
+#include <db-util.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+
+#include <packet.h>
+#include <com-core.h>
+#include <com-core_packet.h>
+
+#include "shortcut.h"
+#include "shortcut_product.h"
+#include "shortcut_private.h"
+
+int errno;
+
+static struct info {
+ const char *dbfile;
+ sqlite3 *handle;
+ int server_fd;
+ int client_fd;
+ const char *socket_file;
+ struct {
+ int (*request_cb)(const char *appid, const char *name, int type, const char *content, const char *icon, pid_t pid, double period, int allow_duplicate, void *data);
+ void *data;
+ } server_cb;
+ int initialized;
+ int db_opened;
+ guint timer_id;
+} s_info = {
+ .server_fd = -1,
+ .client_fd = -1,
+ .socket_file = "/tmp/.shortcut.service",
+ .dbfile = "/opt/dbspace/.shortcut_service.db",
+ .handle = NULL,
+ .initialized = 0,
+ .db_opened = 0,
+ .timer_id = 0,
+};
+
+
+static inline int make_connection(void);
+
+
+static struct packet *remove_shortcut_handler(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *appid;
+ const char *name;
+ const char *content_info;
+ int ret;
+ int sender_pid;
+
+ if (!packet) {
+ ErrPrint("Packet is NIL, maybe disconnected?\n");
+ return NULL;
+ }
+
+ if (packet_get(packet, "isss", &sender_pid, &appid, &name, &content_info) != 4) {
+ ErrPrint("Invalid apcket\n");
+ return NULL;
+ }
+
+ DbgPrint("appid[%s], name[%s], content_info[%s]\n", appid, name, content_info);
+
+ if (s_info.server_cb.request_cb) {
+ ret = s_info.server_cb.request_cb(appid, name, SHORTCUT_REMOVE, content_info, NULL, sender_pid, -1.0f, 0, s_info.server_cb.data);
+ } else {
+ ret = SHORTCUT_ERROR_UNSUPPORTED;
+ }
+
+ return packet_create_reply(packet, "i", ret);
+}
+
+
+
+static struct packet *remove_dynamicbox_handler(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *appid;
+ const char *name;
+ int ret;
+ int sender_pid;
+
+ if (!packet) {
+ ErrPrint("PAcket is NIL, maybe disconnected?\n");
+ return NULL;
+ }
+
+ if (packet_get(packet, "iss", &sender_pid, &appid, &name) != 3) {
+ ErrPrint("Invalid packet\n");
+ return NULL;
+ }
+
+ DbgPrint("appid[%s], name[%s]\n", appid, name);
+
+ if (s_info.server_cb.request_cb) {
+ ret = s_info.server_cb.request_cb(appid, name, DYNAMICBOX_REMOVE, NULL, NULL, sender_pid, -1.0f, 0, s_info.server_cb.data);
+ } else {
+ ret = SHORTCUT_ERROR_UNSUPPORTED;
+ }
+
+ return packet_create_reply(packet, "i", ret);
+}
+
+
+
+static struct packet *add_shortcut_handler(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *appid;
+ const char *name;
+ int type;
+ const char *content;
+ const char *icon;
+ int allow_duplicate;
+ int ret;
+ int sender_pid;
+
+ if (!packet) {
+ return NULL;
+ }
+
+ if (packet_get(packet, "ississi", &sender_pid, &appid, &name, &type, &content, &icon, &allow_duplicate) != 7) {
+ ErrPrint("Invalid packet\n");
+ return NULL;
+ }
+
+ DbgPrint("appid[%s], name[%s], type[0x%x], content[%s], icon[%s] allow_duplicate[%d]\n", appid, name, type, content, icon, allow_duplicate);
+
+ if (s_info.server_cb.request_cb) {
+ ret = s_info.server_cb.request_cb(appid, name, type, content, icon, sender_pid, -1.0f, allow_duplicate, s_info.server_cb.data);
+ } else {
+ ret = SHORTCUT_ERROR_UNSUPPORTED;
+ }
+
+ return packet_create_reply(packet, "i", ret);
+}
+
+
+
+static struct packet *add_dynamicbox_handler(pid_t pid, int handle, const struct packet *packet)
+{
+ const char *appid;
+ const char *name;
+ int type;
+ const char *content;
+ const char *icon;
+ double period;
+ int allow_duplicate;
+ int ret;
+ int sender_pid;
+
+ if (!packet) {
+ return NULL;
+ }
+
+ if (packet_get(packet, "ississdi", &sender_pid, &appid, &name, &type, &content, &icon, &period, &allow_duplicate) != 8) {
+ ErrPrint("Invalid packet\n");
+ return NULL;
+ }
+
+ DbgPrint("appid[%s], name[%s], type[0x%x], content[%s], icon[%s], period[%lf], allow_duplicate[%d]\n", appid, name, type, content, icon, period, allow_duplicate);
+
+ if (s_info.server_cb.request_cb) {
+ ret = s_info.server_cb.request_cb(appid, name, type, content, icon, sender_pid, period, allow_duplicate, s_info.server_cb.data);
+ } else {
+ ret = 0;
+ }
+
+ return packet_create_reply(packet, "i", ret);
+}
+
+
+
+static void master_started_cb(keynode_t *node, void *user_data)
+{
+ int state = 0;
+
+ if (vconf_get_bool(VCONFKEY_MASTER_STARTED, &state) < 0) {
+ ErrPrint("Unable to get \"%s\"\n", VCONFKEY_MASTER_STARTED);
+ }
+
+ if (state == 1 && make_connection() == SHORTCUT_ERROR_NONE) {
+ (void)vconf_ignore_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb);
+ }
+}
+
+
+
+static gboolean timeout_cb(void *data)
+{
+ int ret;
+
+ ret = vconf_notify_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb, NULL);
+ if (ret < 0) {
+ ErrPrint("Failed to add vconf for service state [%d]\n", ret);
+ } else {
+ DbgPrint("vconf is registered\n");
+ }
+
+ master_started_cb(NULL, NULL);
+
+ s_info.timer_id = 0;
+ return FALSE;
+}
+
+
+
+static int disconnected_cb(int handle, void *data)
+{
+ if (s_info.client_fd == handle) {
+ s_info.client_fd = SHORTCUT_ERROR_INVALID_PARAMETER;
+ return 0;
+ }
+
+ if (s_info.server_fd == handle) {
+ if (!s_info.timer_id) {
+ s_info.server_fd = SHORTCUT_ERROR_INVALID_PARAMETER;
+ s_info.timer_id = g_timeout_add(1000, timeout_cb, NULL);
+ if (!s_info.timer_id) {
+ ErrPrint("Unable to add timer\n");
+ }
+ }
+ return 0;
+ }
+
+ return 0;
+}
+
+
+
+static inline int make_connection(void)
+{
+ int ret;
+ struct packet *packet;
+ static struct method service_table[] = {
+ {
+ .cmd = "add_shortcut",
+ .handler = add_shortcut_handler,
+ },
+ {
+ .cmd = "add_dynamicbox",
+ .handler = add_dynamicbox_handler,
+ },
+ {
+ .cmd = "rm_shortcut",
+ .handler = remove_shortcut_handler,
+ },
+ {
+ .cmd = "rm_dynamicbox",
+ .handler = remove_dynamicbox_handler,
+ },
+ {
+ .cmd = NULL,
+ .handler = NULL,
+ },
+ };
+
+ if (s_info.initialized == 0) {
+ s_info.initialized = 1;
+ com_core_add_event_callback(CONNECTOR_DISCONNECTED, disconnected_cb, NULL);
+ }
+
+ s_info.server_fd = com_core_packet_client_init(s_info.socket_file, 0, service_table);
+ if (s_info.server_fd < 0) {
+ ErrPrint("Failed to make a connection to the master\n");
+ return SHORTCUT_ERROR_COMM;
+ }
+
+ packet = packet_create_noack("service_register", "");
+ if (!packet) {
+ ErrPrint("Failed to build a packet\n");
+ return SHORTCUT_ERROR_FAULT;
+ }
+
+ ret = com_core_packet_send_only(s_info.server_fd, packet);
+ DbgPrint("Service register sent: %d\n", ret);
+ packet_destroy(packet);
+ if (ret != 0) {
+ com_core_packet_client_fini(s_info.server_fd);
+ s_info.server_fd = -1;
+ ret = SHORTCUT_ERROR_COMM;
+ } else {
+ ret = SHORTCUT_ERROR_NONE;
+ }
+
+ DbgPrint("Server FD: %d\n", s_info.server_fd);
+ return ret;
+}
+
+
+
+EAPI int shortcut_set_request_cb(request_cb_t request_cb, void *data)
+{
+ if (request_cb == NULL) {
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ s_info.server_cb.request_cb = request_cb;
+ s_info.server_cb.data = data;
+
+ if (s_info.server_fd < 0) {
+ int ret;
+
+ ret = vconf_notify_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb, NULL);
+ if (ret < 0) {
+ ErrPrint("Failed to add vconf for service state [%d]\n", ret);
+ return SHORTCUT_ERROR_COMM;
+ } else {
+ DbgPrint("vconf is registered\n");
+ }
+
+ master_started_cb(NULL, NULL);
+ }
+
+ return SHORTCUT_ERROR_NONE;
+}
+
+
+
+struct result_cb_item {
+ result_internal_cb_t result_cb;
+ void *data;
+};
+
+
+
+static int shortcut_send_cb(pid_t pid, int handle, const struct packet *packet, void *data)
+{
+ struct result_cb_item *item = data;
+ int ret;
+
+ if (!packet) {
+ ErrPrint("Packet is not valid\n");
+ ret = SHORTCUT_ERROR_FAULT;
+ } else if (packet_get(packet, "i", &ret) != 1) {
+ ErrPrint("Packet is not valid\n");
+ ret = SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if (item->result_cb) {
+ ret = item->result_cb(ret, pid, item->data);
+ } else {
+ ret = SHORTCUT_ERROR_NONE;
+ }
+ free(item);
+ return ret;
+}
+
+
+
+EAPI int add_to_home_remove_shortcut(const char *appid, const char *name, const char *content_info, result_internal_cb_t result_cb, void *data)
+{
+ struct packet *packet;
+ struct result_cb_item *item;
+ int ret;
+
+ if (!appid || !name) {
+ ErrPrint("Invalid argument\n");
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if (!s_info.initialized) {
+ s_info.initialized = 1;
+ com_core_add_event_callback(CONNECTOR_DISCONNECTED, disconnected_cb, NULL);
+ }
+
+ if (s_info.client_fd < 0) {
+ static struct method service_table[] = {
+ {
+ .cmd = NULL,
+ .handler = NULL,
+ },
+ };
+
+ s_info.client_fd = com_core_packet_client_init(s_info.socket_file, 0, service_table);
+ if (s_info.client_fd < 0) {
+ ErrPrint("Failed to make connection\n");
+ return SHORTCUT_ERROR_COMM;
+ }
+ }
+
+ item = malloc(sizeof(*item));
+ if (!item) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+
+ item->result_cb = result_cb;
+ item->data = data;
+
+ packet = packet_create("rm_shortcut", "isss", getpid(), appid, name, content_info);
+ if (!packet) {
+ ErrPrint("Failed to build a packet\n");
+ free(item);
+ return SHORTCUT_ERROR_FAULT;
+ }
+
+ ret = com_core_packet_async_send(s_info.client_fd, packet, 0.0f, shortcut_send_cb, item);
+ if (ret < 0) {
+ packet_destroy(packet);
+ free(item);
+ com_core_packet_client_fini(s_info.client_fd);
+ s_info.client_fd = SHORTCUT_ERROR_INVALID_PARAMETER;
+ return SHORTCUT_ERROR_COMM;
+ }
+
+ return SHORTCUT_ERROR_NONE;
+}
+
+
+
+EAPI int add_to_home_remove_dynamicbox(const char *appid, const char *name, result_internal_cb_t result_cb, void *data)
+{
+ struct packet *packet;
+ struct result_cb_item *item;
+ int ret;
+
+ if (!appid || !name) {
+ ErrPrint("Invalid argument\n");
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if (!s_info.initialized) {
+ s_info.initialized = 1;
+ com_core_add_event_callback(CONNECTOR_DISCONNECTED, disconnected_cb, NULL);
+ }
+
+ if (s_info.client_fd < 0) {
+ static struct method service_table[] = {
+ {
+ .cmd = NULL,
+ .handler = NULL,
+ },
+ };
+
+
+ s_info.client_fd = com_core_packet_client_init(s_info.socket_file, 0, service_table);
+ if (s_info.client_fd < 0) {
+ ErrPrint("Failed to make connection\n");
+ return SHORTCUT_ERROR_COMM;
+ }
+ }
+
+ item = malloc(sizeof(*item));
+ if (!item) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+
+ item->result_cb = result_cb;
+ item->data = data;
+
+ packet = packet_create("rm_dynamicbox", "iss", getpid(), appid, name);
+ if (!packet) {
+ ErrPrint("Failed to build a packet\n");
+ free(item);
+ return SHORTCUT_ERROR_FAULT;
+ }
+
+ ret = com_core_packet_async_send(s_info.client_fd, packet, 0.0f, shortcut_send_cb, item);
+ if (ret < 0) {
+ packet_destroy(packet);
+ free(item);
+ com_core_packet_client_fini(s_info.client_fd);
+ s_info.client_fd = SHORTCUT_ERROR_INVALID_PARAMETER;
+ return SHORTCUT_ERROR_COMM;
+ }
+
+ return SHORTCUT_ERROR_NONE;
+}
+
+
+
+EAPI int add_to_home_shortcut(const char *appid, const char *name, int type, const char *content, const char *icon, int allow_duplicate, result_internal_cb_t result_cb, void *data)
+{
+ struct packet *packet;
+ struct result_cb_item *item;
+ int ret;
+
+ if (!appid || ADD_TO_HOME_IS_DYNAMICBOX(type)) {
+ ErrPrint("Invalid type used for adding a shortcut\n");
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if (!s_info.initialized) {
+ s_info.initialized = 1;
+ com_core_add_event_callback(CONNECTOR_DISCONNECTED, disconnected_cb, NULL);
+ }
+
+ if (s_info.client_fd < 0) {
+ static struct method service_table[] = {
+ {
+ .cmd = NULL,
+ .handler = NULL,
+ },
+ };
+
+ s_info.client_fd = com_core_packet_client_init(s_info.socket_file, 0, service_table);
+ if (s_info.client_fd < 0) {
+ ErrPrint("Failed to make connection\n");
+ return SHORTCUT_ERROR_COMM;
+ }
+ }
+
+ item = malloc(sizeof(*item));
+ if (!item) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+
+ item->result_cb = result_cb;
+ item->data = data;
+
+ if (!name) {
+ name = "";
+ }
+
+ if (!content) {
+ content = "";
+ }
+
+ if (!icon) {
+ icon = "";
+ }
+
+ packet = packet_create("add_shortcut", "ississi", getpid(), appid, name, type, content, icon, allow_duplicate);
+ if (!packet) {
+ ErrPrint("Failed to build a packet\n");
+ free(item);
+ return SHORTCUT_ERROR_FAULT;
+ }
+
+ ret = com_core_packet_async_send(s_info.client_fd, packet, 0.0f, shortcut_send_cb, item);
+ if (ret < 0) {
+ packet_destroy(packet);
+ free(item);
+ com_core_packet_client_fini(s_info.client_fd);
+ s_info.client_fd = SHORTCUT_ERROR_INVALID_PARAMETER;
+ return SHORTCUT_ERROR_COMM;
+ }
+
+ return SHORTCUT_ERROR_NONE;
+}
+
+EAPI int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, const char *icon, int allow_duplicate, result_cb_t result_cb, void *data)
+{
+ return 0;
+}
+
+
+EAPI int add_to_home_dynamicbox(const char *appid, const char *name, int type, const char *content, const char *icon, double period, int allow_duplicate, result_internal_cb_t result_cb, void *data)
+{
+ struct packet *packet;
+ struct result_cb_item *item;
+ int ret;
+
+ if (!appid || !ADD_TO_HOME_IS_DYNAMICBOX(type)) {
+ ErrPrint("Invalid type is used for adding a dynamicbox\n");
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if (!s_info.initialized) {
+ s_info.initialized = 1;
+ com_core_add_event_callback(CONNECTOR_DISCONNECTED, disconnected_cb, NULL);
+ }
+
+ if (s_info.client_fd < 0) {
+ static struct method service_table[] = {
+ {
+ .cmd = NULL,
+ .handler = NULL,
+ },
+ };
+
+ s_info.client_fd = com_core_packet_client_init(s_info.socket_file, 0, service_table);
+ if (s_info.client_fd < 0) {
+ return SHORTCUT_ERROR_COMM;
+ }
+ }
+
+ item = malloc(sizeof(*item));
+ if (!item) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ return SHORTCUT_ERROR_OUT_OF_MEMORY;
+ }
+
+ item->result_cb = result_cb;
+ item->data = data;
+
+ packet = packet_create("add_dynamicbox", "ississdi", getpid(), appid, name, type, content, icon, period, allow_duplicate);
+ if (!packet) {
+ ErrPrint("Failed to build a packet\n");
+ free(item);
+ return SHORTCUT_ERROR_FAULT;
+ }
+
+ ret = com_core_packet_async_send(s_info.client_fd, packet, 0.0f, shortcut_send_cb, item);
+ if (ret < 0) {
+ packet_destroy(packet);
+ free(item);
+ com_core_packet_client_fini(s_info.client_fd);
+ s_info.client_fd = SHORTCUT_ERROR_INVALID_PARAMETER;
+ return SHORTCUT_ERROR_COMM;
+ }
+
+ return SHORTCUT_ERROR_NONE;
+}
+
+
+
+static inline int open_db(void)
+{
+ int ret;
+
+ ret = db_util_open(s_info.dbfile, &s_info.handle, DB_UTIL_REGISTER_HOOK_METHOD);
+ if (ret != SQLITE_OK) {
+ DbgPrint("Failed to open a %s\n", s_info.dbfile);
+ return SHORTCUT_ERROR_IO_ERROR;
+ }
+
+ return SHORTCUT_ERROR_NONE;
+}
+
+
+
+/*!
+ * \note this function will returns allocated(heap) string
+ */
+static inline int get_i18n_name(const char *lang, int id, char **name, char **icon)
+{
+ sqlite3_stmt *stmt;
+ static const char *query = "SELECT name, icon FROM shortcut_name WHERE id = ? AND lang = ? COLLATE NOCASE";
+ const unsigned char *_name;
+ const unsigned char *_icon;
+ int ret = 0;
+ int status;
+
+ status = sqlite3_prepare_v2(s_info.handle, query, -1, &stmt, NULL);
+ if (status != SQLITE_OK) {
+ ErrPrint("Failed to prepare stmt: %s\n", sqlite3_errmsg(s_info.handle));
+ return -EFAULT;
+ }
+
+ status = sqlite3_bind_int(stmt, 1, id);
+ if (status != SQLITE_OK) {
+ ErrPrint("Failed to bind id: %s\n", sqlite3_errmsg(s_info.handle));
+ ret = -EFAULT;
+ goto out;
+ }
+
+ status = sqlite3_bind_text(stmt, 2, lang, -1, SQLITE_TRANSIENT);
+ if (status != SQLITE_OK) {
+ ErrPrint("Failed to bind lang: %s\n", sqlite3_errmsg(s_info.handle));
+ ret = -EFAULT;
+ goto out;
+ }
+
+ DbgPrint("id: %d, lang: %s\n", id, lang);
+ if (SQLITE_ROW != sqlite3_step(stmt)) {
+ ErrPrint("Failed to do step: %s\n", sqlite3_errmsg(s_info.handle));
+ ret = -ENOENT;
+ goto out;
+ }
+
+ _name = sqlite3_column_text(stmt, 0);
+ if (name) {
+ if (_name && strlen((const char *)_name)) {
+ *name = strdup((const char *)_name);
+ if (!*name) {
+ ErrPrint("strdup: %s\n", strerror(errno));
+ ret = -ENOMEM;
+ goto out;
+ }
+ } else {
+ *name = NULL;
+ }
+ }
+
+ _icon = sqlite3_column_text(stmt, 1);
+ if (icon) {
+ if (_icon && strlen((const char *)_icon)) {
+ *icon = strdup((const char *)_icon);
+ if (!*icon) {
+ ErrPrint("strdup: %s\n", strerror(errno));
+ ret = -ENOMEM;
+ if (name && *name) {
+ free(*name);
+ }
+ goto out;
+ }
+ } else {
+ *icon = NULL;
+ }
+ }
+
+out:
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+
+
+static inline char *cur_locale(void)
+{
+ char *language;
+ language = vconf_get_str(VCONFKEY_LANGSET);
+ if (language) {
+ char *ptr;
+
+ ptr = language;
+ while (*ptr) {
+ if (*ptr == '.') {
+ *ptr = '\0';
+ break;
+ }
+
+ if (*ptr == '_') {
+ *ptr = '-';
+ }
+
+ ptr++;
+ }
+ } else {
+ language = strdup("en-us");
+ if (!language) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ }
+ }
+
+ return language;
+}
+
+
+
+/*!
+ * \note READ ONLY DB
+ */
+EAPI int shortcut_get_list(const char *appid, int (*cb)(const char *appid, const char *icon, const char *name, const char *extra_key, const char *extra_data, void *data), void *data)
+{
+ sqlite3_stmt *stmt;
+ const char *query;
+ const unsigned char *name;
+ char *i18n_name = NULL;
+ char *i18n_icon = NULL;
+ const unsigned char *extra_data;
+ const unsigned char *extra_key;
+ const unsigned char *icon;
+ int id;
+ int ret;
+ int cnt;
+ char *language;
+
+ if (cb == NULL) {
+ return SHORTCUT_ERROR_INVALID_PARAMETER;
+ }
+
+ if (!s_info.db_opened) {
+ s_info.db_opened = (open_db() == 0);
+ }
+
+ if (!s_info.db_opened) {
+ ErrPrint("Failed to open a DB\n");
+ return SHORTCUT_ERROR_IO_ERROR;
+ }
+
+ language = cur_locale();
+ if (!language) {
+ ErrPrint("Locale is not valid\n");
+ return SHORTCUT_ERROR_FAULT;
+ }
+
+ if (appid) {
+ query = "SELECT id, appid, name, extra_key, extra_data, icon FROM shortcut_service WHERE appid = ?";
+ ret = sqlite3_prepare_v2(s_info.handle, query, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("prepare: %s\n", sqlite3_errmsg(s_info.handle));
+ free(language);
+ return SHORTCUT_ERROR_IO_ERROR;
+ }
+
+ ret = sqlite3_bind_text(stmt, 1, appid, -1, SQLITE_TRANSIENT);
+ if (ret != SQLITE_OK) {
+ ErrPrint("bind text: %s\n", sqlite3_errmsg(s_info.handle));
+ sqlite3_finalize(stmt);
+ free(language);
+ return SHORTCUT_ERROR_IO_ERROR;
+ }
+ } else {
+ query = "SELECT id, appid, name, extra_key, extra_data, icon FROM shortcut_service";
+ ret = sqlite3_prepare_v2(s_info.handle, query, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("prepare: %s\n", sqlite3_errmsg(s_info.handle));
+ free(language);
+ return SHORTCUT_ERROR_IO_ERROR;
+ }
+ }
+
+ cnt = 0;
+ while (SQLITE_ROW == sqlite3_step(stmt)) {
+ id = sqlite3_column_int(stmt, 0);
+
+ appid = (const char *)sqlite3_column_text(stmt, 1);
+ if (!appid) {
+ LOGE("Failed to get package name\n");
+ continue;
+ }
+
+ name = sqlite3_column_text(stmt, 2);
+ if (!name) {
+ LOGE("Failed to get name\n");
+ continue;
+ }
+
+ extra_key = sqlite3_column_text(stmt, 3);
+ if (!extra_key) {
+ LOGE("Failed to get service\n");
+ continue;
+ }
+
+ extra_data = sqlite3_column_text(stmt, 4);
+ if (!extra_data) {
+ LOGE("Failed to get service\n");
+ continue;
+ }
+
+ icon = sqlite3_column_text(stmt, 5);
+ if (!icon) {
+ LOGE("Failed to get icon\n");
+ continue;
+ }
+
+ /*!
+ * \todo
+ * Implement the "GET LOCALE" code
+ */
+ if (get_i18n_name(language, id, &i18n_name, &i18n_icon) < 0) {
+ /* Okay, we can't manage this. just use the fallback string */
+ }
+
+ cnt++;
+ if (cb(appid, (i18n_icon != NULL ? i18n_icon : (char *)icon), (i18n_name != NULL ? i18n_name : (char *)name), (char *)extra_key, (char *)extra_data, data) < 0) {
+ free(i18n_name);
+ break;
+ }
+
+ free(i18n_name);
+ i18n_name = NULL;
+
+ free(i18n_icon);
+ i18n_icon = NULL;
+ }
+
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ free(language);
+ return cnt;
+}
+
+/* End of a file */
diff --git a/packaging/libshortcut.manifest b/packaging/libshortcut.manifest
new file mode 100644
index 0000000..f1055e7
--- /dev/null
+++ b/packaging/libshortcut.manifest
@@ -0,0 +1,22 @@
+<manifest>
+ <!-- Shortcut service -->
+ <define>
+ <domain name="shortcut-service" policy="restricted" />
+ <provide>
+ <label name="shortcut-service::db" />
+ </provide>
+ </define>
+ <request>
+ <domain name="_" />
+ </request>
+
+ <assign>
+ <!-- Executable file -->
+ <filesystem path="/usr/lib/libshortcut.so.0.0.1" label="_" />
+ <filesystem path="/usr/etc/package-manager/parserlib/libshortcut-list.so" label="_" />
+
+ <!-- Database file -->
+ <filesystem path="/opt/dbspace/.shortcut_service.db" label="shortcut-service::db" />
+ <filesystem path="/opt/dbspace/.shortcut_service.db-journal" label="shortcut-service::db" />
+ </assign>
+</manifest>
diff --git a/packaging/libshortcut.spec b/packaging/libshortcut.spec
new file mode 100755
index 0000000..465cd43
--- /dev/null
+++ b/packaging/libshortcut.spec
@@ -0,0 +1,82 @@
+Name: libshortcut
+Summary: Shortcut add feature supporting library
+Version: 0.6.14
+Release: 0
+Group: HomeTF/Framework
+License: Apache
+Source0: %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+BuildRequires: cmake, gettext-tools, coreutils
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(db-util)
+BuildRequires: pkgconfig(sqlite3)
+BuildRequires: pkgconfig(com-core)
+BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(capi-base-common)
+
+%description
+[Shortcut] AddToHome feature supporting library for menu/home screen developers.
+
+%package devel
+Summary: AddToHome feature supporting library development files
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+[Shortcut] AddToHome feature supporting library for menu/home screen developers
+(dev).
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+%build
+%if 0%{?sec_build_binary_debug_enable}
+export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
+export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+%endif
+%if 0%{?tizen_build_binary_release_type_eng}
+export CFLAGS="${CFLAGS} -DTIZEN_ENGINEER_MODE"
+export CXXFLAGS="${CXXFLAGS} -DTIZEN_ENGINEER_MODE"
+export FFLAGS="${FFLAGS} -DTIZEN_ENGINEER_MODE"
+%endif
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+mkdir -p %{buildroot}/opt/dbspace
+touch %{buildroot}/opt/dbspace/.shortcut_service.db
+touch %{buildroot}/opt/dbspace/.shortcut_service.db-journal
+
+%post
+
+%postun
+
+%files -n libshortcut
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_libdir}/*.so*
+%{_prefix}/etc/package-manager/parserlib/*
+%{_datarootdir}/license/*
+%attr(640,root,app) /opt/dbspace/.shortcut_service.db
+%attr(640,root,app) /opt/dbspace/.shortcut_service.db-journal
+
+%files devel
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_includedir}/shortcut/shortcut.h
+%{_includedir}/shortcut/shortcut_product.h
+%{_includedir}/shortcut/shortcut_private.h
+%{_includedir}/shortcut/shortcut_manager.h
+%{_libdir}/pkgconfig/shortcut.pc
+
+# End of a file
diff --git a/pkgmgr_shortcut/CMakeLists.txt b/pkgmgr_shortcut/CMakeLists.txt
new file mode 100644
index 0000000..0a4abc7
--- /dev/null
+++ b/pkgmgr_shortcut/CMakeLists.txt
@@ -0,0 +1,31 @@
+PROJECT(shortcut-list C)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/pkgmgr_shortcut/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(bin_pkgs REQUIRED
+ dlog
+ sqlite3
+ libxml-2.0
+ db-util
+)
+
+FOREACH(flag ${bin_pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Wall -Werror")
+
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DLOG_TAG=\"PKGMGR_SHORTCUT\"")
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED
+ src/service_register.c
+ src/dlist.c
+)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${bin_pkgs_LDFLAGS})
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "etc/package-manager/parserlib")
+
+# End of a file
diff --git a/pkgmgr_shortcut/include/dlist.h b/pkgmgr_shortcut/include/dlist.h
new file mode 100644
index 0000000..04283eb
--- /dev/null
+++ b/pkgmgr_shortcut/include/dlist.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#define dlist_remove_data(list, data) do { \
+ struct dlist *l; \
+ l = dlist_find_data(list, data); \
+ list = dlist_remove(list, l); \
+} while (0)
+
+#define dlist_foreach(list, l, data) \
+ for ((l) = (list); (l) && ((data) = dlist_data(l)); (l) = dlist_next(l))
+
+#define dlist_foreach_safe(list, l, n, data) \
+ for ((l) = (list), (n) = dlist_next(l); \
+ (l) && ((data) = dlist_data(l)); \
+ (l) = (n), (n) = dlist_next(l))
+
+struct dlist;
+
+extern struct dlist *dlist_append(struct dlist *list, void *data);
+extern struct dlist *dlist_prepend(struct dlist *list, void *data);
+extern struct dlist *dlist_remove(struct dlist *list, struct dlist *l);
+extern struct dlist *dlist_find_data(struct dlist *list, void *data);
+extern void *dlist_data(struct dlist *l);
+extern struct dlist *dlist_next(struct dlist *l);
+extern struct dlist *dlist_prev(struct dlist *l);
+extern int dlist_count(struct dlist *l);
+extern struct dlist *dlist_nth(struct dlist *l, int nth);
+
+/* End of a file */
diff --git a/pkgmgr_shortcut/src/dlist.c b/pkgmgr_shortcut/src/dlist.c
new file mode 100644
index 0000000..1764dfd
--- /dev/null
+++ b/pkgmgr_shortcut/src/dlist.c
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include "dlist.h"
+
+/*!
+ * \brief
+ * This dlist is called Modified Doubly Linked List.
+ *
+ * Noramlly, The dobule linked list contains address of previous and next element.
+ * This dlist also contains them, but the tail element only contains prev address.
+ *
+ * The head element's prev pointer indicates the last element.
+ * But the last element's next pointer indicates NIL.
+ *
+ * So we can find the last element while crawling this DList
+ * But we have to remember the address of the head element.
+ */
+
+struct dlist {
+ struct dlist *next;
+ struct dlist *prev;
+ void *data;
+};
+
+struct dlist *dlist_append(struct dlist *list, void *data)
+{
+ struct dlist *item;
+
+ item = malloc(sizeof(*item));
+ if (!item) {
+ return NULL;
+ }
+
+ item->next = NULL;
+ item->data = data;
+
+ if (!list) {
+ item->prev = item;
+
+ list = item;
+ } else {
+ item->prev = list->prev;
+ item->prev->next = item;
+ list->prev = item;
+ }
+
+ assert(!list->prev->next && "item NEXT");
+
+ return list;
+}
+
+struct dlist *dlist_prepend(struct dlist *list, void *data)
+{
+ struct dlist *item;
+
+ item = malloc(sizeof(*item));
+ if (!item) {
+ return NULL;
+ }
+
+ item->data = data;
+
+ if (!list) {
+ item->prev = item;
+ item->next = NULL;
+ } else {
+ if (list->prev->next) {
+ list->prev->next = item;
+ }
+
+ item->prev = list->prev;
+ item->next = list;
+
+ list->prev = item;
+
+ }
+
+ return item;
+}
+
+struct dlist *dlist_remove(struct dlist *list, struct dlist *l)
+{
+ if (!list || !l)
+ return NULL;
+
+ if (l == list) {
+ list = l->next;
+ } else {
+ l->prev->next = l->next;
+ }
+
+ if (l->next) {
+ l->next->prev = l->prev;
+ }
+ /*!
+ * \note
+ * If the removed entry 'l' has no next element, it is the last element.
+ * In this case, check the existence of the list first,
+ * and if the list is not empty, update the 'prev' of the list (which is a head element of the list)
+ *
+ * If we didn't care about this, the head element(list) can indicates the invalid element.
+ */
+ else if (list) {
+ list->prev = l->prev;
+ }
+
+ free(l);
+ return list;
+}
+
+struct dlist *dlist_find_data(struct dlist *list, void *data)
+{
+ struct dlist *l;
+ void *_data;
+
+ dlist_foreach(list, l, _data) {
+ if (data == _data) {
+ return l;
+ }
+ }
+
+ return NULL;
+}
+
+void *dlist_data(struct dlist *l)
+{
+ return l ? l->data : NULL;
+}
+
+struct dlist *dlist_next(struct dlist *l)
+{
+ return l ? l->next : NULL;
+}
+
+struct dlist *dlist_prev(struct dlist *l)
+{
+ return l ? l->prev : NULL;
+}
+
+int dlist_count(struct dlist *l)
+{
+ register int i;
+ struct dlist *n;
+ void *data;
+
+ i = 0;
+ dlist_foreach(l, n, data) {
+ i++;
+ }
+
+ return i;
+}
+
+struct dlist *dlist_nth(struct dlist *l, int nth)
+{
+ register int i;
+ struct dlist *n;
+
+ i = 0;
+ for (n = l; n; n = n->next) {
+ if (i == nth) {
+ return n;
+ }
+ i++;
+ }
+
+ return NULL;
+}
+
+/* End of a file */
diff --git a/pkgmgr_shortcut/src/service_register.c b/pkgmgr_shortcut/src/service_register.c
new file mode 100644
index 0000000..c4c1a7f
--- /dev/null
+++ b/pkgmgr_shortcut/src/service_register.c
@@ -0,0 +1,1244 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#include <stdio.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <libgen.h>
+#include <string.h>
+
+#include <sqlite3.h>
+#include <db-util.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <dlog.h>
+
+#include "dlist.h"
+
+#if !defined(FLOG)
+#define DbgPrint(format, arg...) SECURE_LOGD("[%s/%s:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg)
+#define ErrPrint(format, arg...) SECURE_LOGE("[%s/%s:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg)
+#endif
+/* End of a file */
+
+/*!
+ * DB Table schema
+ *
+ * +----+-------+-------+------+---------+-----------+------------+
+ * | id | pkgid | appid | Icon | Name | extra_key | extra_data |
+ * +----+-------+-------+------+---------+-----------+------------+
+ * | id | - | - | - | - | - | - |
+ * +----+-------+-------+------+---------+-----------+------------+
+ *
+ * +----+-------+------+------+------+
+ * | fk | pkgid | lang | name | icon |
+ * +----+-------+------+------+------+
+ * | id | - | - | | - |
+ * +----+-------+------+------+------+
+ */
+
+#if !defined(LIBXML_TREE_ENABLED)
+ #error "LIBXML is not supporting the tree"
+#endif
+
+int errno;
+
+struct i18n_name {
+ xmlChar *icon;
+ xmlChar *name;
+ xmlChar *lang;
+};
+
+static struct {
+ const char *dbfile;
+ sqlite3 *handle;
+} s_info = {
+ .dbfile = "/opt/dbspace/.shortcut_service.db",
+ .handle = NULL,
+};
+
+static inline int begin_transaction(void)
+{
+ sqlite3_stmt *stmt;
+ int ret;
+
+ ret = sqlite3_prepare_v2(s_info.handle, "BEGIN TRANSACTION", -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ DbgPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
+ return EXIT_FAILURE;
+ }
+
+ if (sqlite3_step(stmt) != SQLITE_DONE) {
+ DbgPrint("Failed to do update (%s)\n",
+ sqlite3_errmsg(s_info.handle));
+ sqlite3_finalize(stmt);
+ return EXIT_FAILURE;
+ }
+
+ sqlite3_finalize(stmt);
+ return EXIT_SUCCESS;
+}
+
+static inline int rollback_transaction(void)
+{
+ int ret;
+ sqlite3_stmt *stmt;
+
+ ret = sqlite3_prepare_v2(s_info.handle, "ROLLBACK TRANSACTION", -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ DbgPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
+ return EXIT_FAILURE;
+ }
+
+ if (sqlite3_step(stmt) != SQLITE_DONE) {
+ DbgPrint("Failed to do update (%s)\n",
+ sqlite3_errmsg(s_info.handle));
+ sqlite3_finalize(stmt);
+ return EXIT_FAILURE;
+ }
+
+ sqlite3_finalize(stmt);
+ return EXIT_SUCCESS;
+}
+
+static inline int commit_transaction(void)
+{
+ sqlite3_stmt *stmt;
+ int ret;
+
+ ret = sqlite3_prepare_v2(s_info.handle, "COMMIT TRANSACTION", -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ DbgPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
+ return EXIT_FAILURE;
+ }
+
+ if (sqlite3_step(stmt) != SQLITE_DONE) {
+ DbgPrint("Failed to do update (%s)\n",
+ sqlite3_errmsg(s_info.handle));
+ sqlite3_finalize(stmt);
+ return EXIT_FAILURE;
+ }
+
+ sqlite3_finalize(stmt);
+ return EXIT_SUCCESS;
+}
+
+static void db_create_version(void)
+{
+ static const char *ddl = "CREATE TABLE version (version INTEGER)";
+ char *err;
+
+ if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
+ ErrPrint("Failed to execute the DDL (%s)\n", err);
+ return;
+ }
+
+ if (sqlite3_changes(s_info.handle) == 0) {
+ ErrPrint("No changes to DB\n");
+ }
+}
+
+static int set_version(int version)
+{
+ static const char *dml = "INSERT INTO version (version) VALUES (?)";
+ sqlite3_stmt *stmt;
+ int ret;
+
+ ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("Failed to prepare the initial DML(%s)\n", sqlite3_errmsg(s_info.handle));
+ return -EIO;
+ }
+
+ if (sqlite3_bind_int(stmt, 1, version) != SQLITE_OK) {
+ ErrPrint("Failed to bind a id(%s)\n", sqlite3_errmsg(s_info.handle));
+ ret = -EIO;
+ goto out;
+ }
+
+ ret = sqlite3_step(stmt);
+ if (ret != SQLITE_DONE) {
+ ErrPrint("Failed to execute the DML for version: %d\n", ret);
+ ret = -EIO;
+ } else {
+ ret = 0;
+ }
+
+out:
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+static int update_version(int version)
+{
+ static const char *dml = "UPDATE version SET version = ?";
+ sqlite3_stmt *stmt;
+ int ret;
+
+ ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("Failed to prepare the initial DML(%s)\n", sqlite3_errmsg(s_info.handle));
+ return -EIO;
+ }
+
+ if (sqlite3_bind_int(stmt, 1, version) != SQLITE_OK) {
+ ErrPrint("Failed to bind a version: %s\n", sqlite3_errmsg(s_info.handle));
+ ret = -EIO;
+ goto out;
+ }
+
+ ret = sqlite3_step(stmt);
+ if (ret != SQLITE_DONE) {
+ ErrPrint("Failed to execute DML: %d\n", ret);
+ ret = -EIO;
+ } else {
+ ret = 0;
+ }
+
+out:
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+static int get_version(void)
+{
+ static const char *dml = "SELECT version FROM version";
+ sqlite3_stmt *stmt;
+ int ret;
+
+ ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ return -ENOSYS;
+ }
+
+ if (sqlite3_step(stmt) != SQLITE_ROW) {
+ ret = -ENOENT;
+ } else {
+ ret = sqlite3_column_int(stmt, 0);
+ }
+
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+static void db_create_table(void)
+{
+ char *err;
+ static const char *ddl =
+ "CREATE TABLE shortcut_service ("
+ "id INTEGER PRIMARY KEY AUTOINCREMENT, "
+ "pkgid TEXT, "
+ "appid TEXT, "
+ "icon TEXT, "
+ "name TEXT, "
+ "extra_key TEXT, "
+ "extra_data TEXT)";
+
+ if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
+ ErrPrint("Failed to execute the DDL (%s)\n", err);
+ return;
+ }
+
+ if (sqlite3_changes(s_info.handle) == 0) {
+ ErrPrint("No changes to DB\n");
+ }
+
+ ddl = "CREATE TABLE shortcut_name (id INTEGER, pkgid TEXT, lang TEXT, name TEXT, icon TEXT)";
+ if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
+ ErrPrint("Failed to execute the DDL (%s)\n", err);
+ return;
+ }
+
+ if (sqlite3_changes(s_info.handle) == 0) {
+ ErrPrint("No changes to DB\n");
+ }
+
+ db_create_version();
+}
+
+static void alter_shortcut_icon(void)
+{
+ char *err;
+ static const char *ddl = "ALTER TABLE shortcut_name ADD icon TEXT";
+
+ if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
+ ErrPrint("Failed to execute the DDL (%s)\n", err);
+ return;
+ }
+
+ if (sqlite3_changes(s_info.handle) == 0) {
+ ErrPrint("No changes to DB\n");
+ }
+}
+
+static void alter_shortcut_name(void)
+{
+ char *err;
+ static const char *ddl = "ALTER TABLE shortcut_name ADD pkgid TEXT";
+
+ if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
+ ErrPrint("Failed to execute the DDL (%s)\n", err);
+ return;
+ }
+
+ if (sqlite3_changes(s_info.handle) == 0) {
+ ErrPrint("No changes to DB\n");
+ }
+}
+
+static void alter_shortcut_service(void)
+{
+ char *err;
+ static const char *ddl = "ALTER TABLE shortcut_service ADD pkgid TEXT";
+
+ if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
+ ErrPrint("Failed to execute the DDL (%s)\n", err);
+ return;
+ }
+
+ if (sqlite3_changes(s_info.handle) == 0) {
+ ErrPrint("No changes to DB\n");
+ }
+}
+
+static int db_remove_by_pkgid(const char *pkgid)
+{
+ static const char *dml = "DELETE FROM shortcut_service WHERE pkgid = ?";
+ sqlite3_stmt *stmt;
+ int ret;
+
+ if (!pkgid) {
+ ErrPrint("Invalid argument\n");
+ return -EINVAL;
+ }
+
+ ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("Failed to prepare the initial DML(%s)\n", sqlite3_errmsg(s_info.handle));
+ return -EIO;
+ }
+
+ ret = -EIO;
+ if (sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a pkgid(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ ret = 0;
+ if (sqlite3_step(stmt) != SQLITE_DONE) {
+ ret = -EIO;
+ ErrPrint("Failed to execute the DML for %s\n", pkgid);
+ } else {
+ if (sqlite3_changes(s_info.handle) == 0) {
+ DbgPrint("No changed\n");
+ }
+ }
+
+out:
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+static void do_upgrade_db_schema(void)
+{
+ int version;
+
+ version = get_version();
+
+ switch (version) {
+ case -ENOSYS:
+ db_create_version();
+ /* Need to create version table */
+ case -ENOENT:
+ if (set_version(1) < 0) {
+ ErrPrint("Failed to set version\n");
+ }
+ /* Need to set version */
+ alter_shortcut_name();
+ alter_shortcut_service();
+ case 1:
+ alter_shortcut_icon();
+ if (update_version(2) < 0) {
+ ErrPrint("Failed to update version\n");
+ }
+ case 2:
+ break;
+ default:
+ /* Need to update version */
+ DbgPrint("Old version: %d\n", version);
+ if (update_version(2) < 0) {
+ ErrPrint("Failed to update version\n");
+ }
+
+ alter_shortcut_name();
+ alter_shortcut_service();
+ /* 2 */
+ alter_shortcut_icon();
+ break;
+ }
+}
+
+static int db_remove_record(const char *pkgid, const char *appid, const char *key, const char *data)
+{
+ static const char *dml = "DELETE FROM shortcut_service WHERE appid = ? AND extra_key = ? AND extra_data = ? AND pkgid = ?";
+ sqlite3_stmt *stmt;
+ int ret;
+
+ if (!appid || !key || !data) {
+ ErrPrint("Invalid argument\n");
+ return -EINVAL;
+ }
+
+ ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("Failed to prepare the initial DML(%s)\n", sqlite3_errmsg(s_info.handle));
+ return -EIO;
+ }
+
+ ret = -EIO;
+ if (sqlite3_bind_text(stmt, 1, appid, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a appid(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 2, key, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a key(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 3, data, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a data(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 4, pkgid, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a pkgid(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ ret = 0;
+ if (sqlite3_step(stmt) != SQLITE_DONE) {
+ ret = -EIO;
+ ErrPrint("Failed to execute the DML for %s - %s(%s)\n", appid, key, data);
+ }
+
+ if (sqlite3_changes(s_info.handle) == 0) {
+ DbgPrint("No changes\n");
+ }
+
+out:
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+static int db_remove_name_by_pkgid(const char *pkgid)
+{
+ static const char *dml = "DELETE FROM shortcut_name WHERE pkgid = ?";
+ sqlite3_stmt *stmt;
+ int ret;
+
+ if (!pkgid) {
+ ErrPrint("Invalid id\n");
+ return -EINVAL;
+ }
+
+ ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("Failed to prepare the initial DML(%s)\n", sqlite3_errmsg(s_info.handle));
+ return -EIO;
+ }
+
+ if (sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind pkgid(%s)\n", pkgid);
+ return -EIO;
+ }
+
+ ret = 0;
+ if (sqlite3_step(stmt) != SQLITE_DONE) {
+ ret = -EIO;
+ ErrPrint("Failed to execute the DML for %s\n", pkgid);
+ goto out;
+ }
+
+ if (sqlite3_changes(s_info.handle) == 0) {
+ DbgPrint("No chnages\n");
+ }
+
+out:
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+static int db_remove_name(int id)
+{
+ static const char *dml = "DELETE FROM shortcut_name WHERE id = ?";
+ sqlite3_stmt *stmt;
+ int ret;
+
+ if (id < 0) {
+ ErrPrint("Inavlid id\n");
+ return -EINVAL;
+ }
+
+ ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("Failed to prepare the initial DML(%s)\n", sqlite3_errmsg(s_info.handle));
+ return -EIO;
+ }
+
+ if (sqlite3_bind_int(stmt, 1, id) != SQLITE_OK) {
+ ErrPrint("Failed to bind id(%d)\n", id);
+ ret = -EIO;
+ goto out;
+ }
+
+ ret = 0;
+ if (sqlite3_step(stmt) != SQLITE_DONE) {
+ ret = -EIO;
+ ErrPrint("Failed to execute the DML for %d\n", id);
+ goto out;
+ }
+
+ if (sqlite3_changes(s_info.handle) == 0) {
+ DbgPrint("No changes\n");
+ }
+
+out:
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+static int db_insert_record(const char *pkgid, const char *appid, const char *icon, const char *name, const char *key, const char *data)
+{
+ static const char *dml = "INSERT INTO shortcut_service (pkgid, appid, icon, name, extra_key, extra_data) VALUES (?, ?, ?, ?, ?, ?)";
+ sqlite3_stmt *stmt;
+ int ret;
+
+ if (!pkgid) {
+ ErrPrint("Failed to get pkgid\n");
+ return -EINVAL;
+ }
+
+ if (!appid) {
+ ErrPrint("Failed to get appid\n");
+ return -EINVAL;
+ }
+
+ if (!name) {
+ ErrPrint("Failed to get name\n");
+ return -EINVAL;
+ }
+
+ if (!key) {
+ ErrPrint("Failed to get key\n");
+ return -EINVAL;
+ }
+
+ if (!data) {
+ ErrPrint("Faield to get key\n");
+ return -EINVAL;
+ }
+
+ ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("Failed to prepare the initial DML(%s)\n", sqlite3_errmsg(s_info.handle));
+ return -EIO;
+ }
+
+ ret = -EIO;
+ if (sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a pkgid(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 2, appid, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a appid(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 3, icon, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a icon(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 4, name, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a name(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 5, key, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a service(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 6, data, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a service(%s)\n", sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ ret = 0;
+ if (sqlite3_step(stmt) != SQLITE_DONE) {
+ ErrPrint("Failed to execute the DML for %s - %s\n", appid, name);
+ ret = -EIO;
+ }
+
+out:
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+static int db_insert_name(int id, const char *pkgid, const char *lang, const char *name, const char *icon)
+{
+ static const char *dml = "INSERT INTO shortcut_name (id, pkgid, lang, name, icon) VALUES (?, ?, ?, ?, ?)";
+ sqlite3_stmt *stmt;
+ int ret;
+
+ if (id < 0 || !lang) {
+ ErrPrint("Invalid parameters\n");
+ return -EINVAL;
+ }
+
+ ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("Failed to prepare the initial DML(%s)\n", sqlite3_errmsg(s_info.handle));
+ return -EIO;
+ }
+
+ if (sqlite3_bind_int(stmt, 1, id) != SQLITE_OK) {
+ ErrPrint("Failed to bind a id(%s)\n", sqlite3_errmsg(s_info.handle));
+ ret = -EIO;
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 2, pkgid, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a pkgid(%s)\n", sqlite3_errmsg(s_info.handle));
+ ret = -EIO;
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 3, lang, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a id(%s)\n", sqlite3_errmsg(s_info.handle));
+ ret = -EIO;
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 4, name, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a id(%s)\n", sqlite3_errmsg(s_info.handle));
+ ret = -EIO;
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 5, icon, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a id(%s)\n", sqlite3_errmsg(s_info.handle));
+ ret = -EIO;
+ goto out;
+ }
+
+ ret = 0;
+ if (sqlite3_step(stmt) != SQLITE_DONE) {
+ ErrPrint("Failed to execute the DML for %d %s %s\n", id, lang, name);
+ ret = -EIO;
+ }
+
+out:
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+static int db_get_id(const char *pkgid, const char *appid, const char *key, const char *data)
+{
+ static const char *dml = "SELECT id FROM shortcut_service WHERE pkgid = ? AND appid = ? AND extra_key = ? AND extra_data = ?";
+ sqlite3_stmt *stmt;
+ int ret;
+
+ if (!appid || !key || !data) {
+ ErrPrint("Invalid argument\n");
+ return -EINVAL;
+ }
+
+ ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
+ if (ret != SQLITE_OK) {
+ ErrPrint("Failed to prepare the initial DML(%s)\n", sqlite3_errmsg(s_info.handle));
+ return -EIO;
+ }
+
+ ret = -EIO;
+ if (sqlite3_bind_text(stmt, 1, pkgid, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a pkgid(%s) - %s\n", pkgid, sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 2, appid, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a appid(%s) - %s\n", appid, sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 3, key, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a key(%s) - %s\n", key, sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_bind_text(stmt, 4, data, -1, SQLITE_TRANSIENT) != SQLITE_OK) {
+ ErrPrint("Failed to bind a data(%s) - %s\n", data, sqlite3_errmsg(s_info.handle));
+ goto out;
+ }
+
+ if (sqlite3_step(stmt) != SQLITE_ROW) {
+ ErrPrint("Failed to execute the DML for %s - %s, %s\n", appid, key, data);
+ ret = -EIO;
+ goto out;
+ }
+
+ ret = sqlite3_column_int(stmt, 0);
+
+out:
+ sqlite3_reset(stmt);
+ sqlite3_clear_bindings(stmt);
+ sqlite3_finalize(stmt);
+ return ret;
+}
+
+static int db_init(void)
+{
+ int ret;
+ struct stat stat;
+
+ ret = db_util_open(s_info.dbfile, &s_info.handle, DB_UTIL_REGISTER_HOOK_METHOD);
+ if (ret != SQLITE_OK) {
+ ErrPrint("Failed to open a DB\n");
+ return -EIO;
+ }
+
+ if (lstat(s_info.dbfile, &stat) < 0) {
+ ErrPrint("%s\n", strerror(errno));
+ db_util_close(s_info.handle);
+ s_info.handle = NULL;
+ return -EIO;
+ }
+
+ if (!S_ISREG(stat.st_mode)) {
+ ErrPrint("Invalid file\n");
+ db_util_close(s_info.handle);
+ s_info.handle = NULL;
+ return -EINVAL;
+ }
+
+ if (!stat.st_size) {
+ db_create_table();
+ }
+
+ return 0;
+}
+
+static int db_fini(void)
+{
+ if (!s_info.handle) {
+ return 0;
+ }
+
+ db_util_close(s_info.handle);
+ s_info.handle = NULL;
+
+ return 0;
+}
+
+static int do_uninstall(const char *appid)
+{
+ int ret;
+
+ ret = db_remove_by_pkgid(appid);
+ if (ret < 0) {
+ ErrPrint("Failed to remove a record: %s\n", appid);
+ return ret;
+ }
+
+ ret = db_remove_name_by_pkgid(appid);
+ if (ret < 0) {
+ ErrPrint("Failed to remove name records: %s\n", appid);
+ return ret;
+ }
+
+ return 0;
+}
+
+static inline struct i18n_name *find_i18n_name(struct dlist *i18n_list, xmlChar *lang)
+{
+ struct dlist *l;
+ struct i18n_name *i18n;
+
+ dlist_foreach(i18n_list, l, i18n) {
+ if (!xmlStrcasecmp(i18n->lang, lang)) {
+ return i18n;
+ }
+ }
+
+ return NULL;
+}
+
+static inline struct i18n_name *create_i18n_name(xmlChar *lang, xmlChar *name, xmlChar *icon)
+{
+ struct i18n_name *i18n;
+
+ i18n = malloc(sizeof(*i18n));
+ if (!i18n) {
+ ErrPrint("Heap: %s\n", strerror(errno));
+ return NULL;
+ }
+
+ i18n->lang = lang;
+ i18n->name = name;
+ i18n->icon = icon;
+
+ return i18n;
+}
+
+static inline void destroy_i18n_name(struct i18n_name *i18n)
+{
+ xmlFree(i18n->lang);
+ xmlFree(i18n->name);
+ xmlFree(i18n->icon);
+ free(i18n);
+}
+
+static int do_install(xmlDocPtr docPtr, const char *appid)
+{
+ xmlNodePtr node = NULL;
+ xmlNodePtr child = NULL;
+ xmlChar *key;
+ xmlChar *data;
+ xmlChar *name;
+ xmlChar *icon;
+ xmlChar *lang;
+ xmlChar *shortcut_appid;
+ xmlNodePtr root;
+ struct i18n_name *i18n;
+ struct dlist *i18n_list = NULL;
+ struct dlist *l;
+ struct dlist *n;
+ int id;
+
+ root = xmlDocGetRootElement(docPtr);
+ if (!root) {
+ ErrPrint("Invalid node ptr\n");
+ return -EINVAL;
+ }
+
+ for (root = root->children; root; root = root->next) {
+ if (!xmlStrcasecmp(root->name, (const xmlChar *)"shortcut-list")) {
+ break;
+ }
+ }
+
+ if (!root) {
+ ErrPrint("Root has no children\n");
+ return -EINVAL;
+ }
+
+ DbgPrint("AppID: %s\n", appid);
+
+ root = root->children; /* Jump to children node */
+ for (node = root; node; node = node->next) {
+ if (node->type == XML_ELEMENT_NODE) {
+ DbgPrint("Element %s\n", node->name);
+ }
+
+ if (xmlStrcasecmp(node->name, (const xmlChar *)"shortcut")) {
+ continue;
+ }
+
+ if (!xmlHasProp(node, (xmlChar *)"extra_key") || !xmlHasProp(node, (xmlChar *)"extra_data")) {
+ DbgPrint("Invalid element %s\n", node->name);
+ continue;
+ }
+
+ key = xmlGetProp(node, (xmlChar *)"extra_key");
+ data = xmlGetProp(node, (xmlChar *)"extra_data");
+ shortcut_appid = xmlGetProp(node, (xmlChar *)"appid");
+
+ icon = NULL;
+ name = NULL;
+ for (child = node->children; child; child = child->next) {
+ if (!xmlStrcasecmp(child->name, (const xmlChar *)"icon")) {
+ lang = xmlNodeGetLang(child);
+ if (!lang) {
+ if (icon) {
+ DbgPrint("Default icon is duplicated\n");
+ } else {
+ icon = xmlNodeGetContent(child);
+ DbgPrint("Default icon is %s\n", icon);
+ }
+
+ continue;
+ }
+
+ i18n = find_i18n_name(i18n_list, lang);
+ if (i18n) {
+ xmlFree(lang);
+
+ if (i18n->icon) {
+ DbgPrint("%s is duplicated\n", i18n->icon);
+ continue;
+ }
+
+ i18n->icon = xmlNodeGetContent(child);
+ } else {
+ i18n = create_i18n_name(lang, NULL, xmlNodeGetContent(child));
+ if (!i18n) {
+ ErrPrint("Failed to create a new i18n_name\n");
+ continue;
+ }
+ i18n_list = dlist_append(i18n_list, i18n);
+ }
+
+ continue;
+ }
+
+ if (!xmlStrcasecmp(child->name, (const xmlChar *)"label")) {
+ lang = xmlNodeGetLang(child);
+ if (!lang) {
+ if (name) {
+ DbgPrint("Default name is duplicated\n");
+ } else {
+ name = xmlNodeGetContent(child);
+ DbgPrint("Default name is %s\n", name);
+ }
+
+ continue;
+ }
+
+ i18n = find_i18n_name(i18n_list, lang);
+ if (i18n) {
+ xmlFree(lang);
+
+ if (i18n->name) {
+ DbgPrint("%s is duplicated\n", i18n->name);
+ continue;
+ }
+
+ i18n->name = xmlNodeGetContent(child);
+ } else {
+ i18n = create_i18n_name(lang, xmlNodeGetContent(child), NULL);
+ if (!i18n) {
+ ErrPrint("Failed to create a new i18n_name\n");
+ continue;
+ }
+ i18n_list = dlist_append(i18n_list, i18n);
+ }
+
+ continue;
+ }
+ }
+
+ DbgPrint("appid: %s\n", appid);
+ DbgPrint("shortcut appid: %s\n", shortcut_appid);
+ DbgPrint("key: %s\n", key);
+ DbgPrint("data: %s\n", data);
+ DbgPrint("icon: %s\n", icon);
+ DbgPrint("Default name: %s\n", name);
+
+ if (!shortcut_appid) {
+ shortcut_appid = xmlStrdup((xmlChar *)appid);
+ DbgPrint("Use the default appid\n");
+ }
+
+ begin_transaction();
+ if (db_insert_record(appid, (char *)shortcut_appid, (char *)icon, (char *)name, (char *)key, (char *)data) < 0) {
+ ErrPrint("Failed to insert a new record\n");
+ rollback_transaction();
+
+ dlist_foreach_safe(i18n_list, l, n, i18n) {
+ i18n_list = dlist_remove(i18n_list, l);
+ destroy_i18n_name(i18n);
+ }
+ } else {
+ id = db_get_id((char *)appid, (char *)shortcut_appid, (char *)key, (char *)data);
+ if (id < 0) {
+ ErrPrint("Failed to insert a new record\n");
+ rollback_transaction();
+
+ dlist_foreach_safe(i18n_list, l, n, i18n) {
+ i18n_list = dlist_remove(i18n_list, l);
+ destroy_i18n_name(i18n);
+ }
+ } else {
+ dlist_foreach_safe(i18n_list, l, n, i18n) {
+ i18n_list = dlist_remove(i18n_list, l);
+ if (db_insert_name(id, appid, (char *)i18n->lang, (char *)i18n->name, (char *)i18n->icon) < 0) {
+ ErrPrint("Failed to add i18n name: %s(%s)\n", i18n->name, i18n->lang);
+ }
+ destroy_i18n_name(i18n);
+ }
+ commit_transaction();
+ }
+ }
+
+ xmlFree(key);
+ xmlFree(data);
+ xmlFree(icon);
+ xmlFree(name);
+ xmlFree(shortcut_appid);
+ }
+
+ return 0;
+}
+
+int PKGMGR_PARSER_PLUGIN_PRE_UNINSTALL(const char *appid)
+{
+ if (!s_info.handle) {
+ if (db_init() < 0) {
+ return -EIO;
+ }
+ }
+
+ do_upgrade_db_schema();
+ return 0;
+}
+
+int PKGMGR_PARSER_PLUGIN_POST_UNINSTALL(const char *appid)
+{
+ int ret;
+
+ begin_transaction();
+ ret = do_uninstall(appid);
+ if (ret < 0) {
+ rollback_transaction();
+ return ret;
+ }
+ commit_transaction();
+
+ db_fini();
+ return 0;
+}
+
+int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char *_appid)
+{
+ xmlNodePtr node = NULL;
+ xmlChar *key;
+ xmlChar *data;
+ xmlChar *appid;
+ xmlNodePtr root;
+ int id;
+
+ if (!docPtr) {
+ DbgPrint("Package manager doesn't support the docPtr (%s)\n", _appid);
+ return 0;
+ }
+
+ root = xmlDocGetRootElement(docPtr);
+ if (!root) {
+ ErrPrint("Invalid node ptr\n");
+ return -EINVAL;
+ }
+
+ for (root = root->children; root; root = root->next) {
+ if (!xmlStrcasecmp(root->name, (const xmlChar *)"shortcut-list")) {
+ break;
+ }
+ }
+
+ if (!root) {
+ ErrPrint("Root has no shortcut-list\n");
+ return -EINVAL;
+ }
+
+ DbgPrint("AppID: %s\n", _appid);
+ root = root->children;
+ for (node = root; node; node = node->next) {
+ if (node->type == XML_ELEMENT_NODE) {
+ DbgPrint("Element %s\n", node->name);
+ }
+
+ if (xmlStrcasecmp(node->name, (const xmlChar *)"shortcut")) {
+ continue;
+ }
+
+ if (!xmlHasProp(node, (xmlChar *)"extra_data")
+ || !xmlHasProp(node, (xmlChar *)"extra_key")
+ || !xmlHasProp(node, (xmlChar *)"appid"))
+ {
+ DbgPrint("Invalid element %s\n", node->name);
+ continue;
+ }
+
+ appid = xmlGetProp(node, (xmlChar *)"appid");
+ key = xmlGetProp(node, (xmlChar *)"extra_key");
+ data = xmlGetProp(node, (xmlChar *)"extra_data");
+
+ DbgPrint("appid: %s\n", appid);
+ DbgPrint("key: %s\n", key);
+ DbgPrint("data: %s\n", data);
+
+ id = db_get_id(NULL, (char *)appid, (char *)key, (char *)data);
+ if (id < 0) {
+ ErrPrint("No records found\n");
+ xmlFree(appid);
+ xmlFree(key);
+ xmlFree(data);
+ continue;
+ }
+
+ begin_transaction();
+ if (db_remove_record(NULL, (char *)appid, (char *)key, (char *)data) < 0) {
+ ErrPrint("Failed to remove a record\n");
+ rollback_transaction();
+ xmlFree(appid);
+ xmlFree(key);
+ xmlFree(data);
+ continue;
+ }
+
+ if (db_remove_name(id) < 0) {
+ ErrPrint("Failed to remove name records\n");
+ rollback_transaction();
+ xmlFree(appid);
+ xmlFree(key);
+ xmlFree(data);
+ continue;
+ }
+ commit_transaction();
+
+ xmlFree(appid);
+ xmlFree(key);
+ xmlFree(data);
+
+ /*!
+ * \note
+ * if (node->children)
+ * DbgPrint("Skip this node's children\n");
+ */
+ }
+
+ return 0;
+}
+
+int PKGMGR_PARSER_PLUGIN_PRE_INSTALL(const char *appid)
+{
+ int ret;
+
+ if (!s_info.handle) {
+ if (db_init() < 0) {
+ return -EIO;
+ }
+ }
+
+ do_upgrade_db_schema();
+
+ begin_transaction();
+ ret = do_uninstall(appid);
+ if (ret < 0) {
+ ErrPrint("Failed to remove record: %s\n", appid);
+ /* Keep going */
+ }
+ commit_transaction();
+ return 0;
+}
+
+int PKGMGR_PARSER_PLUGIN_POST_INSTALL(const char *appid)
+{
+ db_fini();
+ return 0;
+}
+
+int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char *appid)
+{
+ return do_install(docPtr, appid);
+}
+
+int PKGMGR_PARSER_PLUGIN_PRE_UPGRADE(const char *appid)
+{
+ int ret;
+
+ if (!s_info.handle) {
+ if (db_init() < 0) {
+ return -EIO;
+ }
+ }
+
+ do_upgrade_db_schema();
+
+ begin_transaction();
+ ret = do_uninstall(appid);
+ if (ret < 0) {
+ ErrPrint("Failed to remove a record: %s\n", appid);
+ /* Keep going */
+ }
+ commit_transaction();
+ return 0;
+}
+
+int PKGMGR_PARSER_PLUGIN_POST_UPGRADE(const char *appid)
+{
+ db_fini();
+ return 0;
+}
+
+int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr docPtr, const char *appid)
+{
+ /* So... ugly */
+ return do_install(docPtr, appid);
+}
+
+/*
+int main(int argc, char *argv[])
+{
+ xmlDoc *doc;
+ xmlNode *root;
+
+ if (argc != 2) {
+ ErrPRint("Invalid argument: %s XML_FILENAME\n", argv[0]);
+ return -EINVAL;
+ }
+
+ doc = xmlReadFile(argv[1], NULL, 0);
+ if (!doc) {
+ ErrPrint("Failed to parse %s\n", argv[1]);
+ return -EIO;
+ }
+
+ root = xmlDocGetRootElement(doc);
+
+ db_init();
+ install_shortcut("", root);
+ db_fini();
+
+ xmlFreeDoc(doc);
+ xmlCleanupParser();
+ return 0;
+}
+*/
+
+/* End of a file */
diff --git a/sample.xml b/sample.xml
new file mode 100644
index 0000000..f3a6bc8
--- /dev/null
+++ b/sample.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<manifest xmlns="http://tizen.org/ns/packages" package="com.samsung.myapp" version="0.3.5" install-location="auto">
+<shortcut-list test="a">
+ <shortcut appid="com.samsung.myapp" extra_key="key" extra_data="SERVICE INFORMATION 1">
+ <icon>/opt/usr/apps/com.samsung.myapp/res/icon/myapp_shortcut01.png</icon>
+ <label>Default Name</label>
+ <label xml:lang="en-us">Name en</label>
+ <label xml:lang="nl-nl">Name nl</label>
+ <label xml:lang="de-de">Name de</label>
+ <label xml:lang="zh-hk">Name hk</label>
+ <label xml:lang="zh-cn">Name cn</label>
+ <label xml:lang="ru-ru">Name ru</label>
+ <label xml:lang="zh-tw">Name tw</label>
+ <label xml:lang="ja-jp">Name jp</label>
+ <label xml:lang="es-es">Name es</label>
+ <label xml:lang="el-gr">Name gr</label>
+ <label xml:lang="it-it">Name it</label>
+ <label xml:lang="tr-tr">Name tr</label>
+ <label xml:lang="pt-pt">Name pt</label>
+ <label xml:lang="fr-fr">Name fr</label>
+ <label xml:lang="kor-kr">Name kr</label>
+ </shortcut>
+ <shortcut appid="com.samsung.myapp-gadget" extra_key="key" extra_data="SERVICE INFORMATION 2">
+ <icon>/opt/usr/apps/com.samsung.myapp/res/icon/gadget_shortcut01.png</icon>
+ <label>Default Name 02</label>
+ <label xml:lang="en-us">Name en</label>
+ <label xml:lang="nl-nl">Name nl</label>
+ <label xml:lang="de-de">Name de</label>
+ <label xml:lang="zh-hk">Name hk</label>
+ <label xml:lang="zh-cn">Name cn</label>
+ <label xml:lang="ru-ru">Name ru</label>
+ <label xml:lang="zh-tw">Name tw</label>
+ <label xml:lang="ja-jp">Name jp</label>
+ <label xml:lang="es-es">Name es</label>
+ <label xml:lang="el-gr">Name gr</label>
+ <label xml:lang="it-it">Name it</label>
+ <label xml:lang="tr-tr">Name tr</label>
+ <label xml:lang="pt-pt">Name pt</label>
+ <label xml:lang="fr-fr">Name fr</label>
+ <label xml:lang="kor-kr">Name kr</label>
+ </shortcut>
+ <shortcut appid="com.samsung.myapp" extra_key="key" extra_data="SERVICE INFORMATION 3">
+ <icon>/opt/usr/apps/com.samsung.myapp/res/icon/mayapp_shortcut02.png</icon>
+ <label>Default Name 03</label>
+ <label xml:lang="en-us">Name en</label>
+ <label xml:lang="nl-nl">Name nl</label>
+ <label xml:lang="de-de">Name de</label>
+ <label xml:lang="zh-hk">Name hk</label>
+ <label xml:lang="zh-cn">Name cn</label>
+ <label xml:lang="ru-ru">Name ru</label>
+ <label xml:lang="zh-tw">Name tw</label>
+ <label xml:lang="ja-jp">Name jp</label>
+ <label xml:lang="es-es">Name es</label>
+ <label xml:lang="el-gr">Name gr</label>
+ <label xml:lang="it-it">Name it</label>
+ <label xml:lang="tr-tr">Name tr</label>
+ <label xml:lang="pt-pt">Name pt</label>
+ <label xml:lang="fr-fr">Name fr</label>
+ <label xml:lang="kor-kr">Name kr</label>
+ </shortcut>
+</shortcut-list>
+</manifest>
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..abe5c1b
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,4 @@
+all:
+ @gcc homescreen.c -Wall -o homescreen `pkg-config ecore elementary shortcut --cflags --libs`
+ @gcc application.c -Wall -o application `pkg-config ecore elementary shortcut --cflags --libs`
+ @gcc shortcut.c -Wall -o shortcut `pkg-config ecore elementary shortcut --cflags --libs`
diff --git a/test/application.c b/test/application.c
new file mode 100755
index 0000000..5d69981
--- /dev/null
+++ b/test/application.c
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#include <Elementary.h>
+#include <shortcut.h>
+
+static int result_cb(int ret, int pid, void *data)
+{
+ printf("Client: Return %d (%d)\n", ret, pid);
+ //elm_exit();
+ return 0;
+}
+
+static Eina_Bool shortcut_add_cb(void *data)
+{
+ int ret;
+
+ ret = add_to_home_shortcut("pkgname", "MyName", 0, "/usr/bin/true", "/opt/share/image/what.png", result_cb, NULL);
+ printf("Client: shortcut_add_to_home returns: %d\n", ret);
+
+ ret = add_to_home_dynamicbox("pkgname", "MyName", 0, "/usr/bin/true", "/opt/share/image/what.png", 1.0f, result_cb, NULL);
+ printf("Client: shortcut_add_to_home_with_period returns: %d\n", ret);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+int elm_main(int argc, char *argv[])
+{
+ Ecore_Timer *timer;
+
+ timer = ecore_timer_add(3.0f, shortcut_add_cb, NULL);
+ if (!timer) {
+ printf("Failed to add a timer\n");
+ }
+
+ elm_run();
+ elm_shutdown();
+
+ return 0;
+}
+
+ELM_MAIN()
+/* End of a file */
diff --git a/test/homescreen.c b/test/homescreen.c
new file mode 100644
index 0000000..0b6c5f7
--- /dev/null
+++ b/test/homescreen.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#include <Elementary.h>
+#include <shortcut.h>
+
+int shortcut_request_cb(const char *pkgname, const char *name, int type, const char *exec, const char *icon, int pid, double period, void *data)
+{
+ printf("SERVER: name: %s, type: %d, exec: %s, icon: %s, pid: %d, data: %p, period: %lf\n",
+ name, type, exec, icon, pid, data, period);
+ return 0;
+}
+
+int elm_main(int argc, char *argv[])
+{
+ shortcut_set_request_cb(shortcut_request_cb, NULL);
+
+ elm_run();
+ elm_shutdown();
+
+ return 0;
+}
+
+ELM_MAIN()
+/* End of a file */
+
diff --git a/test/icon.c b/test/icon.c
new file mode 100755
index 0000000..4f1364d
--- /dev/null
+++ b/test/icon.c
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#include <Elementary.h>
+#include <shortcut.h>
+
+static int result_cb(struct shortcut_icon *handle, int ret, void *data)
+{
+ printf("Client: Return %d (%p)\n", ret, handle);
+ return 0;
+}
+
+static Eina_Bool test_main(void *data)
+{
+ struct shortcut_icon *handle;
+ static int idx = 0;
+ int ret;
+ char filename[256];
+ int type;
+
+ idx++;
+
+ handle = shortcut_icon_request_create();
+ if (!handle) {
+ printf("Failed to create a request\n");
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ printf("Test: %d\n", idx);
+ ret = shortcut_icon_request_set_info(handle, NULL, SHORTCUT_ICON_TYPE_IMAGE, DEFAULT_ICON_PART, "/usr/share/icons/default/small/com.samsung.music-player.png", NULL, NULL);
+ printf("NAME set_info: %d\n", ret);
+
+ snprintf(filename, sizeof(filename), "App Name %d", idx);
+ ret = shortcut_icon_request_set_info(handle, NULL, SHORTCUT_ICON_TYPE_TEXT, DEFAULT_NAME_PART, filename, NULL, NULL);
+ printf("TEXT set_info: %d\n", ret);
+
+ snprintf(filename, sizeof(filename), "/opt/usr/share/live_magazine/always/out%d.png", idx);
+
+ switch (idx % 7) {
+ case 0: type = DYNAMICBOX_TYPE_1x1; break;
+ case 1: type = DYNAMICBOX_TYPE_2x1; break;
+ case 2: type = DYNAMICBOX_TYPE_2x2; break;
+ case 3: type = DYNAMICBOX_TYPE_4x1; break;
+ case 4: type = DYNAMICBOX_TYPE_4x2; break;
+ case 5: type = DYNAMICBOX_TYPE_4x3; break;
+ case 6: type = DYNAMICBOX_TYPE_4x4; break;
+ default: type = DYNAMICBOX_TYPE_1x1; break;
+ }
+
+ ret = shortcut_icon_request_send(handle, type, NULL, NULL, filename, result_cb, NULL);
+ printf("request: %d\n", ret);
+
+ ret = shortcut_icon_request_destroy(handle);
+ printf("destroy: %d\n", ret);
+ return ECORE_CALLBACK_RENEW;
+}
+
+static int initialized_cb(int status, void *data)
+{
+ printf("Hello initializer\n");
+ return 0;
+}
+
+int elm_main(int argc, char *argv[])
+{
+ shortcut_icon_service_init(NULL, NULL);
+
+ ecore_timer_add(5.0f, test_main, NULL);
+
+ elm_run();
+ shortcut_icon_service_fini();
+ elm_shutdown();
+ return 0;
+}
+
+ELM_MAIN()
+/* End of a file */
diff --git a/test/shortcut.c b/test/shortcut.c
new file mode 100644
index 0000000..eb8b5d6
--- /dev/null
+++ b/test/shortcut.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#include <Elementary.h>
+#include <shortcut.h>
+
+static int shortcut_list_cb(const char *appid, const char *icon, const char *name, const char *extra_key, const char *extra_data, void *data)
+{
+ printf("appid[%s] icon[%s], name[%s] extra_key[%s], extra_ata[%s]\n", appid, icon, name, extra_key, extra_data);
+ return 0;
+}
+
+int elm_main(int argc, char *argv[])
+{
+ int ret;
+ ret = shortcut_get_list(NULL, shortcut_list_cb, NULL);
+ if (ret < 0)
+ printf("Error: %d\n", ret);
+
+ elm_run();
+ elm_shutdown();
+
+ return 0;
+}
+
+ELM_MAIN()
+/* End of a file */
diff --git a/test_db_builder.sh b/test_db_builder.sh
new file mode 100755
index 0000000..0bb675d
--- /dev/null
+++ b/test_db_builder.sh
@@ -0,0 +1,80 @@
+#!/bin/sh
+#/*
+# * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# * http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#*/
+
+DBFILE="/opt/dbspace/.shortcut_service.db"
+
+APPID=(
+"com.samsung.facebook"
+"com.samsung.facebook"
+"com.samsung.facebook"
+"com.samsung.facebook"
+"com.samsung.facebook"
+)
+
+ICON=(
+""
+""
+""
+""
+""
+)
+
+NAME=(
+"Friend's wall"
+"Groups"
+"Update status"
+"Like by me"
+"My wall"
+)
+
+KEY=(
+"dynamicbox_shortcut_type"
+"dynamicbox_shortcut_type"
+"dynamicbox_shortcut_type"
+"dynamicbox_shortcut_type"
+"dynamicbox_shortcut_type"
+)
+
+VALUE=(
+"shortcut_friends"
+"shortcut_groups"
+"shortcut_post"
+"shortcut_like"
+"shortcut_me"
+)
+
+CNT=0
+ERR=0
+MAX=5
+
+sqlite3 $DBFILE "CREATE TABLE shortcut_service (id INTEGER PRIMARY KEY AUTOINCREMENT, appid TEXT, icon TEXT, name TEXT, extra_key TEXT, extra_data TEXT)"
+sqlite3 $DBFILE "CREATE TABLE shortcut_name (id INTEGER, lang TEXT, name TEXT)"
+while [ $CNT -lt $MAX ]
+do
+ echo "Insert a new record ('${APPID[$CNT]}', '${ICON[$CNT]}', '${NAME[$CNT]}', \"${KEY[$CNT]}\", \"${VALUE[$CNT]}\")"
+ sqlite3 $DBFILE "INSERT INTO shortcut_service (appid, icon, name, extra_key, extra_data) VALUES ('${APPID[$CNT]}', '${ICON[$CNT]}', \"${NAME[$CNT]}\", \"${KEY[$CNT]}\", \"${VALUE[$CNT]}\")" 2>/dev/null
+ if [ $? -ne 0 ]; then
+ let ERR=$ERR+1
+ fi
+ ID=`sqlite3 $DBFILE "SELECT id FROM shortcut_service WHERE appid = \"${APPID[$CNT]}\" AND extra_key = \"${KEY[$CNT]}\" AND extra_data = \"${VALUE[$CNT]}\""`
+ echo "Insert a name: \"${NAME[$CNT]}\""
+ sqlite3 $DBFILE "INSERT INTO shortcut_name (id, lang, name) VALUES ('$ID', 'en-us', \"${NAME[CNT]}\")"
+ let CNT=$CNT+1
+done
+
+echo "Error/Total: $ERR/$CNT"