summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJiwoong Im <jiwoong.im@samsung.com>2016-03-28 19:06:57 +0900
committerJiwoong Im <jiwoong.im@samsung.com>2016-04-04 19:36:04 -0700
commitc03ad4957f334b9e42b4fab1e2fc42e12e078451 (patch)
tree5b00f0ce7c45b244e5fa44a2be2503e6a83bab6f /src
parent982f58616e9d466a76d13fe23bdbc97c512d8893 (diff)
downloadui-gadget-1-c03ad4957f334b9e42b4fab1e2fc42e12e078451.tar.gz
ui-gadget-1-c03ad4957f334b9e42b4fab1e2fc42e12e078451.tar.bz2
ui-gadget-1-c03ad4957f334b9e42b4fab1e2fc42e12e078451.zip
add missing internal api from tizen 2.4
- int ugman_resume_ug() int ugman_pause_ug() int ugman_create_cb() Change-Id: I76f13d7f6567e50b46ad159f0f5c8603f4e46e77 Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/manager.c74
-rw-r--r--src/ug.c34
2 files changed, 108 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c
index 409082d..0f19b4a 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -44,6 +44,12 @@
#define ugman_idler_add(func, data) \
ecore_job_add((Ecore_Cb) func, (void *)data);
+#ifdef ENABLE_UG_CREATE_CB
+typedef void (*fn_ug_trace_cb)(char *ug, char *mem, char *parent, void *user_data);
+fn_ug_trace_cb g_create_cb;
+void *g_create_cb_user_data;
+#endif
+
struct ug_manager {
ui_gadget_h root;
ui_gadget_h fv_top;
@@ -605,6 +611,19 @@ static int ugman_ug_create(void *data)
ugman_tree_dump(ug_man.root);
+#ifdef ENABLE_UG_CREATE_CB
+ if (g_create_cb) {
+ ui_gadget_h parent = ug->parent;
+
+ _DBG("invoke trace create cb(%p)", g_create_cb);
+
+ g_create_cb((char *)ug->name, (char *)ug->module->addr,
+ parent ? (char *)parent->name : NULL,
+ g_create_cb_user_data);
+ }
+#endif
+
+
return 0;
}
@@ -909,6 +928,25 @@ int ugman_resume(void)
return 0;
}
+int ugman_resume_ug(ui_gadget_h ug)
+{
+ if (!ug_man.is_initted) {
+ _ERR("ugman_pause_ug failed: manager is not initialized");
+ return -1;
+ }
+
+ if (!ug_man.root || !ug) {
+ _WRN("ugman_pause_ug failed: no root");
+ return -1;
+ }
+
+ _DBG("ugman_resume_ug called");
+
+ ugman_idler_add((Idle_Cb)ugman_ug_resume, ug);
+
+ return 0;
+}
+
int ugman_pause(void)
{
/* PAUSE (Background) */
@@ -929,6 +967,25 @@ int ugman_pause(void)
return 0;
}
+int ugman_pause_ug(ui_gadget_h ug)
+{
+ if (!ug_man.is_initted) {
+ _ERR("ugman_pause_ug failed: manager is not initialized");
+ return -1;
+ }
+
+ if (!ug_man.root || !ug) {
+ _WRN("ugman_pause_ug failed: no root");
+ return -1;
+ }
+
+ _DBG("ugman_pause_ug called");
+
+ ugman_idler_add((Idle_Cb)ugman_ug_pause, ug);
+
+ return 0;
+}
+
static int ugman_send_event_pre(void *data)
{
job_start();
@@ -1097,3 +1154,20 @@ int ugman_ug_exist(ui_gadget_h ug)
{
return ugman_ug_find(ug_man.root, ug);
}
+
+#ifdef ENABLE_UG_CREATE_CB
+int ugman_create_cb(void (*create_cb)(char *, char *, char *, void *), void *user_data)
+{
+ if (create_cb == NULL) {
+ _DBG("disable trace create cb");
+ g_create_cb_user_data = NULL;
+ g_create_cb = NULL;
+ } else {
+ _DBG("enable trace create cb(%p)", create_cb);
+ g_create_cb_user_data = user_data;
+ g_create_cb = create_cb;
+ }
+
+ return 0;
+}
+#endif
diff --git a/src/ug.c b/src/ug.c
index 0ae3416..2090c58 100644
--- a/src/ug.c
+++ b/src/ug.c
@@ -140,11 +140,33 @@ UG_API int ug_pause(void)
return ugman_pause();
}
+UG_API int ug_pause_ug(ui_gadget_h ug)
+{
+ if (!ug || !ugman_ug_exist(ug)) {
+ _ERR("ug_pause_ug() failed: Invalid ug");
+ errno = EINVAL;
+ return -1;
+ }
+
+ return ugman_pause_ug(ug);
+}
+
UG_API int ug_resume(void)
{
return ugman_resume();
}
+UG_API int ug_resume_ug(ui_gadget_h ug)
+{
+ if (!ug || !ugman_ug_exist(ug)) {
+ _ERR("ug_resume_ug() failed: Invalid ug");
+ errno = EINVAL;
+ return -1;
+ }
+
+ return ugman_resume_ug(ug);
+}
+
UG_API int ug_destroy(ui_gadget_h ug)
{
return ugman_ug_del(ug);
@@ -354,3 +376,15 @@ UG_API int ug_is_installed(const char *name)
return ug_exist(name);
}
+#ifdef ENABLE_UG_CREATE_CB
+UG_API int ug_create_cb(void (*create_cb)(char *, char *, char *, void *), void *user_data)
+{
+ int ret;
+
+ ret = ugman_create_cb(create_cb, user_data);
+ if (ret == -1)
+ _ERR("trace cb register fail");
+
+ return ret;
+}
+#endif