Enhance the double buffering concept.
authorSung-jae Park <nicesj.park@samsung.com>
Fri, 31 Oct 2014 13:02:26 +0000 (22:02 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Fri, 31 Oct 2014 13:02:26 +0000 (22:02 +0900)
[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: Id3ac98d4d3e5564fa164f93411a4732984f0ac07

src/dlist.c
src/dynamicbox.c
src/snapshot_window.c
src/util.c
src/virtual_window.c
src/virtual_window_wayland.c

index 44178c5..cb3aa39 100644 (file)
@@ -32,21 +32,21 @@ struct dlist *dlist_append(struct dlist *list, void *data)
 
     item = malloc(sizeof(*item));
     if (!item) {
-        return NULL;
+       return NULL;
     }
 
     item->next = NULL;
     item->data = data;
 
     if (!list) {
-        item->prev = item;
+       item->prev = item;
 
-        list = item;
+       list = item;
     } else {
-        item->prev = list->prev;
-        item->prev->next = item;
+       item->prev = list->prev;
+       item->prev->next = item;
 
-        list->prev = item;
+       list->prev = item;
     }
 
     assert(!list->prev->next && "item NEXT");
@@ -60,16 +60,16 @@ struct dlist *dlist_prepend(struct dlist *list, void *data)
 
     item = malloc(sizeof(*item));
     if (!item) {
-        return NULL;
+       return NULL;
     }
 
     if (!list) {
-        item->prev = item;
-        item->next = NULL;
+       item->prev = item;
+       item->next = NULL;
     } else {
-        item->prev = list->prev;
-        list->prev = item;
-        item->next = list;
+       item->prev = list->prev;
+       list->prev = item;
+       item->next = list;
     }
 
     return item;
@@ -78,18 +78,18 @@ struct dlist *dlist_prepend(struct dlist *list, void *data)
 struct dlist *dlist_remove(struct dlist *list, struct dlist *l)
 {
     if (!list || !l) {
-        return NULL;
+       return NULL;
     }
 
     if (l == list) {
-        l->prev = list->prev;
-        list = l->next;
+       l->prev = list->prev;
+       list = l->next;
     } else {
-        l->prev->next = l->next;
+       l->prev->next = l->next;
     }
 
     if (l->next) {
-        l->next->prev = l->prev;
+       l->next->prev = l->prev;
     }
 
     free(l);
@@ -102,9 +102,9 @@ struct dlist *dlist_find_data(struct dlist *list, void *data)
     void *_data;
 
     dlist_foreach(list, l, _data) {
-        if (data == _data) {
-            return l;
-        }
+       if (data == _data) {
+           return l;
+       }
     }
 
     return NULL;
@@ -133,7 +133,7 @@ int dlist_count(struct dlist *l)
 
     i = 0;
     dlist_foreach(l, n, data) {
-        i++;
+       i++;
     }
 
     return i;
@@ -147,11 +147,11 @@ struct dlist *dlist_nth(struct dlist *l, int nth)
 
     i = 0;
     dlist_foreach(l, n, data) {
-        if (i == nth) {
-            return l;
-        }
+       if (i == nth) {
+           return l;
+       }
 
-        i++;
+       i++;
     }
 
     return NULL;
index 1c2002d..67dc1c3 100644 (file)
@@ -86,19 +86,19 @@ static struct info {
     int (*update_extra_info)(const char *id, const char *content, const char *title, const char *icon, const char *name);
 
     enum load_type {
-    LOAD_TYPE_UNKNOWN = -1,
-    LOAD_TYPE_SLAVE   = 0,
-    LOAD_TYPE_APP     = 1
+       LOAD_TYPE_UNKNOWN = -1,
+       LOAD_TYPE_SLAVE   = 0,
+       LOAD_TYPE_APP     = 1
     } type;
 
     union _updated {
-    struct _slave {
-        int (*send)(const char *pkgname, const char *id, int idx, int x, int y, int w, int h, int gbar, const char *descfile);
-    } slave;
+       struct _slave {
+           int (*send)(const char *pkgname, const char *id, int idx, int x, int y, int w, int h, int gbar, const char *descfile);
+       } slave;
 
-    struct _app {
-        int (*send)(const char *id, int idx, int x, int y, int w, int h, int gbar);
-    } app;
+       struct _app {
+           int (*send)(const char *id, int idx, int x, int y, int w, int h, int gbar);
+       } app;
     } updated;
 } s_info = {
     .find_pkgname = NULL,
@@ -121,14 +121,14 @@ static inline void load_update_function(void)
     /* Must to be checked the slave function first. */
     s_info.updated.slave.send = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_SEND_UPDATED);
     if (s_info.updated.slave.send) {
-    s_info.type = LOAD_TYPE_SLAVE;
-    DbgPrint("Slave detected\n");
+       s_info.type = LOAD_TYPE_SLAVE;
+       DbgPrint("Slave detected\n");
     } else {
-    s_info.updated.app.send = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_PROVIDER_APP_UPDATED);
-    if (s_info.updated.app.send) {
-        s_info.type = LOAD_TYPE_APP;
-        DbgPrint("App detected\n");
-    }
+       s_info.updated.app.send = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_PROVIDER_APP_UPDATED);
+       if (s_info.updated.app.send) {
+           s_info.type = LOAD_TYPE_APP;
+           DbgPrint("App detected\n");
+       }
     }
 }
 
