#include <dlog.h>
#include <debug.h>
#include <vconf.h>
-#include <dynamicbox_errno.h>
-#include <dynamicbox_service.h>
-#include <dynamicbox_script.h>
+#include <widget_errno.h>
+#include <widget_service.h>
+#include <widget_script.h>
#include "script_port.h"
#include "abi.h"
edje = find_edje(handle, id);
if (!edje) {
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
ret = sscanf(rgba, "%d %d %d %d %d %d %d %d %d %d %d %d",
r + 2, g + 2, b + 2, a + 2); /* SHADOW */
if (ret != 12) {
DbgPrint("id[%s] part[%s] rgba[%s]\n", id, part, rgba);
- return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
}
ret = edje_object_color_class_set(elm_layout_edje_get(edje), part,
r[2], g[2], b[2], a[2]); /* SHADOW */
DbgPrint("EDJE[%s] color class is %s changed", id, ret == EINA_TRUE ? "successfully" : "not");
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
static void activate_cb(void *data, Evas_Object *part_obj, Elm_Object_Item *item)
edje = find_edje(handle, id);
if (!edje) {
ErrPrint("Failed to find EDJE\n");
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
obj_info = evas_object_data_get(edje, "obj_info");
if (!obj_info) {
ErrPrint("Object info is not available\n");
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
elm_object_part_text_set(edje, part, text ? text : "");
}
out:
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
static void parse_aspect(struct image_option *img_opt, const char *value, int len)
edje = find_edje(handle, id);
if (!edje) {
ErrPrint("No such object: %s\n", id);
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
obj_info = evas_object_data_get(edje, "obj_info");
if (!obj_info) {
ErrPrint("Object info is not available\n");
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
edje_part = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(edje), part);
ErrPrint("[%s] is not exists\n", part);
}
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
PUBLIC int script_operate_access(void *_h, const char *id, const char *part, const char *operation, const char *option)
int ret;
if (!operation || !strlen(operation)) {
- return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
}
edje = find_edje(handle, id);
if (!edje) {
ErrPrint("No such object: %s\n", id);
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
obj_info = evas_object_data_get(edje, "obj_info");
if (!obj_info) {
ErrPrint("Object info is not available\n");
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
memset(&action_info, 0, sizeof(action_info));
}
out:
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
static inline void apply_shadow_effect(struct image_option *img_opt, Evas_Object *img)
edje = find_edje(handle, id);
if (!edje) {
ErrPrint("No such object: %s\n", id);
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
obj_info = evas_object_data_get(edje, "obj_info");
if (!obj_info) {
ErrPrint("Object info is not available\n");
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
img = elm_object_part_content_unset(edje, part);
if (!path || !strlen(path) || access(path, R_OK) != 0) {
DbgPrint("SKIP - Path: [%s]\n", path);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
img = evas_object_image_add(handle->e);
if (!img) {
ErrPrint("Failed to add an image object\n");
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
evas_object_image_preload(img, EINA_FALSE);
if (err != EVAS_LOAD_ERROR_NONE) {
ErrPrint("Load error: %s\n", evas_load_error_str(err));
evas_object_del(img);
- return DBOX_STATUS_ERROR_IO_ERROR;
+ return WIDGET_STATUS_ERROR_IO_ERROR;
}
apply_shadow_effect(&img_opt, img);
if (!part_w || !part_h || !w || !h) {
evas_object_del(img);
- return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
}
img = crop_image(img, path, part_w, part_h, w, h, &img_opt);
if (!part_w || !part_h || !w || !h) {
evas_object_del(img);
- return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
}
img = crop_image(img, path, part_w, part_h, w, h, &img_opt);
if (!part_w || !part_h || !w || !h) {
evas_object_del(img);
- return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
}
img = crop_image(img, path, part_w, part_h, w, h, &img_opt);
* This object is not registered as an access object.
* So the developer should add it to access list manually, using DESC_ACCESS block.
*/
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
static void script_signal_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
}
/*!
- DBOX_ACCESS_HIGHLIGHT 0
- DBOX_ACCESS_HIGHLIGHT_NEXT 1
- DBOX_ACCESS_HIGHLIGHT_PREV 2
- DBOX_ACCESS_ACTIVATE 3
- DBOX_ACCESS_ACTION 4
- DBOX_ACCESS_SCROLL 5
+ WIDGET_ACCESS_HIGHLIGHT 0
+ WIDGET_ACCESS_HIGHLIGHT_NEXT 1
+ WIDGET_ACCESS_HIGHLIGHT_PREV 2
+ WIDGET_ACCESS_ACTIVATE 3
+ WIDGET_ACCESS_ACTION 4
+ WIDGET_ACCESS_SCROLL 5
*/
PUBLIC int script_feed_event(void *h, int event_type, int x, int y, int type, unsigned int keycode, double timestamp)
{
struct info *handle = h;
Evas_Object *edje;
struct obj_info *obj_info;
- int ret = DBOX_STATUS_ERROR_NONE;
+ int ret = WIDGET_STATUS_ERROR_NONE;
edje = find_edje(handle, NULL); /*!< Get the base layout */
if (!edje) {
ErrPrint("Base layout is not exist\n");
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
obj_info = evas_object_data_get(edje, "obj_info");
if (!obj_info) {
ErrPrint("Object info is not valid\n");
- return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
}
- if (event_type & DBOX_SCRIPT_ACCESS_EVENT) {
+ if (event_type & WIDGET_SCRIPT_ACCESS_EVENT) {
Elm_Access_Action_Info info;
Elm_Access_Action_Type action;
memset(&info, 0, sizeof(info));
- if ((event_type & DBOX_SCRIPT_ACCESS_HIGHLIGHT) == DBOX_SCRIPT_ACCESS_HIGHLIGHT) {
+ if ((event_type & WIDGET_SCRIPT_ACCESS_HIGHLIGHT) == WIDGET_SCRIPT_ACCESS_HIGHLIGHT) {
action = ELM_ACCESS_ACTION_HIGHLIGHT;
info.x = x;
info.y = y;
if (ret == EINA_TRUE) {
if (!get_highlighted_object(edje)) {
ErrPrint("Highlighted object is not found\n");
- ret = DBOX_ACCESS_STATUS_ERROR;
+ ret = WIDGET_ACCESS_STATUS_ERROR;
} else {
DbgPrint("Highlighted object is found\n");
- ret = DBOX_ACCESS_STATUS_DONE;
+ ret = WIDGET_ACCESS_STATUS_DONE;
}
} else {
ErrPrint("Action error\n");
- ret = DBOX_ACCESS_STATUS_ERROR;
+ ret = WIDGET_ACCESS_STATUS_ERROR;
}
- } else if ((event_type & DBOX_SCRIPT_ACCESS_HIGHLIGHT_NEXT) == DBOX_SCRIPT_ACCESS_HIGHLIGHT_NEXT) {
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_HIGHLIGHT_NEXT) == WIDGET_SCRIPT_ACCESS_HIGHLIGHT_NEXT) {
action = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT;
info.highlight_cycle = EINA_FALSE;
ret = elm_access_action(edje, action, &info);
DbgPrint("ACCESS_HIGHLIGHT_NEXT, returns %d\n", ret);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_LAST : DBOX_ACCESS_STATUS_DONE;
- } else if ((event_type & DBOX_SCRIPT_ACCESS_HIGHLIGHT_PREV) == DBOX_SCRIPT_ACCESS_HIGHLIGHT_PREV) {
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_LAST : WIDGET_ACCESS_STATUS_DONE;
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_HIGHLIGHT_PREV) == WIDGET_SCRIPT_ACCESS_HIGHLIGHT_PREV) {
action = ELM_ACCESS_ACTION_HIGHLIGHT_PREV;
info.highlight_cycle = EINA_FALSE;
ret = elm_access_action(edje, action, &info);
DbgPrint("ACCESS_HIGHLIGHT_PREV, returns %d\n", ret);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_FIRST : DBOX_ACCESS_STATUS_DONE;
- } else if ((event_type & DBOX_SCRIPT_ACCESS_ACTIVATE) == DBOX_SCRIPT_ACCESS_ACTIVATE) {
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_FIRST : WIDGET_ACCESS_STATUS_DONE;
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_ACTIVATE) == WIDGET_SCRIPT_ACCESS_ACTIVATE) {
action = ELM_ACCESS_ACTION_ACTIVATE;
ret = elm_access_action(edje, action, &info);
DbgPrint("ACCESS_ACTIVATE, returns %d\n", ret);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
- } else if ((event_type & DBOX_SCRIPT_ACCESS_ACTION) == DBOX_SCRIPT_ACCESS_ACTION) {
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_ACTION) == WIDGET_SCRIPT_ACCESS_ACTION) {
switch (type) {
case ACCESS_TYPE_UP:
action = ELM_ACCESS_ACTION_UP;
ret = elm_access_action(edje, action, &info);
DbgPrint("ACCESS_ACTION(%d), returns %d\n", type, ret);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
break;
case ACCESS_TYPE_DOWN:
action = ELM_ACCESS_ACTION_DOWN;
ret = elm_access_action(edje, action, &info);
DbgPrint("ACCESS_ACTION(%d), returns %d\n", type, ret);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
break;
default:
ErrPrint("Invalid access event\n");
- ret = DBOX_ACCESS_STATUS_ERROR;
+ ret = WIDGET_ACCESS_STATUS_ERROR;
break;
}
- } else if ((event_type & DBOX_SCRIPT_ACCESS_SCROLL) == DBOX_SCRIPT_ACCESS_SCROLL) {
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_SCROLL) == WIDGET_SCRIPT_ACCESS_SCROLL) {
action = ELM_ACCESS_ACTION_SCROLL;
info.x = x;
info.y = y;
info.mouse_type = 0;
ret = elm_access_action(edje, action, &info);
DbgPrint("ACCESS_HIGHLIGHT_SCROLL, returns %d\n", ret);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
break;
case ACCESS_TYPE_MOVE:
info.mouse_type = 1;
ret = elm_access_action(edje, action, &info);
DbgPrint("ACCESS_HIGHLIGHT_SCROLL, returns %d\n", ret);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
break;
case ACCESS_TYPE_UP:
info.mouse_type = 2;
ret = elm_access_action(edje, action, &info);
DbgPrint("ACCESS_HIGHLIGHT_SCROLL, returns %d\n", ret);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
break;
default:
- ret = DBOX_ACCESS_STATUS_ERROR;
+ ret = WIDGET_ACCESS_STATUS_ERROR;
break;
}
- } else if ((event_type & DBOX_SCRIPT_ACCESS_UNHIGHLIGHT) == DBOX_SCRIPT_ACCESS_UNHIGHLIGHT) {
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_UNHIGHLIGHT) == WIDGET_SCRIPT_ACCESS_UNHIGHLIGHT) {
action = ELM_ACCESS_ACTION_UNHIGHLIGHT;
ret = elm_access_action(edje, action, &info);
DbgPrint("ACCESS_UNHIGHLIGHT, returns %d\n", ret);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
- } else if ((event_type & DBOX_SCRIPT_ACCESS_VALUE_CHANGE) == DBOX_SCRIPT_ACCESS_VALUE_CHANGE) {
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_VALUE_CHANGE) == WIDGET_SCRIPT_ACCESS_VALUE_CHANGE) {
action = ELM_ACCESS_ACTION_VALUE_CHANGE;
info.mouse_type = type;
info.x = x;
info.y = y;
ret = elm_access_action(edje, action, &info);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
- } else if ((event_type & DBOX_SCRIPT_ACCESS_MOUSE) == DBOX_SCRIPT_ACCESS_MOUSE) {
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_MOUSE) == WIDGET_SCRIPT_ACCESS_MOUSE) {
action = ELM_ACCESS_ACTION_MOUSE;
info.mouse_type = type;
info.x = x;
info.y = y;
ret = elm_access_action(edje, action, &info);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
- } else if ((event_type & DBOX_SCRIPT_ACCESS_BACK) == DBOX_SCRIPT_ACCESS_BACK) {
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_BACK) == WIDGET_SCRIPT_ACCESS_BACK) {
action = ELM_ACCESS_ACTION_BACK;
info.mouse_type = type;
info.x = x;
info.y = y;
ret = elm_access_action(edje, action, &info);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
- } else if ((event_type & DBOX_SCRIPT_ACCESS_OVER) == DBOX_SCRIPT_ACCESS_OVER) {
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_OVER) == WIDGET_SCRIPT_ACCESS_OVER) {
action = ELM_ACCESS_ACTION_OVER;
info.mouse_type = type;
info.x = x;
info.y = y;
ret = elm_access_action(edje, action, &info);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
- } else if ((event_type & DBOX_SCRIPT_ACCESS_READ) == DBOX_SCRIPT_ACCESS_READ) {
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_READ) == WIDGET_SCRIPT_ACCESS_READ) {
action = ELM_ACCESS_ACTION_READ;
info.mouse_type = type;
info.x = x;
info.y = y;
ret = elm_access_action(edje, action, &info);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
- } else if ((event_type & DBOX_SCRIPT_ACCESS_ENABLE) == DBOX_SCRIPT_ACCESS_ENABLE) {
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_ENABLE) == WIDGET_SCRIPT_ACCESS_ENABLE) {
action = ELM_ACCESS_ACTION_ENABLE;
info.mouse_type = type;
info.x = x;
info.y = y;
ret = elm_access_action(edje, action, &info);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
- } else if ((event_type & DBOX_SCRIPT_ACCESS_DISABLE) == DBOX_SCRIPT_ACCESS_DISABLE) {
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
+ } else if ((event_type & WIDGET_SCRIPT_ACCESS_DISABLE) == WIDGET_SCRIPT_ACCESS_DISABLE) {
action = ELM_ACCESS_ACTION_ENABLE;
info.mouse_type = type;
info.x = x;
info.y = y;
ret = elm_access_action(edje, action, &info);
- ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+ ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE;
} else {
DbgPrint("Invalid event\n");
- ret = DBOX_ACCESS_STATUS_ERROR;
+ ret = WIDGET_ACCESS_STATUS_ERROR;
}
- } else if (event_type & DBOX_SCRIPT_MOUSE_EVENT) {
+ } else if (event_type & WIDGET_SCRIPT_MOUSE_EVENT) {
double cur_timestamp;
unsigned int flags;
#endif
if (cur_timestamp - timestamp > 0.1f && handle->is_mouse_down == 0) {
DbgPrint("Discard lazy event : %lf\n", cur_timestamp - timestamp);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
switch (event_type) {
- case DBOX_SCRIPT_MOUSE_DOWN:
+ case WIDGET_SCRIPT_MOUSE_DOWN:
if (handle->is_mouse_down == 0) {
flags = evas_event_default_flags_get(handle->e);
flags &= ~EVAS_EVENT_FLAG_ON_SCROLL;
handle->is_mouse_down = 1;
}
break;
- case DBOX_SCRIPT_MOUSE_MOVE:
+ case WIDGET_SCRIPT_MOUSE_MOVE:
evas_event_feed_mouse_move(handle->e, x, y, timestamp * 1000, NULL);
break;
- case DBOX_SCRIPT_MOUSE_UP:
+ case WIDGET_SCRIPT_MOUSE_UP:
if (handle->is_mouse_down == 1) {
evas_event_feed_mouse_move(handle->e, x, y, timestamp * 1000, NULL);
evas_event_feed_mouse_up(handle->e, 1, EVAS_BUTTON_NONE, (timestamp + 0.01f) * 1000, NULL);
handle->is_mouse_down = 0;
}
break;
- case DBOX_SCRIPT_MOUSE_IN:
+ case WIDGET_SCRIPT_MOUSE_IN:
evas_event_feed_mouse_in(handle->e, timestamp * 1000, NULL);
break;
- case DBOX_SCRIPT_MOUSE_OUT:
+ case WIDGET_SCRIPT_MOUSE_OUT:
evas_event_feed_mouse_out(handle->e, timestamp * 1000, NULL);
break;
- case DBOX_SCRIPT_MOUSE_ON_SCROLL:
+ case WIDGET_SCRIPT_MOUSE_ON_SCROLL:
flags = evas_event_default_flags_get(handle->e);
flags |= EVAS_EVENT_FLAG_ON_SCROLL;
evas_event_default_flags_set(handle->e, flags);
break;
- case DBOX_SCRIPT_MOUSE_ON_HOLD: // To cancel the clicked, enable this
+ case WIDGET_SCRIPT_MOUSE_ON_HOLD: // To cancel the clicked, enable this
flags = evas_event_default_flags_get(handle->e);
flags |= EVAS_EVENT_FLAG_ON_HOLD;
evas_event_default_flags_set(handle->e, flags);
break;
- case DBOX_SCRIPT_MOUSE_OFF_SCROLL:
+ case WIDGET_SCRIPT_MOUSE_OFF_SCROLL:
flags = evas_event_default_flags_get(handle->e);
flags &= ~EVAS_EVENT_FLAG_ON_SCROLL;
evas_event_default_flags_set(handle->e, flags);
break;
- case DBOX_SCRIPT_MOUSE_OFF_HOLD:
+ case WIDGET_SCRIPT_MOUSE_OFF_HOLD:
flags = evas_event_default_flags_get(handle->e);
flags &= ~EVAS_EVENT_FLAG_ON_HOLD;
evas_event_default_flags_set(handle->e, flags);
break;
default:
- return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
}
- } else if (event_type & DBOX_SCRIPT_KEY_EVENT) {
+ } else if (event_type & WIDGET_SCRIPT_KEY_EVENT) {
const char *keyname = "";
const char *key = "";
const char *string = "";
const char *compose = "";
switch (event_type) {
- case DBOX_SCRIPT_KEY_DOWN:
+ case WIDGET_SCRIPT_KEY_DOWN:
evas_event_feed_key_down(handle->e, keyname, key, string, compose, timestamp * 1000, NULL);
- ret = DBOX_KEY_STATUS_DONE;
+ ret = WIDGET_KEY_STATUS_DONE;
/*!
* \TODO
* If the keyname == RIGHT, Need to check that
/*!
* if (REACH to the LAST) {
- * ret = DBOX_KEY_STATUS_LAST;
+ * ret = WIDGET_KEY_STATUS_LAST;
* } else {
- * ret = DBOX_KEY_STATUS_DONE;
+ * ret = WIDGET_KEY_STATUS_DONE;
* }
*
* if (REACH to the FIRST) {
- * ret = DBOX_KEY_STATUS_FIRST;
+ * ret = WIDGET_KEY_STATUS_FIRST;
* } else {
- * ret = DBOX_KEY_STATUS_DONE;
+ * ret = WIDGET_KEY_STATUS_DONE;
* }
*/
break;
- case DBOX_SCRIPT_KEY_UP:
+ case WIDGET_SCRIPT_KEY_UP:
evas_event_feed_key_up(handle->e, keyname, key, string, compose, timestamp * 1000, NULL);
- ret = DBOX_KEY_STATUS_DONE;
+ ret = WIDGET_KEY_STATUS_DONE;
break;
- case DBOX_SCRIPT_KEY_FOCUS_IN:
+ case WIDGET_SCRIPT_KEY_FOCUS_IN:
// evas_event_callback_call(handle->e, EVAS_CALLBACK_CANVAS_FOCUS_IN, NULL);
- ret = DBOX_KEY_STATUS_DONE;
+ ret = WIDGET_KEY_STATUS_DONE;
break;
- case DBOX_SCRIPT_KEY_FOCUS_OUT:
+ case WIDGET_SCRIPT_KEY_FOCUS_OUT:
// evas_event_callback_call(handle->e, EVAS_CALLBACK_CANVAS_FOCUS_OUT, NULL);
- ret = DBOX_KEY_STATUS_DONE;
+ ret = WIDGET_KEY_STATUS_DONE;
break;
default:
DbgPrint("Event is not implemented\n");
- ret = DBOX_KEY_STATUS_ERROR;
+ ret = WIDGET_KEY_STATUS_ERROR;
break;
}
}
edje = find_edje(handle, src_id);
if (!edje) {
ErrPrint("Edje is not exists (%s)\n", src_id);
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
obj_info = evas_object_data_get(edje, "obj_info");
if (!obj_info) {
ErrPrint("Object info is not valid\n");
- return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
}
obj = elm_object_part_content_unset(edje, part);
if (!path || !strlen(path) || access(path, R_OK) != 0) {
DbgPrint("SKIP - Path: [%s]\n", path);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
if (!target_id) {
obj = elm_layout_add(edje);
if (!obj) {
ErrPrint("Failed to add a new edje object\n");
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
edje_object_scale_set(elm_layout_edje_get(obj), elm_config_scale_get());
ErrPrint("Could not load %s from %s: %s\n", group, path, edje_load_error_str(err));
}
evas_object_del(obj);
- return DBOX_STATUS_ERROR_IO_ERROR;
+ return WIDGET_STATUS_ERROR_IO_ERROR;
}
evas_object_show(obj);
if (!obj_info) {
ErrPrint("Failed to add a obj_info\n");
evas_object_del(obj);
- return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
}
obj_info->id = strdup(target_id);
ErrPrint("Failed to add a obj_info\n");
free(obj_info);
evas_object_del(obj);
- return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
}
obj_info->parent = edje;
free(obj_info->id);
free(obj_info);
evas_object_del(obj);
- return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
}
child->part = strdup(part);
free(obj_info->id);
free(obj_info);
evas_object_del(obj);
- return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
}
child->obj = obj;
obj_info = evas_object_data_get(edje, "obj_info");
obj_info->children = eina_list_append(obj_info->children, child);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
PUBLIC int script_update_signal(void *h, const char *id, const char *part, const char *signal)
edje = find_edje(handle, id);
if (!edje) {
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
elm_object_signal_emit(edje, signal, part);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
PUBLIC int script_update_drag(void *h, const char *id, const char *part, double x, double y)
edje = find_edje(handle, id);
if (!edje) {
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
edje_object_part_drag_value_set(elm_layout_edje_get(edje), part, x, y);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
PUBLIC int script_update_size(void *han, const char *id, int w, int h)
edje = find_edje(handle, id);
if (!edje) {
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
if (!id) {
DbgPrint("Resize object to %dx%d\n", w, h);
evas_object_resize(edje, w, h);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
PUBLIC int script_update_category(void *h, const char *id, const char *category)
}
if (!category) {
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
handle->category = strdup(category);
if (!handle->category) {
ErrPrint("Error: %s\n", strerror(errno));
- return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
}
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
PUBLIC void *script_create(void *buffer_handle, const char *file, const char *group)
if (!eina_list_data_find(s_info.handle_list, handle)) {
DbgPrint("Not found (already deleted?)\n");
- return DBOX_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_STATUS_ERROR_NOT_EXIST;
}
s_info.handle_list = eina_list_remove(s_info.handle_list, handle);
free(handle->file);
free(handle->group);
free(handle);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
static void sw_render_pre_cb(void *data, Evas *e, void *event_info)
static int destroy_ecore_evas(struct info *handle)
{
if (!handle->ee) {
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
ecore_evas_free(handle->ee);
handle->ee = NULL;
handle->e = NULL;
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
static int create_ecore_evas(struct info *handle, int *w, int *h)
script_buffer_get_size(handle->buffer_handle, w, h);
if (*w == 0 && *h == 0) {
ErrPrint("ZERO size FB accessed\n");
- return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
}
if (handle->ee) {
ecore_evas_resize(handle->ee, *w, *h);
}
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
if (!script_buffer_auto_align() && s_info.alloc_canvas_with_stride) {
handle->ee = s_info.alloc_canvas(*w, *h, alloc_fb, free_fb, handle);
} else {
ErrPrint("Failed to allocate canvas\n");
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
if (!handle->ee) {
ErrPrint("Failed to create a buffer\n");
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
handle->e = ecore_evas_get(handle->ee);
ErrPrint("Failed to get an Evas\n");
ecore_evas_free(handle->ee);
handle->ee = NULL;
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
if (script_buffer_type(handle->buffer_handle) == BUFFER_TYPE_PIXMAP) {
ecore_evas_show(handle->ee);
ecore_evas_activate(handle->ee);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
PUBLIC int script_load(void *_handle, int (*render_pre)(void *buffer_handle, void *data), int (*render_post)(void *render_handle, void *data), void *data)
if (!obj_info) {
ErrPrint("Heap: %s\n", strerror(errno));
destroy_ecore_evas(handle);
- return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
}
obj_info->parent = evas_object_rectangle_add(handle->e);
ErrPrint("Unable to create a parent box\n");
free(obj_info);
destroy_ecore_evas(handle);
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
edje = elm_layout_add(obj_info->parent);
evas_object_del(obj_info->parent);
free(obj_info);
destroy_ecore_evas(handle);
- return DBOX_STATUS_ERROR_FAULT;
+ return WIDGET_STATUS_ERROR_FAULT;
}
edje_object_scale_set(elm_layout_edje_get(edje), elm_config_scale_get());
evas_object_del(obj_info->parent);
free(obj_info);
destroy_ecore_evas(handle);
- return DBOX_STATUS_ERROR_IO_ERROR;
+ return WIDGET_STATUS_ERROR_IO_ERROR;
}
handle->parent = edje;
evas_object_data_set(edje, "obj_info", obj_info);
handle->obj_list = eina_list_append(handle->obj_list, edje);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
PUBLIC int script_unload(void *_handle)
}
(void)destroy_ecore_evas(handle);
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
static void access_cb(keynode_t *node, void *user_data)
ErrPrint("No way to allocate canvas\n");
}
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
PUBLIC int script_fini(void)
free(s_info.font_name);
s_info.font_name = NULL;
- return DBOX_STATUS_ERROR_NONE;
+ return WIDGET_STATUS_ERROR_NONE;
}
/* End of a file */