From ee7eb962259a3522e32103b2c6a91b415f53d4c3 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Sat, 4 Jan 2014 17:17:27 +0900 Subject: [PATCH] Separate the EFL plugin from the master process. Only the EFL should be loaded by liblivebox-edje when it is required. Change-Id: I35bce038a77d8d9b5d350071858c4b5c8e9dc765 --- CMakeLists.txt | 1 - include/buffer_handler.h | 161 ++++++++++++++- include/conf.h | 3 + include/fb.h | 39 ---- include/instance.h | 2 +- include/script_handler.h | 7 +- packaging/data-provider-master.spec | 2 +- src/buffer_handler.c | 281 +++++++++++++------------ src/fb.c | 299 --------------------------- src/instance.c | 22 +- src/main.c | 22 -- src/script_handler.c | 400 +++++++++++++----------------------- src/server.c | 355 +------------------------------- 13 files changed, 478 insertions(+), 1116 deletions(-) delete mode 100644 include/fb.h delete mode 100644 src/fb.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 23a424d..63bc22c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,6 @@ ADD_EXECUTABLE(${PROJECT_NAME} src/conf.c src/dead_monitor.c src/group.c - src/fb.c src/script_handler.c src/buffer_handler.c src/io.c diff --git a/include/buffer_handler.h b/include/buffer_handler.h index 368f8e6..e3aa982 100644 --- a/include/buffer_handler.h +++ b/include/buffer_handler.h @@ -18,7 +18,7 @@ struct buffer_info; struct inst_info; struct buffer; -enum buffer_type { /*!< Must have to be sync with libprovider, liblivebox-viewer */ +enum buffer_type { /*!< Must have to be sync with libprovider, liblivebox-viewer, liblivebox-edje */ BUFFER_TYPE_FILE, BUFFER_TYPE_SHM, BUFFER_TYPE_PIXMAP, @@ -146,30 +146,187 @@ extern int buffer_handler_init(void); /*! * \brief + * \details + * \remarks * \return int + * \retval + * \pre + * \post + * \sa */ extern int buffer_handler_fini(void); +/*! + * \brief + * \details + * \remarks + * \param[in] info + * \return void * + * \retval NULL + * \retval address + * \pre + * \post + * \sa + */ extern void *buffer_handler_pixmap_ref(struct buffer_info *info); +/*! + * \brief + * \details + * \remarks + * \param[in] buffer_ptr + * \return int + * \retval + * \pre + * \post + * \sa + */ extern int buffer_handler_pixmap_unref(void *buffer_ptr); +/*! + * \brief + * \details + * \remarks + * \param[in] pixmap + * \return void * + * \retval + * \pre + * \post + * \sa + */ extern void *buffer_handler_pixmap_find(int pixmap); +/*! + * \brief + * \details + * \remarks + * \param[in] info + * \return void * + * \retval + * \pre + * \post + * \sa + */ extern void *buffer_handler_pixmap_buffer(struct buffer_info *info); +/*! + * \brief + * \details + * \remarks + * \param[in] info + * \return struct inst_info * + * \retval + * \pre + * \post + * \sa + */ extern struct inst_info *buffer_handler_instance(struct buffer_info *info); -extern struct buffer *buffer_handler_raw_open(enum buffer_type, void *resource); +/*! + * \brief + * \details + * \remarks + * \param[in] type + * \param[in] resource + * \return struct buffer * + * \retval NULL + * \retval address + * \pre + * \post + * \sa + */ +extern struct buffer *buffer_handler_raw_open(enum buffer_type type, void *resource); +/*! + * \brief + * \details + * \remarks + * \param[in] buffer + * \return int + * \retval + * \pre + * \post + * \sa + */ extern int buffer_handler_raw_close(struct buffer *buffer); +/*! + * \brief + * \details + * \remarks + * \param[in] buffer + * \return void * + * \retval NULL + * \pre + * \post + * \sa + */ extern void *buffer_handler_raw_data(struct buffer *buffer); +/*! + * \brief + * \details + * \remarks + * \param[in] buffer + * \return int + * \retval + * \pre + * \post + * \sa + */ extern int buffer_handler_raw_size(struct buffer *buffer); +/*! + * \brief + * \details + * \remarks + * \param[in] buffer + * \return int + * \retval + * \pre + * \post + * \sa + */ extern int buffer_handler_lock(struct buffer_info *buffer); +/*! + * \brief + * \details + * \remarks + * \param[in] buffer + * \return int + * \retval + * \pre + * \post + * \sa + */ extern int buffer_handler_unlock(struct buffer_info *buffer); +/*! + * \brief + * \details + * \remarks + * \param[in] buffer + * \param[in] data + * \return int + * \retval + * \pre + * \post + * \sa + */ +extern int buffer_handler_set_data(struct buffer_info *buffer, void *data); + +/*! + * \brief + * \details + * \remarks + * \param[in] buffer + * \return void * + * \retval NULL + * \retval address + * \pre + * \post + * \sa + */ +extern void *buffer_handler_data(struct buffer_info *buffer); /* End of a file */ diff --git a/include/conf.h b/include/conf.h index 75b8d51..db1bdeb 100755 --- a/include/conf.h +++ b/include/conf.h @@ -192,5 +192,8 @@ extern void conf_init(void); #define USE_XMONITOR g_conf.use_xmonitor #define HAPI __attribute__((visibility("hidden"))) +/*! + * EAPI is defined from eina.h + */ /* End of a file */ diff --git a/include/fb.h b/include/fb.h deleted file mode 100644 index 0061bc6..0000000 --- a/include/fb.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -struct fb_info; -struct inst_info; -struct buffer_info; - -extern int fb_init(void); -extern int fb_fini(void); -extern struct fb_info *fb_create(struct inst_info *inst, int w, int h, enum buffer_type type); -extern int fb_destroy(struct fb_info *info); -extern Ecore_Evas * const fb_canvas(struct fb_info *info); -extern const char *fb_id(struct fb_info *info); -extern int fb_get_size(struct fb_info *info, int *w, int *h); -extern void fb_sync(struct fb_info *info); -extern int fb_create_buffer(struct fb_info *info); -extern int fb_destroy_buffer(struct fb_info *info); -extern int fb_resize(struct fb_info *info, int w, int h); - -/*! - * \note Only for the pixmap - */ -extern void *fb_pixmap_render_pre(struct fb_info *info); -extern int fb_pixmap_render_post(struct fb_info *info); -extern struct buffer_info *fb_buffer_info(struct fb_info *info); -/* End of a file */ diff --git a/include/instance.h b/include/instance.h index 47ae61e..a523c7f 100644 --- a/include/instance.h +++ b/include/instance.h @@ -19,7 +19,7 @@ * An instance has three states. * ACTIVATED, DEACTIVATED, DESTROYED * - * When the master is launched and someone requiers to create this instance, + * When the master is launched and someone requires to create this instance, * The master just allocate a heap for new instance. * We defined this as "DEACTIVATED" state. * diff --git a/include/script_handler.h b/include/script_handler.h index 66b5c6b..5e84f2b 100644 --- a/include/script_handler.h +++ b/include/script_handler.h @@ -19,8 +19,6 @@ struct fb_info; extern struct script_info *script_handler_create(struct inst_info *inst, const char *file, const char *group, int w, int h); extern int script_handler_destroy(struct script_info *info); -extern struct fb_info *script_handler_fb(struct script_info *info); -extern void *script_handler_evas(struct script_info *info); extern int script_handler_parse_desc(struct inst_info *inst, const char *descfile, int is_pd); extern int script_handler_unload(struct script_info *info, int is_pd); extern int script_handler_load(struct script_info *info, int is_pd); @@ -30,9 +28,12 @@ extern int script_handler_feed_event(struct script_info *info, int event, double extern int script_init(void); extern int script_fini(void); -extern int script_signal_emit(Evas *e, const char *part, const char *signal, double sx, double sy, double ex, double ey); +extern int script_signal_emit(void *buffer_handle, const char *part, const char *signal, double sx, double sy, double ex, double ey); + extern int script_handler_update_pointer(struct script_info *inst, int x, int y, int down); extern int script_handler_update_keycode(struct script_info *info, unsigned int keycode); extern int script_handler_resize(struct script_info *info, int w, int h); +extern const char *script_handler_buffer_id(struct script_info *info); +extern struct buffer_info *script_handler_buffer_info(struct script_info *info); /* End of a file */ diff --git a/packaging/data-provider-master.spec b/packaging/data-provider-master.spec index ff2bc6d..50999c7 100755 --- a/packaging/data-provider-master.spec +++ b/packaging/data-provider-master.spec @@ -1,6 +1,6 @@ Name: data-provider-master Summary: Master service provider for liveboxes -Version: 0.32.0 +Version: 0.33.0 Release: 1 Group: HomeTF/Livebox License: Flora diff --git a/src/buffer_handler.c b/src/buffer_handler.c index 7eeb9e6..f692841 100644 --- a/src/buffer_handler.c +++ b/src/buffer_handler.c @@ -98,6 +98,7 @@ struct buffer_info int is_loaded; struct inst_info *inst; + void *data; }; static struct { @@ -117,11 +118,11 @@ static struct { static int destroy_lock_file(struct buffer_info *info) { if (!info->inst) { - return -EINVAL; + return LB_STATUS_ERROR_INVALID; } if (!info->lock) { - return -EINVAL; + return LB_STATUS_ERROR_INVALID; } if (close(info->lock_fd) < 0) { @@ -135,7 +136,7 @@ static int destroy_lock_file(struct buffer_info *info) DbgFree(info->lock); info->lock = NULL; - return 0; + return LB_STATUS_SUCCESS; } static int create_lock_file(struct buffer_info *info) @@ -145,19 +146,19 @@ static int create_lock_file(struct buffer_info *info) char *file; if (!info->inst) { - return -EINVAL; + return LB_STATUS_ERROR_INVALID; } id = instance_id(info->inst); if (!id) { - return -EINVAL; + return LB_STATUS_ERROR_INVALID; } len = strlen(id); file = malloc(len + 20); if (!file) { ErrPrint("Heap: %s\n", strerror(errno)); - return -ENOMEM; + return LB_STATUS_ERROR_MEMORY; } snprintf(file, len + 20, "%s.%s.lck", util_uri_to_path(id), instance_pd_buffer(info->inst) == info ? "pd" : "lb"); @@ -165,11 +166,11 @@ static int create_lock_file(struct buffer_info *info) if (info->lock_fd < 0) { ErrPrint("open: %s\n", strerror(errno)); DbgFree(file); - return -EIO; + return LB_STATUS_ERROR_IO; } info->lock = file; - return 0; + return LB_STATUS_SUCCESS; } static int do_buffer_lock(struct buffer_info *buffer) @@ -178,7 +179,7 @@ static int do_buffer_lock(struct buffer_info *buffer) int ret; if (buffer->lock_fd < 0) { - return 0; + return LB_STATUS_SUCCESS; } flock.l_type = F_WRLCK; @@ -195,7 +196,7 @@ static int do_buffer_lock(struct buffer_info *buffer) } } while (ret == EINTR); - return 0; + return LB_STATUS_SUCCESS; } static int do_buffer_unlock(struct buffer_info *buffer) @@ -204,7 +205,7 @@ static int do_buffer_unlock(struct buffer_info *buffer) int ret; if (buffer->lock_fd < 0) { - return 0; + return LB_STATUS_SUCCESS; } flock.l_type = F_UNLCK; @@ -221,61 +222,7 @@ static int do_buffer_unlock(struct buffer_info *buffer) } } while (ret == EINTR); - return 0; -} - -HAPI struct buffer_info *buffer_handler_create(struct inst_info *inst, enum buffer_type type, int w, int h, int pixel_size) -{ - struct buffer_info *info; - - info = malloc(sizeof(*info)); - if (!info) { - ErrPrint("Heap: %s\n", strerror(errno)); - return NULL; - } - - switch (type) { - case BUFFER_TYPE_SHM: - info->id = strdup(SCHEMA_SHM "-1"); - if (!info->id) { - ErrPrint("Heap: %s\n", strerror(errno)); - DbgFree(info); - return NULL; - } - break; - case BUFFER_TYPE_FILE: - info->id = strdup(SCHEMA_FILE "/tmp/.live.undefined"); - if (!info->id) { - ErrPrint("Heap: %s\n", strerror(errno)); - DbgFree(info); - return NULL; - } - break; - case BUFFER_TYPE_PIXMAP: - info->id = strdup(SCHEMA_PIXMAP "0"); - if (!info->id) { - ErrPrint("Heap: %s\n", strerror(errno)); - DbgFree(info); - return NULL; - } - break; - default: - ErrPrint("Invalid type\n"); - DbgFree(info); - return NULL; - } - - info->lock = NULL; - info->lock_fd = -1; - info->w = w; - info->h = h; - info->pixel_size = pixel_size; - info->type = type; - info->is_loaded = 0; - info->inst = inst; - info->buffer = NULL; - - return info; + return LB_STATUS_SUCCESS; } static inline struct buffer *create_pixmap(struct buffer_info *info) @@ -712,7 +659,7 @@ static inline int load_pixmap_buffer(struct buffer_info *info) return LB_STATUS_SUCCESS; } -HAPI int buffer_handler_load(struct buffer_info *info) +EAPI int buffer_handler_load(struct buffer_info *info) { int ret; @@ -849,7 +796,7 @@ static inline int unload_pixmap_buffer(struct buffer_info *info) return LB_STATUS_SUCCESS; } -HAPI int buffer_handler_unload(struct buffer_info *info) +EAPI int buffer_handler_unload(struct buffer_info *info) { int ret; @@ -888,45 +835,17 @@ HAPI int buffer_handler_unload(struct buffer_info *info) return ret; } -HAPI int buffer_handler_destroy(struct buffer_info *info) -{ - Eina_List *l; - struct buffer *buffer; - - if (!info) { - DbgPrint("Buffer is not created yet. info is NIL\n"); - return LB_STATUS_SUCCESS; - } - - EINA_LIST_FOREACH(s_info.pixmap_list, l, buffer) { - if (buffer->info == info) { - buffer->info = NULL; - } - } - - buffer_handler_unload(info); - if (info->lock) { - if (unlink(info->lock) < 0) { - ErrPrint("Remove lock: %s (%s)\n", info->lock, strerror(errno)); - } - } - - DbgFree(info->id); - DbgFree(info); - return LB_STATUS_SUCCESS; -} - -HAPI const char *buffer_handler_id(const struct buffer_info *info) +EAPI const char *buffer_handler_id(const struct buffer_info *info) { return info ? info->id : ""; } -HAPI enum buffer_type buffer_handler_type(const struct buffer_info *info) +EAPI enum buffer_type buffer_handler_type(const struct buffer_info *info) { return info ? info->type : BUFFER_TYPE_ERROR; } -HAPI void *buffer_handler_fb(struct buffer_info *info) +EAPI void *buffer_handler_fb(struct buffer_info *info) { struct buffer *buffer; @@ -955,7 +874,7 @@ HAPI void *buffer_handler_fb(struct buffer_info *info) return buffer->data; } -HAPI int buffer_handler_pixmap(const struct buffer_info *info) +EAPI int buffer_handler_pixmap(const struct buffer_info *info) { struct buffer *buf; struct gem_data *gem; @@ -980,7 +899,7 @@ HAPI int buffer_handler_pixmap(const struct buffer_info *info) return gem->pixmap; } -HAPI void *buffer_handler_pixmap_acquire_buffer(struct buffer_info *info) +EAPI void *buffer_handler_pixmap_acquire_buffer(struct buffer_info *info) { struct buffer *buffer; @@ -997,7 +916,7 @@ HAPI void *buffer_handler_pixmap_acquire_buffer(struct buffer_info *info) return acquire_gem(buffer); } -HAPI void *buffer_handler_pixmap_buffer(struct buffer_info *info) +EAPI void *buffer_handler_pixmap_buffer(struct buffer_info *info) { struct buffer *buffer; struct gem_data *gem; @@ -1023,7 +942,7 @@ HAPI void *buffer_handler_pixmap_buffer(struct buffer_info *info) /*! * \return "buffer" object (Not the buffer_info) */ -HAPI void *buffer_handler_pixmap_ref(struct buffer_info *info) +EAPI void *buffer_handler_pixmap_ref(struct buffer_info *info) { struct buffer *buffer; @@ -1084,7 +1003,7 @@ HAPI void *buffer_handler_pixmap_ref(struct buffer_info *info) /*! * \return "buffer" */ -HAPI void *buffer_handler_pixmap_find(int pixmap) +EAPI void *buffer_handler_pixmap_find(int pixmap) { struct buffer *buffer; struct gem_data *gem; @@ -1111,7 +1030,7 @@ HAPI void *buffer_handler_pixmap_find(int pixmap) return NULL; } -HAPI int buffer_handler_pixmap_release_buffer(void *canvas) +EAPI int buffer_handler_pixmap_release_buffer(void *canvas) { struct buffer *buffer; struct gem_data *gem; @@ -1152,7 +1071,7 @@ HAPI int buffer_handler_pixmap_release_buffer(void *canvas) * \return Return NULL if the buffer is in still uses. * Return buffer_ptr if it needs to destroy */ -HAPI int buffer_handler_pixmap_unref(void *buffer_ptr) +EAPI int buffer_handler_pixmap_unref(void *buffer_ptr) { struct buffer *buffer = buffer_ptr; struct buffer_info *info; @@ -1181,12 +1100,12 @@ HAPI int buffer_handler_pixmap_unref(void *buffer_ptr) return LB_STATUS_SUCCESS; } -HAPI int buffer_handler_is_loaded(const struct buffer_info *info) +EAPI int buffer_handler_is_loaded(const struct buffer_info *info) { return info ? info->is_loaded : 0; } -HAPI void buffer_handler_update_size(struct buffer_info *info, int w, int h) +EAPI void buffer_handler_update_size(struct buffer_info *info, int w, int h) { if (!info) { return; @@ -1196,7 +1115,7 @@ HAPI void buffer_handler_update_size(struct buffer_info *info, int w, int h) info->h = h; } -HAPI int buffer_handler_resize(struct buffer_info *info, int w, int h) +EAPI int buffer_handler_resize(struct buffer_info *info, int w, int h) { int ret; @@ -1230,7 +1149,7 @@ HAPI int buffer_handler_resize(struct buffer_info *info, int w, int h) return LB_STATUS_SUCCESS; } -HAPI int buffer_handler_get_size(struct buffer_info *info, int *w, int *h) +EAPI int buffer_handler_get_size(struct buffer_info *info, int *w, int *h) { if (!info) { return LB_STATUS_ERROR_INVALID; @@ -1246,7 +1165,7 @@ HAPI int buffer_handler_get_size(struct buffer_info *info, int *w, int *h) return LB_STATUS_SUCCESS; } -HAPI struct inst_info *buffer_handler_instance(struct buffer_info *info) +EAPI struct inst_info *buffer_handler_instance(struct buffer_info *info) { return info->inst; } @@ -1364,7 +1283,7 @@ static inline int sync_for_pixmap(struct buffer *buffer) return LB_STATUS_SUCCESS; } -HAPI void buffer_handler_flush(struct buffer_info *info) +EAPI void buffer_handler_flush(struct buffer_info *info) { int fd; int size; @@ -1421,7 +1340,7 @@ HAPI void buffer_handler_flush(struct buffer_info *info) } } -HAPI int buffer_handler_init(void) +EAPI int buffer_handler_init(void) { int dri2Major, dri2Minor; char *driverName, *deviceName; @@ -1493,7 +1412,7 @@ HAPI int buffer_handler_init(void) return LB_STATUS_SUCCESS; } -HAPI int buffer_handler_fini(void) +EAPI int buffer_handler_fini(void) { if (s_info.fd >= 0) { if (close(s_info.fd) < 0) { @@ -1632,7 +1551,7 @@ static inline int raw_close_pixmap(struct buffer *buffer) return 0; } -HAPI void *buffer_handler_raw_data(struct buffer *buffer) +EAPI void *buffer_handler_raw_data(struct buffer *buffer) { if (!buffer || buffer->state != CREATED) { return NULL; @@ -1641,16 +1560,16 @@ HAPI void *buffer_handler_raw_data(struct buffer *buffer) return buffer->data; } -HAPI int buffer_handler_raw_size(struct buffer *buffer) +EAPI int buffer_handler_raw_size(struct buffer *buffer) { if (!buffer || buffer->state != CREATED) { - return -EINVAL; + return LB_STATUS_ERROR_INVALID; } return (int)buffer->info; } -HAPI struct buffer *buffer_handler_raw_open(enum buffer_type buffer_type, void *resource) +EAPI struct buffer *buffer_handler_raw_open(enum buffer_type buffer_type, void *resource) { struct buffer *handle; @@ -1672,7 +1591,7 @@ HAPI struct buffer *buffer_handler_raw_open(enum buffer_type buffer_type, void * return handle; } -HAPI int buffer_handler_raw_close(struct buffer *buffer) +EAPI int buffer_handler_raw_close(struct buffer *buffer) { int ret; @@ -1687,37 +1606,147 @@ HAPI int buffer_handler_raw_close(struct buffer *buffer) ret = raw_close_pixmap(buffer); break; default: - ret = -EINVAL; + ret = LB_STATUS_ERROR_INVALID; break; } return ret; } -HAPI int buffer_handler_lock(struct buffer_info *buffer) +EAPI int buffer_handler_lock(struct buffer_info *buffer) { if (buffer->type == BUFFER_TYPE_PIXMAP) { - return 0; + return LB_STATUS_SUCCESS; } if (buffer->type == BUFFER_TYPE_FILE) { - return 0; + return LB_STATUS_SUCCESS; } return do_buffer_lock(buffer); } -HAPI int buffer_handler_unlock(struct buffer_info *buffer) +EAPI int buffer_handler_unlock(struct buffer_info *buffer) { if (buffer->type == BUFFER_TYPE_PIXMAP) { - return 0; + return LB_STATUS_SUCCESS; } if (buffer->type == BUFFER_TYPE_FILE) { - return 0; + return LB_STATUS_SUCCESS; } return do_buffer_unlock(buffer); } +/*! + * \note + * Only can be used by master. + * Plugin cannot access the user data + */ + +HAPI int buffer_handler_set_data(struct buffer_info *buffer, void *data) +{ + if (!buffer) { + ErrPrint("Invalid handle\n"); + return LB_STATUS_ERROR_INVALID; + } + + buffer->data = data; + return LB_STATUS_SUCCESS; +} + +HAPI void *buffer_handler_data(struct buffer_info *buffer) +{ + if (!buffer) { + ErrPrint("Invalid handle\n"); + return NULL; + } + + return buffer->data; +} + +HAPI int buffer_handler_destroy(struct buffer_info *info) +{ + Eina_List *l; + struct buffer *buffer; + + if (!info) { + DbgPrint("Buffer is not created yet. info is NIL\n"); + return LB_STATUS_SUCCESS; + } + + EINA_LIST_FOREACH(s_info.pixmap_list, l, buffer) { + if (buffer->info == info) { + buffer->info = NULL; + } + } + + buffer_handler_unload(info); + if (info->lock) { + if (unlink(info->lock) < 0) { + ErrPrint("Remove lock: %s (%s)\n", info->lock, strerror(errno)); + } + } + + DbgFree(info->id); + DbgFree(info); + return LB_STATUS_SUCCESS; +} + +HAPI struct buffer_info *buffer_handler_create(struct inst_info *inst, enum buffer_type type, int w, int h, int pixel_size) +{ + struct buffer_info *info; + + info = malloc(sizeof(*info)); + if (!info) { + ErrPrint("Heap: %s\n", strerror(errno)); + return NULL; + } + + switch (type) { + case BUFFER_TYPE_SHM: + info->id = strdup(SCHEMA_SHM "-1"); + if (!info->id) { + ErrPrint("Heap: %s\n", strerror(errno)); + DbgFree(info); + return NULL; + } + break; + case BUFFER_TYPE_FILE: + info->id = strdup(SCHEMA_FILE "/tmp/.live.undefined"); + if (!info->id) { + ErrPrint("Heap: %s\n", strerror(errno)); + DbgFree(info); + return NULL; + } + break; + case BUFFER_TYPE_PIXMAP: + info->id = strdup(SCHEMA_PIXMAP "0"); + if (!info->id) { + ErrPrint("Heap: %s\n", strerror(errno)); + DbgFree(info); + return NULL; + } + break; + default: + ErrPrint("Invalid type\n"); + DbgFree(info); + return NULL; + } + + info->lock = NULL; + info->lock_fd = -1; + info->w = w; + info->h = h; + info->pixel_size = pixel_size; + info->type = type; + info->is_loaded = 0; + info->inst = inst; + info->buffer = NULL; + info->data = NULL; + + return info; +} + /* End of a file */ diff --git a/src/fb.c b/src/fb.c deleted file mode 100644 index ffd8b5c..0000000 --- a/src/fb.c +++ /dev/null @@ -1,299 +0,0 @@ -/* - * 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 -#include /* access */ -#include - -#include -#include -#include -#include - -#include "util.h" -#include "conf.h" -#include "debug.h" -#include "buffer_handler.h" -#include "fb.h" - -int errno; - -struct fb_info { - Ecore_Evas *ee; - - struct buffer_info *buffer; -}; - -HAPI int fb_init(void) -{ - return LB_STATUS_SUCCESS; -} - -HAPI int fb_fini(void) -{ - return LB_STATUS_SUCCESS; -} - -static void *alloc_fb(void *data, int size) -{ - struct fb_info *info = data; - - if (buffer_handler_load(info->buffer) < 0) { - ErrPrint("Failed to load buffer handler\n"); - return NULL; - } - - return buffer_handler_fb(info->buffer); -} - -static void free_fb(void *data, void *ptr) -{ - struct fb_info *info = data; - - if (!info->buffer) { - ErrPrint("Buffer is not valid (maybe already released)\n"); - return; - } - - if (buffer_handler_fb(info->buffer) != ptr) { - ErrPrint("Buffer pointer is not matched\n"); - } - - (void)buffer_handler_unload(info->buffer); -} - -HAPI struct fb_info *fb_create(struct inst_info *inst, int w, int h, enum buffer_type type) -{ - struct fb_info *info; - - info = calloc(1, sizeof(*info)); - if (!info) { - ErrPrint("Heap: %s\n", strerror(errno)); - return NULL; - } - - info->buffer = buffer_handler_create(inst, type, w, h, sizeof(int)); - if (!info->buffer) { - ErrPrint("Failed to create a buffer\n"); - DbgFree(info); - return NULL; - } - - info->ee = NULL; - return info; -} - -static void sw_render_pre_cb(void *data, Evas *e, void *event_info) -{ - struct fb_info *info = data; - - buffer_handler_lock(info->buffer); - - if (PREMULTIPLIED_COLOR) { - int w; - int h; - - buffer_handler_get_size(info->buffer, &w, &h); - evas_damage_rectangle_add(e, 0, 0, w, h); - } -} - -static void sw_render_post_cb(void *data, Evas *e, void *event_info) -{ - struct fb_info *info = data; - - if (PREMULTIPLIED_COLOR) { - void *canvas; - Ecore_Evas *internal_ee; - int x, y, w, h; - - internal_ee = ecore_evas_ecore_evas_get(e); - if (!internal_ee) { - ErrPrint("Failed to get ecore evas\n"); - return; - } - - // Get a pointer of a buffer of the virtual canvas - canvas = (void*)ecore_evas_buffer_pixels_get(internal_ee); - if (!canvas) { - ErrPrint("Failed to get pixel canvas\n"); - return; - } - - ecore_evas_geometry_get(internal_ee, &x, &y, &w, &h); - evas_data_argb_unpremul(canvas, w * h); - } - - buffer_handler_unlock(info->buffer); -} - -static void render_pre_cb(void *data, Evas *e, void *event_info) -{ - fb_pixmap_render_pre(data); - sw_render_pre_cb(data, e, event_info); -} - -static void render_post_cb(void *data, Evas *e, void *event_info) -{ - sw_render_post_cb(data, e, event_info); - fb_pixmap_render_post(data); -} - -HAPI int fb_create_buffer(struct fb_info *info) -{ - int ow; - int oh; - Evas *e; - - buffer_handler_get_size(info->buffer, &ow, &oh); - if (ow == 0 && oh == 0) { - DbgPrint("ZERO Size FB accessed\n"); - return LB_STATUS_SUCCESS; - } - - if (info->ee) { - int w = 0; - int h = 0; - - ecore_evas_geometry_get(info->ee, NULL, NULL, &w, &h); - if (w != ow || h != oh) { - ErrPrint("EE exists, size mismatched requested (%dx%d) but (%dx%d)\n", ow, oh, w, h); - ecore_evas_resize(info->ee, ow, oh); - } - - return LB_STATUS_SUCCESS; - } - - info->ee = ecore_evas_buffer_allocfunc_new(ow, oh, alloc_fb, free_fb, info); - if (!info->ee) { - ErrPrint("Failed to create a buffer\n"); - return LB_STATUS_ERROR_FAULT; - } - - e = ecore_evas_get(info->ee); - if (buffer_handler_type(info->buffer) == BUFFER_TYPE_PIXMAP) { - evas_event_callback_add(e, EVAS_CALLBACK_RENDER_PRE, render_pre_cb, info); - evas_event_callback_add(e, EVAS_CALLBACK_RENDER_POST, render_post_cb, info); - - /*! - * \note - * ecore_evas_alpha_set tries to access the canvas buffer. - * Without any render_pre/render_post callback. - */ - fb_pixmap_render_pre(info); - ecore_evas_alpha_set(info->ee, EINA_TRUE); - fb_pixmap_render_post(info); - } else { - evas_event_callback_add(e, EVAS_CALLBACK_RENDER_PRE, sw_render_pre_cb, info); - evas_event_callback_add(e, EVAS_CALLBACK_RENDER_POST, sw_render_post_cb, info); - ecore_evas_alpha_set(info->ee, EINA_TRUE); - } - - return LB_STATUS_SUCCESS; -} - -HAPI int fb_destroy_buffer(struct fb_info *info) -{ - if (!info->ee) { - ErrPrint("EE is not exists (Maybe ZERO byte ee?)\n"); - return LB_STATUS_ERROR_INVALID; - } - - Evas *e; - e = ecore_evas_get(info->ee); - if (e) { - if (buffer_handler_type(info->buffer) == BUFFER_TYPE_PIXMAP) { - evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, render_post_cb); - evas_event_callback_del(e, EVAS_CALLBACK_RENDER_PRE, render_pre_cb); - } else { - evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, sw_render_post_cb); - evas_event_callback_del(e, EVAS_CALLBACK_RENDER_PRE, sw_render_pre_cb); - } - } - - ecore_evas_free(info->ee); - info->ee = NULL; - return LB_STATUS_SUCCESS; -} - -HAPI int fb_destroy(struct fb_info *info) -{ - fb_destroy_buffer(info); - DbgFree(info); - return LB_STATUS_SUCCESS; -} - -HAPI Ecore_Evas * const fb_canvas(struct fb_info *info) -{ - return info->ee; -} - -HAPI const char *fb_id(struct fb_info *fb) -{ - return fb ? buffer_handler_id(fb->buffer) : ""; -} - -HAPI int fb_resize(struct fb_info *info, int w, int h) -{ - buffer_handler_update_size(info->buffer, w, h); - - if (info->ee) { - ecore_evas_resize(info->ee, w, h); - } else if (!info->ee && !info->buffer) { - /*! - * This object has no size at the initial time. - * Create a new buffer and use it - */ - } - - return LB_STATUS_SUCCESS; -} - -HAPI int fb_get_size(struct fb_info *info, int *w, int *h) -{ - return buffer_handler_get_size(info->buffer, w, h); -} - -HAPI void fb_sync(struct fb_info *info) -{ - buffer_handler_flush(info->buffer); -} - -HAPI void *fb_pixmap_render_pre(struct fb_info *info) -{ - void *canvas; - canvas = buffer_handler_pixmap_acquire_buffer(info->buffer); - return canvas; -} - -HAPI int fb_pixmap_render_post(struct fb_info *info) -{ - void *canvas; - - /*! - * \note - * info->buffer == struct buffer_info - */ - canvas = buffer_handler_pixmap_buffer(info->buffer); - return buffer_handler_pixmap_release_buffer(canvas); -} - -HAPI struct buffer_info *fb_buffer_info(struct fb_info *info) -{ - return info->buffer; -} - -/* End of a file */ diff --git a/src/instance.c b/src/instance.c index 7c3ff28..3a2f4ba 100644 --- a/src/instance.c +++ b/src/instance.c @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -40,7 +39,6 @@ #include "package.h" #include "script_handler.h" #include "buffer_handler.h" -#include "fb.h" #include "setting.h" int errno; @@ -319,7 +317,7 @@ static inline void instance_send_resized_event(struct inst_info *inst, int is_pd lb_type = package_lb_type(inst->info); if (lb_type == LB_TYPE_SCRIPT) { - id = fb_id(script_handler_fb(inst->lb.canvas.script)); + id = script_handler_buffer_id(inst->lb.canvas.script); } else if (lb_type == LB_TYPE_BUFFER) { id = buffer_handler_id(inst->lb.canvas.buffer); } else { @@ -380,7 +378,7 @@ HAPI int instance_unicast_created_event(struct inst_info *inst, struct client_no pd_type = package_pd_type(inst->info); if (lb_type == LB_TYPE_SCRIPT) { - lb_file = fb_id(script_handler_fb(inst->lb.canvas.script)); + lb_file = script_handler_buffer_id(inst->lb.canvas.script); } else if (lb_type == LB_TYPE_BUFFER) { lb_file = buffer_handler_id(inst->lb.canvas.buffer); } else { @@ -388,7 +386,7 @@ HAPI int instance_unicast_created_event(struct inst_info *inst, struct client_no } if (pd_type == PD_TYPE_SCRIPT) { - pd_file = fb_id(script_handler_fb(inst->pd.canvas.script)); + pd_file = script_handler_buffer_id(inst->pd.canvas.script); } else if (pd_type == PD_TYPE_BUFFER) { pd_file = buffer_handler_id(inst->pd.canvas.buffer); } else { @@ -441,7 +439,7 @@ static int instance_broadcast_created_event(struct inst_info *inst) pd_type = package_pd_type(inst->info); if (lb_type == LB_TYPE_SCRIPT) { - lb_file = fb_id(script_handler_fb(inst->lb.canvas.script)); + lb_file = script_handler_buffer_id(inst->lb.canvas.script); } else if (lb_type == LB_TYPE_BUFFER) { lb_file = buffer_handler_id(inst->lb.canvas.buffer); } else { @@ -449,7 +447,7 @@ static int instance_broadcast_created_event(struct inst_info *inst) } if (pd_type == PD_TYPE_SCRIPT) { - pd_file = fb_id(script_handler_fb(inst->pd.canvas.script)); + pd_file = script_handler_buffer_id(inst->pd.canvas.script); } else if (pd_type == PD_TYPE_BUFFER) { pd_file = buffer_handler_id(inst->pd.canvas.buffer); } else { @@ -1632,7 +1630,7 @@ HAPI int instance_lb_update_begin(struct inst_info *inst, double priority, const ErrPrint("Script is null [%s]\n", inst->id); return LB_STATUS_ERROR_INVALID; } - fbfile = fb_id(script_handler_fb(inst->lb.canvas.script)); + fbfile = script_handler_buffer_id(inst->lb.canvas.script); break; default: ErrPrint("Invalid request[%s]\n", inst->id); @@ -1707,7 +1705,7 @@ HAPI int instance_pd_update_begin(struct inst_info *inst) ErrPrint("Script is null [%s]\n", inst->id); return LB_STATUS_ERROR_INVALID; } - fbfile = fb_id(script_handler_fb(inst->pd.canvas.script)); + fbfile = script_handler_buffer_id(inst->pd.canvas.script); break; default: ErrPrint("Invalid request[%s]\n", inst->id); @@ -1779,7 +1777,7 @@ HAPI void instance_lb_updated_by_instance(struct inst_info *inst, const char *sa lb_type = package_lb_type(inst->info); if (lb_type == LB_TYPE_SCRIPT) { - id = fb_id(script_handler_fb(inst->lb.canvas.script)); + id = script_handler_buffer_id(inst->lb.canvas.script); } else if (lb_type == LB_TYPE_BUFFER) { id = buffer_handler_id(inst->lb.canvas.buffer); } else { @@ -1875,7 +1873,7 @@ HAPI void instance_pd_updated_by_instance(struct inst_info *inst, const char *de switch (package_pd_type(inst->info)) { case PD_TYPE_SCRIPT: - id = fb_id(script_handler_fb(inst->pd.canvas.script)); + id = script_handler_buffer_id(inst->pd.canvas.script); break; case PD_TYPE_BUFFER: id = buffer_handler_id(inst->pd.canvas.buffer); @@ -3104,7 +3102,7 @@ HAPI int instance_client_pd_created(struct inst_info *inst, int status) switch (package_pd_type(inst->info)) { case PD_TYPE_SCRIPT: - buf_id = fb_id(script_handler_fb(inst->pd.canvas.script)); + buf_id = script_handler_buffer_id(inst->pd.canvas.script); break; case PD_TYPE_BUFFER: buf_id = buffer_handler_id(inst->pd.canvas.buffer); diff --git a/src/main.c b/src/main.c index a6636f4..631f45c 100755 --- a/src/main.c +++ b/src/main.c @@ -25,8 +25,6 @@ #include #include -#include -#include #include #include #include @@ -353,23 +351,6 @@ int main(int argc, char *argv[]) ecore_app_args_set(argc, (const char **)argv); - if (evas_init() <= 0) { - CRITICAL_LOG("Failed to init evas return count is below than 0\n"); - ecore_x_shutdown(); - ecore_shutdown(); - critical_log_fini(); - return -EFAULT; - } - - if (ecore_evas_init() <= 0) { - CRITICAL_LOG("Failed to init ecore_evas\n"); - evas_shutdown(); - ecore_x_shutdown(); - ecore_shutdown(); - critical_log_fini(); - return -EFAULT; - } - #if (GLIB_MAJOR_VERSION <= 2 && GLIB_MINOR_VERSION < 36) g_type_init(); #endif @@ -392,9 +373,6 @@ int main(int argc, char *argv[]) app_terminate(); - evas_shutdown(); - ecore_evas_shutdown(); - ecore_x_shutdown(); if (signal_handler) { diff --git a/src/script_handler.c b/src/script_handler.c index 5b03dac..b571b89 100644 --- a/src/script_handler.c +++ b/src/script_handler.c @@ -27,9 +27,7 @@ #include #include -#include #include -#include #include #include @@ -43,7 +41,6 @@ #include "instance.h" #include "buffer_handler.h" #include "script_handler.h" -#include "fb.h" #include "debug.h" #include "conf.h" #include "util.h" @@ -90,25 +87,25 @@ 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, const char *option); - int (*update_access)(void *handle, Evas *e, const char *id, const char *part, const char *text, const char *option); - int (*operate_access)(void *handle, Evas *e, const char *id, const char *part, const char *operation, const char *option); - int (*update_script)(void *handle, Evas *e, const char *src_id, const char *target_id, const char *part, const char *path, const char *option); - int (*update_signal)(void *handle, Evas *e, const char *id, const char *part, const char *signal); - int (*update_drag)(void *handle, Evas *e, const char *id, const char *part, double x, double y); - int (*update_size)(void *handle, Evas *e, const char *id, int w, int h); - int (*update_category)(void *handle, Evas *e, const char *id, const char *category); - int (*feed_event)(void *handle, Evas *e, int event_type, int x, int y, int down, unsigned int keycode, double timestamp); - - void *(*create)(const char *file, const char *option); + int (*update_color)(void *handle, const char *id, const char *part, const char *rgba); + int (*update_text)(void *handle, const char *id, const char *part, const char *text); + int (*update_image)(void *handle, const char *id, const char *part, const char *path, const char *option); + int (*update_access)(void *handle, const char *id, const char *part, const char *text, const char *option); + int (*operate_access)(void *handle, const char *id, const char *part, const char *operation, const char *option); + int (*update_script)(void *handle, const char *src_id, const char *target_id, const char *part, const char *path, const char *option); + int (*update_signal)(void *handle, const char *id, const char *part, const char *signal); + int (*update_drag)(void *handle, const char *id, const char *part, double x, double y); + int (*update_size)(void *handle, const char *id, int w, int h); + int (*update_category)(void *handle, const char *id, const char *category); + int (*feed_event)(void *handle, int event_type, int x, int y, int down, unsigned int keycode, double timestamp); + + void *(*create)(void *buffer_info, const char *file, const char *option); int (*destroy)(void *handle); - int (*load)(void *handle, Evas *e, int w, int h); - int (*unload)(void *handle, Evas *e); + int (*load)(void *handle, int (*render_pre)(void *buffer_info, void *data), int (*render_post)(void *buffer_info, void *data), void *data); + int (*unload)(void *handle); - int (*init)(double scale); + int (*init)(double scale, int premultiplied); int (*fini)(void); }; @@ -150,9 +147,7 @@ struct block { }; struct script_info { - Ecore_Evas *ee; - struct fb_info *fb; - struct inst_info *inst; + struct buffer_info *buffer_handle; int loaded; int w; @@ -317,7 +312,7 @@ static int load_all_ports(void) goto errout; } - if (item->init(SCALE_WIDTH_FACTOR) < 0) { + if (item->init(SCALE_WIDTH_FACTOR, PREMULTIPLIED_COLOR) < 0) { ErrPrint("Failed to initialize script engine\n"); goto errout; } @@ -372,91 +367,76 @@ static inline void delete_block(struct block *block) DbgFree(block); } -static void render_pre_cb(void *data, Evas *e, void *event_info) +static int render_post_cb(void *_buffer_handle, void *data) { PERF_INIT(); PERF_BEGIN(); - struct inst_info *inst = data; + struct inst_info *inst; + struct buffer_info *buffer_handle = _buffer_handle; struct script_info *info; - if (instance_state(inst) != INST_ACTIVATED) { - ErrPrint("Render pre invoked but instance is not activated\n"); - goto out; - } - - info = instance_lb_script(inst); - if (info && script_handler_evas(info) == e) { - goto out; - } - - info = instance_pd_script(inst); - if (info && script_handler_evas(info) == e) { + inst = buffer_handler_instance(buffer_handle); + if (!inst) { goto out; } - ErrPrint("Failed to do sync\n"); -out: - PERF_MARK("render,pre"); - return; -} - -static void render_post_cb(void *data, Evas *e, void *event_info) -{ - PERF_INIT(); - PERF_BEGIN(); - struct inst_info *inst; - struct script_info *info; - - inst = data; - if (instance_state(inst) != INST_ACTIVATED) { ErrPrint("Render post invoked but instance is not activated\n"); PERF_MARK(__func__); - return; + return LB_STATUS_ERROR_INVALID; } info = instance_lb_script(inst); - if (info && script_handler_evas(info) == e) { - fb_sync(script_handler_fb(info)); + if (info && info == data) { + buffer_handler_flush(buffer_handle); instance_lb_updated_by_instance(inst, NULL); PERF_MARK("lb,update"); - return; + return LB_STATUS_SUCCESS; } info = instance_pd_script(inst); - if (info && script_handler_evas(info) == e) { - fb_sync(script_handler_fb(info)); + if (info && info == data) { + buffer_handler_flush(buffer_handle); instance_pd_updated_by_instance(inst, NULL); PERF_MARK("pd,update"); - return; + return LB_STATUS_SUCCESS; } +out: ErrPrint("Failed to sync\n"); PERF_MARK(__func__); - return; + return LB_STATUS_ERROR_FAULT; } /*! * \NOTE * Exported API */ -int script_signal_emit(Evas *e, const char *part, const char *signal, double sx, double sy, double ex, double ey) +EAPI int script_signal_emit(void *buffer_handle, const char *part, const char *signal, double sx, double sy, double ex, double ey) { - Ecore_Evas *ee; struct script_info *info; + struct inst_info *inst; + int w; + int h; + double fx; + double fy; - ee = ecore_evas_ecore_evas_get(e); - if (!ee) { - ErrPrint("Evas has no Ecore_Evas\n"); + if (!buffer_handle) { + ErrPrint("Invalid handle\n"); return LB_STATUS_ERROR_INVALID; } - info = ecore_evas_data_get(ee, "script,info"); + info = buffer_handler_data(buffer_handle); if (!info) { - ErrPrint("ecore_evas doesn't carry info data\n"); + ErrPrint("Invalid handle\n"); return LB_STATUS_ERROR_INVALID; } + inst = buffer_handler_instance(buffer_handle); + if (!inst) { + return LB_STATUS_ERROR_FAULT; + } + if (!signal || strlen(signal) == 0) { signal = ""; } @@ -465,22 +445,35 @@ int script_signal_emit(Evas *e, const char *part, const char *signal, double sx, part = ""; } - return instance_signal_emit(info->inst, signal, part, sx, sy, ex, ey, (double)info->x / (double)info->w, (double)info->y / (double)info->h, info->down); + buffer_handler_get_size(buffer_handle, &w, &h); + + fx = (double)info->x / (double)w; + fy = (double)info->y / (double)h; + + return instance_signal_emit(inst, signal, part, sx, sy, ex, ey, fx, fy, info->down); } static inline void flushing_cached_block(struct script_info *info) { struct block *block; + struct inst_info *inst; + int is_pd; + + inst = buffer_handler_instance(info->buffer_handle); + if (!inst) { + ErrPrint("Instance is not valid\n"); + } + + is_pd = instance_pd_script(inst) == info; EINA_LIST_FREE(info->cached_blocks, block) { - consuming_parsed_block(info->inst, (instance_pd_script(info->inst) == info), block); + consuming_parsed_block(inst, is_pd, block); } } HAPI int script_handler_load(struct script_info *info, int is_pd) { - int ret; - Evas *e; + struct inst_info *inst; if (!info || !info->port) { ErrPrint("Script handler is not created\n"); @@ -492,53 +485,25 @@ HAPI int script_handler_load(struct script_info *info, int is_pd) return LB_STATUS_SUCCESS; } - ret = fb_create_buffer(info->fb); - if (ret < 0) { - return ret; - } - - info->ee = fb_canvas(info->fb); - if (!info->ee) { - ErrPrint("Failed to get canvas\n"); - fb_destroy_buffer(info->fb); + if (info->port->load(info->port_data, NULL, render_post_cb, info) < 0) { + ErrPrint("Unable to load the script\n"); return LB_STATUS_ERROR_FAULT; } - ecore_evas_data_set(info->ee, "script,info", info); + info->loaded = 1; + flushing_cached_block(info); - e = script_handler_evas(info); - if (e) { - evas_event_callback_add(e, EVAS_CALLBACK_RENDER_PRE, render_pre_cb, info->inst); - evas_event_callback_add(e, EVAS_CALLBACK_RENDER_POST, render_post_cb, info->inst); - if (info->port->load(info->port_data, e, info->w, info->h) < 0) { - ErrPrint("Failed to add new script object\n"); - evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, render_post_cb); - evas_event_callback_del(e, EVAS_CALLBACK_RENDER_PRE, render_pre_cb); - fb_destroy_buffer(info->fb); - return LB_STATUS_ERROR_FAULT; - } - info->loaded = 1; - flushing_cached_block(info); - script_signal_emit(e, instance_id(info->inst), + inst = buffer_handler_instance(info->buffer_handle); + if (inst) { + script_signal_emit(info->buffer_handle, instance_id(inst), is_pd ? "pd,show" : "lb,show", 0.0f, 0.0f, 0.0f, 0.0f); - } else { - ErrPrint("Evas: (nil) %dx%d\n", info->w, info->h); } - - ecore_evas_manual_render_set(info->ee, EINA_FALSE); - ecore_evas_resize(info->ee, info->w, info->h); - ecore_evas_show(info->ee); - ecore_evas_activate(info->ee); - fb_sync(info->fb); - + buffer_handler_flush(info->buffer_handle); return LB_STATUS_SUCCESS; } HAPI int script_handler_unload(struct script_info *info, int is_pd) { - Ecore_Evas *ee; - Evas *e; - if (!info || !info->port) { return LB_STATUS_ERROR_INVALID; } @@ -553,25 +518,10 @@ HAPI int script_handler_unload(struct script_info *info, int is_pd) return LB_STATUS_ERROR_ALREADY; } - e = script_handler_evas(info); - if (e) { - script_signal_emit(e, instance_id(info->inst), - is_pd ? "pd,hide" : "lb,hide", 0.0f, 0.0f, 0.0f, 0.0f); - if (info->port->unload(info->port_data, e) < 0) { - ErrPrint("Failed to unload script object. but go ahead\n"); - } - evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, render_post_cb); - evas_event_callback_del(e, EVAS_CALLBACK_RENDER_PRE, render_pre_cb); - } else { - ErrPrint("Evas(nil): Unload script\n"); - } - - ee = fb_canvas(info->fb); - if (ee) { - ecore_evas_data_set(ee, "script,info", NULL); + if (info->port->unload(info->port_data) < 0) { + ErrPrint("Failed to unload script object. but go ahead\n"); } - fb_destroy_buffer(info->fb); return LB_STATUS_SUCCESS; } @@ -591,30 +541,28 @@ HAPI struct script_info *script_handler_create(struct inst_info *inst, const cha return NULL; } - info->fb = fb_create(inst, w, h, s_info.env_buf_type); - if (!info->fb) { - ErrPrint("Failed to create a FB (%dx%d)\n", w, h); + info->buffer_handle = buffer_handler_create(inst, s_info.env_buf_type, w, h, sizeof(int)); + if (!info->buffer_handle) { + /* buffer_handler_create will prints some log */ DbgFree(info); return NULL; } - info->inst = inst; + (void)buffer_handler_set_data(info->buffer_handle, info); + info->port = find_port(package_script(instance_package(inst))); if (!info->port) { ErrPrint("Failed to find a proper port for [%s]%s\n", instance_package(inst), package_script(instance_package(inst))); - fb_destroy(info->fb); + buffer_handler_destroy(info->buffer_handle); DbgFree(info); return NULL; } - info->w = w; - info->h = h; - - info->port_data = info->port->create(file, option); + info->port_data = info->port->create(info->buffer_handle, file, option); if (!info->port_data) { ErrPrint("Failed to create a port (%s - %s)\n", file, option); - fb_destroy(info->fb); + buffer_handler_destroy(info->buffer_handle); DbgFree(info); return NULL; } @@ -642,7 +590,7 @@ HAPI int script_handler_destroy(struct script_info *info) ErrPrint("Failed to destroy port, but go ahead: %d\n", ret); } - fb_destroy(info->fb); + (void)buffer_handler_destroy(info->buffer_handle); EINA_LIST_FREE(info->cached_blocks, block) { delete_block(block); @@ -657,22 +605,13 @@ HAPI int script_handler_is_loaded(struct script_info *info) return info ? info->loaded > 0 : 0; } -HAPI struct fb_info *script_handler_fb(struct script_info *info) -{ - return info ? info->fb : NULL; -} - -HAPI void *script_handler_evas(struct script_info *info) +HAPI struct buffer_info *script_handler_buffer_info(struct script_info *info) { if (!info) { return NULL; } - if (!info->ee) { - return NULL; - } - - return ecore_evas_get(info->ee); + return info->buffer_handle; } static int update_script_color(struct inst_info *inst, struct block *block, int is_pd) @@ -680,7 +619,7 @@ static int update_script_color(struct inst_info *inst, struct block *block, int PERF_INIT(); PERF_BEGIN(); struct script_info *info; - Evas *e; + int ret; if (!block || !block->part || !block->data) { ErrPrint("Block or part or data is not valid\n"); @@ -701,16 +640,9 @@ static int update_script_color(struct inst_info *inst, struct block *block, int return LB_STATUS_ERROR_INVALID; } - e = script_handler_evas(info); - if (e) { - DbgPrint("[%s] %s (%s)\n", block->id, block->part, block->data); - 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); - } + ret = info->port->update_color(info->port_data, block->id, block->part, block->data); PERF_MARK("color"); - - return LB_STATUS_SUCCESS; + return ret; } static int update_script_text(struct inst_info *inst, struct block *block, int is_pd) @@ -718,7 +650,7 @@ static int update_script_text(struct inst_info *inst, struct block *block, int i PERF_INIT(); PERF_BEGIN(); struct script_info *info; - Evas *e; + int ret; if (!block || !block->part || !block->data) { ErrPrint("Block or part or data is not valid\n"); @@ -739,16 +671,11 @@ static int update_script_text(struct inst_info *inst, struct block *block, int i return LB_STATUS_ERROR_INVALID; } - e = script_handler_evas(info); - if (e) { - DbgPrint("[%s] %s (%s)\n", block->id, block->part, block->data); - info->port->update_text(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); - } - + DbgPrint("[%s] %s (%s)\n", block->id, block->part, block->data); + ret = info->port->update_text(info->port_data, block->id, block->part, block->data); + PERF_MARK("text"); - return LB_STATUS_SUCCESS; + return ret; } static int update_script_image(struct inst_info *inst, struct block *block, int is_pd) @@ -756,7 +683,7 @@ static int update_script_image(struct inst_info *inst, struct block *block, int PERF_INIT(); PERF_BEGIN(); struct script_info *info; - Evas *e; + int ret; if (!block || !block->part) { ErrPrint("Block or part is not valid\n"); @@ -777,15 +704,10 @@ static int update_script_image(struct inst_info *inst, struct block *block, int return LB_STATUS_ERROR_INVALID; } - e = script_handler_evas(info); - if (e) { - DbgPrint("[%s] %s (%s)\n", block->id, block->part, block->data); - info->port->update_image(info->port_data, e, block->id, block->part, block->data, block->option); - } else { - ErrPrint("Evas: (nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data); - } + DbgPrint("[%s] %s (%s)\n", block->id, block->part, block->data); + ret = info->port->update_image(info->port_data, block->id, block->part, block->data, block->option); PERF_MARK("image"); - return LB_STATUS_SUCCESS; + return ret; } static int update_access(struct inst_info *inst, struct block *block, int is_pd) @@ -793,7 +715,7 @@ static int update_access(struct inst_info *inst, struct block *block, int is_pd) PERF_INIT(); PERF_BEGIN(); struct script_info *info; - Evas *e; + int ret; if (!block || !block->part) { ErrPrint("Block or block->part is NIL\n"); @@ -814,14 +736,9 @@ static int update_access(struct inst_info *inst, struct block *block, int is_pd) return LB_STATUS_ERROR_INVALID; } - e = script_handler_evas(info); - if (e) { - info->port->update_access(info->port_data, e, block->id, block->part, block->data, block->option); - } else { - ErrPrint("Evas: (nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data); - } + ret = info->port->update_access(info->port_data, block->id, block->part, block->data, block->option); PERF_MARK("access"); - return LB_STATUS_SUCCESS; + return ret; } static int operate_access(struct inst_info *inst, struct block *block, int is_pd) @@ -829,7 +746,7 @@ static int operate_access(struct inst_info *inst, struct block *block, int is_pd PERF_INIT(); PERF_BEGIN(); struct script_info *info; - Evas *e; + int ret; if (!block || !block->part) { ErrPrint("Block or block->part is NIL\n"); @@ -850,14 +767,9 @@ static int operate_access(struct inst_info *inst, struct block *block, int is_pd return LB_STATUS_ERROR_INVALID; } - e = script_handler_evas(info); - if (e) { - info->port->operate_access(info->port_data, e, block->id, block->part, block->data, block->option); - } else { - ErrPrint("Evas: (nil) id[%s] part[%s] data[%s]\n", block->id, block->part, block->data); - } + ret = info->port->operate_access(info->port_data, block->id, block->part, block->data, block->option); PERF_MARK("operate_access"); - return LB_STATUS_SUCCESS; + return ret; } static int update_script_script(struct inst_info *inst, struct block *block, int is_pd) @@ -865,7 +777,7 @@ static int update_script_script(struct inst_info *inst, struct block *block, int PERF_INIT(); PERF_BEGIN(); struct script_info *info; - Evas *e; + int ret; if (!block || !block->part) { ErrPrint("Block or part is NIL\n"); @@ -886,16 +798,9 @@ static int update_script_script(struct inst_info *inst, struct block *block, int return LB_STATUS_ERROR_INVALID; } - e = script_handler_evas(info); - if (e) { - DbgPrint("[%s] %s (%s)\n", block->id, block->part, block->data); - info->port->update_script(info->port_data, e, block->id, block->target, block->part, block->data, block->option); - } else { - ErrPrint("Evas: (nil) id[%s] part[%s] data[%s] option[%s]\n", - block->id, block->part, block->data, block->option); - } + ret = info->port->update_script(info->port_data, block->id, block->target, block->part, block->data, block->option); PERF_MARK("script"); - return LB_STATUS_SUCCESS; + return ret; } static int update_script_signal(struct inst_info *inst, struct block *block, int is_pd) @@ -903,7 +808,7 @@ static int update_script_signal(struct inst_info *inst, struct block *block, int PERF_INIT(); PERF_BEGIN(); struct script_info *info; - Evas *e; + int ret; if (!block) { ErrPrint("block is NIL\n"); @@ -924,15 +829,9 @@ static int update_script_signal(struct inst_info *inst, struct block *block, int return LB_STATUS_ERROR_INVALID; } - e = script_handler_evas(info); - if (e) { - DbgPrint("[%s] %s (%s)\n", block->id, block->part, block->data); - info->port->update_signal(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); - } + ret = info->port->update_signal(info->port_data, block->id, block->part, block->data); PERF_MARK("signal"); - return LB_STATUS_SUCCESS; + return ret; } static int update_script_drag(struct inst_info *inst, struct block *block, int is_pd) @@ -941,7 +840,7 @@ static int update_script_drag(struct inst_info *inst, struct block *block, int i PERF_BEGIN(); struct script_info *info; double dx, dy; - Evas *e; + int ret; if (!block || !block->data || !block->part) { ErrPrint("block or block->data or block->part is NIL\n"); @@ -968,54 +867,58 @@ static int update_script_drag(struct inst_info *inst, struct block *block, int i return LB_STATUS_ERROR_INVALID; } - e = script_handler_evas(info); - if (e) { - info->port->update_drag(info->port_data, e, block->id, block->part, dx, dy); - } else { - ErrPrint("Evas(nil) id[%s] part[%s] %lfx%lf\n", block->id, block->part, dx, dy); - } + ret = info->port->update_drag(info->port_data, block->id, block->part, dx, dy); PERF_MARK("drag"); - return LB_STATUS_SUCCESS; + return ret; } HAPI int script_handler_resize(struct script_info *info, int w, int h) { PERF_INIT(); PERF_BEGIN(); + struct inst_info *inst; + if (!info) { - //|| (info->w == w && info->h == h)) { ErrPrint("info[%p] resize is ignored\n", info); PERF_MARK("resize"); return LB_STATUS_SUCCESS; } - fb_resize(script_handler_fb(info), w, h); + inst = buffer_handler_instance(info->buffer_handle); + if (!inst) { + ErrPrint("Instance is not valid\n"); + PERF_MARK("resize"); + return LB_STATUS_ERROR_INVALID; + } + + buffer_handler_update_size(info->buffer_handle, w, h); if (info->port->update_size) { - Evas *e; - e = script_handler_evas(info); - if (e) { - info->port->update_size(info->port_data, e, NULL , w, h); - } else { - ErrPrint("Evas(nil) resize to %dx%d\n", w, h); - } + (void)info->port->update_size(info->port_data, NULL, w, h); } - if (instance_lb_script(info->inst) == info) { - instance_set_lb_size(info->inst, w, h); - } else if (instance_pd_script(info->inst) == info) { - instance_set_pd_size(info->inst, w, h); + if (instance_lb_script(inst) == info) { + instance_set_lb_size(inst, w, h); + } else if (instance_pd_script(inst) == info) { + instance_set_pd_size(inst, w, h); } else { ErrPrint("Script is not known\n"); } - info->w = w; - info->h = h; PERF_MARK("resize"); - return LB_STATUS_SUCCESS; } +HAPI const char *script_handler_buffer_id(struct script_info *info) +{ + if (!info || !info->buffer_handle) { + ErrPrint("Invalid info\n"); + return ""; + } + + return buffer_handler_id(info->buffer_handle); +} + static int update_info(struct inst_info *inst, struct block *block, int is_pd) { PERF_INIT(); @@ -1042,7 +945,7 @@ static int update_info(struct inst_info *inst, struct block *block, int is_pd) } if (!strcasecmp(block->part, INFO_SIZE)) { - Evas_Coord w, h; + int w, h; if (sscanf(block->data, "%dx%d", &w, &h) != 2) { ErrPrint("Invalid format for SIZE(%s)\n", block->data); @@ -1053,22 +956,10 @@ static int update_info(struct inst_info *inst, struct block *block, int is_pd) if (!block->id) { script_handler_resize(info, w, h); } else { - Evas *e; - e = script_handler_evas(info); - if (e) { - info->port->update_size(info->port_data, e, block->id, w, h); - } else { - ErrPrint("Evas(nil): id[%s] %dx%d\n", block->id, w, h); - } + (void)info->port->update_size(info->port_data, block->id, w, h); } } else if (!strcasecmp(block->part, INFO_CATEGORY)) { - Evas *e; - e = script_handler_evas(info); - if (e) { - info->port->update_category(info->port_data, e, block->id, block->data); - } else { - ErrPrint("Evas(nil): id[%s] data[%s]\n", block->id, block->data); - } + (void)info->port->update_category(info->port_data, block->id, block->data); } PERF_MARK("info"); @@ -1173,20 +1064,15 @@ HAPI int script_handler_update_keycode(struct script_info *info, unsigned int ke HAPI int script_handler_feed_event(struct script_info *info, int event, double timestamp) { - Evas *e; + int ret; if (!info->port) { ErrPrint("info->port is NIL\n"); return LB_STATUS_ERROR_INVALID; } - e = script_handler_evas(info); - if (!e) { - ErrPrint("Evas is not exists\n"); - return LB_STATUS_ERROR_FAULT; - } - - return info->port->feed_event(info->port_data, e, event, info->x, info->y, info->down, info->keycode, timestamp); + ret = info->port->feed_event(info->port_data, event, info->x, info->y, info->down, info->keycode, timestamp); + return ret; } static inline char *load_file(const char *filename) diff --git a/src/server.c b/src/server.c index 4f16e12..2080d49 100644 --- a/src/server.c +++ b/src/server.c @@ -19,8 +19,6 @@ #include #include -#include -#include /* fb.h */ #include #include #include @@ -44,7 +42,6 @@ #include "buffer_handler.h" #include "util.h" #include "fault_manager.h" -#include "fb.h" /* fb_type */ #include "group.h" #include "xmonitor.h" #include "abi.h" @@ -457,7 +454,6 @@ static int key_event_lb_consume_cb(enum event_state state, struct event_data *ev struct inst_info *inst = data; const struct pkg_info *pkg; double timestamp; - Evas *e; pkg = instance_package(inst); if (!pkg) { @@ -469,12 +465,6 @@ static int key_event_lb_consume_cb(enum event_state state, struct event_data *ev return LB_STATUS_ERROR_FAULT; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - return LB_STATUS_ERROR_FAULT; - } - timestamp = util_timestamp(); switch (state) { @@ -504,7 +494,6 @@ static int mouse_event_lb_consume_cb(enum event_state state, struct event_data * struct inst_info *inst = data; const struct pkg_info *pkg; double timestamp; - Evas *e; pkg = instance_package(inst); if (!pkg) { @@ -516,12 +505,6 @@ static int mouse_event_lb_consume_cb(enum event_state state, struct event_data * return LB_STATUS_ERROR_FAULT; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - return LB_STATUS_ERROR_FAULT; - } - timestamp = util_timestamp(); switch (state) { @@ -630,7 +613,6 @@ static int key_event_pd_consume_cb(enum event_state state, struct event_data *ev struct inst_info *inst = data; const struct pkg_info *pkg; double timestamp; - Evas *e; pkg = instance_package(inst); if (!pkg) { @@ -642,12 +624,6 @@ static int key_event_pd_consume_cb(enum event_state state, struct event_data *ev return LB_STATUS_ERROR_FAULT; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - return LB_STATUS_ERROR_FAULT; - } - timestamp = util_timestamp(); switch (state) { @@ -677,7 +653,6 @@ static int mouse_event_pd_consume_cb(enum event_state state, struct event_data * struct inst_info *inst = data; const struct pkg_info *pkg; double timestamp; - Evas *e; pkg = instance_package(inst); if (!pkg) { @@ -689,12 +664,6 @@ static int mouse_event_pd_consume_cb(enum event_state state, struct event_data * return LB_STATUS_ERROR_FAULT; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - return LB_STATUS_ERROR_FAULT; - } - timestamp = util_timestamp(); switch (state) { @@ -1403,7 +1372,6 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct ret = forward_pd_event_packet(pkg, inst, packet); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -1411,13 +1379,6 @@ static struct packet *client_pd_mouse_enter(pid_t pid, int handle, const struct goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); script_handler_feed_event(script, LB_SCRIPT_MOUSE_IN, timestamp); ret = 0; @@ -1466,7 +1427,6 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct ret = forward_pd_event_packet(pkg, inst, packet); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -1474,13 +1434,6 @@ static struct packet *client_pd_mouse_leave(pid_t pid, int handle, const struct goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); script_handler_feed_event(script, LB_SCRIPT_MOUSE_OUT, timestamp); ret = 0; @@ -1529,7 +1482,6 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p ret = forward_pd_event_packet(pkg, inst, packet); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -1537,13 +1489,6 @@ static struct packet *client_pd_mouse_down(pid_t pid, int handle, const struct p goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 1); script_handler_feed_event(script, LB_SCRIPT_MOUSE_DOWN, timestamp); ret = 0; @@ -1592,7 +1537,6 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac ret = forward_pd_event_packet(pkg, inst, packet); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -1600,13 +1544,6 @@ static struct packet *client_pd_mouse_up(pid_t pid, int handle, const struct pac goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 0); script_handler_feed_event(script, LB_SCRIPT_MOUSE_UP, timestamp); ret = 0; @@ -1655,7 +1592,6 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p ret = forward_pd_event_packet(pkg, inst, packet); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -1663,13 +1599,6 @@ static struct packet *client_pd_mouse_move(pid_t pid, int handle, const struct p goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); script_handler_feed_event(script, LB_SCRIPT_MOUSE_MOVE, timestamp); ret = 0; @@ -1718,7 +1647,6 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p ret = forward_lb_event_packet(pkg, inst, packet); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -1726,13 +1654,6 @@ static struct packet *client_lb_mouse_move(pid_t pid, int handle, const struct p goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); script_handler_feed_event(script, LB_SCRIPT_MOUSE_MOVE, timestamp); ret = 0; @@ -2205,7 +2126,6 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct ret = forward_lb_event_packet(pkg, inst, packet); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -2213,13 +2133,6 @@ static struct packet *client_lb_mouse_enter(pid_t pid, int handle, const struct goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); script_handler_feed_event(script, LB_SCRIPT_MOUSE_IN, timestamp); ret = 0; @@ -2268,7 +2181,6 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct ret = forward_lb_event_packet(pkg, inst, packet); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -2276,13 +2188,6 @@ static struct packet *client_lb_mouse_leave(pid_t pid, int handle, const struct goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); script_handler_feed_event(script, LB_SCRIPT_MOUSE_OUT, timestamp); ret = 0; @@ -2331,7 +2236,6 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p ret = forward_lb_event_packet(pkg, inst, packet); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -2339,13 +2243,6 @@ static struct packet *client_lb_mouse_down(pid_t pid, int handle, const struct p goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 1); script_handler_feed_event(script, LB_SCRIPT_MOUSE_DOWN, timestamp); ret = 0; @@ -2394,7 +2291,6 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac ret = forward_lb_event_packet(pkg, inst, packet); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -2402,13 +2298,6 @@ static struct packet *client_lb_mouse_up(pid_t pid, int handle, const struct pac goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 0); script_handler_feed_event(script, LB_SCRIPT_MOUSE_UP, timestamp); ret = 0; @@ -2458,7 +2347,6 @@ static struct packet *client_pd_access_action_up(pid_t pid, int handle, const st ret = forward_pd_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -2466,13 +2354,6 @@ static struct packet *client_pd_access_action_up(pid_t pid, int handle, const st goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 0); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_ACTION, timestamp); if (ret >= 0) { @@ -2544,7 +2425,6 @@ static struct packet *client_pd_access_action_down(pid_t pid, int handle, const ret = forward_pd_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -2552,13 +2432,6 @@ static struct packet *client_pd_access_action_down(pid_t pid, int handle, const goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_ACTION, timestamp); if (ret >= 0) { @@ -2630,7 +2503,6 @@ static struct packet *client_pd_access_scroll_down(pid_t pid, int handle, const ret = forward_pd_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -2638,13 +2510,6 @@ static struct packet *client_pd_access_scroll_down(pid_t pid, int handle, const goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_SCROLL, timestamp); if (ret >= 0) { @@ -2716,7 +2581,6 @@ static struct packet *client_pd_access_scroll_move(pid_t pid, int handle, const ret = forward_pd_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -2724,13 +2588,6 @@ static struct packet *client_pd_access_scroll_move(pid_t pid, int handle, const goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_SCROLL, timestamp); if (ret >= 0) { @@ -2802,7 +2659,6 @@ static struct packet *client_pd_access_scroll_up(pid_t pid, int handle, const st ret = forward_pd_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -2810,13 +2666,6 @@ static struct packet *client_pd_access_scroll_up(pid_t pid, int handle, const st goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 0); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_SCROLL, timestamp); if (ret >= 0) { @@ -2888,7 +2737,6 @@ static struct packet *client_pd_access_unhighlight(pid_t pid, int handle, const ret = forward_pd_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -2896,13 +2744,6 @@ static struct packet *client_pd_access_unhighlight(pid_t pid, int handle, const goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_UNHIGHLIGHT, timestamp); if (ret >= 0) { @@ -2973,7 +2814,6 @@ static struct packet *client_pd_access_hl(pid_t pid, int handle, const struct pa ret = forward_pd_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -2981,13 +2821,6 @@ static struct packet *client_pd_access_hl(pid_t pid, int handle, const struct pa goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_HIGHLIGHT, timestamp); if (ret >= 0) { @@ -3059,7 +2892,6 @@ static struct packet *client_pd_access_hl_prev(pid_t pid, int handle, const stru ret = forward_pd_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -3067,13 +2899,6 @@ static struct packet *client_pd_access_hl_prev(pid_t pid, int handle, const stru goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_HIGHLIGHT_PREV, timestamp); if (ret >= 0) { @@ -3145,7 +2970,6 @@ static struct packet *client_pd_access_hl_next(pid_t pid, int handle, const stru ret = forward_pd_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -3154,13 +2978,6 @@ static struct packet *client_pd_access_hl_next(pid_t pid, int handle, const stru goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_HIGHLIGHT_NEXT, timestamp); if (ret >= 0) { @@ -3236,7 +3053,6 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str ret = forward_pd_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -3244,13 +3060,6 @@ static struct packet *client_pd_access_activate(pid_t pid, int handle, const str goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_ACTIVATE, timestamp); if (ret >= 0) { @@ -3321,7 +3130,6 @@ static struct packet *client_pd_key_focus_in(pid_t pid, int handle, const struct ret = forward_pd_key_packet(pkg, inst, packet_command(packet), timestamp, keycode); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -3329,13 +3137,6 @@ static struct packet *client_pd_key_focus_in(pid_t pid, int handle, const struct goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_keycode(script, keycode); ret = script_handler_feed_event(script, LB_SCRIPT_KEY_FOCUS_IN, timestamp); if (ret >= 0) { @@ -3406,7 +3207,6 @@ static struct packet *client_pd_key_focus_out(pid_t pid, int handle, const struc ret = forward_pd_key_packet(pkg, inst, packet_command(packet), timestamp, keycode); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -3414,13 +3214,6 @@ static struct packet *client_pd_key_focus_out(pid_t pid, int handle, const struc goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_keycode(script, keycode); ret = script_handler_feed_event(script, LB_SCRIPT_KEY_FOCUS_OUT, timestamp); if (ret >= 0) { @@ -3491,7 +3284,6 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac ret = forward_pd_key_packet(pkg, inst, packet_command(packet), timestamp, keycode); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -3499,13 +3291,6 @@ static struct packet *client_pd_key_down(pid_t pid, int handle, const struct pac goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_keycode(script, keycode); ret = script_handler_feed_event(script, LB_SCRIPT_KEY_DOWN, timestamp); if (ret >= 0) { @@ -3634,7 +3419,6 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe ret = forward_pd_key_packet(pkg, inst, packet_command(packet), timestamp, keycode); } else if (package_pd_type(pkg) == PD_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_pd_script(inst); if (!script) { @@ -3642,13 +3426,6 @@ static struct packet *client_pd_key_up(pid_t pid, int handle, const struct packe goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_keycode(script, keycode); ret = script_handler_feed_event(script, LB_SCRIPT_KEY_UP, timestamp); if (ret >= 0) { @@ -3720,7 +3497,6 @@ static struct packet *client_lb_access_hl(pid_t pid, int handle, const struct pa ret = forward_lb_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -3728,13 +3504,6 @@ static struct packet *client_lb_access_hl(pid_t pid, int handle, const struct pa goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_HIGHLIGHT, timestamp); if (ret >= 0) { @@ -3806,7 +3575,6 @@ static struct packet *client_lb_access_hl_prev(pid_t pid, int handle, const stru ret = forward_lb_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -3814,13 +3582,6 @@ static struct packet *client_lb_access_hl_prev(pid_t pid, int handle, const stru goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_HIGHLIGHT_PREV, timestamp); if (ret >= 0) { @@ -3892,7 +3653,6 @@ static struct packet *client_lb_access_hl_next(pid_t pid, int handle, const stru ret = forward_lb_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -3900,13 +3660,6 @@ static struct packet *client_lb_access_hl_next(pid_t pid, int handle, const stru goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_HIGHLIGHT_NEXT, timestamp); if (ret >= 0) { @@ -3983,7 +3736,6 @@ static struct packet *client_lb_access_action_up(pid_t pid, int handle, const st */ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -3992,13 +3744,6 @@ static struct packet *client_lb_access_action_up(pid_t pid, int handle, const st goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 0); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_ACTION, timestamp); if (ret >= 0) { @@ -4075,7 +3820,6 @@ static struct packet *client_lb_access_action_down(pid_t pid, int handle, const */ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -4084,13 +3828,6 @@ static struct packet *client_lb_access_action_down(pid_t pid, int handle, const goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_ACTION, timestamp); if (ret >= 0) { @@ -4162,7 +3899,6 @@ static struct packet *client_lb_access_unhighlight(pid_t pid, int handle, const ret = forward_lb_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -4170,13 +3906,6 @@ static struct packet *client_lb_access_unhighlight(pid_t pid, int handle, const goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_UNHIGHLIGHT, timestamp); if (ret >= 0) { @@ -4253,7 +3982,6 @@ static struct packet *client_lb_access_scroll_down(pid_t pid, int handle, const */ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -4262,13 +3990,6 @@ static struct packet *client_lb_access_scroll_down(pid_t pid, int handle, const goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_SCROLL, timestamp); if (ret >= 0) { @@ -4345,7 +4066,6 @@ static struct packet *client_lb_access_scroll_move(pid_t pid, int handle, const */ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -4354,13 +4074,6 @@ static struct packet *client_lb_access_scroll_move(pid_t pid, int handle, const goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_SCROLL, timestamp); if (ret >= 0) { @@ -4437,7 +4150,6 @@ static struct packet *client_lb_access_scroll_up(pid_t pid, int handle, const st */ } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -4446,13 +4158,6 @@ static struct packet *client_lb_access_scroll_up(pid_t pid, int handle, const st goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, 0); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_SCROLL, timestamp); if (ret >= 0) { @@ -4524,7 +4229,6 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str ret = forward_lb_access_packet(pkg, inst, packet_command(packet), timestamp, x, y); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -4533,13 +4237,6 @@ static struct packet *client_lb_access_activate(pid_t pid, int handle, const str goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_pointer(script, x, y, -1); ret = script_handler_feed_event(script, LB_SCRIPT_ACCESS_ACTIVATE, timestamp); if (ret >= 0) { @@ -4610,7 +4307,6 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac ret = forward_lb_key_packet(pkg, inst, packet_command(packet), timestamp, keycode); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -4618,13 +4314,6 @@ static struct packet *client_lb_key_down(pid_t pid, int handle, const struct pac goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_keycode(script, keycode); ret = script_handler_feed_event(script, LB_SCRIPT_KEY_DOWN, timestamp); if (ret >= 0) { @@ -4695,7 +4384,6 @@ static struct packet *client_lb_key_focus_in(pid_t pid, int handle, const struct ret = forward_lb_key_packet(pkg, inst, packet_command(packet), timestamp, keycode); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -4703,13 +4391,6 @@ static struct packet *client_lb_key_focus_in(pid_t pid, int handle, const struct goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_keycode(script, keycode); ret = script_handler_feed_event(script, LB_SCRIPT_KEY_FOCUS_IN, timestamp); if (ret >= 0) { @@ -4780,7 +4461,6 @@ static struct packet *client_lb_key_focus_out(pid_t pid, int handle, const struc ret = forward_lb_key_packet(pkg, inst, packet_command(packet), timestamp, keycode); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -4788,13 +4468,6 @@ static struct packet *client_lb_key_focus_out(pid_t pid, int handle, const struc goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_keycode(script, keycode); ret = script_handler_feed_event(script, LB_SCRIPT_KEY_FOCUS_OUT, timestamp); if (ret >= 0) { @@ -4865,7 +4538,6 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe ret = forward_lb_key_packet(pkg, inst, packet_command(packet), timestamp, keycode); } else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) { struct script_info *script; - Evas *e; script = instance_lb_script(inst); if (!script) { @@ -4873,13 +4545,6 @@ static struct packet *client_lb_key_up(pid_t pid, int handle, const struct packe goto out; } - e = script_handler_evas(script); - if (!e) { - ErrPrint("Script has no evas\n"); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - script_handler_update_keycode(script, keycode); ret = script_handler_feed_event(script, LB_SCRIPT_KEY_UP, timestamp); if (ret >= 0) { @@ -4956,7 +4621,6 @@ static struct packet *client_lb_acquire_pixmap(pid_t pid, int handle, const stru buffer = instance_lb_buffer(inst); if (!buffer) { struct script_info *script_info; - struct fb_info *fb_info; script_info = instance_lb_script(inst); if (!script_info) { @@ -4965,14 +4629,7 @@ static struct packet *client_lb_acquire_pixmap(pid_t pid, int handle, const stru goto out; } - fb_info = script_handler_fb(script_info); - if (!fb_info) { - ErrPrint("Unable to get fb_info: %s\n", id); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - - buffer = fb_buffer_info(fb_info); + buffer = script_handler_buffer_info(script_info); if (!buffer) { ErrPrint("Unable to get buffer_info: %s\n", id); ret = LB_STATUS_ERROR_FAULT; @@ -5085,7 +4742,6 @@ static struct packet *client_pd_acquire_pixmap(pid_t pid, int handle, const stru buffer = instance_pd_buffer(inst); if (!buffer) { struct script_info *script_info; - struct fb_info *fb_info; script_info = instance_pd_script(inst); if (!script_info) { @@ -5094,14 +4750,7 @@ static struct packet *client_pd_acquire_pixmap(pid_t pid, int handle, const stru goto out; } - fb_info = script_handler_fb(script_info); - if (!fb_info) { - ErrPrint("Unable to get fb_info: %s\n", id); - ret = LB_STATUS_ERROR_FAULT; - goto out; - } - - buffer = fb_buffer_info(fb_info); + buffer = script_handler_buffer_info(script_info); if (!buffer) { ErrPrint("Unable to get buffer_info: %s\n", id); ret = LB_STATUS_ERROR_FAULT; -- 2.7.4