summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-01-30 05:58:47 (GMT)
committerSung-jae Park <nicesj.park@samsung.com>2013-01-30 05:58:47 (GMT)
commiteaf0a5fe7bde3406d22d53a506a0f4ec56e37db8 (patch)
treeed6066b57402d4ee19be8377948df590e638ce7a
parenta43afcebe43c2d38fb7a70475ce13efe3c4e83bf (diff)
downloaddata-provider-master-eaf0a5fe7bde3406d22d53a506a0f4ec56e37db8.zip
data-provider-master-eaf0a5fe7bde3406d22d53a506a0f4ec56e37db8.tar.gz
data-provider-master-eaf0a5fe7bde3406d22d53a506a0f4ec56e37db8.tar.bz2
Add new script handler for updating color
Update smack label & domain name to "data-provider-master" Change-Id: I233eb3425e80df1f15b0c1b19c7de9e681c56227
-rw-r--r--org.tizen.data-provider-master.manifest28
-rw-r--r--packaging/org.tizen.data-provider-master.spec2
-rw-r--r--src/script_handler.c40
3 files changed, 55 insertions, 15 deletions
diff --git a/org.tizen.data-provider-master.manifest b/org.tizen.data-provider-master.manifest
index 56bbd6c..e54196b 100644
--- a/org.tizen.data-provider-master.manifest
+++ b/org.tizen.data-provider-master.manifest
@@ -1,12 +1,12 @@
<manifest>
<!-- Provider master label -->
<define>
- <domain name="org.tizen.data-provider-master" policy="restricted" />
+ <domain name="data-provider-master" policy="restricted" />
<provide>
- <label name="org.tizen.data-provider-master::log" />
- <label name="org.tizen.data-provider-master::db" />
- <label name="org.tizen.data-provider-master::data" />
- <label name="org.tizen.data-provider-master::share" />
+ <label name="data-provider-master::log" />
+ <label name="data-provider-master::db" />
+ <label name="data-provider-master::data" />
+ <label name="data-provider-master::share" />
</provide>
</define>
<request>
@@ -15,24 +15,24 @@
<assign>
<!-- Executable file -->
- <filesystem path="/usr/bin/data-provider-master" label="org.tizen.data-provider-master" exec_label="org.tizen.data-provider-master" />
- <filesystem path="/usr/bin/liveinfo" label="org.tizen.data-provider-master" exec_label="org.tizen.data-provider-master" />
+ <filesystem path="/usr/bin/data-provider-master" label="data-provider-master" exec_label="data-provider-master" />
+ <filesystem path="/usr/bin/liveinfo" label="data-provider-master" exec_label="data-provider-master" />
<!-- Configuration data -->
- <filesystem path="/usr/share/data-provider-master" label="org.tizen.data-provider-master::data" />
- <filesystem path="/usr/share/data-provider-master/abi.ini" label="org.tizen.data-provider-master::data" />
+ <filesystem path="/usr/share/data-provider-master" label="data-provider-master::data" />
+ <filesystem path="/usr/share/data-provider-master/abi.ini" label="data-provider-master::data" />
<!-- livebox-service is able to access the resolution.ini file -->
<filesystem path="/usr/share/data-provider-master/resolution.ini" label="_" />
<!-- Slave provider and the master provider are able to access the conf.ini file -->
- <filesystem path="/usr/share/data-provider-master/conf.ini" label="_" />
+ <filesystem path="/usr/share/data-provider-master/conf.ini" label="data-provider-master::data" />
<!-- Shared data folder -->
- <filesystem path="/opt/usr/share/live_magazine" label="org.tizen.data-provider-master::share" />
- <filesystem path="/opt/usr/share/live_magazine/log" label="org.tizen.data-provider-master::share" />
- <filesystem path="/opt/usr/share/live_magazine/reader" label="org.tizen.data-provider-master::share" />
- <filesystem path="/opt/usr/share/live_magazine/always" label="org.tizen.data-provider-master::share" />
+ <filesystem path="/opt/usr/share/live_magazine" label="data-provider-master::share" type="transmutable" />
+ <filesystem path="/opt/usr/share/live_magazine/log" label="data-provider-master::share" type="transmutable" />
+ <filesystem path="/opt/usr/share/live_magazine/reader" label="data-provider-master::share" type="transmutable" />
+ <filesystem path="/opt/usr/share/live_magazine/always" label="data-provider-master::share" type="transmutable" />
<!-- Database -->
<filesystem path="/opt/dbspace/.livebox.db" label="data-provider-master::db" />
diff --git a/packaging/org.tizen.data-provider-master.spec b/packaging/org.tizen.data-provider-master.spec
index a13920d..cb8b9e0 100644
--- a/packaging/org.tizen.data-provider-master.spec
+++ b/packaging/org.tizen.data-provider-master.spec
@@ -1,6 +1,6 @@
Name: org.tizen.data-provider-master
Summary: Master service provider for liveboxes.
-Version: 0.15.0
+Version: 0.15.2
Release: 1
Group: framework/livebox
License: Flora License
diff --git a/src/script_handler.c b/src/script_handler.c
index 9acf0e5..024432d 100644
--- a/src/script_handler.c
+++ b/src/script_handler.c
@@ -42,6 +42,7 @@
#include "conf.h"
#include "util.h"
+#define TYPE_COLOR "color"
#define TYPE_TEXT "text"
#define TYPE_IMAGE "image"
#define TYPE_EDJE "script"
@@ -66,6 +67,7 @@ struct script_port {
void *handle;
const char *(*magic_id)(void);
+ int (*update_color)(void *handle, Evas *e, const char *id, const char *part, const char *rgba);
int (*update_text)(void *handle, Evas *e, const char *id, const char *part, const char *text);
int (*update_image)(void *handle, Evas *e, const char *id, const char *part, const char *path);
int (*update_script)(void *handle, Evas *e, const char *src_id, const char *target_id, const char *part, const char *path, const char *group);
@@ -403,6 +405,36 @@ HAPI void *script_handler_evas(struct script_info *info)
return ecore_evas_get(info->ee);
}
+static int update_script_color(struct inst_info *inst, struct block *block, int is_pd)
+{
+ struct script_info *info;
+ Evas *e;
+
+ if (!block || !block->part || !block->data) {
+ ErrPrint("Block or part or data is not valid\n");
+ return -EINVAL;
+ }
+
+ info = is_pd ? instance_pd_script(inst) : instance_lb_script(inst);
+ if (!info) {
+ ErrPrint("info is NIL\n");
+ return -EFAULT;
+ }
+
+ if (!info->port) {
+ ErrPrint("info->port is NIL\n");
+ return -EINVAL;
+ }
+
+ e = script_handler_evas(info);
+ if (e)
+ info->port->update_color(info->port_data, e, block->id, block->part, block->data);
+ else
+ ErrPrint("Evas(nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data);
+
+ return 0;
+}
+
static int update_script_text(struct inst_info *inst, struct block *block, int is_pd)
{
struct script_info *info;
@@ -676,6 +708,10 @@ HAPI int script_handler_parse_desc(const char *pkgname, const char *id, const ch
int (*handler)(struct inst_info *inst, struct block *block, int is_pd);
} handlers[] = {
{
+ .type = TYPE_COLOR,
+ .handler = update_script_color,
+ },
+ {
.type = TYPE_TEXT,
.handler = update_script_text,
},
@@ -1159,6 +1195,10 @@ HAPI int script_init(void)
DbgPrint("SCRIPT PORT magic id: %s\n", item->magic_id());
+ item->update_color = dlsym(item->handle, "script_update_color");
+ if (!item->update_color)
+ goto errout;
+
item->update_text = dlsym(item->handle, "script_update_text");
if (!item->update_text)
goto errout;