@@ -137,21 +137,21 @@ static int send_updated(const char *pkgname, const char *id, int idx, int x, int
     int ret = DBOX_STATUS_ERROR_INVALID_PARAMETER;
 
     if (s_info.type == LOAD_TYPE_UNKNOWN) {
-    load_update_function();
+       load_update_function();
     }
 
     if (s_info.type == LOAD_TYPE_APP) {
-    ret = s_info.updated.app.send(id, idx, x, y, w, h, gbar);
+       ret = s_info.updated.app.send(id, idx, x, y, w, h, gbar);
     } else if (s_info.type == LOAD_TYPE_SLAVE) {
-    ret = s_info.updated.slave.send(pkgname, id, idx, x, y, w, h, gbar, descfile);
+       ret = s_info.updated.slave.send(pkgname, id, idx, x, y, w, h, gbar, descfile);
     } else {
-    dynamicbox_damage_region_t region = {
-        .x = x,
-        .y = y,
-        .w = w,
-        .h = h,
-    };
-    ret = dynamicbox_provider_send_updated(pkgname, id, idx, &region, gbar, descfile);
+       dynamicbox_damage_region_t region = {
+           .x = x,
+           .y = y,
+           .w = w,
+           .h = h,
+       };
+       ret = dynamicbox_provider_send_updated(pkgname, id, idx, &region, gbar, descfile);
     }
 
     return ret;
@@ -166,7 +166,7 @@ static char *id_to_uri(const char *id)
 
     uri = malloc(uri_len);
     if (!uri) {
-    return NULL;
+       return NULL;
     }
 
     snprintf(uri, uri_len, FILE_SCHEMA "%s", id);
@@ -182,60 +182,60 @@ static inline int event_handler_wrapper(dynamicbox_buffer_h buffer, dynamicbox_b
 
     pkgname = dynamicbox_provider_buffer_pkgname(buffer);
     if (!pkgname) {
-    ErrPrint("pkgname is not valid\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("pkgname is not valid\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     id = dynamicbox_provider_buffer_id(buffer);
     if (!id) {
-    ErrPrint("id is not valid[%s]\n", pkgname);
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("id is not valid[%s]\n", pkgname);
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (cbdata->handler) {
-    ret = cbdata->handler(buffer, event_info, cbdata->cbdata);
+       ret = cbdata->handler(buffer, event_info, cbdata->cbdata);
     } else {
-    ret = DBOX_STATUS_ERROR_FAULT;
+       ret = DBOX_STATUS_ERROR_FAULT;
     }
 
     switch (event_info->type) {
-    case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT:
-    case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_NEXT:
-    case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_PREV:
-    case DBOX_BUFFER_EVENT_ACCESS_ACTIVATE:
-    case DBOX_BUFFER_EVENT_ACCESS_ACTION_UP:
-    case DBOX_BUFFER_EVENT_ACCESS_ACTION_DOWN:
-    case DBOX_BUFFER_EVENT_ACCESS_SCROLL_UP:
-    case DBOX_BUFFER_EVENT_ACCESS_SCROLL_MOVE:
-    case DBOX_BUFFER_EVENT_ACCESS_SCROLL_DOWN:
-    case DBOX_BUFFER_EVENT_ACCESS_UNHIGHLIGHT:
-    case DBOX_BUFFER_EVENT_ACCESS_VALUE_CHANGE:
-    case DBOX_BUFFER_EVENT_ACCESS_MOUSE:
-    case DBOX_BUFFER_EVENT_ACCESS_BACK:
-    case DBOX_BUFFER_EVENT_ACCESS_OVER:
-    case DBOX_BUFFER_EVENT_ACCESS_READ:
-    case DBOX_BUFFER_EVENT_ACCESS_ENABLE:
-    case DBOX_BUFFER_EVENT_ACCESS_DISABLE:
-        DbgPrint("Accessibility event: %d\n", event_info->type);
-        if (ret < 0) {
-        (void)dynamicbox_provider_send_access_status(pkgname, id, DBOX_ACCESS_STATUS_ERROR);
-        } else {
-        (void)dynamicbox_provider_send_access_status(pkgname, id, ret);
-        }
-        break;
-    case DBOX_BUFFER_EVENT_KEY_UP:
-    case DBOX_BUFFER_EVENT_KEY_DOWN:
-    case DBOX_BUFFER_EVENT_KEY_FOCUS_IN:
-    case DBOX_BUFFER_EVENT_KEY_FOCUS_OUT:
-        DbgPrint("Key event: %d\n", event_info->type);
-        if (ret < 0) {
-        (void)dynamicbox_provider_send_key_status(pkgname, id, DBOX_KEY_STATUS_ERROR);
-        } else {
-        (void)dynamicbox_provider_send_key_status(pkgname, id, ret);
-        }
-        break;
-    default:
-        break;
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT:
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_NEXT:
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_PREV:
+       case DBOX_BUFFER_EVENT_ACCESS_ACTIVATE:
+       case DBOX_BUFFER_EVENT_ACCESS_ACTION_UP:
+       case DBOX_BUFFER_EVENT_ACCESS_ACTION_DOWN:
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_UP:
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_MOVE:
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_DOWN:
+       case DBOX_BUFFER_EVENT_ACCESS_UNHIGHLIGHT:
+       case DBOX_BUFFER_EVENT_ACCESS_VALUE_CHANGE:
+       case DBOX_BUFFER_EVENT_ACCESS_MOUSE:
+       case DBOX_BUFFER_EVENT_ACCESS_BACK:
+       case DBOX_BUFFER_EVENT_ACCESS_OVER:
+       case DBOX_BUFFER_EVENT_ACCESS_READ:
+       case DBOX_BUFFER_EVENT_ACCESS_ENABLE:
+       case DBOX_BUFFER_EVENT_ACCESS_DISABLE:
+           DbgPrint("Accessibility event: %d\n", event_info->type);
+           if (ret < 0) {
+               (void)dynamicbox_provider_send_access_status(pkgname, id, DBOX_ACCESS_STATUS_ERROR);
+           } else {
+               (void)dynamicbox_provider_send_access_status(pkgname, id, ret);
+           }
+           break;
+       case DBOX_BUFFER_EVENT_KEY_UP:
+       case DBOX_BUFFER_EVENT_KEY_DOWN:
+       case DBOX_BUFFER_EVENT_KEY_FOCUS_IN:
+       case DBOX_BUFFER_EVENT_KEY_FOCUS_OUT:
+           DbgPrint("Key event: %d\n", event_info->type);
+           if (ret < 0) {
+               (void)dynamicbox_provider_send_key_status(pkgname, id, DBOX_KEY_STATUS_ERROR);
+           } else {
+               (void)dynamicbox_provider_send_key_status(pkgname, id, ret);
+           }
+           break;
+       default:
+           break;
     }
 
     return ret;
@@ -273,39 +273,39 @@ PUBLIC struct dynamicbox_desc *dynamicbox_desc_open(const char *filename, int fo
 
     handle = calloc(1, sizeof(*handle));
     if (!handle) {
-    ErrPrint("Error: %s\n", strerror(errno));
-    return NULL;
+       ErrPrint("Error: %s\n", strerror(errno));
+       return NULL;
     }
 
     if (for_pd) {
-    int len;
-    len = strlen(filename) + strlen(".desc") + 1;
-    new_fname = malloc(len);
-    if (!new_fname) {
-        ErrPrint("Error: %s\n", strerror(errno));
-        free(handle);
-        return NULL;
-    }
-    snprintf(new_fname, len, "%s.desc", filename);
+       int len;
+       len = strlen(filename) + strlen(".desc") + 1;
+       new_fname = malloc(len);
+       if (!new_fname) {
+           ErrPrint("Error: %s\n", strerror(errno));
+           free(handle);
+           return NULL;
+       }
+       snprintf(new_fname, len, "%s.desc", filename);
     } else {
-    new_fname = strdup(filename);
-    if (!new_fname) {
-        ErrPrint("Error: %s\n", strerror(errno));
-        free(handle);
-        return NULL;
-    }
+       new_fname = strdup(filename);
+       if (!new_fname) {
+           ErrPrint("Error: %s\n", strerror(errno));
+           free(handle);
+           return NULL;
+       }
     }
 
     DbgPrint("Open a file %s with merge mode %s\n",
-        new_fname,
-        access(new_fname, F_OK) == 0 ? "enabled" : "disabled");
+           new_fname,
+           access(new_fname, F_OK) == 0 ? "enabled" : "disabled");
 
     handle->fp = fopen(new_fname, "at");
     free(new_fname);
     if (!handle->fp) {
-    ErrPrint("Failed to open a file: %s\n", strerror(errno));
-    free(handle);
-    return NULL;
+       ErrPrint("Failed to open a file: %s\n", strerror(errno));
+       free(handle);
+       return NULL;
     }
 
     return handle;
@@ -318,49 +318,49 @@ PUBLIC int dynamicbox_desc_close(struct dynamicbox_desc *handle)
     struct block *block;
 
     if (!handle) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     dlist_foreach_safe(handle->block_list, l, n, block) {
-    handle->block_list = dlist_remove(handle->block_list, l);
+       handle->block_list = dlist_remove(handle->block_list, l);
 
-    fprintf(handle->fp, "{\n");
-    if (block->type) {
-        fprintf(handle->fp, "type=%s\n", block->type);
-    }
+       fprintf(handle->fp, "{\n");
+       if (block->type) {
+           fprintf(handle->fp, "type=%s\n", block->type);
+       }
 
-    if (block->part) {
-        fprintf(handle->fp, "part=%s\n", block->part);
-    }
+       if (block->part) {
+           fprintf(handle->fp, "part=%s\n", block->part);
+       }
 
-    if (block->data) {
-        fprintf(handle->fp, "data=%s\n", block->data);
-    }
+       if (block->data) {
+           fprintf(handle->fp, "data=%s\n", block->data);
+       }
 
-    if (block->option) {
-        fprintf(handle->fp, "option=%s\n", block->option);
-    }
+       if (block->option) {
+           fprintf(handle->fp, "option=%s\n", block->option);
+       }
 
-    if (block->id) {
-        fprintf(handle->fp, "id=%s\n", block->id);
-    }
+       if (block->id) {
+           fprintf(handle->fp, "id=%s\n", block->id);
+       }
 
-    if (block->target_id) {
-        fprintf(handle->fp, "target=%s\n", block->target_id);
-    }
-    fprintf(handle->fp, "}\n");
+       if (block->target_id) {
+           fprintf(handle->fp, "target=%s\n", block->target_id);
+       }
+       fprintf(handle->fp, "}\n");
 
-    free(block->type);
-    free(block->part);
-    free(block->data);
-    free(block->option);
-    free(block->id);
-    free(block->target_id);
-    free(block);
+       free(block->type);
+       free(block->part);
+       free(block->data);
+       free(block->option);
+       free(block->id);
+       free(block->target_id);
+       free(block);
     }
 
     if (fclose(handle->fp) != 0) {
-    ErrPrint("fclose: %s\n", strerror(errno));
+       ErrPrint("fclose: %s\n", strerror(errno));
     }
     free(handle);
     return DBOX_STATUS_ERROR_NONE;
@@ -371,44 +371,44 @@ PUBLIC int dynamicbox_desc_set_category(struct dynamicbox_desc *handle, const ch
     struct block *block;
 
     if (!handle || !category) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     block = calloc(1, sizeof(*block));
     if (!block) {
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     block->type = strdup(DBOX_DESC_TYPE_INFO);
     if (!block->type) {
-    free(block);
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       free(block);
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     block->part = strdup("category");
     if (!block->part) {
-    free(block->type);
-    free(block);
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       free(block->type);
+       free(block);
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     block->data = strdup(category);
     if (!block->data) {
-    free(block->type);
-    free(block->part);
-    free(block);
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       free(block->type);
+       free(block->part);
+       free(block);
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     if (id) {
-    block->id = strdup(id);
-    if (!block->id) {
-        free(block->data);
-        free(block->type);
-        free(block->part);
-        free(block);
-        return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
-    }
+       block->id = strdup(id);
+       if (!block->id) {
+           free(block->data);
+           free(block->type);
+           free(block->part);
+           free(block);
+           return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       }
     }
 
     block->idx = handle->last_idx++;
@@ -422,44 +422,44 @@ PUBLIC int dynamicbox_desc_set_size(struct dynamicbox_desc *handle, const char *
     char buffer[BUFSIZ];
 
     if (!handle) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     block = calloc(1, sizeof(*block));
     if (!block) {
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     block->type = strdup(DBOX_DESC_TYPE_INFO);
     if (!block->type) {
-    free(block);
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       free(block);
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     block->part = strdup("size");
     if (!block->part) {
-    free(block->type);
-    free(block);
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       free(block->type);
+       free(block);
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     if (id) {
-    block->id = strdup(id);
-    if (!block->id) {
-        free(block->part);
-        free(block->type);
-        free(block);
-        return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
-    }
+       block->id = strdup(id);
+       if (!block->id) {
+           free(block->part);
+           free(block->type);
+           free(block);
+           return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       }
     }
 
     snprintf(buffer, sizeof(buffer), "%dx%d", w, h);
     block->data = strdup(buffer);
     if (!block->data) {
-    free(block->part);
-    free(block->type);
-    free(block);
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       free(block->part);
+       free(block->type);
+       free(block);
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     block->idx = handle->last_idx++;
@@ -473,27 +473,27 @@ PUBLIC int dynamicbox_desc_set_id(struct dynamicbox_desc *handle, int idx, const
     struct block *block;
 
     dlist_foreach(handle->block_list, l, block) {
-    if (block->idx == idx) {
-        if (strcasecmp(block->type, DBOX_DESC_TYPE_SCRIPT)) {
-        ErrPrint("Invalid block is used\n");
-        return DBOX_STATUS_ERROR_INVALID_PARAMETER;
-        }
+       if (block->idx == idx) {
+           if (strcasecmp(block->type, DBOX_DESC_TYPE_SCRIPT)) {
+               ErrPrint("Invalid block is used\n");
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+           }
 
-        free(block->target_id);
-        block->target_id = NULL;
+           free(block->target_id);
+           block->target_id = NULL;
 
-        if (!id || !strlen(id)) {
-        return DBOX_STATUS_ERROR_NONE;
-        }
+           if (!id || !strlen(id)) {
+               return DBOX_STATUS_ERROR_NONE;
+           }
 
-        block->target_id = strdup(id);
-        if (!block->target_id) {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
-        }
+           block->target_id = strdup(id);
+           if (!block->target_id) {
+               ErrPrint("Heap: %s\n", strerror(errno));
+               return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+           }
 
-        return DBOX_STATUS_ERROR_NONE;
-    }
+           return DBOX_STATUS_ERROR_NONE;
+       }
     }
 
     return DBOX_STATUS_ERROR_NOT_EXIST;
@@ -507,70 +507,70 @@ PUBLIC int dynamicbox_desc_add_block(struct dynamicbox_desc *handle, const char
     struct block *block;
 
     if (!handle || !type) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (!part) {
-    part = "";
+       part = "";
     }
 
     if (!data) {
-    data = "";
+       data = "";
     }
 
     block = calloc(1, sizeof(*block));
     if (!block) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     block->type = strdup(type);
     if (!block->type) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    free(block);
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       free(block);
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     block->part = strdup(part);
     if (!block->part) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    free(block->type);
-    free(block);
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       free(block->type);
+       free(block);
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     block->data = strdup(data);
     if (!block->data) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    free(block->type);
-    free(block->part);
-    free(block);
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       free(block->type);
+       free(block->part);
+       free(block);
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     if (option) {
-    block->option = strdup(option);
-    if (!block->option) {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        free(block->data);
-        free(block->type);
-        free(block->part);
-        free(block);
-        return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
-    }
+       block->option = strdup(option);
+       if (!block->option) {
+           ErrPrint("Heap: %s\n", strerror(errno));
+           free(block->data);
+           free(block->type);
+           free(block->part);
+           free(block);
+           return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       }
     }
 
     if (id) {
-    block->id = strdup(id);
-    if (!block->id) {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        free(block->option);
-        free(block->data);
-        free(block->type);
-        free(block->part);
-        free(block);
-        return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
-    }
+       block->id = strdup(id);
+       if (!block->id) {
+           ErrPrint("Heap: %s\n", strerror(errno));
+           free(block->option);
+           free(block->data);
+           free(block->type);
+           free(block->part);
+           free(block);
+           return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       }
     }
 
     block->idx = handle->last_idx++;
@@ -584,21 +584,21 @@ PUBLIC int dynamicbox_desc_del_block(struct dynamicbox_desc *handle, int idx)
     struct block *block;
 
     if (!handle || idx < 0) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     dlist_foreach(handle->block_list, l, block) {
-    if (block->idx == idx) {
-        handle->block_list = dlist_remove(handle->block_list, l);
-        free(block->type);
-        free(block->part);
-        free(block->data);
-        free(block->option);
-        free(block->id);
-        free(block->target_id);
-        free(block);
-        return DBOX_STATUS_ERROR_NONE;
-    }
+       if (block->idx == idx) {
+           handle->block_list = dlist_remove(handle->block_list, l);
+           free(block->type);
+           free(block->part);
+           free(block->data);
+           free(block->option);
+           free(block->id);
+           free(block->target_id);
+           free(block);
+           return DBOX_STATUS_ERROR_NONE;
+       }
     }
 
     return DBOX_STATUS_ERROR_NOT_EXIST;
@@ -609,25 +609,25 @@ PUBLIC int dynamicbox_acquire_buffer(dynamicbox_buffer_h handle, int idx, int wi
     int ret;
 
     if (!handle || width <= 0 || height <= 0 || pixel_size <= 0 || idx > DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (idx >= 0) {
-    int _width = 0;
-    int _height = 0;
-    int _pixel_size = 0;
-    /* To validate the buffer */
-    if (dynamicbox_provider_buffer_get_size(handle, &_width, &_height, &_pixel_size) < 0) {
-        ErrPrint("Failed to get buffer size\n");
-    }
-
-        if (_width != width || _height != height || pixel_size != _pixel_size) {
-        DbgPrint("Extra buffer's geometry is not matched with primary one\n");
-    }
-
-    ret = dynamicbox_provider_buffer_extra_acquire(handle, idx, width, height, pixel_size);
+       int _width = 0;
+       int _height = 0;
+       int _pixel_size = 0;
+       /* To validate the buffer */
+       if (dynamicbox_provider_buffer_get_size(handle, &_width, &_height, &_pixel_size) < 0) {
+           ErrPrint("Failed to get buffer size\n");
+       }
+
+       if (_width != width || _height != height || pixel_size != _pixel_size) {
+           DbgPrint("Extra buffer's geometry is not matched with primary one\n");
+       }
+
+       ret = dynamicbox_provider_buffer_extra_acquire(handle, idx, width, height, pixel_size);
     } else {
-    ret = dynamicbox_provider_buffer_acquire(handle, width, height, pixel_size);
+       ret = dynamicbox_provider_buffer_acquire(handle, width, height, pixel_size);
     }
 
     return ret;
@@ -641,14 +641,14 @@ PUBLIC dynamicbox_buffer_h dynamicbox_create_buffer(const char *filename, int is
     char *uri;
 
     if (!filename) {
-    ErrPrint("Invalid argument: %p(%dx%d)\n", filename);
-    return NULL;
+       ErrPrint("Invalid argument: %p(%dx%d)\n", filename);
+       return NULL;
     }
 
     user_data = calloc(1, sizeof(*user_data));
     if (!user_data) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    return NULL;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       return NULL;
     }
 
     user_data->is_gbar = is_gbar;
@@ -657,34 +657,34 @@ PUBLIC dynamicbox_buffer_h dynamicbox_create_buffer(const char *filename, int is
 
     uri = id_to_uri(filename);
     if (!uri) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    free(user_data);
-    return NULL;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       free(user_data);
+       return NULL;
     }
 
     if (!s_info.find_pkgname) {
-    s_info.find_pkgname = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_FIND_PKGNAME);
-    if (!s_info.find_pkgname) {
-        ErrPrint("Failed to find a \"dynamicbox_find_pkgname\"\n");
-        free(user_data);
-        free(uri);
-        return NULL;
-    }
+       s_info.find_pkgname = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_FIND_PKGNAME);
+       if (!s_info.find_pkgname) {
+           ErrPrint("Failed to find a \"dynamicbox_find_pkgname\"\n");
+           free(user_data);
+           free(uri);
+           return NULL;
+       }
     }
 
     pkgname = s_info.find_pkgname(uri);
     if (!pkgname) {
-    ErrPrint("Invalid Request\n");
-    free(user_data);
-    free(uri);
-    return NULL;
+       ErrPrint("Invalid Request\n");
+       free(user_data);
+       free(uri);
+       return NULL;
     }
 
     handle = dynamicbox_provider_buffer_create((!!is_gbar) ? DBOX_TYPE_GBAR : DBOX_TYPE_DBOX, pkgname, uri, auto_align, event_handler_wrapper, user_data);
     free(uri);
     if (!handle) {
-    free(user_data);
-    return NULL;
+       free(user_data);
+       return NULL;
     }
 
     (void)dynamicbox_provider_buffer_set_user_data(handle, user_data);
@@ -697,23 +697,23 @@ PUBLIC int dynamicbox_request_update(const char *filename)
     int ret;
 
     if (!filename) {
-    ErrPrint("Invalid argument\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid argument\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     uri = id_to_uri(filename);
     if (!uri) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     if (!s_info.request_update_by_id) {
-    s_info.request_update_by_id = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_REQUEST_UPDATE_BY_ID);
-    if (!s_info.request_update_by_id) {
-        ErrPrint("\"dynamicbox_request_update_by_id\" is not exists\n");
-        free(uri);
-        return DBOX_STATUS_ERROR_FAULT;
-    }
+       s_info.request_update_by_id = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_REQUEST_UPDATE_BY_ID);
+       if (!s_info.request_update_by_id) {
+           ErrPrint("\"dynamicbox_request_update_by_id\" is not exists\n");
+           free(uri);
+           return DBOX_STATUS_ERROR_FAULT;
+       }
     }
 
     ret = s_info.request_update_by_id(uri);
@@ -726,13 +726,13 @@ PUBLIC unsigned int dynamicbox_resource_id(dynamicbox_buffer_h handle, int idx)
     int ret;
 
     if (!handle || idx > DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (idx >= 0) {
-    ret = dynamicbox_provider_buffer_extra_resource_id(handle, idx);
+       ret = dynamicbox_provider_buffer_extra_resource_id(handle, idx);
     } else {
-    ret = dynamicbox_provider_buffer_resource_id(handle);
+       ret = dynamicbox_provider_buffer_resource_id(handle);
     }
 
     return ret;
@@ -743,13 +743,13 @@ PUBLIC int dynamicbox_release_buffer(dynamicbox_buffer_h handle, int idx)
     int ret;
 
     if (!handle || idx > DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (idx >= 0) {
-    ret = dynamicbox_provider_buffer_extra_release(handle, idx);
+       ret = dynamicbox_provider_buffer_extra_release(handle, idx);
     } else {
-    ret = dynamicbox_provider_buffer_release(handle);
+       ret = dynamicbox_provider_buffer_release(handle);
     }
 
     DbgPrint("Release buffer: %d (%d)\n", idx, ret);
@@ -761,17 +761,17 @@ PUBLIC int dynamicbox_destroy_buffer(dynamicbox_buffer_h handle)
     struct dynamicbox_buffer_data *user_data;
 
     if (!handle) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     user_data = dynamicbox_provider_buffer_user_data(handle);
     if (user_data) {
-    free(user_data->content);
-    free(user_data->title);
-    free(user_data->icon);
-    free(user_data->name);
-    free(user_data);
-    dynamicbox_provider_buffer_set_user_data(handle, NULL);
+       free(user_data->content);
+       free(user_data->title);
+       free(user_data->icon);
+       free(user_data->name);
+       free(user_data);
+       dynamicbox_provider_buffer_set_user_data(handle, NULL);
     }
 
     DbgPrint("Destroy buffer\n");
@@ -786,25 +786,25 @@ PUBLIC void *dynamicbox_ref_buffer(dynamicbox_buffer_h handle)
     int ret;
 
     if (!handle) {
-    return NULL;
+       return NULL;
     }
 
     user_data = dynamicbox_provider_buffer_user_data(handle);
     if (!user_data) {
-    return NULL;
+       return NULL;
     }
 
     if (user_data->accelerated) {
-    DbgPrint("H/W accelerated buffer is allocated\n");
-    return NULL;
+       DbgPrint("H/W accelerated buffer is allocated\n");
+       return NULL;
     }
 
     ret = dynamicbox_provider_buffer_get_size(handle, &w, &h, &size);
 
     data = dynamicbox_provider_buffer_ref(handle);
     if (data && !ret && w > 0 && h > 0 && size > 0) {
-    memset(data, 0, w * h * size);
-    (void)dynamicbox_provider_buffer_sync(handle);
+       memset(data, 0, w * h * size);
+       (void)dynamicbox_provider_buffer_sync(handle);
     }
 
     DbgPrint("Ref buffer %ds%d(%d)\n", w, h, size);
@@ -814,7 +814,7 @@ PUBLIC void *dynamicbox_ref_buffer(dynamicbox_buffer_h handle)
 PUBLIC int dynamicbox_unref_buffer(void *buffer)
 {
     if (!buffer) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     DbgPrint("Unref buffer\n");
@@ -831,36 +831,36 @@ PUBLIC int dynamicbox_sync_buffer(dynamicbox_buffer_h handle)
     int pixel_size;
 
     if (!handle) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     user_data = dynamicbox_provider_buffer_user_data(handle);
     if (!user_data) {
-    ErrPrint("Invalid buffer\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid buffer\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (user_data->accelerated) {
-    DbgPrint("H/W Buffer allocated. skip the sync buffer\n");
-    return DBOX_STATUS_ERROR_NONE;
+       DbgPrint("H/W Buffer allocated. skip the sync buffer\n");
+       return DBOX_STATUS_ERROR_NONE;
     }
 
     pkgname = dynamicbox_provider_buffer_pkgname(handle);
     if (!pkgname) {
-    ErrPrint("Invalid buffer handler\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid buffer handler\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     id = dynamicbox_provider_buffer_id(handle);
     if (!id) {
-    ErrPrint("Invalid buffer handler\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid buffer handler\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     (void)dynamicbox_provider_buffer_sync(handle);
 
     if (dynamicbox_provider_buffer_get_size(handle, &w, &h, &pixel_size) < 0) {
-    ErrPrint("Failed to get size (%s)\n", id);
+       ErrPrint("Failed to get size (%s)\n", id);
     }
 
     /**
@@ -870,13 +870,13 @@ PUBLIC int dynamicbox_sync_buffer(dynamicbox_buffer_h handle)
      */
 
     if (user_data->is_gbar == 1) {
-    if (send_updated(pkgname, id, DBOX_PRIMARY_BUFFER, 0, 0, w, h, user_data->is_gbar, NULL) < 0) {
-        ErrPrint("Failed to send GBAR updated (%s)\n", id);
-    }
+       if (send_updated(pkgname, id, DBOX_PRIMARY_BUFFER, 0, 0, w, h, user_data->is_gbar, NULL) < 0) {
+           ErrPrint("Failed to send GBAR updated (%s)\n", id);
+       }
     } else {
-    if (send_updated(pkgname, id, DBOX_PRIMARY_BUFFER, 0, 0, w, h, user_data->is_gbar, NULL) < 0) {
-        ErrPrint("Failed to send updated (%s)\n", id);
-    }
+       if (send_updated(pkgname, id, DBOX_PRIMARY_BUFFER, 0, 0, w, h, user_data->is_gbar, NULL) < 0) {
+           ErrPrint("Failed to send updated (%s)\n", id);
+       }
     }
 
     return DBOX_STATUS_ERROR_NONE;
@@ -893,35 +893,35 @@ PUBLIC int dynamicbox_send_updated_by_idx(dynamicbox_buffer_h handle, int idx)
 
     user_data = dynamicbox_provider_buffer_user_data(handle);
     if (!user_data) {
-    ErrPrint("Invalid buffer\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid buffer\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     pkgname = dynamicbox_provider_buffer_pkgname(handle);
     if (!pkgname) {
-    ErrPrint("Invalid buffer handler\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid buffer handler\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     id = dynamicbox_provider_buffer_id(handle);
     if (!id) {
-    ErrPrint("Invalid buffer handler\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid buffer handler\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (dynamicbox_provider_buffer_get_size(handle, &w, &h, &pixel_size) < 0) {
-    ErrPrint("Failed to get size (%s)\n", id);
+       ErrPrint("Failed to get size (%s)\n", id);
     }
 
     if (send_updated(pkgname, id, idx, 0, 0, w, h, user_data->is_gbar, NULL) < 0) {
-    ErrPrint("Failed to send GBAR updated (%s) %d\n", id, idx);
+       ErrPrint("Failed to send GBAR updated (%s) %d\n", id, idx);
     }
 }
 
 PUBLIC int dynamicbox_support_hw_buffer(dynamicbox_buffer_h handle)
 {
     if (!handle) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     return dynamicbox_provider_buffer_is_support_hw(handle);
@@ -933,16 +933,16 @@ PUBLIC int dynamicbox_create_hw_buffer(dynamicbox_buffer_h handle)
     int ret;
 
     if (!handle) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     user_data = dynamicbox_provider_buffer_user_data(handle);
     if (!user_data) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (user_data->accelerated) {
-    return DBOX_STATUS_ERROR_ALREADY;
+       return DBOX_STATUS_ERROR_ALREADY;
     }
 
     ret = dynamicbox_provider_buffer_create_hw(handle);
@@ -955,14 +955,14 @@ PUBLIC int dynamicbox_destroy_hw_buffer(dynamicbox_buffer_h handle)
     struct dynamicbox_buffer_data *user_data;
 
     if (!handle) {
-    LOGD("handle is NULL\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       LOGD("handle is NULL\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     user_data = dynamicbox_provider_buffer_user_data(handle);
     if (!user_data || !user_data->accelerated) {
-    LOGD("user_data is NULL\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       LOGD("user_data is NULL\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     user_data->accelerated = 0;
@@ -975,12 +975,12 @@ PUBLIC void *dynamicbox_buffer_hw_buffer(dynamicbox_buffer_h handle)
     struct dynamicbox_buffer_data *user_data;
 
     if (!handle) {
-    return NULL;
+       return NULL;
     }
 
     user_data = dynamicbox_provider_buffer_user_data(handle);
     if (!user_data || !user_data->accelerated) {
-    return NULL;
+       return NULL;
     }
 
     return dynamicbox_provider_buffer_hw_addr(handle);
@@ -991,16 +991,16 @@ PUBLIC int dynamicbox_buffer_pre_render(dynamicbox_buffer_h handle)
     struct dynamicbox_buffer_data *user_data;
 
     if (!handle) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     user_data = dynamicbox_provider_buffer_user_data(handle);
     if (!user_data) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (!user_data->accelerated) {
-    return DBOX_STATUS_ERROR_NONE;
+       return DBOX_STATUS_ERROR_NONE;
     }
 
     /*!
@@ -1021,38 +1021,38 @@ PUBLIC int dynamicbox_buffer_post_render(dynamicbox_buffer_h handle)
     int pixel_size;
 
     if (!handle) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     user_data = dynamicbox_provider_buffer_user_data(handle);
     if (!user_data) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (!user_data->accelerated) {
-    return DBOX_STATUS_ERROR_NONE;
+       return DBOX_STATUS_ERROR_NONE;
     }
 
     pkgname = dynamicbox_provider_buffer_pkgname(handle);
     if (!pkgname) {
-    ErrPrint("Invalid buffer handle\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid buffer handle\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     id = dynamicbox_provider_buffer_id(handle);
     if (!id) {
-    ErrPrint("Invalid buffer handler\n");
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid buffer handler\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     ret = dynamicbox_provider_buffer_post_render(handle);
     if (ret < 0) {
-    ErrPrint("Failed to post render processing\n");
-    return ret;
+       ErrPrint("Failed to post render processing\n");
+       return ret;
     }
 
     if (dynamicbox_provider_buffer_get_size(handle, &w, &h, &pixel_size) < 0) {
-    ErrPrint("Failed to get size (%s)\n", id);
+       ErrPrint("Failed to get size (%s)\n", id);
     }
 
     /**
@@ -1062,7 +1062,7 @@ PUBLIC int dynamicbox_buffer_post_render(dynamicbox_buffer_h handle)
      */
 
     if (send_updated(pkgname, id, DBOX_PRIMARY_BUFFER, 0, 0, w, h, user_data->is_gbar, NULL) < 0) {
-    ErrPrint("Failed to send GBAR updated (%s)\n", id);
+       ErrPrint("Failed to send GBAR updated (%s)\n", id);
     }
 
     return DBOX_STATUS_ERROR_NONE;
@@ -1071,7 +1071,7 @@ PUBLIC int dynamicbox_buffer_post_render(dynamicbox_buffer_h handle)
 PUBLIC int dynamicbox_buffer_stride(dynamicbox_buffer_h handle)
 {
     if (!handle) {
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     return dynamicbox_provider_buffer_stride(handle);
@@ -1080,11 +1080,11 @@ PUBLIC int dynamicbox_buffer_stride(dynamicbox_buffer_h handle)
 PUBLIC int dynamicbox_content_is_updated(const char *filename, int is_gbar)
 {
     if (!s_info.trigger_update_monitor) {
-    s_info.trigger_update_monitor = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_TRIGGER_UPDATE_MONITOR);
-    if (!s_info.trigger_update_monitor) {
-        ErrPrint("Trigger update monitor function is not exists\n");
-        return DBOX_STATUS_ERROR_FAULT;
-    }
+       s_info.trigger_update_monitor = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_TRIGGER_UPDATE_MONITOR);
+       if (!s_info.trigger_update_monitor) {
+           ErrPrint("Trigger update monitor function is not exists\n");
+           return DBOX_STATUS_ERROR_FAULT;
+       }
     }
 
     return s_info.trigger_update_monitor(filename, is_gbar);
@@ -1097,22 +1097,22 @@ PUBLIC int dynamicbox_request_close_glance_bar(const char *pkgname, const char *
     int ret;
 
     if (!pkgname || !id) {
-    ErrPrint("Invalid parameters (%s) (%s)\n", pkgname, id);
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid parameters (%s) (%s)\n", pkgname, id);
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     if (strncmp(id, FILE_SCHEMA, schema_len)) {
-    uri = id_to_uri(id);
-    if (!uri) {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
-    }
+       uri = id_to_uri(id);
+       if (!uri) {
+           ErrPrint("Heap: %s\n", strerror(errno));
+           return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       }
     } else {
-    uri = strdup(id);
-    if (!uri) {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
-    }
+       uri = strdup(id);
+       if (!uri) {
+           ErrPrint("Heap: %s\n", strerror(errno));
+           return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       }
     }
 
     ret = dynamicbox_provider_send_request_close_gbar(pkgname, uri, reason);
@@ -1127,8 +1127,8 @@ PUBLIC int dynamicbox_freeze_scroller(const char *pkgname, const char *id)
 
     uri = id_to_uri(id);
     if (!uri) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     ret = dynamicbox_provider_send_hold_scroll(pkgname, uri, 1);
@@ -1143,8 +1143,8 @@ PUBLIC int dynamicbox_thaw_scroller(const char *pkgname, const char *id)
 
     uri = id_to_uri(id);
     if (!uri) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     ret = dynamicbox_provider_send_hold_scroll(pkgname, uri, 0);
@@ -1160,112 +1160,112 @@ PUBLIC int dynamicbox_set_extra_info(const char *id, const char *content, const
 
     uri = id_to_uri(id);
     if (!uri) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
     }
 
     if (!s_info.find_pkgname) {
-    s_info.find_pkgname = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_FIND_PKGNAME);
-    if (!s_info.find_pkgname) {
-        ErrPrint("Failed to find a \"dynamicbox_find_pkgname\"\n");
-        free(uri);
-        return DBOX_STATUS_ERROR_FAULT;
-    }
+       s_info.find_pkgname = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_FIND_PKGNAME);
+       if (!s_info.find_pkgname) {
+           ErrPrint("Failed to find a \"dynamicbox_find_pkgname\"\n");
+           free(uri);
+           return DBOX_STATUS_ERROR_FAULT;
+       }
     }
 
     pkgname = s_info.find_pkgname(uri);
     if (!pkgname) {
-    ErrPrint("Failed to find a package (%s)\n", uri);
-    free(uri);
-    return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Failed to find a package (%s)\n", uri);
+       free(uri);
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     handle = dynamicbox_provider_buffer_find_buffer(DBOX_TYPE_DBOX, pkgname, uri);
     if (handle) {
-    struct dynamicbox_buffer_data *user_data;
-
-    user_data = dynamicbox_provider_buffer_user_data(handle);
-    if (!user_data) {
-        ErrPrint("User data is not available\n");
-        free(uri);
-        return DBOX_STATUS_ERROR_FAULT;
-    }
-
-    if (content && strlen(content)) {
-        char *_content;
-
-        _content = strdup(content);
-        if (_content) {
-        if (user_data->content) {
-            free(user_data->content);
-        }
-
-        user_data->content = _content;
-        } else {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        }
-    }
-
-    if (title && strlen(title)) {
-        char *_title;
-
-        _title = strdup(title);
-        if (_title) {
-        if (user_data->title) {
-            free(user_data->title);
-        }
-
-        user_data->title = _title;
-        } else {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        }
-    }
-
-    if (icon && strlen(icon)) {
-        char *_icon;
-
-        _icon = strdup(icon);
-        if (_icon) {
-        if (user_data->icon) {
-            free(user_data->icon);
-        }
-
-        user_data->icon = _icon;
-        } else {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        }
-    }
-
-    if (name && strlen(name)) {
-        char *_name;
-
-        _name = strdup(name);
-        if (_name) {
-        if (user_data->name) {
-            free(user_data->name);
-        }
-
-        user_data->name = _name;
-        } else {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        }
-    }
-
-    if (dynamicbox_provider_send_extra_info(pkgname, uri, -1.0f, user_data->content, user_data->title, user_data->icon, user_data->name) < 0) {
-        ErrPrint("Failed to send extra info (%s)\n", id);
-    }
-
-    free(uri);
-    return DBOX_STATUS_ERROR_NONE;
+       struct dynamicbox_buffer_data *user_data;
+
+       user_data = dynamicbox_provider_buffer_user_data(handle);
+       if (!user_data) {
+           ErrPrint("User data is not available\n");
+           free(uri);
+           return DBOX_STATUS_ERROR_FAULT;
+       }
+
+       if (content && strlen(content)) {
+           char *_content;
+
+           _content = strdup(content);
+           if (_content) {
+               if (user_data->content) {
+                   free(user_data->content);
+               }
+
+               user_data->content = _content;
+           } else {
+               ErrPrint("Heap: %s\n", strerror(errno));
+           }
+       }
+
+       if (title && strlen(title)) {
+           char *_title;
+
+           _title = strdup(title);
+           if (_title) {
+               if (user_data->title) {
+                   free(user_data->title);
+               }
+
+               user_data->title = _title;
+           } else {
+               ErrPrint("Heap: %s\n", strerror(errno));
+           }
+       }
+
+       if (icon && strlen(icon)) {
+           char *_icon;
+
+           _icon = strdup(icon);
+           if (_icon) {
+               if (user_data->icon) {
+                   free(user_data->icon);
+               }
+
+               user_data->icon = _icon;
+           } else {
+               ErrPrint("Heap: %s\n", strerror(errno));
+           }
+       }
+
+       if (name && strlen(name)) {
+           char *_name;
+
+           _name = strdup(name);
+           if (_name) {
+               if (user_data->name) {
+                   free(user_data->name);
+               }
+
+               user_data->name = _name;
+           } else {
+               ErrPrint("Heap: %s\n", strerror(errno));
+           }
+       }
+
+       if (dynamicbox_provider_send_extra_info(pkgname, uri, -1.0f, user_data->content, user_data->title, user_data->icon, user_data->name) < 0) {
+           ErrPrint("Failed to send extra info (%s)\n", id);
+       }
+
+       free(uri);
+       return DBOX_STATUS_ERROR_NONE;
     }
     free(uri);
 
     if (!s_info.update_extra_info) {
-    s_info.update_extra_info = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_UPDATE_EXTRA_INFO);
-    if (!s_info.update_extra_info) {
-        ErrPrint("Failed to find a \"dynamicbox_update_extra_info\"\n");
-        return DBOX_STATUS_ERROR_INVALID_PARAMETER;
-    }
+       s_info.update_extra_info = dlsym(RTLD_DEFAULT, FUNC_DYNAMICBOX_UPDATE_EXTRA_INFO);
+       if (!s_info.update_extra_info) {
+           ErrPrint("Failed to find a \"dynamicbox_update_extra_info\"\n");
+           return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
     }
 
     return s_info.update_extra_info(id, content, title, icon, name);
index 2fcdaf8..ad5a5b1 100644 (file)
@@ -30,8 +30,6 @@
 #define QUALITY_N_COMPRESS "quality=100 compress=1"
 #define PUBLIC __attribute__((visibility("default")))
 
-
-
 struct snapshot_info {
     char *id;
     dynamicbox_flush_cb flush_cb;
@@ -46,90 +44,82 @@ struct snapshot_info {
 static void post_render_cb(void *data, Evas *e, void *event_info);
 static void pre_render_cb(void *data, Evas *e, void *event_info);
 
-
-
 static inline Evas *create_virtual_canvas(int w, int h)
 {
-        Ecore_Evas *internal_ee;
-        Evas *internal_e;
-
-        // Create virtual canvas
-        internal_ee = ecore_evas_buffer_new(w, h);
-        if (!internal_ee) {
-                DbgPrint("Failed to create a new canvas buffer\n");
-                return NULL;
-        }
+    Ecore_Evas *internal_ee;
+    Evas *internal_e;
+
+    // Create virtual canvas
+    internal_ee = ecore_evas_buffer_new(w, h);
+    if (!internal_ee) {
+       DbgPrint("Failed to create a new canvas buffer\n");
+       return NULL;
+    }
 
     ecore_evas_alpha_set(internal_ee, EINA_TRUE);
     ecore_evas_manual_render_set(internal_ee, EINA_FALSE);
 
-        // Get the "Evas" object from a virtual canvas
-        internal_e = ecore_evas_get(internal_ee);
-        if (!internal_e) {
-                ecore_evas_free(internal_ee);
-                DbgPrint("Faield to get Evas object\n");
-                return NULL;
-        }
+    // Get the "Evas" object from a virtual canvas
+    internal_e = ecore_evas_get(internal_ee);
+    if (!internal_e) {
+       ecore_evas_free(internal_ee);
+       DbgPrint("Faield to get Evas object\n");
+       return NULL;
+    }
 
-        return internal_e;
+    return internal_e;
 }
 
-
-
 static inline int flush_data_to_file(Evas *e, char *data, const char *filename, int w, int h)
 {
-        Evas_Object *output;
-
-        output = evas_object_image_add(e);
-        if (!output) {
-        DbgPrint("Failed to create an image object\n");
-                return DBOX_STATUS_ERROR_FAULT;
-        }
-
-        evas_object_image_data_set(output, NULL);
-        evas_object_image_colorspace_set(output, EVAS_COLORSPACE_ARGB8888);
-        evas_object_image_alpha_set(output, EINA_TRUE);
-        evas_object_image_size_set(output, w, h);
-        evas_object_image_smooth_scale_set(output, EINA_TRUE);
-        evas_object_image_data_set(output, data);
+    Evas_Object *output;
+
+    output = evas_object_image_add(e);
+    if (!output) {
+       DbgPrint("Failed to create an image object\n");
+       return DBOX_STATUS_ERROR_FAULT;
+    }
+
+    evas_object_image_data_set(output, NULL);
+    evas_object_image_colorspace_set(output, EVAS_COLORSPACE_ARGB8888);
+    evas_object_image_alpha_set(output, EINA_TRUE);
+    evas_object_image_size_set(output, w, h);
+    evas_object_image_smooth_scale_set(output, EINA_TRUE);
+    evas_object_image_data_set(output, data);
     evas_object_image_fill_set(output, 0, 0, w, h);
-        evas_object_image_data_update_add(output, 0, 0, w, h);
+    evas_object_image_data_update_add(output, 0, 0, w, h);
 
-        if (evas_object_image_save(output, filename, NULL, QUALITY_N_COMPRESS) == EINA_FALSE) {
-                evas_object_del(output);
-        DbgPrint("Faield to save a captured image (%s)\n", filename);
-                return DBOX_STATUS_ERROR_IO_ERROR;
-        }
+    if (evas_object_image_save(output, filename, NULL, QUALITY_N_COMPRESS) == EINA_FALSE) {
+       evas_object_del(output);
+       DbgPrint("Faield to save a captured image (%s)\n", filename);
+       return DBOX_STATUS_ERROR_IO_ERROR;
+    }
 
     evas_object_del(output);
 
-        if (access(filename, F_OK) != 0) {
-        DbgPrint("File %s is not found\n", filename);
-                return DBOX_STATUS_ERROR_IO_ERROR;
-        }
+    if (access(filename, F_OK) != 0) {
+       DbgPrint("File %s is not found\n", filename);
+       return DBOX_STATUS_ERROR_IO_ERROR;
+    }
 
     DbgPrint("Flush data to a file (%s)\n", filename);
     return DBOX_STATUS_ERROR_NONE;
 }
 
-
-
 static inline int destroy_virtual_canvas(Evas *e)
 {
-        Ecore_Evas *ee;
+    Ecore_Evas *ee;
 
-        ee = ecore_evas_ecore_evas_get(e);
-        if (!ee) {
-        DbgPrint("Failed to ecore evas object\n");
-                return DBOX_STATUS_ERROR_FAULT;
-        }
+    ee = ecore_evas_ecore_evas_get(e);
+    if (!ee) {
+       DbgPrint("Failed to ecore evas object\n");
+       return DBOX_STATUS_ERROR_FAULT;
+    }
 
-        ecore_evas_free(ee);
-        return DBOX_STATUS_ERROR_NONE;
+    ecore_evas_free(ee);
+    return DBOX_STATUS_ERROR_NONE;
 }
 
-
-
 static inline int flush_to_file(const void *canvas, const char *filename, int w, int h)
 {
     int status;
@@ -138,15 +128,15 @@ static inline int flush_to_file(const void *canvas, const char *filename, int w,
 
     shot_e = create_virtual_canvas(w, h);
     if (!shot_e) {
-        ErrPrint("Unable to create a new virtual window\n");
-        return DBOX_STATUS_ERROR_FAULT;
+       ErrPrint("Unable to create a new virtual window\n");
+       return DBOX_STATUS_ERROR_FAULT;
     }
 
     shot_ee = ecore_evas_ecore_evas_get(shot_e);
     if (!shot_ee) {
-        ErrPrint("Unable to get Ecore_Evas\n");
-        destroy_virtual_canvas(shot_e);
-        return DBOX_STATUS_ERROR_FAULT;
+       ErrPrint("Unable to get Ecore_Evas\n");
+       destroy_virtual_canvas(shot_e);
+       return DBOX_STATUS_ERROR_FAULT;
     }
 
     ecore_evas_manual_render_set(shot_ee, EINA_TRUE);
@@ -157,8 +147,6 @@ static inline int flush_to_file(const void *canvas, const char *filename, int w,
     return status;
 }
 
-
-
 static Eina_Bool snapshot_cb(void *data)
 {
     Evas_Object *snapshot_win = data;
@@ -171,14 +159,14 @@ static Eina_Bool snapshot_cb(void *data)
 
     info = evas_object_data_get(snapshot_win, "snapshot,info");
     if (!info) {
-        ErrPrint("Invalid object\n");
-        return ECORE_CALLBACK_CANCEL;
+       ErrPrint("Invalid object\n");
+       return ECORE_CALLBACK_CANCEL;
     }
 
     if (info->flush_timer) {
-        info->flush_timer = NULL;
+       info->flush_timer = NULL;
     } else {
-        status = DBOX_STATUS_ERROR_CANCEL;
+       status = DBOX_STATUS_ERROR_CANCEL;
     }
 
     flush_cb = info->flush_cb;
@@ -186,62 +174,60 @@ static Eina_Bool snapshot_cb(void *data)
 
     e = evas_object_evas_get(snapshot_win);
     if (!e) {
-        ErrPrint("Invalid object\n");
-        if (flush_cb) {
-            flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
-        }
-        return ECORE_CALLBACK_CANCEL;
+       ErrPrint("Invalid object\n");
+       if (flush_cb) {
+           flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
+       }
+       return ECORE_CALLBACK_CANCEL;
     }
 
     ee = ecore_evas_ecore_evas_get(e);
     if (!ee) {
-        ErrPrint("Invalid object (ee)\n");
-        if (flush_cb) {
-            flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
-        }
-        return ECORE_CALLBACK_CANCEL;
+       ErrPrint("Invalid object (ee)\n");
+       if (flush_cb) {
+           flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
+       }
+       return ECORE_CALLBACK_CANCEL;
     }
 
     canvas = (void*)ecore_evas_buffer_pixels_get(ee);
     if (!canvas) {
-        DbgPrint("Failed to get pixel canvas\n");
-        if (flush_cb) {
-            flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
-        }
-        return ECORE_CALLBACK_CANCEL;
+       DbgPrint("Failed to get pixel canvas\n");
+       if (flush_cb) {
+           flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
+       }
+       return ECORE_CALLBACK_CANCEL;
     }
 
     if (flush_cb) {
-        int w;
-        int h;
-        int ret;
-
-        ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
-
-        DbgPrint("Flush size: %dx%d\n", w, h);
-        ret = flush_to_file(canvas, info->id, w, h);
-        if (status == DBOX_STATUS_ERROR_NONE) {
-            status = ret;
-        }
-
-        flush_cb(snapshot_win, info->id, status, info->data);
-        /**
-         * Do not access info after this.
-         */
+       int w;
+       int h;
+       int ret;
+
+       ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
+
+       DbgPrint("Flush size: %dx%d\n", w, h);
+       ret = flush_to_file(canvas, info->id, w, h);
+       if (status == DBOX_STATUS_ERROR_NONE) {
+           status = ret;
+       }
+
+       flush_cb(snapshot_win, info->id, status, info->data);
+       /**
+        * Do not access info after this.
+        */
     }
 
     return ECORE_CALLBACK_CANCEL;
 }
 
-
-
 static void del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
     struct snapshot_info *info;
 
     info = evas_object_data_del(obj, "snapshot,info");
     if (!info) {
-        return;
+       return;
     }
 
     DbgPrint("Delete object (%s)\n", info->id);
@@ -250,11 +236,11 @@ static void del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
     evas_event_callback_del(e, EVAS_CALLBACK_RENDER_PRE, pre_render_cb);
 
     if (info->flush_timer) {
-        ecore_timer_del(info->flush_timer);
-        info->flush_timer = NULL;
+       ecore_timer_del(info->flush_timer);
+       info->flush_timer = NULL;
 
-        (void)snapshot_cb(obj);
-        DbgPrint("Flush is canceled\n");
+       (void)snapshot_cb(obj);
+       DbgPrint("Flush is canceled\n");
     }
 
     /**
@@ -265,8 +251,6 @@ static void del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
     free(info);
 }
 
-
-
 static Eina_Bool direct_snapshot_cb(void *data)
 {
     Evas *e;
@@ -281,8 +265,8 @@ static Eina_Bool direct_snapshot_cb(void *data)
 
     info = evas_object_data_get(snapshot_win, "snapshot,info");
     if (!info) {
-        ErrPrint("Unable to get snapshot info\n");
-        return ECORE_CALLBACK_CANCEL;
+       ErrPrint("Unable to get snapshot info\n");
+       return ECORE_CALLBACK_CANCEL;
     }
 
     info->flush_timer = NULL;
@@ -291,20 +275,20 @@ static Eina_Bool direct_snapshot_cb(void *data)
 
     e = evas_object_evas_get(snapshot_win);
     if (!e) {
-        ErrPrint("Invalid object, failed to get Evas\n");
-        if (flush_cb) {
-            flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
-        }
-        return ECORE_CALLBACK_CANCEL;
+       ErrPrint("Invalid object, failed to get Evas\n");
+       if (flush_cb) {
+           flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
+       }
+       return ECORE_CALLBACK_CANCEL;
     }
 
     ee = ecore_evas_ecore_evas_get(e);
     if (!ee) {
-        ErrPrint("Unable to get Ecore_Evas object\n");
-        if (flush_cb) {
-            flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
-        }
-        return ECORE_CALLBACK_CANCEL;
+       ErrPrint("Unable to get Ecore_Evas object\n");
+       if (flush_cb) {
+           flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
+       }
+       return ECORE_CALLBACK_CANCEL;
     }
 
     ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
@@ -312,22 +296,20 @@ static Eina_Bool direct_snapshot_cb(void *data)
 
     canvas = ecore_evas_buffer_pixels_get(ee);
     if (!canvas) {
-        ErrPrint("Failed to get canvas\n");
-        if (flush_cb) {
-            flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
-        }
-        return ECORE_CALLBACK_CANCEL;
+       ErrPrint("Failed to get canvas\n");
+       if (flush_cb) {
+           flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
+       }
+       return ECORE_CALLBACK_CANCEL;
     }
 
     status = flush_to_file(canvas, info->id, w, h);
     if (flush_cb) {
-        flush_cb(snapshot_win, info->id, status, info->data);
+       flush_cb(snapshot_win, info->id, status, info->data);
     }
     return ECORE_CALLBACK_CANCEL;
 }
 
-
-
 static void post_render_cb(void *data, Evas *e, void *event_info)
 {
     Evas_Object *snapshot_win = data;
@@ -335,25 +317,25 @@ static void post_render_cb(void *data, Evas *e, void *event_info)
 
     info = evas_object_data_get(snapshot_win, "snapshot,info");
     if (!info) {
-        ErrPrint("snapshot info is not valid\n");
-        return;
+       ErrPrint("snapshot info is not valid\n");
+       return;
     }
 
     info->render_cnt++;
 
     if (info->flush_timer) {
-        /**
-         * @note
-         * This has not to be happens.
-         */
-        ErrPrint("Flush timer is not cleared\n");
-        ecore_timer_del(info->flush_timer);
-        info->flush_timer = NULL;
+       /**
+        * @note
+        * This has not to be happens.
+        */
+       ErrPrint("Flush timer is not cleared\n");
+       ecore_timer_del(info->flush_timer);
+       info->flush_timer = NULL;
     }
 
     if (!info->flush_cb) {
-        DbgPrint("Flush request is not initiated yet\n");
-        return;
+       DbgPrint("Flush request is not initiated yet\n");
+       return;
     }
 
     /*!
@@ -366,24 +348,22 @@ static void post_render_cb(void *data, Evas *e, void *event_info)
     DbgPrint("Fire the flush timer %lf (%d)\n", info->timeout, info->render_cnt);
     info->flush_timer = ecore_timer_add(info->timeout, snapshot_cb, snapshot_win);
     if (!info->flush_timer) {
-        dynamicbox_flush_cb flush_cb;
-
-        ErrPrint("Unalbe to add timer for getting the snapshot\n");
-        flush_cb = info->flush_cb;
-        info->flush_cb = NULL;
-
-        if (flush_cb) {
-            flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
-        }
-        /*!
-         * \note
-         * Do not access info after from here.
-         */
+       dynamicbox_flush_cb flush_cb;
+
+       ErrPrint("Unalbe to add timer for getting the snapshot\n");
+       flush_cb = info->flush_cb;
+       info->flush_cb = NULL;
+
+       if (flush_cb) {
+           flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
+       }
+       /*!
+        * \note
+        * Do not access info after from here.
+        */
     }
 }
 
-
-
 static void pre_render_cb(void *data, Evas *e, void *event_info)
 {
     Evas_Object *snapshot_win = data;
@@ -391,21 +371,19 @@ static void pre_render_cb(void *data, Evas *e, void *event_info)
 
     info = evas_object_data_get(snapshot_win, "snapshot,info");
     if (!info) {
-        ErrPrint("snapshot info is not valid\n");
-        return;
+       ErrPrint("snapshot info is not valid\n");
+       return;
     }
 
     if (info->flush_timer) {
-        ecore_timer_del(info->flush_timer);
-        info->flush_timer = NULL;
-        DbgPrint("Clear the flush timer\n");
+       ecore_timer_del(info->flush_timer);
+       info->flush_timer = NULL;
+       DbgPrint("Clear the flush timer\n");
     }
 
     DbgPrint("Pre-render callback\n");
 }
 
-
-
 PUBLIC void *dynamicbox_snapshot_window_add(const char *id, int size_type)
 {
     struct snapshot_info *info;
@@ -416,21 +394,21 @@ PUBLIC void *dynamicbox_snapshot_window_add(const char *id, int size_type)
     int h;
 
     if (dynamicbox_service_get_size(size_type, &w, &h) != DBOX_STATUS_ERROR_NONE) {
-        ErrPrint("Invalid size\n");
-        return NULL;
+       ErrPrint("Invalid size\n");
+       return NULL;
     }
 
     info = malloc(sizeof(*info));
     if (!info) {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        return NULL;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       return NULL;
     }
 
     info->id = strdup(id);
     if (!info->id) {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        free(info);
-        return NULL;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       free(info);
+       return NULL;
     }
 
     info->flush_cb = NULL;
@@ -440,26 +418,26 @@ PUBLIC void *dynamicbox_snapshot_window_add(const char *id, int size_type)
 
     e = create_virtual_canvas(w, h);
     if (!e) {
-        free(info->id);
-        free(info);
-        return NULL;
+       free(info->id);
+       free(info);
+       return NULL;
     }
 
     parent = evas_object_rectangle_add(e);
     if (!parent) {
-        destroy_virtual_canvas(e);
-        free(info->id);
-        free(info);
-        return NULL;
+       destroy_virtual_canvas(e);
+       free(info->id);
+       free(info);
+       return NULL;
     }
 
     snapshot_win = elm_win_add(parent, "DBox,Snapshot", ELM_WIN_DYNAMIC_BOX);
     evas_object_del(parent);
     if (!snapshot_win) {
-        destroy_virtual_canvas(e);
-        free(info->id);
-        free(info);
-        return NULL;
+       destroy_virtual_canvas(e);
+       free(info->id);
+       free(info);
+       return NULL;
     }
 
     DbgPrint("Create a new window %dx%d for %s\n", w, h, id);
@@ -475,45 +453,43 @@ PUBLIC void *dynamicbox_snapshot_window_add(const char *id, int size_type)
     return snapshot_win;
 }
 
-
-
 PUBLIC int dynamicbox_snapshot_window_flush(void *snapshot_win, double timeout, dynamicbox_flush_cb flush_cb, void *data)
 {
     struct snapshot_info *info;
 
     if (!flush_cb || timeout < 0.0f) {
-        ErrPrint("Invalid argument (%p, %lf)\n", flush_cb, timeout);
-        return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid argument (%p, %lf)\n", flush_cb, timeout);
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     info = evas_object_data_get(snapshot_win, "snapshot,info");
     if (!info) {
-        ErrPrint("Invalid argument\n");
-        return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       ErrPrint("Invalid argument\n");
+       return DBOX_STATUS_ERROR_INVALID_PARAMETER;
     }
 
     info->timeout = timeout;
 
     if (timeout == 0.0f) {
-        /*!
-         * This timer is just used for guarantees same behavious even if it flushes content directly,
-         * The callback should be called from next loop.
-         * or the developer will get confused
-         */
-        info->flush_timer = ecore_timer_add(0.0001f, direct_snapshot_cb, snapshot_win);
-        if (!info->flush_timer) {
-            return DBOX_STATUS_ERROR_FAULT;
-        }
+       /*!
+        * This timer is just used for guarantees same behavious even if it flushes content directly,
+        * The callback should be called from next loop.
+        * or the developer will get confused
+        */
+       info->flush_timer = ecore_timer_add(0.0001f, direct_snapshot_cb, snapshot_win);
+       if (!info->flush_timer) {
+           return DBOX_STATUS_ERROR_FAULT;
+       }
     } else if (info->render_cnt) {
-        /*!
-         * Try to watit pre-render callback.
-         * If there is rendered contents.
-         */
-        DbgPrint("Rendered %d times already\n", info->render_cnt);
-        info->flush_timer = ecore_timer_add(info->timeout, snapshot_cb, snapshot_win);
-        if (!info->flush_timer) {
-            return DBOX_STATUS_ERROR_FAULT;
-        }
+       /*!
+        * Try to watit pre-render callback.
+        * If there is rendered contents.
+        */
+       DbgPrint("Rendered %d times already\n", info->render_cnt);
+       info->flush_timer = ecore_timer_add(info->timeout, snapshot_cb, snapshot_win);
+       if (!info->flush_timer) {
+           return DBOX_STATUS_ERROR_FAULT;
+       }
     }
 
     info->flush_cb = flush_cb;
@@ -522,6 +498,4 @@ PUBLIC int dynamicbox_snapshot_window_flush(void *snapshot_win, double timeout,
     return DBOX_STATUS_ERROR_NONE;
 }
 
-
-
 /* End of a file */
index 1c74ecc..e9f5ebe 100644 (file)
@@ -33,10 +33,10 @@ int util_check_extension(const char *filename, const char *check_ptr)
 
     name_len = strlen(filename);
     while (--name_len >= 0 && *check_ptr) {
-        if (filename[name_len] != *check_ptr)
-            return -EINVAL;
+       if (filename[name_len] != *check_ptr)
+           return -EINVAL;
 
-        check_ptr ++;
+       check_ptr ++;
     }
 
     return 0;
index 81805b8..f177819 100644 (file)
@@ -47,7 +47,7 @@
 static struct static_info {
     Ecore_Evas *(*alloc_canvas)(int w, int h, void *(*a)(void *data, int size), void (*f)(void *data, void *ptr), void *data);
     Ecore_Evas *(*alloc_canvas_with_stride)(int w, int h, void *(*a)(void *data, int size, int *stride, int *bpp), void (*f)(void *data, void *ptr), void *data);
-    Ecore_Evas *(*alloc_canvas_with_pixmap)(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h, Ecore_X_Pixmap (*alloc_cb)(void *data, Ecore_X_Window parent, int w, int h, int *depth), void (*free_cb)(void *data, Ecore_X_Pixmap pixmap), void *data);
+    Ecore_Evas *(*alloc_canvas_with_pixmap)(const char *disp_name, Ecore_X_Window parent, int x, int y, int w, int h, Ecore_X_Pixmap (*alloc_cb)(void *data, Ecore_X_Window parent, int w, int h, int depth), void (*free_cb)(void *data, Ecore_X_Pixmap pixmap), void *data);
 } s_info = {
     .alloc_canvas = NULL,
     .alloc_canvas_with_stride = NULL,
@@ -62,10 +62,10 @@ typedef struct virtual_window_info {
     char *id; /**< Identification */
     dynamicbox_buffer_h handle; /**< Livebox buffer handle */
     enum win_type {
-    VWIN_SW_BUF = 0x00, /**< S/W buffer */
-    VWIN_GEM    = 0x01, /**< GEM buffer */
-        VWIN_PIXMAP = 0x02, /**< PIXMAP */
-    VWIN_ERROR  = 0x03  /**< Unknown */
+       VWIN_SW_BUF = 0x00, /**< S/W buffer */
+       VWIN_GEM    = 0x01, /**< GEM buffer */
+       VWIN_PIXMAP = 0x02, /**< PIXMAP */
+       VWIN_ERROR  = 0x03  /**< Unknown */
     } type;
     Ecore_Evas *ee;
     Evas *e;
@@ -105,8 +105,8 @@ static int event_handler_cb(dynamicbox_buffer_h handler, struct dynamicbox_buffe
     unsigned int flags = 0;
 
     if (!info->handle) {
-    /* Just ignore this event */
-    return 0;
+       /* Just ignore this event */
+       return 0;
     }
 
     /**
@@ -114,390 +114,390 @@ static int event_handler_cb(dynamicbox_buffer_h handler, struct dynamicbox_buffe
      * Feed up events
      */
     switch (event_info->type) {
-    case DBOX_BUFFER_EVENT_ON_HOLD:
-        flags = evas_event_default_flags_get(info->e);
-        flags |= EVAS_EVENT_FLAG_ON_HOLD;
-        evas_event_default_flags_set(info->e, flags);
-        break;
-    case DBOX_BUFFER_EVENT_OFF_HOLD:
-        flags = evas_event_default_flags_get(info->e);
-        flags &= ~EVAS_EVENT_FLAG_ON_HOLD;
-        evas_event_default_flags_set(info->e, flags);
-        break;
-    case DBOX_BUFFER_EVENT_ON_SCROLL:
-        flags = evas_event_default_flags_get(info->e);
-        flags |= EVAS_EVENT_FLAG_ON_SCROLL;
-        evas_event_default_flags_set(info->e, flags);
-        break;
-    case DBOX_BUFFER_EVENT_OFF_SCROLL:
-        flags = evas_event_default_flags_get(info->e);
-        flags &= ~EVAS_EVENT_FLAG_ON_SCROLL;
-        evas_event_default_flags_set(info->e, flags);
-        break;
-    case DBOX_BUFFER_EVENT_ENTER:
-        evas_event_feed_mouse_in(info->e, event_info->timestamp * 1000, NULL);
-        break;
-    case DBOX_BUFFER_EVENT_LEAVE:
-        evas_event_feed_mouse_out(info->e, event_info->timestamp * 1000, NULL);
-        break;
-    case DBOX_BUFFER_EVENT_DOWN:
-        /**
-         * @note
-         * Before processing the DOWN event,
-         * Reset the evas event flags regarding ON_HOLD option.
-         * It can be re-enabled while processing down-move-up events.
-         */
-        flags = evas_event_default_flags_get(info->e);
-        flags &= ~EVAS_EVENT_FLAG_ON_SCROLL;
-        flags &= ~EVAS_EVENT_FLAG_ON_HOLD;
-        evas_event_default_flags_set(info->e, flags);
-        /**
-         * @note
-         * Calculate the event occurred X & Y on the buffer
-         */
-        evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
-        evas_event_feed_mouse_down(info->e, 1, EVAS_BUTTON_NONE, event_info->timestamp * 1000, NULL); /* + 0.2f just for fake event */
-        break;
-    case DBOX_BUFFER_EVENT_MOVE:
-        /**
-         * @note
-         * Calculate the event occurred X & Y on the buffer
-         */
-        evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
-        break;
-    case DBOX_BUFFER_EVENT_UP:
-        evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
-        evas_event_feed_mouse_up(info->e, 1, EVAS_BUTTON_NONE, event_info->timestamp * 1000, NULL);
-        /**
-         * @note
-         * We have to keep the event flags, so we should not clear them from here.
-         * Sometimes, asynchronously callable Callbacks can refer the evas event flags after up event.
-         * so if we reset them from here, those kind of callbacks will fails to do their job properly.
-         */
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_HIGHLIGHT;
-        /**
-         * @note
-         * Calculate the event occurred X & Y on the buffer
-         */
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        if (ret == EINA_TRUE) {
-        if (!get_highlighted_object(parent_elm)) {
-            ErrPrint("Highlighted object is not found\n");
-            ret = DBOX_ACCESS_STATUS_ERROR;
-        } else {
-            DbgPrint("Highlighted object is found\n");
-            ret = DBOX_ACCESS_STATUS_DONE;
-        }
-        } else {
-        ErrPrint("Action error\n");
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        }
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_NEXT:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT;
-        action_info.highlight_cycle = EINA_FALSE;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_LAST : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_PREV:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_HIGHLIGHT_PREV;
-        action_info.highlight_cycle = EINA_FALSE;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_FIRST : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_ACTIVATE:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_ACTIVATE;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_ACTION_UP:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_UP;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_ACTION_DOWN:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_DOWN;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_SCROLL_UP:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_SCROLL;
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        action_info.mouse_type = event_info->info.access.mouse_type;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_SCROLL_MOVE:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_SCROLL;
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        action_info.mouse_type = event_info->info.access.mouse_type;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_SCROLL_DOWN:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_SCROLL;
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        action_info.mouse_type = event_info->info.access.mouse_type;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_UNHIGHLIGHT:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_UNHIGHLIGHT;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_VALUE_CHANGE:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_VALUE_CHANGE;
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        action_info.mouse_type = event_info->info.access.mouse_type;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_MOUSE:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_MOUSE;
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        action_info.mouse_type = event_info->info.access.mouse_type;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_BACK:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_BACK;
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        action_info.mouse_type = event_info->info.access.mouse_type;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_OVER:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_OVER;
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        action_info.mouse_type = event_info->info.access.mouse_type;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_READ:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_READ;
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        action_info.mouse_type = event_info->info.access.mouse_type;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_ENABLE:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_ENABLE;
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        action_info.mouse_type = event_info->info.access.mouse_type;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_DISABLE:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_DISABLE;
-        action_info.x = event_info->info.access.x;
-        action_info.y = event_info->info.access.y;
-        action_info.mouse_type = event_info->info.access.mouse_type;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_KEY_DOWN:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-
-        key_symbol = XGetKeyboardMapping(ecore_x_display_get(), event_info->info.keycode, 1, &ret);
-        if (key_symbol) {
-        char *key_name;
-        char *key_string;
-
-        key_string = XKeysymToString(*key_symbol);
-        key_name = XKeysymToString(*key_symbol);
-        DbgPrint("Key symbol: %s, name: %s\n", key_string, key_name);
-        XFree(key_symbol);
-        XFree(key_name);
-        XFree(key_string);
-        }
-        ret = DBOX_KEY_STATUS_ERROR;
-        break;
-    case DBOX_BUFFER_EVENT_KEY_UP:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-
-        key_symbol = XGetKeyboardMapping(ecore_x_display_get(), event_info->info.keycode, 1, &ret);
-        if (key_symbol) {
-        char *key_name;
-        char *key_string;
-
-        key_string = XKeysymToString(*key_symbol);
-        key_name = XKeysymToString(*key_symbol);
-        DbgPrint("Key symbol: %s, name: %s\n", key_string, key_name);
-        XFree(key_symbol);
-        XFree(key_name);
-        XFree(key_string);
-        }
-        ret = DBOX_KEY_STATUS_ERROR;
-        break;
-    case DBOX_BUFFER_EVENT_KEY_FOCUS_IN:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-
-        key_symbol = XGetKeyboardMapping(ecore_x_display_get(), event_info->info.keycode, 1, &ret);
-        if (key_symbol) {
-        char *key_name;
-        char *key_string;
-
-        key_string = XKeysymToString(*key_symbol);
-        key_name = XKeysymToString(*key_symbol);
-        DbgPrint("Key symbol: %s, name: %s\n", key_string, key_name);
-        XFree(key_symbol);
-        XFree(key_name);
-        XFree(key_string);
-        }
-        ret = DBOX_KEY_STATUS_ERROR;
-        break;
-    case DBOX_BUFFER_EVENT_KEY_FOCUS_OUT:
-        parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
-        if (!parent_elm) {
-        ret = DBOX_ACCESS_STATUS_ERROR;
-        break;
-        }
-
-        key_symbol = XGetKeyboardMapping(ecore_x_display_get(), event_info->info.keycode, 1, &ret);
-        if (key_symbol) {
-        char *key_name;
-        char *key_string;
-
-        key_string = XKeysymToString(*key_symbol);
-        key_name = XKeysymToString(*key_symbol);
-        DbgPrint("Key symbol: %s, name: %s\n", key_string, key_name);
-        XFree(key_symbol);
-        XFree(key_name);
-        XFree(key_string);
-        }
-        ret = DBOX_KEY_STATUS_ERROR;
-        break;
-    default:
-        DbgPrint("Unhandled buffer event (%d)\n", event_info->type);
-        break;
+       case DBOX_BUFFER_EVENT_ON_HOLD:
+           flags = evas_event_default_flags_get(info->e);
+           flags |= EVAS_EVENT_FLAG_ON_HOLD;
+           evas_event_default_flags_set(info->e, flags);
+           break;
+       case DBOX_BUFFER_EVENT_OFF_HOLD:
+           flags = evas_event_default_flags_get(info->e);
+           flags &= ~EVAS_EVENT_FLAG_ON_HOLD;
+           evas_event_default_flags_set(info->e, flags);
+           break;
+       case DBOX_BUFFER_EVENT_ON_SCROLL:
+           flags = evas_event_default_flags_get(info->e);
+           flags |= EVAS_EVENT_FLAG_ON_SCROLL;
+           evas_event_default_flags_set(info->e, flags);
+           break;
+       case DBOX_BUFFER_EVENT_OFF_SCROLL:
+           flags = evas_event_default_flags_get(info->e);
+           flags &= ~EVAS_EVENT_FLAG_ON_SCROLL;
+           evas_event_default_flags_set(info->e, flags);
+           break;
+       case DBOX_BUFFER_EVENT_ENTER:
+           evas_event_feed_mouse_in(info->e, event_info->timestamp * 1000, NULL);
+           break;
+       case DBOX_BUFFER_EVENT_LEAVE:
+           evas_event_feed_mouse_out(info->e, event_info->timestamp * 1000, NULL);
+           break;
+       case DBOX_BUFFER_EVENT_DOWN:
+           /**
+            * @note
+            * Before processing the DOWN event,
+            * Reset the evas event flags regarding ON_HOLD option.
+            * It can be re-enabled while processing down-move-up events.
+            */
+           flags = evas_event_default_flags_get(info->e);
+           flags &= ~EVAS_EVENT_FLAG_ON_SCROLL;
+           flags &= ~EVAS_EVENT_FLAG_ON_HOLD;
+           evas_event_default_flags_set(info->e, flags);
+           /**
+            * @note
+            * Calculate the event occurred X & Y on the buffer
+            */
+           evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
+           evas_event_feed_mouse_down(info->e, 1, EVAS_BUTTON_NONE, event_info->timestamp * 1000, NULL); /* + 0.2f just for fake event */
+           break;
+       case DBOX_BUFFER_EVENT_MOVE:
+           /**
+            * @note
+            * Calculate the event occurred X & Y on the buffer
+            */
+           evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
+           break;
+       case DBOX_BUFFER_EVENT_UP:
+           evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
+           evas_event_feed_mouse_up(info->e, 1, EVAS_BUTTON_NONE, event_info->timestamp * 1000, NULL);
+           /**
+            * @note
+            * We have to keep the event flags, so we should not clear them from here.
+            * Sometimes, asynchronously callable Callbacks can refer the evas event flags after up event.
+            * so if we reset them from here, those kind of callbacks will fails to do their job properly.
+            */
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_HIGHLIGHT;
+           /**
+            * @note
+            * Calculate the event occurred X & Y on the buffer
+            */
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           if (ret == EINA_TRUE) {
+               if (!get_highlighted_object(parent_elm)) {
+                   ErrPrint("Highlighted object is not found\n");
+                   ret = DBOX_ACCESS_STATUS_ERROR;
+               } else {
+                   DbgPrint("Highlighted object is found\n");
+                   ret = DBOX_ACCESS_STATUS_DONE;
+               }
+           } else {
+               ErrPrint("Action error\n");
+               ret = DBOX_ACCESS_STATUS_ERROR;
+           }
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_NEXT:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT;
+           action_info.highlight_cycle = EINA_FALSE;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_LAST : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_PREV:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_HIGHLIGHT_PREV;
+           action_info.highlight_cycle = EINA_FALSE;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_FIRST : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_ACTIVATE:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_ACTIVATE;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_ACTION_UP:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_UP;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_ACTION_DOWN:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_DOWN;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_UP:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_SCROLL;
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           action_info.mouse_type = event_info->info.access.mouse_type;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_MOVE:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_SCROLL;
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           action_info.mouse_type = event_info->info.access.mouse_type;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_DOWN:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_SCROLL;
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           action_info.mouse_type = event_info->info.access.mouse_type;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_UNHIGHLIGHT:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_UNHIGHLIGHT;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_VALUE_CHANGE:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_VALUE_CHANGE;
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           action_info.mouse_type = event_info->info.access.mouse_type;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_MOUSE:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_MOUSE;
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           action_info.mouse_type = event_info->info.access.mouse_type;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_BACK:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_BACK;
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           action_info.mouse_type = event_info->info.access.mouse_type;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_OVER:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_OVER;
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           action_info.mouse_type = event_info->info.access.mouse_type;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_READ:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_READ;
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           action_info.mouse_type = event_info->info.access.mouse_type;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_ENABLE:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_ENABLE;
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           action_info.mouse_type = event_info->info.access.mouse_type;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_DISABLE:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_DISABLE;
+           action_info.x = event_info->info.access.x;
+           action_info.y = event_info->info.access.y;
+           action_info.mouse_type = event_info->info.access.mouse_type;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_KEY_DOWN:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+
+           key_symbol = XGetKeyboardMapping(ecore_x_display_get(), event_info->info.keycode, 1, &ret);
+           if (key_symbol) {
+               char *key_name;
+               char *key_string;
+
+               key_string = XKeysymToString(*key_symbol);
+               key_name = XKeysymToString(*key_symbol);
+               DbgPrint("Key symbol: %s, name: %s\n", key_string, key_name);
+               XFree(key_symbol);
+               XFree(key_name);
+               XFree(key_string);
+           }
+           ret = DBOX_KEY_STATUS_ERROR;
+           break;
+       case DBOX_BUFFER_EVENT_KEY_UP:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+
+           key_symbol = XGetKeyboardMapping(ecore_x_display_get(), event_info->info.keycode, 1, &ret);
+           if (key_symbol) {
+               char *key_name;
+               char *key_string;
+
+               key_string = XKeysymToString(*key_symbol);
+               key_name = XKeysymToString(*key_symbol);
+               DbgPrint("Key symbol: %s, name: %s\n", key_string, key_name);
+               XFree(key_symbol);
+               XFree(key_name);
+               XFree(key_string);
+           }
+           ret = DBOX_KEY_STATUS_ERROR;
+           break;
+       case DBOX_BUFFER_EVENT_KEY_FOCUS_IN:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+
+           key_symbol = XGetKeyboardMapping(ecore_x_display_get(), event_info->info.keycode, 1, &ret);
+           if (key_symbol) {
+               char *key_name;
+               char *key_string;
+
+               key_string = XKeysymToString(*key_symbol);
+               key_name = XKeysymToString(*key_symbol);
+               DbgPrint("Key symbol: %s, name: %s\n", key_string, key_name);
+               XFree(key_symbol);
+               XFree(key_name);
+               XFree(key_string);
+           }
+           ret = DBOX_KEY_STATUS_ERROR;
+           break;
+       case DBOX_BUFFER_EVENT_KEY_FOCUS_OUT:
+           parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+
+           key_symbol = XGetKeyboardMapping(ecore_x_display_get(), event_info->info.keycode, 1, &ret);
+           if (key_symbol) {
+               char *key_name;
+               char *key_string;
+
+               key_string = XKeysymToString(*key_symbol);
+               key_name = XKeysymToString(*key_symbol);
+               DbgPrint("Key symbol: %s, name: %s\n", key_string, key_name);
+               XFree(key_symbol);
+               XFree(key_name);
+               XFree(key_string);
+           }
+           ret = DBOX_KEY_STATUS_ERROR;
+           break;
+       default:
+           DbgPrint("Unhandled buffer event (%d)\n", event_info->type);
+           break;
     }
 
     return ret;
@@ -508,70 +508,69 @@ static int event_handler_cb(dynamicbox_buffer_h handler, struct dynamicbox_buffe
  * This callback can be called twice (or more) to get a several pixmaps
  * Acquired pixmaps are used for double/tripple buffering for canvas
  */
-static Ecore_X_Pixmap alloc_pixmap_cb(void *data, Ecore_X_Window parent, int w, int h, int *depth)
+static Ecore_X_Pixmap alloc_pixmap_cb(void *data, Ecore_X_Window parent, int w, int h, int depth)
 {
     vwin_info_t info = data;
     Ecore_X_Pixmap pixmap;
-    int pixel_size = DYNAMICBOX_CONF_DEFAULT_PIXELS;
 
     if (!info->handle) {
-    ErrPrint("Invalid handle\n");
-    return 0u;
+       ErrPrint("Invalid handle\n");
+       return 0u;
     }
 
     info->w = w;
     info->h = h;
-    *depth = pixel_size << 3;
-    DbgPrint("Size of ee is updated: %dx%d - %d (info: %p)\n", info->w, info->h, pixel_size, info);
+    DbgPrint("Size of ee is updated: %dx%d - %d (info: %p)\n", info->w, info->h, depth, info);
+    depth >>= 3;
 
     if (dynamicbox_resource_id(info->handle, DBOX_PRIMARY_BUFFER) == 0u) {
-    /**
-     * @note
-     * Need to allocate a primary buffer
-     */
-    dynamicbox_acquire_buffer(info->handle, DBOX_PRIMARY_BUFFER, info->w, info->h, pixel_size);
-    if (!info->handle) {
-        ErrPrint("Failed to get the buffer\n");
-        return 0u;
-    }
-
-    pixmap = (Ecore_X_Pixmap)dynamicbox_resource_id(info->handle, DBOX_PRIMARY_BUFFER);
+       /**
+        * @note
+        * Need to allocate a primary buffer
+        */
+       dynamicbox_acquire_buffer(info->handle, DBOX_PRIMARY_BUFFER, info->w, info->h, depth);
+       if (!info->handle) {
+           ErrPrint("Failed to get the buffer\n");
+           return 0u;
+       }
+
+       pixmap = (Ecore_X_Pixmap)dynamicbox_resource_id(info->handle, DBOX_PRIMARY_BUFFER);
     } else if (DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT > 0) {
-    int idx;
-
-    if (!info->resource_array) {
-        info->resource_array = calloc(DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT, sizeof(*info->resource_array));
-        if (!info->resource_array) {
-        ErrPrint("Out of memory: %s\n", strerror(errno));
-        return 0u;
-        }
-
-        idx = 0;
-    } else {
-        for (idx = 0; idx < DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT; idx++) {
-        if (info->resource_array[idx] == 0u) {
-            break;
-        }
-        }
-
-        if (idx == DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT) {
-        ErrPrint("Out of index: %d\n", idx);
-        return 0u;
-        }
-    }
-
-    if (dynamicbox_acquire_buffer(info->handle, idx, info->w, info->h, pixel_size) < 0) {
-        ErrPrint("Failed to acquire a buffer for %d\n", idx);
-        return 0u;
-    }
-
-    info->resource_array[idx] = dynamicbox_resource_id(info->handle, idx);
-    if (info->resource_array[idx] == 0u) {
-        ErrPrint("Failed to allocate pixmap\n");
-    }
-
-    DbgPrint("Allocated index: %d/%d - %u\n", idx, DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT, info->resource_array[idx]);
-    pixmap = info->resource_array[idx];
+       int idx;
+
+       if (!info->resource_array) {
+           info->resource_array = calloc(DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT, sizeof(*info->resource_array));
+           if (!info->resource_array) {
+               ErrPrint("Out of memory: %s\n", strerror(errno));
+               return 0u;
+           }
+
+           idx = 0;
+       } else {
+           for (idx = 0; idx < DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT; idx++) {
+               if (info->resource_array[idx] == 0u) {
+                   break;
+               }
+           }
+
+           if (idx == DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT) {
+               ErrPrint("Out of index: %d\n", idx);
+               return 0u;
+           }
+       }
+
+       if (dynamicbox_acquire_buffer(info->handle, idx, info->w, info->h, depth) < 0) {
+           ErrPrint("Failed to acquire a buffer for %d\n", idx);
+           return 0u;
+       }
+
+       info->resource_array[idx] = dynamicbox_resource_id(info->handle, idx);
+       if (info->resource_array[idx] == 0u) {
+           ErrPrint("Failed to allocate pixmap\n");
+       }
+
+       DbgPrint("Allocated index: %d/%d - %u\n", idx, DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT, info->resource_array[idx]);
+       pixmap = info->resource_array[idx];
     }
 
     /**
@@ -587,44 +586,44 @@ static void free_pixmap_cb(void *data, Ecore_X_Pixmap pixmap)
     vwin_info_t info = data;
 
     if (!info->handle) {
-    return;
+       return;
     }
 
     if (info->type != VWIN_PIXMAP) {
-    ErrPrint("Impossible\n");
+       ErrPrint("Impossible\n");
     }
 
     if (dynamicbox_resource_id(info->handle, DBOX_PRIMARY_BUFFER) == pixmap) {
-    if (dynamicbox_release_buffer(info->handle, DBOX_PRIMARY_BUFFER) < 0) {
-        DbgPrint("Failed to release buffer\n");
-    }
-    info->resource_cnt--;
+       if (dynamicbox_release_buffer(info->handle, DBOX_PRIMARY_BUFFER) < 0) {
+           DbgPrint("Failed to release buffer\n");
+       }
+       info->resource_cnt--;
     } else {
-    int idx;
-
-    for (idx = 0; idx < DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT; idx++) {
-        /**
-         * @note
-         * Find a index to release it
-         */
-        if (info->resource_array[idx] == pixmap) {
-        if (dynamicbox_release_buffer(info->handle, idx) < 0) {
-            DbgPrint("Failed to release buffer\n");
-        }
-        info->resource_array[idx] = 0u;
-        info->resource_cnt--;
-        break;
-        }
-    }
+       int idx;
+
+       for (idx = 0; idx < DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT; idx++) {
+           /**
+            * @note
+            * Find a index to release it
+            */
+           if (info->resource_array[idx] == pixmap) {
+               if (dynamicbox_release_buffer(info->handle, idx) < 0) {
+                   DbgPrint("Failed to release buffer\n");
+               }
+               info->resource_array[idx] = 0u;
+               info->resource_cnt--;
+               break;
+           }
+       }
     }
 
     if (info->deleted && info->resource_cnt == 0) {
-    DbgPrint("Destroy buffer handle\n");
+       DbgPrint("Destroy buffer handle\n");
 
-    dynamicbox_destroy_buffer(info->handle);
-    free(info->resource_array);
-    free(info->id);
-    free(info);
+       dynamicbox_destroy_buffer(info->handle);
+       free(info->resource_array);
+       free(info->id);
+       free(info);
     }
 }
 
@@ -634,18 +633,18 @@ static void *alloc_fb(void *data, int size)
     void *buffer;
 
     if (info->ee) {
-    ecore_evas_geometry_get(info->ee, NULL, NULL, &info->w, &info->h);
-    DbgPrint("Size of ee is updated: %dx%d (info: %p)\n", info->w, info->h, info);
+       ecore_evas_geometry_get(info->ee, NULL, NULL, &info->w, &info->h);
+       DbgPrint("Size of ee is updated: %dx%d (info: %p)\n", info->w, info->h, info);
     }
 
     if (!info->handle) {
-    ErrPrint("Failed to create a buffer\n");
-    return NULL;
+       ErrPrint("Failed to create a buffer\n");
+       return NULL;
     }
 
     if (dynamicbox_acquire_buffer(info->handle, DBOX_PRIMARY_BUFFER, info->w, info->h, sizeof(int)) < 0) {
-    ErrPrint("Failed to acquire buffer\n");
-    return NULL;
+       ErrPrint("Failed to acquire buffer\n");
+       return NULL;
     }
 
     /**
@@ -653,16 +652,16 @@ static void *alloc_fb(void *data, int size)
      * Use it.
      */
     if (dynamicbox_support_hw_buffer(info->handle)) {
-    if (dynamicbox_create_hw_buffer(info->handle) == 0) {
-        buffer = dynamicbox_buffer_hw_buffer(info->handle);
-        if (buffer) {
-        DbgPrint("HW Accelerated buffer is created %p, (%dx%d)\n", info, info->w, info->h);
-        info->type = VWIN_GEM;
-        return buffer;
-        }
-    }
+       if (dynamicbox_create_hw_buffer(info->handle) == 0) {
+           buffer = dynamicbox_buffer_hw_buffer(info->handle);
+           if (buffer) {
+               DbgPrint("HW Accelerated buffer is created %p, (%dx%d)\n", info, info->w, info->h);
+               info->type = VWIN_GEM;
+               return buffer;
+           }
+       }
 
-    ErrPrint("Failed to allocate HW Accelerated buffer\n");
+       ErrPrint("Failed to allocate HW Accelerated buffer\n");
     }
 
     /**
@@ -680,18 +679,18 @@ static void *alloc_stride_fb(void *data, int size, int *stride, int *bpp)
 
     buffer = alloc_fb(data, size);
     if (buffer) {
-    vwin_info_t info = data;
-    int _stride;
+       vwin_info_t info = data;
+       int _stride;
 
-    *bpp = sizeof(int);
-    _stride = dynamicbox_buffer_stride(info->handle);
-    if (_stride < 0) {
-        _stride = info->w * *bpp;
-    }
+       *bpp = sizeof(int);
+       _stride = dynamicbox_buffer_stride(info->handle);
+       if (_stride < 0) {
+           _stride = info->w * *bpp;
+       }
 
-    *stride = _stride;
-    *bpp <<= 3;
-    DbgPrint("bpp: %d, stride: %d\n", *bpp, *stride);
+       *stride = _stride;
+       *bpp <<= 3;
+       DbgPrint("bpp: %d, stride: %d\n", *bpp, *stride);
     }
 
     return buffer;
@@ -702,29 +701,29 @@ static void free_fb(void *data, void *ptr)
     vwin_info_t info = data;
 
     if (!info->handle) {
-    return;
+       return;
     }
 
     if (info->type == VWIN_GEM) {
-    if (dynamicbox_destroy_hw_buffer(info->handle) == 0) {
-        DbgPrint("HW Accelerated buffer is destroyed\n");
-    }
+       if (dynamicbox_destroy_hw_buffer(info->handle) == 0) {
+           DbgPrint("HW Accelerated buffer is destroyed\n");
+       }
     } else if (info->type == VWIN_SW_BUF) {
-    DbgPrint("SW buffer is destroyed, %p\n", info);
-    dynamicbox_unref_buffer(ptr);
+       DbgPrint("SW buffer is destroyed, %p\n", info);
+       dynamicbox_unref_buffer(ptr);
     } else if (info->type == VWIN_PIXMAP) {
-    ErrPrint("Unable to reach to here\n");
+       ErrPrint("Unable to reach to here\n");
     }
 
     if (dynamicbox_release_buffer(info->handle, DBOX_PRIMARY_BUFFER) < 0) {
-    ErrPrint("Failed to release buffer\n");
+       ErrPrint("Failed to release buffer\n");
     }
 
     if (info->deleted) {
-    dynamicbox_destroy_buffer(info->handle);
-    free(info->resource_array);
-    free(info->id);
-    free(info);
+       dynamicbox_destroy_buffer(info->handle);
+       free(info->resource_array);
+       free(info->id);
+       free(info);
     }
 }
 
@@ -733,26 +732,26 @@ static void pre_render_cb(void *data, Evas *e, void *event_info)
     vwin_info_t info = data;
 
     if (!info->handle) {
-    return;
+       return;
     }
 
     if (dynamicbox_conf_premultiplied_alpha()) {
-    Evas_Coord w;
-    Evas_Coord h;
+       Evas_Coord w;
+       Evas_Coord h;
 
-    ecore_evas_geometry_get(info->ee, NULL, NULL, &w, &h);
-    evas_damage_rectangle_add(e, 0, 0, w, h);
+       ecore_evas_geometry_get(info->ee, NULL, NULL, &w, &h);
+       evas_damage_rectangle_add(e, 0, 0, w, h);
     }
 
     if (info->type == VWIN_GEM) {
-    dynamicbox_buffer_pre_render(info->handle);
+       dynamicbox_buffer_pre_render(info->handle);
     } else if (info->type == VWIN_PIXMAP) {
-    /**
-     * Only the pixmap type Ecore_Evas uses this variable
-     */
-    info->front_resource_id = ecore_evas_gl_x11_pixmap_get(info->ee);
+       /**
+        * Only the pixmap type Ecore_Evas uses this variable
+        */
+       info->front_resource_id = ecore_evas_gl_x11_pixmap_get(info->ee);
     } else if (info->type == VWIN_SW_BUF) {
-    /* Do nothing */
+       /* Do nothing */
     }
 }
 
@@ -761,44 +760,48 @@ static void post_render_cb(void *data, Evas *e, void *event_info)
     vwin_info_t info = data;
 
     if (!info->handle) {
-    return;
+       return;
     }
 
     if (dynamicbox_conf_premultiplied_alpha()) {
-    void *canvas;
-    int x, y, w, h;
+       void *canvas;
+       int x, y, w, h;
 
-    // Get a pointer of a buffer of the virtual canvas
-    canvas = (void *)ecore_evas_buffer_pixels_get(info->ee);
-    if (!canvas) {
-        ErrPrint("Failed to get pixel canvas\n");
-        return;
-    }
+       // Get a pointer of a buffer of the virtual canvas
+       canvas = (void *)ecore_evas_buffer_pixels_get(info->ee);
+       if (!canvas) {
+           ErrPrint("Failed to get pixel canvas\n");
+           return;
+       }
 
-    ecore_evas_geometry_get(info->ee, &x, &y, &w, &h);
-    evas_data_argb_unpremul(canvas, w * h);
+       ecore_evas_geometry_get(info->ee, &x, &y, &w, &h);
+       evas_data_argb_unpremul(canvas, w * h);
     }
 
     if (info->type == VWIN_GEM) {
-    dynamicbox_buffer_post_render(info->handle);
+       dynamicbox_buffer_post_render(info->handle);
     } else if (info->type == VWIN_PIXMAP) {
-    int idx;
-
-    for (idx = 0; idx < DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT; idx++) {
-        if (info->front_resource_id == info->resource_array[idx]) {
-        /**
-         */
-        dynamicbox_send_updated_by_idx(info->handle, idx);
-        break;
-        }
-    }
-
-    if (idx == DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT) {
-        /* Send updated event for PRIMARY BUFFER */
-        dynamicbox_send_updated_by_idx(info->handle, DBOX_PRIMARY_BUFFER);
-    }
+       int idx;
+
+       for (idx = 0; idx < DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT; idx++) {
+           if (info->front_resource_id == info->resource_array[idx]) {
+               /**
+                */
+               dynamicbox_send_updated_by_idx(info->handle, idx);
+               break;
+           }
+       }
+
+       if (idx == DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT) {
+           /* Send updated event for PRIMARY BUFFER */
+           if (info->front_resource_id == dynamicbox_resource_id(info->handle, DBOX_PRIMARY_BUFFER)) {
+               dynamicbox_send_updated_by_idx(info->handle, DBOX_PRIMARY_BUFFER);
+           } else {
+               DbgPrint("Unable to send updated: %u (%u)\n", info->front_resource_id, dynamicbox_resource_id(info->handle, DBOX_PRIMARY_BUFFER));
+           }
+       }
     } else if (info->type == VWIN_SW_BUF) {
-    dynamicbox_sync_buffer(info->handle);
+       dynamicbox_sync_buffer(info->handle);
     }
 }
 
@@ -808,13 +811,13 @@ static void ecore_evas_free_cb(Ecore_Evas *ee)
 
     info = ecore_evas_data_get(ee, "dynamic,box,info");
     if (!info) {
-    DbgPrint("Info is not valid\n");
-    return;
+       DbgPrint("Info is not valid\n");
+       return;
     }
 
     if (info->e) {
-    evas_event_callback_del(info->e, EVAS_CALLBACK_RENDER_POST, post_render_cb);
-    evas_event_callback_del(info->e, EVAS_CALLBACK_RENDER_PRE, pre_render_cb);
+       evas_event_callback_del(info->e, EVAS_CALLBACK_RENDER_POST, post_render_cb);
+       evas_event_callback_del(info->e, EVAS_CALLBACK_RENDER_PRE, pre_render_cb);
     }
 
     info->deleted = 1;
@@ -826,45 +829,46 @@ PUBLIC void *dynamicbox_get_evas_object(const char *id, int is_gbar)
     vwin_info_t info;
     Evas_Object *rect;
     const char *engine;
+    int gl_is_turned_on = 0;
 
     if (!s_info.alloc_canvas && !s_info.alloc_canvas_with_stride && !s_info.alloc_canvas_with_pixmap) {
-    s_info.alloc_canvas_with_pixmap = dlsym(RTLD_DEFAULT, "ecore_evas_gl_x11_pixmap_allocfunc_new");
-    if (!s_info.alloc_canvas_with_pixmap) {
-        DbgPrint("pixmap_allocfunc_new is not found\n");
-    }
+       s_info.alloc_canvas_with_pixmap = dlsym(RTLD_DEFAULT, "ecore_evas_gl_x11_pixmap_allocfunc_new");
+       if (!s_info.alloc_canvas_with_pixmap) {
+           DbgPrint("pixmap_allocfunc_new is not found\n");
+       }
 
-    s_info.alloc_canvas_with_stride = dlsym(RTLD_DEFAULT, "ecore_evas_buffer_allocfunc_with_stride_new");
-    if (!s_info.alloc_canvas_with_stride) {
-        DbgPrint("allocfunc_with_stirde_new is not found\n");
-    }
+       s_info.alloc_canvas_with_stride = dlsym(RTLD_DEFAULT, "ecore_evas_buffer_allocfunc_with_stride_new");
+       if (!s_info.alloc_canvas_with_stride) {
+           DbgPrint("allocfunc_with_stirde_new is not found\n");
+       }
 
-    s_info.alloc_canvas = dlsym(RTLD_DEFAULT, "ecore_evas_buffer_allocfunc_new");
-    if (!s_info.alloc_canvas) {
-        ErrPrint("allocfunc_new is not found\n");
-    }
+       s_info.alloc_canvas = dlsym(RTLD_DEFAULT, "ecore_evas_buffer_allocfunc_new");
+       if (!s_info.alloc_canvas) {
+           ErrPrint("allocfunc_new is not found\n");
+       }
 
-    if (!s_info.alloc_canvas_with_stride && !s_info.alloc_canvas && !s_info.alloc_canvas_with_pixmap) {
-        ErrPrint("No way to allocate canvas\n");
-        return NULL;
-    }
+       if (!s_info.alloc_canvas_with_stride && !s_info.alloc_canvas && !s_info.alloc_canvas_with_pixmap) {
+           ErrPrint("No way to allocate canvas\n");
+           return NULL;
+       }
     }
 
     if (!id) {
-    ErrPrint("Invalid parameter\n");
-    return NULL;
+       ErrPrint("Invalid parameter\n");
+       return NULL;
     }
 
     info = calloc(1, sizeof(*info));
     if (!info) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    return NULL;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       return NULL;
     }
 
     info->id = strdup(id);
     if (!info->id) {
-    ErrPrint("Heap: %s\n", strerror(errno));
-    free(info);
-    return NULL;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       free(info);
+       return NULL;
     }
 
     info->is_gbar = is_gbar;
@@ -873,14 +877,14 @@ PUBLIC void *dynamicbox_get_evas_object(const char *id, int is_gbar)
      * Acquire a buffer for canvas.
      */
     info->handle = dynamicbox_create_buffer(info->id, info->is_gbar,
-        (dynamicbox_conf_auto_align() || !s_info.alloc_canvas_with_stride),
-        event_handler_cb, info);
+           (dynamicbox_conf_auto_align() || !s_info.alloc_canvas_with_stride),
+           event_handler_cb, info);
 
     if (!info->handle) {
-    ErrPrint("Failed to create a dynamicbox buffer\n");
-    free(info->id);
-    free(info);
-    return NULL;
+       ErrPrint("Failed to create a dynamicbox buffer\n");
+       free(info->id);
+       free(info);
+       return NULL;
     }
 
     /**
@@ -892,28 +896,30 @@ PUBLIC void *dynamicbox_get_evas_object(const char *id, int is_gbar)
     engine = elm_config_preferred_engine_get();
     DbgPrint("Preferred engine: %s (%s)\n", engine, GL_ENGINE);
     if (engine && !strcmp(engine, GL_ENGINE)) {
-    if (s_info.alloc_canvas_with_pixmap) {
-        info->ee = s_info.alloc_canvas_with_pixmap(NULL, 0u, 0, 0, info->w, info->h, alloc_pixmap_cb, free_pixmap_cb, info);
-        if (!info->ee) {
-        ErrPrint("Unable to create a ee for pixmap\n");
-        }
-    }
+       if (s_info.alloc_canvas_with_pixmap) {
+           info->ee = s_info.alloc_canvas_with_pixmap(NULL, 0u, 0, 0, info->w, info->h, alloc_pixmap_cb, free_pixmap_cb, info);
+           if (!info->ee) {
+               ErrPrint("Unable to create a ee for pixmap\n");
+           } else {
+               gl_is_turned_on = 1;
+           }
+       }
     }
 
     if (!info->ee) {
-    if (!dynamicbox_conf_auto_align() && s_info.alloc_canvas_with_stride) {
-        info->ee = s_info.alloc_canvas_with_stride(info->w, info->h, alloc_stride_fb, free_fb, info);
-    } else if (s_info.alloc_canvas) {
-        info->ee = s_info.alloc_canvas(info->w, info->h, alloc_fb, free_fb, info);
-    }
+       if (!dynamicbox_conf_auto_align() && s_info.alloc_canvas_with_stride) {
+           info->ee = s_info.alloc_canvas_with_stride(info->w, info->h, alloc_stride_fb, free_fb, info);
+       } else if (s_info.alloc_canvas) {
+           info->ee = s_info.alloc_canvas(info->w, info->h, alloc_fb, free_fb, info);
+       }
     }
 
     if (!info->ee) {
-    ErrPrint("Failed to create ecore_evas (%dx%d)\n", info->w, info->h);
-    dynamicbox_destroy_buffer(info->handle);
-    free(info->id);
-    free(info);
-    return NULL;
+       ErrPrint("Failed to create ecore_evas (%dx%d)\n", info->w, info->h);
+       dynamicbox_destroy_buffer(info->handle);
+       free(info->id);
+       free(info);
+       return NULL;
     }
 
     ecore_evas_data_set(info->ee, "dynamic,box,info", info);
@@ -926,14 +932,18 @@ PUBLIC void *dynamicbox_get_evas_object(const char *id, int is_gbar)
 
     info->e = ecore_evas_get(info->ee);
     if (!info->e) {
-    ErrPrint("Failed to get evas\n");
-    ecore_evas_free(info->ee);
-    return NULL;
+       ErrPrint("Failed to get evas\n");
+       ecore_evas_free(info->ee);
+       return NULL;
     }
 
-    pre_render_cb(info, NULL, NULL);
-    ecore_evas_alpha_set(info->ee, EINA_TRUE);
-    post_render_cb(info, NULL, NULL);
+    if (!gl_is_turned_on) {
+       pre_render_cb(info, NULL, NULL);
+       ecore_evas_alpha_set(info->ee, EINA_TRUE);
+       post_render_cb(info, NULL, NULL);
+    } else {
+       DbgPrint("opengl-x11 engine should not turn on the alpha\n");
+    }
 
     ecore_evas_manual_render_set(info->ee, EINA_FALSE);
     ecore_evas_resize(info->ee, info->w, info->h);
@@ -943,9 +953,9 @@ PUBLIC void *dynamicbox_get_evas_object(const char *id, int is_gbar)
 
     rect = evas_object_rectangle_add(info->e);
     if (!rect) {
-    ErrPrint("Failed to create evas_object\n");
-    ecore_evas_free(info->ee);
-    return NULL;
+       ErrPrint("Failed to create evas_object\n");
+       ecore_evas_free(info->ee);
+       return NULL;
     }
 
     evas_object_resize(rect, info->w, info->h);
index b9c5f26..15b668a 100644 (file)
@@ -69,8 +69,8 @@ static int event_handler_cb(struct dynamicbox_buffer *handler, struct dynamicbox
 
 
     if (!info->handle) {
-        /* Just ignore this event */
-        return 0;
+       /* Just ignore this event */
+       return 0;
     }
 
     /*!
@@ -78,208 +78,208 @@ static int event_handler_cb(struct dynamicbox_buffer *handler, struct dynamicbox
      * Feed up events
      */
     switch (event_info->type) {
-    case DBOX_BUFFER_EVENT_ENTER:
-        evas_event_feed_mouse_in(info->e, event_info->timestamp * 1000, NULL);
-        break;
-    case DBOX_BUFFER_EVENT_LEAVE:
-        evas_event_feed_mouse_out(info->e, event_info->timestamp * 1000, NULL);
-        break;
-    case DBOX_BUFFER_EVENT_DOWN:
-        /*!
-         * \note
-         * Calculate the event occurred X & Y on the buffer
-         */
-        evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, (event_info->timestamp - 0.001f) * 1000, NULL); /* + 0.1f just for fake event */
-        evas_event_feed_mouse_down(info->e, 1, EVAS_BUTTON_NONE, event_info->timestamp * 1000, NULL); /* + 0.2f just for fake event */
-        break;
-    case DBOX_BUFFER_EVENT_MOVE:
-        /*!
-         * \note
-         * Calculate the event occurred X & Y on the buffer
-         */
-        evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
-        break;
-    case DBOX_BUFFER_EVENT_UP:
-        evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
-        evas_event_feed_mouse_up(info->e, 1, EVAS_BUTTON_NONE, (event_info->timestamp + 0.001f) * 1000, NULL);
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_HIGHLIGHT;
-        /*!
-         * \note
-         * Calculate the event occurred X & Y on the buffer
-         */
-        action_info.x = event_info->info.pointer.x;
-        action_info.y = event_info->info.pointer.y;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        if (ret == EINA_TRUE) {
-            if (!get_highlighted_object(parent_elm)) {
-                LOGE("Highlighted object is not found\n");
-                ret = DBOX_ACCESS_STATUS_ERROR;
-            } else {
-                LOGD("Highlighted object is found\n");
-                ret = DBOX_ACCESS_STATUS_DONE;
-            }
-        } else {
-            LOGE("Action error\n");
-            ret = DBOX_ACCESS_STATUS_ERROR;
-        }
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_NEXT:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT;
-        action_info.highlight_cycle = EINA_FALSE;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_LAST : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_PREV:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_HIGHLIGHT_PREV;
-        action_info.highlight_cycle = EINA_FALSE;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_FIRST : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_ACTIVATE:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_ACTIVATE;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_ACTION_UP:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_UP;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_ACTION_DOWN:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_DOWN;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_SCROLL_UP:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_SCROLL;
-        action_info.x = event_info->info.pointer.x;
-        action_info.y = event_info->info.pointer.y;
-        action_info.mouse_type = 2;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_SCROLL_MOVE:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_SCROLL;
-        action_info.x = event_info->info.pointer.x;
-        action_info.y = event_info->info.pointer.y;
-        action_info.mouse_type = 1;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_SCROLL_DOWN:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_SCROLL;
-        action_info.x = event_info->info.pointer.x;
-        action_info.y = event_info->info.pointer.y;
-        action_info.mouse_type = 0;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_ACCESS_UNHIGHLIGHT:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-        memset(&action_info, 0, sizeof(action_info));
-        action_type = ELM_ACCESS_ACTION_UNHIGHLIGHT;
-        ret = elm_access_action(parent_elm, action_type, &action_info);
-        ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
-        break;
-    case DBOX_BUFFER_EVENT_KEY_DOWN:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-
-        ret = DBOX_KEY_STATUS_ERROR;
-        break;
-    case DBOX_BUFFER_EVENT_KEY_UP:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-
-        ret = DBOX_KEY_STATUS_ERROR;
-        break;
-    case DBOX_BUFFER_EVENT_KEY_FOCUS_IN:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-
-        ret = DBOX_KEY_STATUS_ERROR;
-        break;
-    case DBOX_BUFFER_EVENT_KEY_FOCUS_OUT:
-        parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
-        if (!parent_elm) {
-            ret = DBOX_ACCESS_STATUS_ERROR;
-            break;
-        }
-
-        ret = DBOX_KEY_STATUS_ERROR;
-        break;
-    default:
-        LOGD("Unhandled buffer event (%d)\n", event_info->type);
-        break;
+       case DBOX_BUFFER_EVENT_ENTER:
+           evas_event_feed_mouse_in(info->e, event_info->timestamp * 1000, NULL);
+           break;
+       case DBOX_BUFFER_EVENT_LEAVE:
+           evas_event_feed_mouse_out(info->e, event_info->timestamp * 1000, NULL);
+           break;
+       case DBOX_BUFFER_EVENT_DOWN:
+           /*!
+            * \note
+            * Calculate the event occurred X & Y on the buffer
+            */
+           evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, (event_info->timestamp - 0.001f) * 1000, NULL); /* + 0.1f just for fake event */
+           evas_event_feed_mouse_down(info->e, 1, EVAS_BUTTON_NONE, event_info->timestamp * 1000, NULL); /* + 0.2f just for fake event */
+           break;
+       case DBOX_BUFFER_EVENT_MOVE:
+           /*!
+            * \note
+            * Calculate the event occurred X & Y on the buffer
+            */
+           evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
+           break;
+       case DBOX_BUFFER_EVENT_UP:
+           evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, event_info->timestamp * 1000, NULL);
+           evas_event_feed_mouse_up(info->e, 1, EVAS_BUTTON_NONE, (event_info->timestamp + 0.001f) * 1000, NULL);
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_HIGHLIGHT;
+           /*!
+            * \note
+            * Calculate the event occurred X & Y on the buffer
+            */
+           action_info.x = event_info->info.pointer.x;
+           action_info.y = event_info->info.pointer.y;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           if (ret == EINA_TRUE) {
+               if (!get_highlighted_object(parent_elm)) {
+                   LOGE("Highlighted object is not found\n");
+                   ret = DBOX_ACCESS_STATUS_ERROR;
+               } else {
+                   LOGD("Highlighted object is found\n");
+                   ret = DBOX_ACCESS_STATUS_DONE;
+               }
+           } else {
+               LOGE("Action error\n");
+               ret = DBOX_ACCESS_STATUS_ERROR;
+           }
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_NEXT:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT;
+           action_info.highlight_cycle = EINA_FALSE;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_LAST : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_PREV:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_HIGHLIGHT_PREV;
+           action_info.highlight_cycle = EINA_FALSE;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_FIRST : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_ACTIVATE:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_ACTIVATE;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_ACTION_UP:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_UP;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_ACTION_DOWN:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_DOWN;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_UP:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_SCROLL;
+           action_info.x = event_info->info.pointer.x;
+           action_info.y = event_info->info.pointer.y;
+           action_info.mouse_type = 2;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_MOVE:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_SCROLL;
+           action_info.x = event_info->info.pointer.x;
+           action_info.y = event_info->info.pointer.y;
+           action_info.mouse_type = 1;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_DOWN:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_SCROLL;
+           action_info.x = event_info->info.pointer.x;
+           action_info.y = event_info->info.pointer.y;
+           action_info.mouse_type = 0;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_ACCESS_UNHIGHLIGHT:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+           memset(&action_info, 0, sizeof(action_info));
+           action_type = ELM_ACCESS_ACTION_UNHIGHLIGHT;
+           ret = elm_access_action(parent_elm, action_type, &action_info);
+           ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
+           break;
+       case DBOX_BUFFER_EVENT_KEY_DOWN:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+
+           ret = DBOX_KEY_STATUS_ERROR;
+           break;
+       case DBOX_BUFFER_EVENT_KEY_UP:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+
+           ret = DBOX_KEY_STATUS_ERROR;
+           break;
+       case DBOX_BUFFER_EVENT_KEY_FOCUS_IN:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+
+           ret = DBOX_KEY_STATUS_ERROR;
+           break;
+       case DBOX_BUFFER_EVENT_KEY_FOCUS_OUT:
+           parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+           if (!parent_elm) {
+               ret = DBOX_ACCESS_STATUS_ERROR;
+               break;
+           }
+
+           ret = DBOX_KEY_STATUS_ERROR;
+           break;
+       default:
+           LOGD("Unhandled buffer event (%d)\n", event_info->type);
+           break;
     }
 
     return ret;
@@ -293,34 +293,34 @@ static void *alloc_fb(void *data, int size)
     int height = 0;
 
     if (info->ee == NULL) {
-        width = 1;
-        height = 1;
+       width = 1;
+       height = 1;
     } else {
-        ecore_evas_geometry_get(info->ee, NULL, NULL, &width, &height);
+       ecore_evas_geometry_get(info->ee, NULL, NULL, &width, &height);
     }
 
     /*!
      * Acquire a buffer for canvas.
      */
     info->handle = dynamicbox_acquire_buffer(info->id, info->is_gbar,
-                    width, height,
-                    event_handler_cb, info);
+           width, height,
+           event_handler_cb, info);
 
     /*!
      * If it supports the H/W accelerated buffer,
      * Use it.
      */
     if (dynamicbox_support_hw_buffer(info->handle)) {
-        if (dynamicbox_create_hw_buffer(info->handle) == 0) {
-            buffer = dynamicbox_buffer_hw_buffer(info->handle);
-            if (buffer) {
-                LOGD("HW Accelerated buffer is created\n");
-                info->is_hw = 1;
-                return buffer;
-            }
-        }
-
-        LOGE("Failed to allocate HW Accelerated buffer\n");
+       if (dynamicbox_create_hw_buffer(info->handle) == 0) {
+           buffer = dynamicbox_buffer_hw_buffer(info->handle);
+           if (buffer) {
+               LOGD("HW Accelerated buffer is created\n");
+               info->is_hw = 1;
+               return buffer;
+           }
+       }
+
+       LOGE("Failed to allocate HW Accelerated buffer\n");
     }
 
     /*!
@@ -337,14 +337,14 @@ static void free_fb(void *data, void *ptr)
     struct info *info = data;
 
     if (!info->handle) {
-        return;
+       return;
     }
 
     if (info->is_hw) {
-        if (dynamicbox_destroy_hw_buffer(info->handle) == 0) {
-            LOGD("HW Accelerated buffer is destroyed\n");
-            goto out;
-        }
+       if (dynamicbox_destroy_hw_buffer(info->handle) == 0) {
+           LOGD("HW Accelerated buffer is destroyed\n");
+           goto out;
+       }
     }
 
     dynamicbox_unref_buffer(ptr);
@@ -359,11 +359,11 @@ static void pre_render_cb(void *data, Evas *e, void *event_info)
     struct info *info = data;
 
     if (!info->handle) {
-        return;
+       return;
     }
 
     if (info->is_hw) {
-        dynamicbox_buffer_pre_render(info->handle);
+       dynamicbox_buffer_pre_render(info->handle);
     }
 }
 
@@ -372,13 +372,13 @@ static void post_render_cb(void *data, Evas *e, void *event_info)
     struct info *info = data;
 
     if (!info->handle) {
-        return;
+       return;
     }
 
     if (info->is_hw) {
-        dynamicbox_buffer_post_render(info->handle);
+       dynamicbox_buffer_post_render(info->handle);
     } else {
-        dynamicbox_sync_buffer(info->handle);
+       dynamicbox_sync_buffer(info->handle);
     }
 }
 
@@ -388,31 +388,31 @@ PUBLIC void *dynamicbox_get_evas_object(const char *id, int is_gbar)
     Evas_Object *rect;
 
     if (!id) {
-        ErrPrint("Invalid parameter\n");
-        return NULL;
+       ErrPrint("Invalid parameter\n");
+       return NULL;
     }
 
     info = calloc(1, sizeof(*info));
     if (!info) {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        return NULL;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       return NULL;
     }
 
     info->id = strdup(id);
     if (!info->id) {
-        ErrPrint("Heap: %s\n", strerror(errno));
-        free(info);
-        return NULL;
+       ErrPrint("Heap: %s\n", strerror(errno));
+       free(info);
+       return NULL;
     }
 
     info->is_gbar = is_gbar;
 
     info->ee = ecore_evas_buffer_allocfunc_new(1, 1, alloc_fb, free_fb, info);
     if (!info->ee) {
-        ErrPrint("Failed to create ecore_evas (%dx%d)\n", 1, 1);
-        free(info->id);
-        free(info);
-        return NULL;
+       ErrPrint("Failed to create ecore_evas (%dx%d)\n", 1, 1);
+       free(info->id);
+       free(info);
+       return NULL;
     }
 
     pre_render_cb(info, NULL, NULL);
@@ -420,15 +420,15 @@ PUBLIC void *dynamicbox_get_evas_object(const char *id, int is_gbar)
     post_render_cb(info, NULL, NULL);
 
     ecore_evas_data_set(info->ee, "dynamic,box,info", info);
-    
+
     ecore_evas_manual_render_set(info->ee, EINA_FALSE);
     ecore_evas_resize(info->ee, 1, 1);
 
     info->e = ecore_evas_get(info->ee);
     if (!info->e) {
-        ErrPrint("Failed to get evas\n");
-        ecore_evas_free(info->ee);
-        return NULL;
+       ErrPrint("Failed to get evas\n");
+       ecore_evas_free(info->ee);
+       return NULL;
     }
 
     evas_event_callback_add(info->e, EVAS_CALLBACK_RENDER_POST, post_render_cb, info);
@@ -436,9 +436,9 @@ PUBLIC void *dynamicbox_get_evas_object(const char *id, int is_gbar)
 
     rect = evas_object_rectangle_add(info->e);
     if (!rect) {
-        ErrPrint("Failed to create evas_object\n");
-        ecore_evas_free(info->ee);
-        return NULL;
+       ErrPrint("Failed to create evas_object\n");
+       ecore_evas_free(info->ee);
+       return NULL;
     }
 
     evas_object_resize(rect, 1, 1);