Only the EFL should be loaded by liblivebox-edje when it is required.
Change-Id: I35bce038a77d8d9b5d350071858c4b5c8e9dc765
src/conf.c
src/dead_monitor.c
src/group.c
- src/fb.c
src/script_handler.c
src/buffer_handler.c
src/io.c
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,
/*!
* \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 */
#define USE_XMONITOR g_conf.use_xmonitor
#define HAPI __attribute__((visibility("hidden")))
+/*!
+ * EAPI is defined from eina.h
+ */
/* End of a file */
+++ /dev/null
-/*
- * 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 */
* 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.
*
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);
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 */
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
int is_loaded;
struct inst_info *inst;
+ void *data;
};
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) {
DbgFree(info->lock);
info->lock = NULL;
- return 0;
+ return LB_STATUS_SUCCESS;
}
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");
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)
int ret;
if (buffer->lock_fd < 0) {
- return 0;
+ return LB_STATUS_SUCCESS;
}
flock.l_type = F_WRLCK;
}
} while (ret == EINTR);
- return 0;
+ return LB_STATUS_SUCCESS;
}
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;
}
} 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)
return LB_STATUS_SUCCESS;
}
-HAPI int buffer_handler_load(struct buffer_info *info)
+EAPI int buffer_handler_load(struct buffer_info *info)
{
int ret;
return LB_STATUS_SUCCESS;
}
-HAPI int buffer_handler_unload(struct buffer_info *info)
+EAPI int buffer_handler_unload(struct buffer_info *info)
{
int ret;
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;
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;
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;
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;
/*!
* \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;
/*!
* \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;
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;
* \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;
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;
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;
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;
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;
}
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;
}
}
-HAPI int buffer_handler_init(void)
+EAPI int buffer_handler_init(void)
{
int dri2Major, dri2Minor;
char *driverName, *deviceName;
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) {
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;
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;
return handle;
}
-HAPI int buffer_handler_raw_close(struct buffer *buffer)
+EAPI int buffer_handler_raw_close(struct buffer *buffer)
{
int ret;
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 */
+++ /dev/null
-/*
- * 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 <stdio.h>
-#include <unistd.h> /* access */
-#include <errno.h>
-
-#include <dlog.h>
-#include <Ecore_Evas.h>
-#include <Evas.h>
-#include <livebox-errno.h>
-
-#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 */
#include <errno.h>
#include <dlog.h>
-#include <Ecore_Evas.h>
#include <Eina.h>
#include <gio/gio.h>
#include <Ecore.h>
#include "package.h"
#include "script_handler.h"
#include "buffer_handler.h"
-#include "fb.h"
#include "setting.h"
int errno;
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 {
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 {
}
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 {
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 {
}
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 {
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);
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);
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 {
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);
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);
#include <Ecore.h>
#include <Ecore_X.h>
-#include <Evas.h>
-#include <Ecore_Evas.h>
#include <glib.h>
#include <glib-object.h>
#include <aul.h>
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
app_terminate();
- evas_shutdown();
- ecore_evas_shutdown();
-
ecore_x_shutdown();
if (signal_handler) {
#include <sys/stat.h>
#include <fcntl.h>
-#include <Ecore_Evas.h>
#include <Ecore.h>
-#include <Evas.h>
#include <Eina.h>
#include <dlog.h>
#include "instance.h"
#include "buffer_handler.h"
#include "script_handler.h"
-#include "fb.h"
#include "debug.h"
#include "conf.h"
#include "util.h"
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);
};
};
struct script_info {
- Ecore_Evas *ee;
- struct fb_info *fb;
- struct inst_info *inst;
+ struct buffer_info *buffer_handle;
int loaded;
int w;
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;
}
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 = "";
}
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");
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;
}
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;
}
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;
}
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);
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)
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");
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)
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");
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)
PERF_INIT();
PERF_BEGIN();
struct script_info *info;
- Evas *e;
+ int ret;
if (!block || !block->part) {
ErrPrint("Block or part is not valid\n");
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)
PERF_INIT();
PERF_BEGIN();
struct script_info *info;
- Evas *e;
+ int ret;
if (!block || !block->part) {
ErrPrint("Block or block->part is NIL\n");
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)
PERF_INIT();
PERF_BEGIN();
struct script_info *info;
- Evas *e;
+ int ret;
if (!block || !block->part) {
ErrPrint("Block or block->part is NIL\n");
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)
PERF_INIT();
PERF_BEGIN();
struct script_info *info;
- Evas *e;
+ int ret;
if (!block || !block->part) {
ErrPrint("Block or part is NIL\n");
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)
PERF_INIT();
PERF_BEGIN();
struct script_info *info;
- Evas *e;
+ int ret;
if (!block) {
ErrPrint("block is NIL\n");
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)
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");
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();
}
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);
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");
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)
#include <errno.h>
#include <dlog.h>
-#include <Evas.h>
-#include <Ecore_Evas.h> /* fb.h */
#include <aul.h>
#include <Ecore.h>
#include <ail.h>
#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"
struct inst_info *inst = data;
const struct pkg_info *pkg;
double timestamp;
- Evas *e;
pkg = instance_package(inst);
if (!pkg) {
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) {
struct inst_info *inst = data;
const struct pkg_info *pkg;
double timestamp;
- Evas *e;
pkg = instance_package(inst);
if (!pkg) {
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) {
struct inst_info *inst = data;
const struct pkg_info *pkg;
double timestamp;
- Evas *e;
pkg = instance_package(inst);
if (!pkg) {
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) {
struct inst_info *inst = data;
const struct pkg_info *pkg;
double timestamp;
- Evas *e;
pkg = instance_package(inst);
if (!pkg) {
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) {
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
*/
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
struct script_info *script;
- Evas *e;
script = instance_lb_script(inst);
if (!script) {
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) {
*/
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
struct script_info *script;
- Evas *e;
script = instance_lb_script(inst);
if (!script) {
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) {
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) {
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) {
*/
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
struct script_info *script;
- Evas *e;
script = instance_lb_script(inst);
if (!script) {
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) {
*/
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
struct script_info *script;
- Evas *e;
script = instance_lb_script(inst);
if (!script) {
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) {
*/
} else if (package_lb_type(pkg) == LB_TYPE_SCRIPT) {
struct script_info *script;
- Evas *e;
script = instance_lb_script(inst);
if (!script) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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;
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) {
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;