From 51349443f5d707609532b2a148699b46e1c2a2bd Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Mon, 12 Nov 2012 17:10:35 +0900 Subject: [PATCH] Replace the livebox_ prefix with lb_ to prevent conflicting of API Hide external hidden API Change-Id: Ifb0b9859038acbf337ff85ad3a394e359d3687e8 --- CMakeLists.txt | 3 +- include/client.h | 1 - include/conf.h | 2 + include/lb.h | 34 +++++++++++++++++ include/livebox.h | 30 --------------- include/so_handler.h | 9 ----- packaging/com.samsung.data-provider-slave.spec | 3 +- src/client.c | 48 +++++++++++------------ src/conf.c | 4 +- src/critical_log.c | 6 +-- src/fault.c | 8 ++-- src/{livebox.c => lb.c} | 53 ++++++++++++++------------ src/main.c | 7 ++-- src/so_handler.c | 39 ++++++++----------- src/update_monitor.c | 12 +++--- src/util.c | 10 ++--- 16 files changed, 132 insertions(+), 137 deletions(-) create mode 100644 include/lb.h delete mode 100644 include/livebox.h rename src/{livebox.c => lb.c} (94%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0497bd..70f12a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ pkg_check_modules(pkg REQUIRED livebox-service edje evas + livebox ) SET(PACKAGE "${PROJECT_NAME}") @@ -58,7 +59,7 @@ ADD_EXECUTABLE(${PROJECT_NAME} src/update_monitor.c src/conf.c src/util.c - src/livebox.c + src/lb.c src/client.c src/critical_log.c ) diff --git a/include/client.h b/include/client.h index edda374..640bf9d 100644 --- a/include/client.h +++ b/include/client.h @@ -1,5 +1,4 @@ extern int client_init(const char *name); -extern int client_fd(void); extern int client_fini(void); /* End of a file */ diff --git a/include/conf.h b/include/conf.h index 8fe0505..be287be 100644 --- a/include/conf.h +++ b/include/conf.h @@ -76,4 +76,6 @@ extern int conf_init(void); #define MAX_LOG_FILE 3 //#define DLAPI __attribute__((visibility("default"))) +#define HAPI __attribute__((visibility("hidden"))) + /* End of a file */ diff --git a/include/lb.h b/include/lb.h new file mode 100644 index 0000000..3c24128 --- /dev/null +++ b/include/lb.h @@ -0,0 +1,34 @@ +extern int lb_init(void); +extern int lb_fini(void); + +extern int lb_create(const char *pkgname, const char *id, const char *content_info, int timeout, int has_livebox_script, double period, const char *cluster, const char *category, int *w, int *h, double *priority, int skip_need_to_create, const char *abi, char **out_content, char **out_title); +extern int lb_destroy(const char *pkgname, const char *id); + +extern int lb_resize(const char *pkgname, const char *id, int w, int h); +extern int lb_clicked(const char *pkgname, const char *id, const char *event, double timestamp, double x, double y); + +extern int lb_script_event(const char *pkgname, const char *id, const char *emission, const char *source, struct event_info *event_info); +extern int lb_change_group(const char *pkgname, const char *id, const char *cluster, const char *category); + +extern int lb_update_all(const char *pkgname, const char *cluster, const char *category); +extern void lb_pause_all(void); +extern void lb_resume_all(void); +extern int lb_set_period(const char *pkgname, const char *id, double period); +extern char *lb_pinup(const char *pkgname, const char *id, int pinup); +extern int lb_system_event(const char *pkgname, const char *id, int event); +extern int lb_system_event_all(int event); + +extern int lb_open_pd(const char *pkgname); +extern int lb_close_pd(const char *pkgname); + +extern int lb_pause(const char *pkgname, const char *id); +extern int lb_resume(const char *pkgname, const char *id); + +extern int lb_is_pinned_up(const char *pkgname, const char *id); + +/*! + * Exported API for each liveboxes + */ +extern const char *livebox_find_pkgname(const char *filename); + +/* End of a file */ diff --git a/include/livebox.h b/include/livebox.h deleted file mode 100644 index 8b1fb2b..0000000 --- a/include/livebox.h +++ /dev/null @@ -1,30 +0,0 @@ -extern int livebox_init(void); -extern int livebox_fini(void); - -extern int livebox_create(const char *pkgname, const char *id, const char *content_info, int timeout, int has_livebox_script, double period, const char *cluster, const char *category, int *w, int *h, double *priority, int skip_need_to_create, const char *abi, char **out_content, char **out_title); -extern int livebox_destroy(const char *pkgname, const char *id); - -extern int livebox_resize(const char *pkgname, const char *id, int w, int h); -extern int livebox_clicked(const char *pkgname, const char *id, const char *event, double timestamp, double x, double y); - -extern int livebox_script_event(const char *pkgname, const char *id, const char *emission, const char *source, struct event_info *event_info); -extern int livebox_change_group(const char *pkgname, const char *id, const char *cluster, const char *category); - -extern int livebox_update_all(const char *pkgname, const char *cluster, const char *category); -extern void livebox_pause_all(void); -extern void livebox_resume_all(void); -extern int livebox_set_period(const char *pkgname, const char *id, double period); -extern char *livebox_pinup(const char *pkgname, const char *id, int pinup); -extern int livebox_system_event(const char *pkgname, const char *id, int event); -extern int livebox_system_event_all(int event); - -extern int livebox_open_pd(const char *pkgname); -extern int livebox_close_pd(const char *pkgname); - -extern int livebox_pause(const char *pkgname, const char *id); -extern int livebox_resume(const char *pkgname, const char *id); - -extern int livebox_is_pinned_up(const char *pkgname, const char *id); - -extern const char *livebox_find_pkgname(const char *filename); -/* End of a file */ diff --git a/include/so_handler.h b/include/so_handler.h index 1ea2468..e08db70 100644 --- a/include/so_handler.h +++ b/include/so_handler.h @@ -32,15 +32,6 @@ typedef char *(*adaptor_pinup_t)(const char *pkgname, const char *filename, int typedef int (*adaptor_is_pinned_up_t)(const char *pkgname, const char *filename); typedef int (*adaptor_system_event_t)(const char *pkgname, const char *filename, int type); -extern const int DONE; -extern const int NEED_TO_SCHEDULE; -extern const int OUTPUT_UPDATED; -extern const int NEED_TO_CREATE; -extern const int NEED_TO_DESTROY; - -extern const int LB_SYS_EVENT_FONT_CHANGED; -extern const int LB_SYS_EVENT_LANG_CHANGED; - struct instance { struct so_item *item; char *id; diff --git a/packaging/com.samsung.data-provider-slave.spec b/packaging/com.samsung.data-provider-slave.spec index e97b781..1670d4f 100644 --- a/packaging/com.samsung.data-provider-slave.spec +++ b/packaging/com.samsung.data-provider-slave.spec @@ -1,6 +1,6 @@ Name: com.samsung.data-provider-slave Summary: Slave data provider -Version: 0.7.3 +Version: 0.7.5 Release: 1 Group: main/app License: Samsung Proprietary License @@ -26,6 +26,7 @@ BuildRequires: pkgconfig(capi-appfw-app-manager) BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(edje) BuildRequires: pkgconfig(evas) +BuildRequires: pkgconfig(livebox) %description Loading livebox and managing their life-cycle to generate contents properly. diff --git a/src/client.c b/src/client.c index 35858ed..e055925 100644 --- a/src/client.c +++ b/src/client.c @@ -18,7 +18,7 @@ #include "debug.h" #include "client.h" #include "so_handler.h" -#include "livebox.h" +#include "lb.h" #include "util.h" static struct info { @@ -41,7 +41,7 @@ static int method_new(struct event_arg *arg, int *width, int *height, double *pr arg->info.lb_create.skip_need_to_create, arg->info.lb_create.abi); - ret = livebox_create(arg->pkgname, arg->id, + ret = lb_create(arg->pkgname, arg->id, arg->info.lb_create.content, arg->info.lb_create.timeout, arg->info.lb_create.has_script, @@ -58,12 +58,12 @@ static int method_new(struct event_arg *arg, int *width, int *height, double *pr if (arg->info.lb_create.width > 0 && arg->info.lb_create.height > 0) { if (*width != arg->info.lb_create.width || *height != arg->info.lb_create.height) { int tmp; - tmp = livebox_resize(arg->pkgname, arg->id, arg->info.lb_create.width, arg->info.lb_create.height); + tmp = lb_resize(arg->pkgname, arg->id, arg->info.lb_create.width, arg->info.lb_create.height); DbgPrint("Resize[%dx%d] returns: %d\n", arg->info.lb_create.width, arg->info.lb_create.height, tmp); } } - arg->info.lb_create.out_is_pinned_up = (livebox_is_pinned_up(arg->pkgname, arg->id) == 1); + arg->info.lb_create.out_is_pinned_up = (lb_is_pinned_up(arg->pkgname, arg->id) == 1); } return ret; @@ -86,7 +86,7 @@ static int method_renew(struct event_arg *arg, void *data) arg->info.lb_recreate.category, arg->info.lb_recreate.abi); - ret = livebox_create(arg->pkgname, arg->id, + ret = lb_create(arg->pkgname, arg->id, arg->info.lb_recreate.content, arg->info.lb_recreate.timeout, arg->info.lb_recreate.has_script, @@ -101,13 +101,13 @@ static int method_renew(struct event_arg *arg, void *data) if (ret == 0) { if (w != arg->info.lb_recreate.width || h != arg->info.lb_recreate.height) { int tmp; - tmp = livebox_resize(arg->pkgname, arg->id, arg->info.lb_recreate.width, arg->info.lb_recreate.height); + tmp = lb_resize(arg->pkgname, arg->id, arg->info.lb_recreate.width, arg->info.lb_recreate.height); DbgPrint("Resize[%dx%d] returns: %d\n", arg->info.lb_recreate.width, arg->info.lb_recreate.height, tmp); } else { DbgPrint("No need to change the size: %dx%d\n", w, h); } - arg->info.lb_recreate.out_is_pinned_up = (livebox_is_pinned_up(arg->pkgname, arg->id) == 1); + arg->info.lb_recreate.out_is_pinned_up = (lb_is_pinned_up(arg->pkgname, arg->id) == 1); } return ret; @@ -117,7 +117,7 @@ static int method_delete(struct event_arg *arg, void *data) { int ret; DbgPrint("pkgname[%s] id[%s]\n", arg->pkgname, arg->id); - ret = livebox_destroy(arg->pkgname, arg->id); + ret = lb_destroy(arg->pkgname, arg->id); return ret; } @@ -129,7 +129,7 @@ static int method_content_event(struct event_arg *arg, void *data) info = arg->info.content_event.info; DbgPrint("pkgname[%s] id[%s] emission[%s] source[%s]\n", arg->pkgname, arg->id, arg->info.content_event.emission, arg->info.content_event.source); - ret = livebox_script_event(arg->pkgname, arg->id, + ret = lb_script_event(arg->pkgname, arg->id, arg->info.content_event.emission, arg->info.content_event.source, &info); return ret; @@ -143,7 +143,7 @@ static int method_clicked(struct event_arg *arg, void *data) arg->pkgname, arg->id, arg->info.clicked.event, arg->info.clicked.timestamp, arg->info.clicked.x, arg->info.clicked.y); - ret = livebox_clicked(arg->pkgname, arg->id, + ret = lb_clicked(arg->pkgname, arg->id, arg->info.clicked.event, arg->info.clicked.timestamp, arg->info.clicked.x, arg->info.clicked.y); @@ -158,7 +158,7 @@ static int method_text_signal(struct event_arg *arg, void *data) info = arg->info.text_signal.info; DbgPrint("pkgname[%s] id[%s] emission[%s] source[%s]\n", arg->pkgname, arg->id, arg->info.text_signal.emission, arg->info.text_signal.source); - ret = livebox_script_event(arg->pkgname, arg->id, + ret = lb_script_event(arg->pkgname, arg->id, arg->info.text_signal.emission, arg->info.text_signal.source, &info); @@ -170,7 +170,7 @@ static int method_resize(struct event_arg *arg, void *data) int ret; DbgPrint("pkgname[%s] id[%s] w[%d] h[%d]\n", arg->pkgname, arg->id, arg->info.resize.w, arg->info.resize.h); - ret = livebox_resize(arg->pkgname, arg->id, arg->info.resize.w, arg->info.resize.h); + ret = lb_resize(arg->pkgname, arg->id, arg->info.resize.w, arg->info.resize.h); return ret; } @@ -179,7 +179,7 @@ static int method_set_period(struct event_arg *arg, void *data) { int ret; DbgPrint("pkgname[%s] id[%s] period[%lf]\n", arg->pkgname, arg->id, arg->info.set_period.period); - ret = livebox_set_period(arg->pkgname, arg->id, arg->info.set_period.period); + ret = lb_set_period(arg->pkgname, arg->id, arg->info.set_period.period); return ret; } @@ -187,14 +187,14 @@ static int method_change_group(struct event_arg *arg, void *data) { int ret; DbgPrint("pkgname[%s] id[%s] cluster[%s] category[%s]\n", arg->pkgname, arg->id, arg->info.change_group.cluster, arg->info.change_group.category); - ret = livebox_change_group(arg->pkgname, arg->id, arg->info.change_group.cluster, arg->info.change_group.category); + ret = lb_change_group(arg->pkgname, arg->id, arg->info.change_group.cluster, arg->info.change_group.category); return ret; } static int method_pinup(struct event_arg *arg, void *data) { DbgPrint("pkgname[%s] id[%s] state[%d]\n", arg->pkgname, arg->id, arg->info.pinup.state); - arg->info.pinup.content_info = livebox_pinup(arg->pkgname, arg->id, arg->info.pinup.state); + arg->info.pinup.content_info = lb_pinup(arg->pkgname, arg->id, arg->info.pinup.state); return arg->info.pinup.content_info ? 0 : -ENOTSUP; } @@ -202,13 +202,13 @@ static int method_update_content(struct event_arg *arg, void *data) { int ret; DbgPrint("pkgname[%s] cluster[%s] category[%s]\n", arg->pkgname, arg->info.update_content.cluster, arg->info.update_content.category); - ret = livebox_update_all(arg->pkgname, arg->info.update_content.cluster, arg->info.update_content.category); + ret = lb_update_all(arg->pkgname, arg->info.update_content.cluster, arg->info.update_content.category); return ret; } static int method_pause(struct event_arg *arg, void *data) { - livebox_pause_all(); + lb_pause_all(); if (s_info.ping_timer) ecore_timer_freeze(s_info.ping_timer); @@ -219,7 +219,7 @@ static int method_pause(struct event_arg *arg, void *data) static int method_resume(struct event_arg *arg, void *data) { - livebox_resume_all(); + lb_resume_all(); if (s_info.ping_timer) ecore_timer_thaw(s_info.ping_timer); return 0; @@ -259,7 +259,7 @@ static int method_pd_created(struct event_arg *arg, void *data) { int ret; - ret = livebox_open_pd(arg->pkgname); + ret = lb_open_pd(arg->pkgname); DbgPrint("%s Open PD: %d\n", arg->pkgname, ret); return 0; @@ -269,7 +269,7 @@ static int method_pd_destroyed(struct event_arg *arg, void *data) { int ret; - ret = livebox_close_pd(arg->pkgname); + ret = lb_close_pd(arg->pkgname); DbgPrint("%s Close PD: %d\n", arg->pkgname, ret); return 0; @@ -277,15 +277,15 @@ static int method_pd_destroyed(struct event_arg *arg, void *data) static int method_lb_pause(struct event_arg *arg, void *data) { - return livebox_pause(arg->pkgname, arg->id); + return lb_pause(arg->pkgname, arg->id); } static int method_lb_resume(struct event_arg *arg, void *data) { - return livebox_resume(arg->pkgname, arg->id); + return lb_resume(arg->pkgname, arg->id); } -int client_init(const char *name) +HAPI int client_init(const char *name) { struct event_handler table = { .lb_create = method_new, @@ -313,7 +313,7 @@ int client_init(const char *name) return 0; } -int client_fini(void) +HAPI int client_fini(void) { provider_fini(); return 0; diff --git a/src/conf.c b/src/conf.c index 226cbee..02d5c15 100644 --- a/src/conf.c +++ b/src/conf.c @@ -23,7 +23,7 @@ #include "conf.h" -struct conf g_conf = { +HAPI struct conf g_conf = { .width = 0, .height = 0, @@ -36,7 +36,7 @@ struct conf g_conf = { .ping_time = 120.0f, }; -int conf_init(void) +HAPI int conf_init(void) { ecore_x_window_size_get(0, &g_conf.width, &g_conf.height); return 0; diff --git a/src/critical_log.c b/src/critical_log.c index 80eccb4..84456dd 100644 --- a/src/critical_log.c +++ b/src/critical_log.c @@ -29,7 +29,7 @@ static struct { -int critical_log(const char *func, int line, const char *fmt, ...) +HAPI int critical_log(const char *func, int line, const char *fmt, ...) { va_list ap; int ret; @@ -74,7 +74,7 @@ int critical_log(const char *func, int line, const char *fmt, ...) -int critical_log_init(const char *name) +HAPI int critical_log_init(const char *name) { int namelen; char *filename; @@ -115,7 +115,7 @@ int critical_log_init(const char *name) -int critical_log_fini(void) +HAPI int critical_log_fini(void) { if (s_info.filename) { free(s_info.filename); diff --git a/src/fault.c b/src/fault.c index 2198d31..209ccce 100644 --- a/src/fault.c +++ b/src/fault.c @@ -88,7 +88,7 @@ static void signal_handler(int signum, siginfo_t *info, void *unused) return; } -int fault_init(void) +HAPI int fault_init(void) { struct sigaction act; @@ -123,7 +123,7 @@ int fault_init(void) return 0; } -int fault_fini(void) +HAPI int fault_fini(void) { /*! * \todo @@ -132,7 +132,7 @@ int fault_fini(void) return 0; } -int fault_mark_call(const char *pkgname, const char *filename, const char *funcname, int noalarm, int life_time) +HAPI int fault_mark_call(const char *pkgname, const char *filename, const char *funcname, int noalarm, int life_time) { provider_send_call(pkgname, filename, funcname); /*! @@ -152,7 +152,7 @@ int fault_mark_call(const char *pkgname, const char *filename, const char *funcn return 0; } -int fault_unmark_call(const char *pkgname, const char *filename, const char *funcname, int noalarm) +HAPI int fault_unmark_call(const char *pkgname, const char *filename, const char *funcname, int noalarm) { if (!noalarm) { /*! diff --git a/src/livebox.c b/src/lb.c similarity index 94% rename from src/livebox.c rename to src/lb.c index 8d80008..5e7c68a 100644 --- a/src/livebox.c +++ b/src/lb.c @@ -6,12 +6,13 @@ #include #include +#include #include "critical_log.h" #include "debug.h" #include "conf.h" #include "so_handler.h" -#include "livebox.h" +#include "lb.h" #include "update_monitor.h" #include "fault.h" #include "util.h" @@ -268,7 +269,7 @@ static Eina_Bool updator_cb(void *data) if (so_is_updated(item->inst) <= 0) { if (so_need_to_destroy(item->inst) == NEED_TO_DESTROY) { provider_send_deleted(item->inst->item->pkgname, item->inst->id); - livebox_destroy(item->inst->item->pkgname, item->inst->id); + lb_destroy(item->inst->item->pkgname, item->inst->id); return ECORE_CALLBACK_CANCEL; } @@ -383,12 +384,12 @@ static inline int update_monitor_add(struct item *item) return 0; } -int livebox_init(void) +HAPI int lb_init(void) { return 0; } -int livebox_fini(void) +HAPI int lb_fini(void) { Eina_List *l; Eina_List *n; @@ -396,7 +397,7 @@ int livebox_fini(void) EINA_LIST_FOREACH_SAFE(s_info.item_list, l, n, item) { provider_send_deleted(item->inst->item->pkgname, item->inst->id); - livebox_destroy(item->inst->item->pkgname, item->inst->id); + lb_destroy(item->inst->item->pkgname, item->inst->id); } if (s_info.pending_timer) { @@ -407,6 +408,10 @@ int livebox_fini(void) return 0; } +/*! + * \note + * Exported API for each liveboxes. + */ const char *livebox_find_pkgname(const char *filename) { Eina_List *l; @@ -420,7 +425,7 @@ const char *livebox_find_pkgname(const char *filename) return NULL; } -int livebox_open_pd(const char *pkgname) +HAPI int lb_open_pd(const char *pkgname) { Eina_List *l; char *tmp; @@ -440,7 +445,7 @@ int livebox_open_pd(const char *pkgname) return 0; } -int livebox_close_pd(const char *pkgname) +HAPI int lb_close_pd(const char *pkgname) { Eina_List *l; Eina_List *n; @@ -458,7 +463,7 @@ int livebox_close_pd(const char *pkgname) return -ENOENT; } -int livebox_create(const char *pkgname, const char *id, const char *content_info, int timeout, int has_livebox_script, double period, const char *cluster, const char *category, int *w, int *h, double *priority, int skip_need_to_create, const char *abi, char **out_content, char **out_title) +HAPI int lb_create(const char *pkgname, const char *id, const char *content_info, int timeout, int has_livebox_script, double period, const char *cluster, const char *category, int *w, int *h, double *priority, int skip_need_to_create, const char *abi, char **out_content, char **out_title) { struct instance *inst; struct item *item; @@ -579,7 +584,7 @@ int livebox_create(const char *pkgname, const char *id, const char *content_info return need_to_create; } -int livebox_destroy(const char *pkgname, const char *id) +HAPI int lb_destroy(const char *pkgname, const char *id) { Eina_List *l; struct instance *inst; @@ -623,7 +628,7 @@ int livebox_destroy(const char *pkgname, const char *id) return 0; } -int livebox_resize(const char *pkgname, const char *id, int w, int h) +HAPI int lb_resize(const char *pkgname, const char *id, int w, int h) { Eina_List *l; struct instance *inst; @@ -659,7 +664,7 @@ int livebox_resize(const char *pkgname, const char *id, int w, int h) return 0; } -char *livebox_pinup(const char *pkgname, const char *id, int pinup) +HAPI char *lb_pinup(const char *pkgname, const char *id, int pinup) { struct instance *inst; char *ret; @@ -674,7 +679,7 @@ char *livebox_pinup(const char *pkgname, const char *id, int pinup) return ret; } -int livebox_set_period(const char *pkgname, const char *id, double period) +HAPI int lb_set_period(const char *pkgname, const char *id, double period) { Eina_List *l; struct instance *inst; @@ -717,7 +722,7 @@ int livebox_set_period(const char *pkgname, const char *id, double period) return 0; } -int livebox_clicked(const char *pkgname, const char *id, const char *event, double timestamp, double x, double y) +HAPI int lb_clicked(const char *pkgname, const char *id, const char *event, double timestamp, double x, double y) { Eina_List *l; struct instance *inst; @@ -753,7 +758,7 @@ int livebox_clicked(const char *pkgname, const char *id, const char *event, doub return 0; } -int livebox_script_event(const char *pkgname, const char *id, const char *emission, const char *source, struct event_info *event_info) +HAPI int lb_script_event(const char *pkgname, const char *id, const char *emission, const char *source, struct event_info *event_info) { Eina_List *l; struct instance *inst; @@ -789,7 +794,7 @@ int livebox_script_event(const char *pkgname, const char *id, const char *emissi return 0; } -int livebox_is_pinned_up(const char *pkgname, const char *id) +HAPI int lb_is_pinned_up(const char *pkgname, const char *id) { Eina_List *l; struct instance *inst; @@ -818,7 +823,7 @@ int livebox_is_pinned_up(const char *pkgname, const char *id) return ret; } -int livebox_change_group(const char *pkgname, const char *id, const char *cluster, const char *category) +HAPI int lb_change_group(const char *pkgname, const char *id, const char *cluster, const char *category) { Eina_List *l; struct instance *inst; @@ -854,7 +859,7 @@ int livebox_change_group(const char *pkgname, const char *id, const char *cluste return 0; } -int livebox_system_event(const char *pkgname, const char *id, int event) +HAPI int lb_system_event(const char *pkgname, const char *id, int event) { Eina_List *l; struct instance *inst; @@ -889,7 +894,7 @@ int livebox_system_event(const char *pkgname, const char *id, int event) return 0; } -int livebox_update_all(const char *pkgname, const char *cluster, const char *category) +HAPI int lb_update_all(const char *pkgname, const char *cluster, const char *category) { Eina_List *l; Eina_List *n; @@ -918,7 +923,7 @@ int livebox_update_all(const char *pkgname, const char *cluster, const char *cat return 0; } -int livebox_system_event_all(int event) +HAPI int lb_system_event_all(int event) { Eina_List *l; Eina_List *n; @@ -929,13 +934,13 @@ int livebox_system_event_all(int event) continue; DbgPrint("System event for %s (%d)\n", item->inst->id, event); - livebox_system_event(item->inst->item->pkgname, item->inst->id, event); + lb_system_event(item->inst->item->pkgname, item->inst->id, event); } return 0; } -void livebox_pause_all(void) +HAPI void lb_pause_all(void) { Eina_List *l; struct item *item; @@ -962,7 +967,7 @@ void livebox_pause_all(void) } } -void livebox_resume_all(void) +HAPI void lb_resume_all(void) { Eina_List *l; struct item *item; @@ -990,7 +995,7 @@ void livebox_resume_all(void) } } -int livebox_pause(const char *pkgname, const char *id) +HAPI int lb_pause(const char *pkgname, const char *id) { struct instance *inst; Eina_List *l; @@ -1018,7 +1023,7 @@ int livebox_pause(const char *pkgname, const char *id) return 0; } -int livebox_resume(const char *pkgname, const char *id) +HAPI int lb_resume(const char *pkgname, const char *id) { struct instance *inst; Eina_List *l; diff --git a/src/main.c b/src/main.c index d7e4b08..7529ebd 100644 --- a/src/main.c +++ b/src/main.c @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -29,7 +30,7 @@ #include "client.h" #include "util.h" #include "so_handler.h" -#include "livebox.h" +#include "lb.h" /*! * \NOTE @@ -99,7 +100,7 @@ static Eina_Bool property_cb(void *data, int type, void *event) * \NOTE * Try to update all liveboxes */ - livebox_system_event_all(LB_SYS_EVENT_FONT_CHANGED); + lb_system_event_all(LB_SYS_EVENT_FONT_CHANGED); } return ECORE_CALLBACK_PASS_ON; @@ -175,7 +176,7 @@ static void app_resume(void *data) static void app_language_changed(void *data) { - livebox_system_event_all(LB_SYS_EVENT_LANG_CHANGED); + lb_system_event_all(LB_SYS_EVENT_LANG_CHANGED); } static void app_service(service_h service, void *data) diff --git a/src/so_handler.c b/src/so_handler.c index 682ed81..3f6c4be 100644 --- a/src/so_handler.c +++ b/src/so_handler.c @@ -19,15 +19,6 @@ int errno; -const int LB_SYS_EVENT_FONT_CHANGED = 0x01; -const int LB_SYS_EVENT_LANG_CHANGED = 0x02; - -const int DONE = 0x00; -const int NEED_TO_SCHEDULE = 0x01; -const int OUTPUT_UPDATED = 0x02; -const int NEED_TO_CREATE = 0x01; -const int NEED_TO_DESTROY = 0x01; - static struct info { Eina_List *livebox_list; } s_info = { @@ -476,7 +467,7 @@ static inline struct instance *find_instance(struct so_item *item, const char *i return NULL; } -struct instance *so_find_instance(const char *pkgname, const char *id) +HAPI struct instance *so_find_instance(const char *pkgname, const char *id) { struct so_item *item; @@ -487,7 +478,7 @@ struct instance *so_find_instance(const char *pkgname, const char *id) return find_instance(item, id); } -int so_create(const char *pkgname, const char *id, const char *content_info, int timeout, int has_livebox_script, const char *cluster, const char *category, const char *abi, struct instance **out) +HAPI int so_create(const char *pkgname, const char *id, const char *content_info, int timeout, int has_livebox_script, const char *cluster, const char *category, const char *abi, struct instance **out) { struct so_item *item; struct instance *inst; @@ -549,7 +540,7 @@ int so_create(const char *pkgname, const char *id, const char *content_info, int return ret; } -int so_destroy(struct instance *inst) +HAPI int so_destroy(struct instance *inst) { struct so_item *item; int ret; @@ -580,7 +571,7 @@ int so_destroy(struct instance *inst) return ret; } -char *so_pinup(struct instance *inst, int pinup) +HAPI char *so_pinup(struct instance *inst, int pinup) { struct so_item *item; char *ret; @@ -600,7 +591,7 @@ char *so_pinup(struct instance *inst, int pinup) return ret; } -int so_is_pinned_up(struct instance *inst) +HAPI int so_is_pinned_up(struct instance *inst) { struct so_item *item; int ret; @@ -620,7 +611,7 @@ int so_is_pinned_up(struct instance *inst) return ret; } -int so_is_updated(struct instance *inst) +HAPI int so_is_updated(struct instance *inst) { struct so_item *item; int ret; @@ -643,7 +634,7 @@ int so_is_updated(struct instance *inst) return ret; } -int so_need_to_destroy(struct instance *inst) +HAPI int so_need_to_destroy(struct instance *inst) { struct so_item *item; int ret; @@ -666,7 +657,7 @@ int so_need_to_destroy(struct instance *inst) return ret; } -int so_update(struct instance *inst) +HAPI int so_update(struct instance *inst) { struct so_item *item; int ret; @@ -690,7 +681,7 @@ int so_update(struct instance *inst) return ret; } -int so_clicked(struct instance *inst, const char *event, double timestamp, double x, double y) +HAPI int so_clicked(struct instance *inst, const char *event, double timestamp, double x, double y) { struct so_item *item; int ret; @@ -713,7 +704,7 @@ int so_clicked(struct instance *inst, const char *event, double timestamp, doubl return ret; } -int so_script_event(struct instance *inst, const char *emission, const char *source, struct event_info *event_info) +HAPI int so_script_event(struct instance *inst, const char *emission, const char *source, struct event_info *event_info) { struct so_item *item; int ret; @@ -736,7 +727,7 @@ int so_script_event(struct instance *inst, const char *emission, const char *sou return ret; } -int so_resize(struct instance *inst, int w, int h) +HAPI int so_resize(struct instance *inst, int w, int h) { struct so_item *item; int ret; @@ -764,7 +755,7 @@ int so_resize(struct instance *inst, int w, int h) return ret; } -int so_create_needed(const char *pkgname, const char *cluster, const char *category, const char *abi) +HAPI int so_create_needed(const char *pkgname, const char *cluster, const char *category, const char *abi) { struct so_item *item; int ret; @@ -794,7 +785,7 @@ int so_create_needed(const char *pkgname, const char *cluster, const char *categ return ret; } -int so_change_group(struct instance *inst, const char *cluster, const char *category) +HAPI int so_change_group(struct instance *inst, const char *cluster, const char *category) { struct so_item *item; int ret; @@ -839,7 +830,7 @@ int so_change_group(struct instance *inst, const char *cluster, const char *cate return ret; } -int so_get_output_info(struct instance *inst, int *w, int *h, double *priority, char **content, char **title) +HAPI int so_get_output_info(struct instance *inst, int *w, int *h, double *priority, char **content, char **title) { struct so_item *item; int ret; @@ -886,7 +877,7 @@ int so_get_output_info(struct instance *inst, int *w, int *h, double *priority, return ret; } -int so_sys_event(struct instance *inst, int event) +HAPI int so_sys_event(struct instance *inst, int event) { struct so_item *item; int ret; diff --git a/src/update_monitor.c b/src/update_monitor.c index 348648f..fb4256e 100644 --- a/src/update_monitor.c +++ b/src/update_monitor.c @@ -156,7 +156,7 @@ static Eina_Bool monitor_cb(void *data, Ecore_Fd_Handler *handler) return ECORE_CALLBACK_RENEW; } -int update_monitor_init(void) +HAPI int update_monitor_init(void) { s_info.ifd = inotify_init(); if (s_info.ifd < 0) { @@ -196,7 +196,7 @@ int update_monitor_init(void) return 0; } -int update_monitor_fini(void) +HAPI int update_monitor_fini(void) { if (!s_info.handler) { ErrPrint("Invalid fd handler\n"); @@ -218,7 +218,7 @@ int update_monitor_fini(void) return 0; } -int update_monitor_add_update_cb(const char *filename, +HAPI int update_monitor_add_update_cb(const char *filename, int (*cb)(const char *filename, void *data, int over), void *data) { struct cb_item *item; @@ -242,7 +242,7 @@ int update_monitor_add_update_cb(const char *filename, return 0; } -int update_monitor_add_delete_cb(const char *filename, +HAPI int update_monitor_add_delete_cb(const char *filename, int (*cb)(const char *filename, void *data, int over), void *data) { struct cb_item *item; @@ -267,7 +267,7 @@ int update_monitor_add_delete_cb(const char *filename, return 0; } -void *update_monitor_del_update_cb(const char *filename, +HAPI void *update_monitor_del_update_cb(const char *filename, int (*cb)(const char *filename, void *data, int over)) { Eina_List *l; @@ -287,7 +287,7 @@ void *update_monitor_del_update_cb(const char *filename, return NULL; } -void *update_monitor_del_delete_cb(const char *filename, +HAPI void *update_monitor_del_delete_cb(const char *filename, int (*cb)(const char *filename, void *data, int over)) { Eina_List *l; diff --git a/src/util.c b/src/util.c index be7584c..1696161 100644 --- a/src/util.c +++ b/src/util.c @@ -35,7 +35,7 @@ #include "conf.h" #include "debug.h" -int util_check_ext(const char *icon, const char *ext) +HAPI int util_check_ext(const char *icon, const char *ext) { int len; @@ -48,7 +48,7 @@ int util_check_ext(const char *icon, const char *ext) return *ext ? 0 : 1; } -double util_get_timestamp(void) +HAPI double util_get_timestamp(void) { struct timeval tv; @@ -57,7 +57,7 @@ double util_get_timestamp(void) return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f; } -const char *util_basename(const char *name) +HAPI const char *util_basename(const char *name) { int length; @@ -75,7 +75,7 @@ const char *util_basename(const char *name) * Just trying to find the nearest module. * It could be wrong. */ -char *util_get_current_module(char **symbol) +HAPI char *util_get_current_module(char **symbol) { int *stack; Dl_info dinfo; @@ -122,7 +122,7 @@ char *util_get_current_module(char **symbol) return ret; } -const char *util_uri_to_path(const char *uri) +HAPI const char *util_uri_to_path(const char *uri) { int len; -- 2.7.4