}
}
-static void pre_destroy_cb(widget_pre_callback_e type, const char *pkgname, const char *id, void *data)
+static void pre_destroy_cb(const char *id, void *data)
{
vwin_info_t info = data;
return;
}
- widget_provider_del_pre_callback(WIDGET_PRE_DESTROY_CALLBACK, pre_destroy_cb, info);
+ widget_del_pre_callback(WIDGET_PRE_DESTROY_CALLBACK, pre_destroy_cb, info);
if (info->e) {
evas_event_callback_del(info->e, EVAS_CALLBACK_RENDER_POST, post_render_cb);
evas_event_callback_add(info->e, EVAS_CALLBACK_RENDER_POST, post_render_cb, info);
evas_event_callback_add(info->e, EVAS_CALLBACK_RENDER_PRE, pre_render_cb, info);
- widget_provider_add_pre_callback(WIDGET_PRE_DESTROY_CALLBACK, pre_destroy_cb, info);
+ widget_add_pre_callback(WIDGET_PRE_DESTROY_CALLBACK, pre_destroy_cb, info);
return info->e;
}
struct _app {
int (*send)(widget_buffer_h handle, int idx, int x, int y, int w, int h, int gbar);
+ int (*add_pre_callback)(widget_pre_callback_e type, widget_pre_callback_t cb, void *data);
+ int (*del_pre_callback)(widget_pre_callback_e type, widget_pre_callback_t cb, void *data);
} app;
- } updated;
+ } binder;
} s_info = {
.find_pkgname = NULL,
.request_update_by_id = NULL,
.trigger_update_monitor = NULL,
.update_extra_info = NULL,
.type = LOAD_TYPE_UNKNOWN, /* Not initialized */
+ .binder = {
+ .slave = {
+ .send = NULL,
+ },
+ .app = {
+ .send = NULL,
+ .add_pre_callback = NULL,
+ .del_pre_callback = NULL,
+ },
+ },
};
#define FUNC_PREFIX "widget_"
#define FUNC_WIDGET_REQUEST_UPDATE_BY_ID FUNC_PREFIX "request_update_by_id"
#define FUNC_WIDGET_TRIGGER_UPDATE_MONITOR FUNC_PREFIX "trigger_update_monitor"
#define FUNC_WIDGET_UPDATE_EXTRA_INFO FUNC_PREFIX "update_extra_info"
+#define FUNC_WIDGET_ADD_PRE_CALLBACK FUNC_PREFIX "provider_app_add_pre_callback"
+#define FUNC_WIDGET_DEL_PRE_CALLBACK FUNC_PREFIX "provider_app_del_pre_callback"
static inline void load_update_function(void)
{
/* Must to be checked the slave function first. */
- s_info.updated.slave.send = dlsym(RTLD_DEFAULT, FUNC_WIDGET_SEND_UPDATED);
- if (s_info.updated.slave.send) {
+ s_info.binder.slave.send = dlsym(RTLD_DEFAULT, FUNC_WIDGET_SEND_UPDATED);
+ if (s_info.binder.slave.send) {
s_info.type = LOAD_TYPE_SLAVE;
DbgPrint("Slave detected\n");
} else {
- s_info.updated.app.send = dlsym(RTLD_DEFAULT, FUNC_WIDGET_PROVIDER_APP_UPDATED);
- if (s_info.updated.app.send) {
+ s_info.binder.app.send = dlsym(RTLD_DEFAULT, FUNC_WIDGET_PROVIDER_APP_UPDATED);
+ if (s_info.binder.app.send) {
s_info.type = LOAD_TYPE_APP;
DbgPrint("App detected\n");
}
}
}
+int widget_add_pre_callback(widget_pre_callback_e type, widget_pre_callback_t cb, void *data)
+{
+ static int loaded = 0;
+ if (!loaded && !s_info.binder.app.add_pre_callback) {
+ s_info.binder.app.add_pre_callback = dlsym(RTLD_DEFAULT, FUNC_WIDGET_ADD_PRE_CALLBACK);
+ loaded = 1;
+ }
+
+ if (!s_info.binder.app.add_pre_callback) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
+ return s_info.binder.app.add_pre_callback(type, cb, data);
+}
+
+int widget_del_pre_callback(widget_pre_callback_e type, widget_pre_callback_t cb, void *data)
+{
+ static int loaded = 0;
+ if (!loaded && !s_info.binder.app.del_pre_callback) {
+ s_info.binder.app.del_pre_callback = dlsym(RTLD_DEFAULT, FUNC_WIDGET_DEL_PRE_CALLBACK);
+ loaded = 1;
+ }
+
+ if (!s_info.binder.app.del_pre_callback) {
+ return WIDGET_ERROR_NOT_SUPPORTED;
+ }
+
+ return s_info.binder.app.del_pre_callback(type, cb, data);
+}
+
static int send_updated(const char *pkgname, const char *id, widget_buffer_h handle, int idx, int x, int y, int w, int h, int gbar, const char *descfile)
{
int ret = WIDGET_ERROR_INVALID_PARAMETER;
}
if (s_info.type == LOAD_TYPE_APP) {
- ret = s_info.updated.app.send(handle, idx, x, y, w, h, gbar);
+ ret = s_info.binder.app.send(handle, idx, x, y, w, h, gbar);
} else if (s_info.type == LOAD_TYPE_SLAVE) {
/**
* pkgname, id are used for finding handle of direct connection.
*/
- ret = s_info.updated.slave.send(pkgname, id, handle, idx, x, y, w, h, gbar, descfile);
+ ret = s_info.binder.slave.send(pkgname, id, handle, idx, x, y, w, h, gbar, descfile);
} else {
widget_damage_region_s region = {
.x = x,