Merge with devel/home/master branch
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 16 Oct 2014 05:55:28 +0000 (14:55 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 16 Oct 2014 05:55:28 +0000 (14:55 +0900)
Package name is replaced with libdynamicbox

[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: Id24a3c01d8f8a5aee7cbd8600db3871edd28a52c

13 files changed:
CMakeLists.txt
doc/dynamicbox_doc.h
include/dynamicbox.h
include/livebox.h [deleted file]
include/livebox_product.h [deleted file]
livebox.pc.in [deleted file]
packaging/libdynamicbox.manifest [moved from packaging/liblivebox.manifest with 100% similarity]
packaging/libdynamicbox.spec [moved from packaging/liblivebox.spec with 75% similarity]
src/dynamicbox.c
src/livebox.c [deleted file]
src/snapshot_window.c
src/virtual_window.c
src/virtual_window_wayland.c

index 71adf8e..127c155 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(livebox C)
+PROJECT(dynamicbox C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "\${prefix}")
@@ -16,8 +16,8 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs REQUIRED
        dlog
-       livebox-service
-       provider
+       dynamicbox_service
+       dynamicbox_provider
        evas
        ecore
        elementary
@@ -53,7 +53,7 @@ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g")
 
 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
-ADD_DEFINITIONS("-DLOG_TAG=\"LIVEBOX\"")
+ADD_DEFINITIONS("-DLOG_TAG=\"DYNAMICBOX\"")
 ADD_DEFINITIONS("-DNDEBUG")
 ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET")
 ADD_DEFINITIONS("-DMASTER_PKGNAME=\"data-provider-master\"")
@@ -62,9 +62,9 @@ ADD_DEFINITIONS("-DSLAVE_PKGNAME=\"com.samsung.data-provider-slave\"")
 SET (BUILD_SOURCE
        ${BUILD_SOURCE}
        src/dlist.c
-       src/livebox.c
        src/util.c
        src/dynamicbox.c
+       src/snapshot_window.c
 )
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${BUILD_SOURCE})
@@ -76,9 +76,11 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
 
 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc")
+
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox.h DESTINATION include/${PROJECT_NAME})
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox_product.h DESTINATION include/${PROJECT_NAME})
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}")
+       
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/dynamicbox.h DESTINATION include/${PROJECT_NAME})
 
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}")
+       
 ADD_SUBDIRECTORY(data)
index a58049e..e00ba37 100644 (file)
@@ -30,7 +30,7 @@
 <H2>1. Script type Dynamic Box</H2>
 If you choose the Script Type DBox, you have to use this.
 
-Dyanmic Box defines its own syntax to share the content between home application and provider application.
+Dynamic Box defines its own syntax to share the content between home application and provider application.
 It is called "Description Data Syntax"
 
 To generate it you have to use following functions.
@@ -58,8 +58,8 @@ dynamicbox_desc_close(desc_handle);
 desc_handle = NULL;
 @endcode
 
-Only after you close the desc_handle, the provider will sends changes to the dynamic box manager service.
-And if it needs to propagates events to the home application, the home application will gets changes event.
+Only after you close the desc_handle, the provider will send changes to the dynamic box manager service.
+And if it needs to propagate events to the home application, the home application will get changes event.
 
 <H2>2. Window(buffer) type Dynamic Box</H2>
 
@@ -81,28 +81,28 @@ if (!win) {
 
 To create a window for dynamic box,
 You have to get the parent object using dynamicbox_get_evas_object().
-And after creates a window for dynamic box, you have to delete it.
+And after creating a window for dynamic box, you have to delete it.
 Its attributes will be passed to the newly created window. So you don't need keep the parent object anymore.
 
-After create a window, you can do what you want like an application.
+After creating a window, you can do what you want like an application.
 Creatig any core-control such as button, list, etc, ....
 
 <H2>3. Image type Dynamic Box</H2>
 This kind of dynamic box should create an image file using given Id.
 The Id's syntax is "file://ABS_PATH_OF_OUTPUT_FILE", so you should create an image file using this URI.
 The Id will be assigned to every dynamic box instances.
-And those are uniq.
+And those are unique.
 
 If you create an image file, you should notify it to the viewer using dynamicbox_provider_app_dbox_updated()
 it is provided by libdynamicbox_provider_app package.
 
 <H2>4. Text type Dynamic Box (Experimental)</H2>
 In case of text type, you may have no window or script file.
-The text type dynamic box only needs to generates content data using dynamicbox_desc_XXXX series APIs.
+The text type dynamic box only needs to generate content data using dynamicbox_desc_XXXX series APIs.
 Of course, after you prepare the desc file, you have to call dynamicbox_provider_app_dbox_updated() function too.
-Then the viewer will gets your updated contents and try to parse it to locate content of dynamic box to its screen.
+Then the viewer will get your updated contents and try to parse it to locate content of dynamic box to its screen.
 But, unfortunately, this type of dynamic box is not fully supported yet.
-Because it is very highly depends on the viewer implementations.
+Because it very highly depends on the viewer implementations.
 So if the viewer doesn't support this type of dynamic box, you cannot do anything for user.
 
 To generate the text data, you can use below API set.
index 768e9c5..f1b8a9b 100644 (file)
  * limitations under the License.
  */
 
+/**
+ * Export by dynamicbox_service
+ */
+#include <dynamicbox_buffer.h>
+#include <dynamicbox_script.h>
+
 #ifndef __DYNAMICBOX_UILITY_H
 #define __DYNAMICBOX_UILITY_H
 
@@ -21,8 +27,6 @@
 extern "C" {
 #endif
 
-#include <Evas.h>
-
 /**
  * @file dynamicbox.h
  * @brief This file declares API of libdynamicbox library
@@ -137,7 +141,14 @@ extern "C" {
  * @brief Dynamic Box description data handle.
  * @since_tizen 2.3
  */
-struct dynamicbox_desc;
+typedef struct dynamicbox_desc *dynamicbox_desc_h;
+
+/**
+ * @internal
+ * @brief Flush Callback for snapshot window
+ * @since_tizen 2.3
+ */
+typedef void (*dynamicbox_flush_cb)(void *snapshot_window, const char *id, int status, void *data);
 
 /**
  * @brief Updates a description file.
@@ -152,7 +163,7 @@ struct dynamicbox_desc;
  * @post Should be destroyed(flushed) using dynamicbox_desc_close() API.
  * @see dynamicbox_desc_close()
  */
-extern struct dynamicbox_desc *dynamicbox_desc_open(const char *id, int gbar);
+extern dynamicbox_desc_h dynamicbox_desc_open(const char *id, int gbar);
 
 /**
  * @brief Completes the description file update.
@@ -169,7 +180,7 @@ extern struct dynamicbox_desc *dynamicbox_desc_open(const char *id, int gbar);
  * @post Handle must not be used after return from this function.
  * @see dynamicbox_desc_open()
  */
-extern int dynamicbox_desc_close(struct dynamicbox_desc *handle);
+extern int dynamicbox_desc_close(dynamicbox_desc_h handle);
 
 /**
  * @brief Sets the category information of current description data.
@@ -185,7 +196,7 @@ extern int dynamicbox_desc_close(struct dynamicbox_desc *handle);
  * @pre Must be called after create a handle using dynamicbox_desc_open()
  * @see dynamicbox_desc_set_id()
  */
-extern int dynamicbox_desc_set_category(struct dynamicbox_desc *handle, const char *id, const char *category);
+extern int dynamicbox_desc_set_category(dynamicbox_desc_h handle, const char *id, const char *category);
 
 /**
  * @brief Sets the content size.
@@ -202,7 +213,7 @@ extern int dynamicbox_desc_set_category(struct dynamicbox_desc *handle, const ch
  * @see dynamicbox_desc_open()
  * @see dynamicbox_desc_set_id()
  */
-extern int dynamicbox_desc_set_size(struct dynamicbox_desc *handle, const char *id, int w, int h);
+extern int dynamicbox_desc_set_size(dynamicbox_desc_h handle, const char *id, int w, int h);
 
 /**
  * @brief Sets the target id of the given block.
@@ -220,7 +231,7 @@ extern int dynamicbox_desc_set_size(struct dynamicbox_desc *handle, const char *
  * @see dynamicbox_desc_open()
  * @see dynamicbox_desc_set_id()
  */
-extern int dynamicbox_desc_set_id(struct dynamicbox_desc *handle, int idx, const char *id);
+extern int dynamicbox_desc_set_id(dynamicbox_desc_h handle, int idx, const char *id);
 
 /**
  * @brief Adds a new block.
@@ -239,7 +250,7 @@ extern int dynamicbox_desc_set_id(struct dynamicbox_desc *handle, int idx, const
  * @see dynamicbox_desc_set_id()
  * @see dynamicbox_desc_del_block()
  */
-extern int dynamicbox_desc_add_block(struct dynamicbox_desc *handle, const char *id, const char *type, const char *part, const char *data, const char *option);
+extern int dynamicbox_desc_add_block(dynamicbox_desc_h handle, const char *id, const char *type, const char *part, const char *data, const char *option);
 
 /**
  * @brief Deletes an added block.
@@ -254,21 +265,21 @@ extern int dynamicbox_desc_add_block(struct dynamicbox_desc *handle, const char
  * @see dynamicbox_desc_add_block()
  * @see dynamicbox_desc_open()
  */
-extern int dynamicbox_desc_del_block(struct dynamicbox_desc *handle, int idx);
+extern int dynamicbox_desc_del_block(dynamicbox_desc_h handle, int idx);
 
 /**
- * @brief Creates an Evas_Object to create an elm_win object.
- * @details Creating a new Evas_Object using Dynamic Box frame buffer.
+ * @brief Creates an Object to create an elm_win object.
+ * @details Creating a new Object using Dynamic Box frame buffer.
  * @since_tizen 2.3
  * @param[in] id Instance Id
  * @param[in] gbar 1 if this object is created for Glance Bar or 0 (for Dynamic Box)
  * @privlevel public
  * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
- * @return Evas_Object* Evas Object type
+ * @return void* Object type
  * @retval Address Valid evas object
  * @retval @c NULL failed to create
  */
-extern Evas_Object *dynamicbox_get_evas_object(const char *id, int gbar);
+extern void *dynamicbox_get_evas_object(const char *id, int gbar);
 
 /**
  * @brief Set extra information for updated content.
@@ -298,63 +309,63 @@ extern int dynamicbox_set_extra_info(const char *id, const char *content, const
  * @brief Structure for a Dynamic Box buffer defined by a provider.
  * @since_tizen 2.3
  */
-struct dynamicbox_buffer;
+typedef struct dynamicbox_buffer *dynamicbox_buffer_h;
 
 /**
  * @internal
  * @brief Return values of dynamicbox programming interfaces: Operation is successfully done.
  * @since_tizen 2.3
  */
-extern const int DONE;
+extern const int DBOX_DONE;
 
 /**
  * @internal
  * @brief Return values of dynamicbox programming interfaces: Contents are updated.
  * @since_tizen 2.3
  */
-extern const int OUTPUT_UPDATED;
+extern const int DBOX_OUTPUT_UPDATED;
 
 /**
  * @internal
  * @brief Return values of dynamicbox programming interfaces: Need to call the dynamicbox_need_to_update and dynamicbox_update_content.
  * @since_tizen 2.3
  */
-extern const int NEED_TO_SCHEDULE;
+extern const int DBOX_NEED_TO_SCHEDULE;
 
 /**
  * @internal
  * @brief Return values of dynamicbox programming interfaces: Need to do force update.
  * @since_tizen 2.3
  */
-extern const int FORCE_TO_SCHEDULE;
+extern const int DBOX_FORCE_TO_SCHEDULE;
 
 /**
  * @internal
  * @brief Return values of dynamicbox programming interfaces: Need to create a new instance.
  * @since_tizen 2.3
  */
-extern const int NEED_TO_CREATE;
+extern const int DBOX_NEED_TO_CREATE;
 
 /**
  * @internal
  * @brief Return values of dynamicbox programming interfaces: Need to destroy this instance.
  * @since_tizen 2.3
  */
-extern const int NEED_TO_DESTROY;
+extern const int DBOX_NEED_TO_DESTROY;
 
 /**
  * @internal
  * @brief Return values of dynamicbox programming interfaces: Need to update.
  * @since_tizen 2.3
  */
-extern const int NEED_TO_UPDATE;
+extern const int DBOX_NEED_TO_UPDATE;
 
 /**
  * @internal
  * @brief Return values of dynamicbox programming interfaces: Using network.
  * @since_tizen 2.3
  */
-extern const int USE_NET;
+extern const int DBOX_USE_NET;
 
 /**
  * @internal
@@ -421,36 +432,6 @@ extern const int DBOX_SYS_EVENT_DELETED;
 
 /**
  * @internal
- * @brief Structure for extra event information for dynamicbox_content_event interface function.
- * @since_tizen 2.3
- */
-#if !defined(__SCRIPT_EVENT_INFO)
-#define __SCRIPT_EVENT_INFO
-
-/**
- * @internal
- * @brief
- * Text signal & Content event uses this data structure.
- * @since_tizen 2.3
- */
-struct event_info {
-        struct _pointer {
-                double x; /**< X value of current mouse(touch) position */
-                double y; /**< Y value of current mouse(touch) position */
-                int down; /**< Is it pressed(1) or not(0) */
-        } pointer;
-
-        struct _part {
-                double sx; /**< Pressed object's left top X */
-                double sy; /**< Pressed object's left top Y */
-                double ex; /**< Pressed object's right bottom X */
-                double ey; /**< Pressed object's right bottom Y */
-        } part;
-};
-#endif
-
-/**
- * @internal
  * @brief Notifies the updated content to the provider.
  * @details Forcedly notifies the updated contents.
  *    This function can be used from async callback function to notify the updated content.
@@ -468,96 +449,6 @@ extern int dynamicbox_content_is_updated(const char *id, int gbar);
 
 /**
  * @internal
- * @brief Replaces "\n" (new line character) with &lt;br&gt; tag.
- * @details This utility function is used to replace all NEW LINE CHARACTER ("\n") with &lt;br&gt; tag.
- * @since_tizen 2.3
- * @param[in] str Source string
- * @return char * type
- * @retval string Allocted in the heap
- * @retval @c NULL If it fails to replace string
- * @post Returned string must has to be free'd by user manually.
- */
-extern char *dynamicbox_util_nl2br(const char *str);
-
-/**
- * @internal
- * @brief Interfaces for direct buffer management (Available only for the GBar area).
- * @since_tizen 2.3
- */
-#ifndef __DBOX_PROVIDER_BUFFER_H
-/**
- * @internal
- * @brief Enumeration for value should be sync'd with provider.
- * @since_tizen 2.3
- */
-enum dbox_buffer_event {
-       DBOX_BUFFER_EVENT_ENTER, /**< Mouse cursor enter */
-       DBOX_BUFFER_EVENT_LEAVE, /**< Mouse cursor leave */
-       DBOX_BUFFER_EVENT_DOWN, /**< Mouse down */
-       DBOX_BUFFER_EVENT_MOVE, /**< Mouse move */
-       DBOX_BUFFER_EVENT_UP, /**< Mouse up */
-
-       DBOX_BUFFER_EVENT_KEY_DOWN, /**< Key down */
-       DBOX_BUFFER_EVENT_KEY_UP, /**< Key up */
-       DBOX_BUFFER_EVENT_KEY_FOCUS_IN, /**< Key focus in */
-       DBOX_BUFFER_EVENT_KEY_FOCUS_OUT, /**< Key focus out */
-
-       DBOX_BUFFER_EVENT_HIGHLIGHT, /**< Accessibility - Highlight */
-       DBOX_BUFFER_EVENT_HIGHLIGHT_NEXT, /**< Accessibility - Move highlight to next */
-       DBOX_BUFFER_EVENT_HIGHLIGHT_PREV, /**< Accessibility - Move highlight to prev */
-       DBOX_BUFFER_EVENT_ACTIVATE, /**< Accessibility - Activate the highlighted object */
-       DBOX_BUFFER_EVENT_ACTION_UP, /**< Accessibility - Make UP action */
-       DBOX_BUFFER_EVENT_ACTION_DOWN, /**< Accessibility - Make Down action */
-       DBOX_BUFFER_EVENT_SCROLL_UP, /**< Accessibility - Scroll up */
-       DBOX_BUFFER_EVENT_SCROLL_MOVE, /**< Accessibility - Scroll move */
-       DBOX_BUFFER_EVENT_SCROLL_DOWN, /**< Accessibility - Scroll down */
-       DBOX_BUFFER_EVENT_UNHIGHLIGHT, /**< Accessibility - Remove highlight */
-
-       DBOX_BUFFER_EVENT_ON_HOLD,      /**< To prevent from generating mouse clicked event */
-       DBOX_BUFFER_EVENT_OFF_HOLD,     /**< Stopped holding. */
-       DBOX_BUFFER_EVENT_ON_SCROLL, /**< On scrolling */
-       DBOX_BUFFER_EVENT_OFF_SCROLL, /**< Scrolling stopped */
-
-       DBOX_BUFFER_EVENT_ACCESS_VALUE_CHANGE, /**< */
-       DBOX_BUFFER_EVENT_ACCESS_MOUSE, /**< give mouse event to highlight object */
-       DBOX_BUFFER_EVENT_ACCESS_BACK, /**< go back to a previous view ex: pop naviframe item */
-       DBOX_BUFFER_EVENT_ACCESS_OVER, /**< mouse over an object */
-       DBOX_BUFFER_EVENT_ACCESS_READ, /**< highlight an object */
-       DBOX_BUFFER_EVENT_ACCESS_ENABLE, /**< enable highlight and read ability */
-       DBOX_BUFFER_EVENT_ACCESS_DISABLE /**< disable highlight and read ability */
-};
-
-/**
- * @internal
- * @brief Event info
- * @since_tizen 2.3
- */
-struct dbox_buffer_event_data {
-       enum dbox_buffer_event type; /**< Mouse, Keyboard, Accessibility event type */
-       double timestamp; /**< Timestamp of events */
-
-       union _input_data {
-               struct _mouse {
-                       int x; /**< If the event type is for accessibility or mouse, coordinates of X for pointer */
-                       int y; /**< If the event type is for accessibility or mouse, coordinates of Y for pointer */
-               } pointer;
-
-               struct _access {
-                       int x; /**< Accessibility event X coordinate */
-                       int y; /**< Accessibility event Y coordinate */
-                       unsigned int mouse_type; /**< 0: down, 1: move, 2: up | 0: cur, 1: next, 2: prev, 3: off */
-                       unsigned int action_type; /**< reserved for protocol */
-                       unsigned int action_by; /**< reserved for protocol */
-                       int cycle; /**< reserved for protocol */
-               } access;
-
-               unsigned int keycode; /**< If the event type is for keyboard, the value of keycode */
-       } info;
-};
-#endif
-
-/**
- * @internal
  * @brief Acquires a buffer for GBar or DBox, currently only the GBar is supported.
  * @since_tizen 2.3
  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
@@ -576,7 +467,7 @@ struct dbox_buffer_event_data {
  * @post Allocated buffer object must be released via dynamicbox_release_buffer().
  * @see dynamicbox_release_buffer()
  */
-extern struct dynamicbox_buffer *dynamicbox_acquire_buffer(const char *id, int gbar, int width, int height, int pixels, int auto_align, int (*handler)(struct dynamicbox_buffer *, struct dbox_buffer_event_data *, void *), void *data);
+extern dynamicbox_buffer_h dynamicbox_acquire_buffer(const char *id, int gbar, int width, int height, int pixels, int auto_align, int (*handler)(dynamicbox_buffer_h, dynamicbox_buffer_event_data_t, void *), void *data);
 
 /**
  * @internal
@@ -591,7 +482,7 @@ extern struct dynamicbox_buffer *dynamicbox_acquire_buffer(const char *id, int g
  * @pre The system must be set to use the Resource Id method for content sharing.
  * @see dynamicbox_acquire_buffer()
  */
-extern unsigned int dynamicbox_resource_id(struct dynamicbox_buffer *handle);
+extern unsigned int dynamicbox_resource_id(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -606,7 +497,7 @@ extern unsigned int dynamicbox_resource_id(struct dynamicbox_buffer *handle);
  * @pre Handle must be created using dynamicbox_acquire_buffer().
  * @see dynamicbox_acquire_buffer()
  */
-extern int dynamicbox_release_buffer(struct dynamicbox_buffer *handle);
+extern int dynamicbox_release_buffer(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -621,7 +512,7 @@ extern int dynamicbox_release_buffer(struct dynamicbox_buffer *handle);
  * @retval address If it succeed to get the buffer address
  * @see dynamicbox_unref_buffer()
  */
-extern void *dynamicbox_ref_buffer(struct dynamicbox_buffer *handle);
+extern void *dynamicbox_ref_buffer(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -651,7 +542,7 @@ extern int dynamicbox_unref_buffer(void *buffer);
  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
  * @see dynamicbox_acquire_buffer()
  */
-extern int dynamicbox_sync_buffer(struct dynamicbox_buffer *handle);
+extern int dynamicbox_sync_buffer(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -678,7 +569,7 @@ extern int dynamicbox_request_update(const char *id);
  * @retval 0 If it doesn not supported
  * @see dynamicbox_acquire_buffer()
  */
-extern int dynamicbox_support_hw_buffer(struct dynamicbox_buffer *handle);
+extern int dynamicbox_support_hw_buffer(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -695,7 +586,7 @@ extern int dynamicbox_support_hw_buffer(struct dynamicbox_buffer *handle);
  * @post Must be destroyed if it is not necessary.
  * @see dynamicbox_support_hw_buffer()
  */
-extern int dynamicbox_create_hw_buffer(struct dynamicbox_buffer *handle);
+extern int dynamicbox_create_hw_buffer(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -710,7 +601,7 @@ extern int dynamicbox_create_hw_buffer(struct dynamicbox_buffer *handle);
  * @pre Must be created h/w buffer using dynamicbox_create_hw_buffer.
  * @see dynamicbox_create_hw_buffer()
  */
-extern int dynamicbox_destroy_hw_buffer(struct dynamicbox_buffer *handle);
+extern int dynamicbox_destroy_hw_buffer(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -724,7 +615,7 @@ extern int dynamicbox_destroy_hw_buffer(struct dynamicbox_buffer *handle);
  * @retval addr H/W accelerated buffer address
  * @see dynamicbox_create_hw_buffer()
  */
-extern void *dynamicbox_buffer_hw_buffer(struct dynamicbox_buffer *handle);
+extern void *dynamicbox_buffer_hw_buffer(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -737,7 +628,7 @@ extern void *dynamicbox_buffer_hw_buffer(struct dynamicbox_buffer *handle);
  * @return DBOX_STATUS_ERROR_FAULT Unrecoverable error
  * @see dynamicbox_create_hw_buffer()
  */
-extern int dynamicbox_buffer_stride(struct dynamicbox_buffer *handle);
+extern int dynamicbox_buffer_stride(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -754,7 +645,7 @@ extern int dynamicbox_buffer_stride(struct dynamicbox_buffer *handle);
  * @see dynamicbox_support_hw_buffer()
  * @see dynamicbox_buffer_post_render()
  */
-extern int dynamicbox_buffer_pre_render(struct dynamicbox_buffer *handle);
+extern int dynamicbox_buffer_pre_render(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -770,7 +661,7 @@ extern int dynamicbox_buffer_pre_render(struct dynamicbox_buffer *handle);
  * @see dynamicbox_support_hw_buffer()
  * @see dynamicbox_buffer_pre_render()
  */
-extern int dynamicbox_buffer_post_render(struct dynamicbox_buffer *handle);
+extern int dynamicbox_buffer_post_render(dynamicbox_buffer_h handle);
 
 /**
  * @internal
@@ -834,30 +725,40 @@ extern int dynamicbox_thaw_scroller(const char *dboxid, const char *id);
 
 /**
  * @internal
- * @brief Get the configuration value for premultiplied alpha.
+ * @brief Create a snapshot window
  * @details
- *     If the system uses the premultiplied alpha for content,
- *     This function will returns 1.
+ *         If you want create a snapshot image of contents, create this snapshot window
+ *         But it will not renders object asynchronously,
+ *         So you have to render the objects immediately, the delayed rendering object will not be on the canvas
+ *         After flush it to a file.
  * @since_tizen 2.3
- * @remarks This function only works with the inhouse provider.
- * @return status of premultiplied alpha.
- * @retval 1 Content rendered with premultiplied alpha.
- * @retval 0 Content doesn't rendered with premultiplied alpha.
+ * @param[in] id
+ * @param[in] size_type
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return void* window
+ * @retval #NULL failed to create a snapshot window
+ * @retval elm_win window object
+ * @see dynamicbox_snapshot_window_flush()
  */
-extern int dynamicbox_conf_premultiplied_alpha(void);
+extern void *dynamicbox_snapshot_window_add(const char *id, int size_type);
 
 /**
  * @internal
- * @brief Get the configuration value for AUTO Alignment of canvas buffer.
- * @details
- *      If the UIFW does not support the STRIDE information for rendering frame,
- *      This function will returns 1, then the dynamicbox will automatically aligning the buffer.
+ * @brief Flush to a file for snapshot window
+ * @details N/A
  * @since_tizen 2.3
- * @return status of auto alignment.
- * @retval 1 Content will be automatically aligned by dynamicbox.
- * @retval 0 Content will be aligned by UIFW, using stride information.
+ * @param[in] snapshot_win Snapshot window
+ * @param[in] timeout After this, the image file will be created
+ * @param[in] flush_cb Right after flush an image file, this callback will be called
+ * @param[in] data Callback data for flush_cb
+ * @return int status
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully flushed (flush timer added)
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid paramter
+ * @retval #DBOX_STATUS_ERROR_FAULT Failed to create a flush timer
+ * @see dynamicbox_snapshot_window_add()
  */
-extern int dynamicbox_conf_auto_align(void);
+extern int dynamicbox_snapshot_window_flush(void *snapshot_win, double timeout, dynamicbox_flush_cb flush_cb, void *data);
 
 /**
  * @}
diff --git a/include/livebox.h b/include/livebox.h
deleted file mode 100644 (file)
index f8686d4..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright 2013  Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __LIVEBOX_HELPER_H
-#define __LIVEBOX_HELPER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <Evas.h>
-
-/**
- * @file livebox.h
- * @brief This file declares API of liblivebox library
- */
-
-/**
- * @addtogroup CAPI_LIVEBOX_HELPER_MODULE
- * @{
- */
-
-/**
- * @brief Definition for COLOR BLOCK.
- */
-#define LB_DESC_TYPE_COLOR "color"
-
-/**
- * @brief Definition for TEXT BLOCK.
- */
-#define LB_DESC_TYPE_TEXT "text"
-
-/**
- * @brief Definition for IMAGE BLOCK.
- */
-#define LB_DESC_TYPE_IMAGE "image"
-
-/**
- * @brief Definition for SIGNAL BLOCK.
- */
-#define LB_DESC_TYPE_SIGNAL "signal"
-
-/**
- * @brief Definition for INFO BLOCK.
- */
-#define LB_DESC_TYPE_INFO "info"
-
-/**
- * @brief Definition for DRAG BLOCK.
- */
-#define LB_DESC_TYPE_DRAG "drag"
-
-/**
- * @brief Definition for SCRIPT SCRIPT.
- */
-#define LB_DESC_TYPE_SCRIPT "script"
-
-/**
- * @brief Definition for ACCESSIBILITY INFORMATION BLOCK.
- */
-#define LB_DESC_TYPE_ACCESS "access"
-
-/**
- * @brief Definition for accessibility operation.
- */
-#define LB_DESC_TYPE_ACCESS_OPERATION  "access,operation"
-
-/**
- * @brief Definition for set highlight on specified part.
- */
-#define LB_DESC_DATA_ACCESS_OPERATION_HL_SET "set,hl"
-
-/**
- * @brief Definition for remove highlight from specified part.
- */
-#define LB_DESC_DATA_ACCESS_OPERATION_HL_UNSET "unset,hl"
-
-/**
- * @brief Definition for move the highlight to next part.
- */
-#define LB_DESC_DATA_ACCESS_OPERATION_HL_NEXT "next,hl"
-
-/**
- * @brief Definition for move the highlight to previous part.
- */
-#define LB_DESC_DATA_ACCESS_OPERATION_HL_PREV "prev,hl"
-
-/**
- * @brief Definition for reset the chain of accessibility highlight list.
- */
-#define LB_DESC_DATA_ACCESS_OPERATION_RESET "reset,focus"
-
-/**
- * @brief Definition for specify the highlight move option.
- * @details If the highlight list reaches to the last object, move back to the first object.
- */
-#define LB_DESC_OPTION_ACCESS_HL_LOOP "cycle"
-
-/**
- * @brief Definition for specify the highlight move option.
- * @details If the highlight list reaches to the last object(or the first object),
- * the "prev,hl", "next,hl" will be failed.
- */
-#define LB_DESC_OPTION_ACCESS_HL_NOLOOP "no,cycle"
-
-/**
- * @brief Livebox description data handle.
- */
-struct livebox_desc;
-
-/**
- * @brief Updates a description file.
- * @remarks Must be used only by Inhouse livebox.
- * @param[in] filename
- * @param[in] for_pd
- * @privlevel public
- * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
- * @return Handle of desc instance
- * @pre Should be loaded by data-provider-slave.
- * @post Should be destroyed(flushed) using livebox_desc_close() API.
- * @see livebox_desc_close()
- */
-extern struct livebox_desc *livebox_desc_open(const char *filename, int for_pd);
-
-/**
- * @brief Completes the description file update.
- * @details Only if this API is called, the description data will be applied to the content of livebox (or PD).
- * @remarks Must be used only by Inhouse livebox.
- * @param[in] handle Handle which is created by livebox_desc_open() function
- * @privlevel public
- * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #LB_STATUS_SUCCESS If the flushing description data is successfully done
- * @retval #LB_STATUS_ERROR_INVALID If the given handle is not valid
- * @pre Handle must be created by livebox_desc_open()
- * @post Handle must not be used after return from this function.
- * @see livebox_desc_open()
- */
-extern int livebox_desc_close(struct livebox_desc *handle);
-
-/**
- * @brief Sets the category information of current description data.
- * @details Creates a new description block for updating category information of layout object.
- * @param[in] handle Handle which is created by livebox_desc_open() function
- * @param[in] id Id string of target object
- * @param[in] category Category string that will be used by layout object
- * @privlevel N/P
- * @return int type
- * @retval #LB_STATUS_ERROR_INVALID Invalid handle
- * @retval #LB_STATUS_ERROR_MEMORY Memory is not enough to add this block
- * @retval index Index(>=0) of added block, which can be used by livebox_desc_set_id()
- * @pre Must be called after create a handle using livebox_desc_open()
- * @see livebox_desc_set_id()
- */
-extern int livebox_desc_set_category(struct livebox_desc *handle, const char *id, const char *category);
-
-/**
- * @brief Sets the content size.
- * @details Sets the content size of layout.
- * @param[in] handle Handle which is created by livebox_desc_open() function
- * @param[in] id Id string of target object
- * @param[in] w Width in pixel
- * @param[in] h Height in pixel
- * @privlevel N/P
- * @return int type
- * @retval #LB_STATUS_ERROR_INVALID Invalid argument
- * @retval #LB_STATUS_ERROR_MEMORY Not enough memory to add a new block
- * @retval index Index(>=0) of added block Successfully added
- * @see livebox_desc_open()
- * @see livebox_desc_set_id()
- */
-extern int livebox_desc_set_size(struct livebox_desc *handle, const char *id, int w, int h);
-
-/**
- * @brief Sets the target id of the given block.
- * @details Only available for the script block.
- * @param[in] handle Handle which is created by livebox_desc_open() function
- * @param[in] idx Index of target block
- * @param[in] id Id String which will be used by other livebox_desc_XXX functions
- * @privlevel N/P
- * @return int type
- * @retval #LB_STATUS_SUCCESS Id is successfully updated for given idx of desc block
- * @retval #LB_STATUS_ERROR_INVALID Invalid argument
- * @retval #LB_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
- * @pre Desc block should be exists which has given index "idx".
- * @post Specified Id string("id") can be used by other livebox_desc_XXXX functions.
- * @see livebox_desc_open()
- * @see livebox_desc_set_id()
- */
-extern int livebox_desc_set_id(struct livebox_desc *handle, int idx, const char *id);
-
-/**
- * @brief Adds a new block.
- * @param[in] handle Handle which is created by the livebox_desc_open() function
- * @param[in] id ID of source script object
- * @param[in] type Type (image|text|script|signal|.. etc)
- * @param[in] part Target part to update with given content(data)
- * @param[in] data Content for specified part
- * @param[in] option Option for the block. (script: group, image: option, ...)
- * @privlevel N/P
- * @return Index of current description block
- * @retval #LB_STATUS_ERROR_INVALID Invalid argument
- * @retval #LB_STATUS_ERROR_MEMORY Not enough memory to add a new desc block
- * @retval index Index(>=0) of added desc block
- * @pre Handle must be created using livebox_desc_open.
- * @see livebox_desc_set_id()
- * @see livebox_desc_del_block()
- */
-extern int livebox_desc_add_block(struct livebox_desc *handle, const char *id, const char *type, const char *part, const char *data, const char *option);
-
-/**
- * @brief Deletes an added block.
- * @details If you discard the added desc block, use this API and the index of the created desc block.
- * @param[in] handle Handle which is created by livebox_desc_open() function
- * @param[in] idx Index of added block, returned from livebox_desc_add_block(), livebox_desc_set_size(), livebox_desc_set_category(), etc
- * @privlevel N/P
- * @return int type
- * @retval #LB_STATUS_SUCCESS Successfully deleted
- * @retval #LB_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
- * @pre Index must be exists.
- * @see livebox_desc_add_block()
- * @see livebox_desc_open()
- */
-extern int livebox_desc_del_block(struct livebox_desc *handle, int idx);
-
-/**
- * @brief Creates an Evas_Object to create an elm_win object.
- * @details Creating a new Evas_Object using livebox frame buffer.
- * @param[in] id Instance Id
- * @param[in] is_pd 1 if this object is created for PD or 0 (for LB)
- * @privlevel public
- * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
- * @return Evas_Object* Evas Object type
- * @retval Address Valid evas object
- * @retval @c NULL failed to create
- */
-extern Evas_Object *livebox_get_evas_object(const char *id, int is_pd);
-
-/**
- * @brief Set extra information for updated content.
- * @details
- *      If the provider should give some hints to the viewer,
- *      such as title, icon and name, this function can set them.
- *      provider will send those information to the viewer when the
- *      content is updated.
- * @remarks This function only works with the buffer type inhouse provider.
- * @param[in] id Livebox Instance Id
- * @param[in] content Content string that will pass to a livebox via livebox_create interface when it is re-created.
- * @param[in] title Human readable text for accessitility, summarized text for representing the content of a box.
- * @param[in] icon Path of icon image file - alternative image content
- * @param[in] name Name of a box - alternative text content
- * @privlevel N/P
- * @return int type
- * @retval #LB_STATUS_ERROR_MEMORY Out of memory
- * @retval #LB_STATUS_ERROR_INVALID Invalid parameters
- * @retval #LB_STATUS_ERROR_FAULT Unrecoverable error
- * @retval #LB_STATUS_SUCCESS Successfully sent
- */
-extern int livebox_set_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* End of a file */
diff --git a/include/livebox_product.h b/include/livebox_product.h
deleted file mode 100644 (file)
index 3df2eac..0000000
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
- * Copyright 2013  Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __LIVEBOX_HELPER_PRODUCT_H
-#define __LIVEBOX_HELPER_PRODUCT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file livebox_product.h
- * @brief This file declares API of liblivebox library for product
- */
-
-/**
- * @addtogroup CAPI_LIVEBOX_HELPER_PRODUCT_MODULE
- * @{
- */
-
-/**
- * @brief Structure for a livebox buffer defined by a provider.
- */
-struct livebox_buffer;
-
-extern const int DONE; /**<Return values of livebox programming interfaces: Operation is successfully done.*/
-
-extern const int OUTPUT_UPDATED; /**<Return values of livebox programming interfaces: Contents are updated.*/
-
-extern const int NEED_TO_SCHEDULE; /**<Return values of livebox programming interfaces: Need to call the livebox_need_to_update and livebox_update_content.*/
-
-extern const int FORCE_TO_SCHEDULE; /**<Return values of livebox programming interfaces: Need to do force update.*/
-
-extern const int NEED_TO_CREATE; /**<Return values of livebox programming interfaces: Need to create a new instance.*/
-
-extern const int NEED_TO_DESTROY; /**<Return values of livebox programming interfaces: Need to destroy this instance.*/
-
-extern const int NEED_TO_UPDATE; /**<Return values of livebox programming interfaces: Need to update.*/
-
-extern const int USE_NET; /**<Return values of livebox programming interfaces: Using network.*/
-
-extern const int LB_SYS_EVENT_FONT_CHANGED; /**<System event type: System font is changed.*/
-
-extern const int LB_SYS_EVENT_LANG_CHANGED; /**<System event type: System language is changed.*/
-
-extern const int LB_SYS_EVENT_TIME_CHANGED; /**<System event type: System time is changed.*/
-
-extern const int LB_SYS_EVENT_REGION_CHANGED; /**<System event type: Region changed. */
-
-extern const int LB_SYS_EVENT_TTS_CHANGED; /**< System event type: Accessibility changed. */
-
-extern const int LB_SYS_EVENT_PAUSED; /**<System event type: Livebox is paused.*/
-
-extern const int LB_SYS_EVENT_RESUMED; /**<System event type: Livebox is resumed.*/
-
-extern const int LB_SYS_EVENT_MMC_STATUS_CHANGED; /**<System event type: MMC Status change event.*/
-
-extern const int LB_SYS_EVENT_DELETED;/**<System event type: Livebox instance is removed from a viewer.*/
-
-/**
- * @brief Structure for extra event information for livebox_content_event interface function.
- */
-#if !defined(__SCRIPT_EVENT_INFO)
-#define __SCRIPT_EVENT_INFO
-/**
- * @brief
- * Text signal & Content event uses this data structure.
- */
-struct event_info {
-        struct pointer {
-                double x; /**< X value of current mouse(touch) position */
-                double y; /**< Y value of current mouse(touch) position */
-                int down; /**< Is it pressed(1) or not(0) */
-        } pointer;
-
-        struct part {
-                double sx; /**< Pressed object's left top X */
-                double sy; /**< Pressed object's left top Y */
-                double ex; /**< Pressed object's right bottom X */
-                double ey; /**< Pressed object's right bottom Y */
-        } part;
-};
-#endif
-
-/**
- * @brief Notifies the updated content to the provider.
- * @details Forcedly notifies the updated contents.
- *    This function can be used from async callback function to notify the updated content.
- * @param[in] id Instance Id which is passed to you via the first parameter of every livebox_XXXX interface functions
- * @param[in] is_pd 1 for updating content of PD or 0(for content of LB)
- * @privlevel N/P
- * @return int type
- * @retval #LB_STATUS_ERROR_MEMORY Not enough memory
- * @retval #LB_STATUS_ERROR_INVALID Invalid argument
- * @retval #LB_STATUS_ERROR_IO I/O failed, Cannot access given resource file(id)
- * @retval #LB_STATUS_SUCCESS Successfully notified
- * @pre This API only can be used after loaded into the data-provider-slave process.
- */
-extern int livebox_content_is_updated(const char *id, int is_pd);
-
-/**
- * @brief Replaces "\n" (new line character) with &lt;br&gt; tag.
- * @details This utility function is used to replace all NEW LINE CHARACTER ("\n") with &lt;br&gt; tag.
- * @param[in] str Source string
- * @privlevel N/P
- * @return char * type
- * @retval string Allocted in the heap
- * @retval @c NULL If it fails to replace string
- * @post Returned string must has to be free'd by user manually.
- */
-extern char *livebox_util_nl2br(const char *str);
-
-/*
- * Interfaces for direct buffer management (Available only for the PD area).
- */
-#ifndef __PROVIDER_BUFFER_H
-/**
- * @brief Enumeration for value should be sync'd with provider.
- */
-enum buffer_event {
-       BUFFER_EVENT_ENTER, /**< Mouse cursor enter */
-       BUFFER_EVENT_LEAVE, /**< Mouse cursor leave */
-       BUFFER_EVENT_DOWN, /**< Mouse down */
-       BUFFER_EVENT_MOVE, /**< Mouse move */
-       BUFFER_EVENT_UP, /**< Mouse up */
-
-       BUFFER_EVENT_KEY_DOWN, /**< Key down */
-       BUFFER_EVENT_KEY_UP, /**< Key up */
-       BUFFER_EVENT_KEY_FOCUS_IN, /**< Key focus in */
-       BUFFER_EVENT_KEY_FOCUS_OUT, /**< Key focus out */
-
-       BUFFER_EVENT_HIGHLIGHT, /**< Accessibility - Highlight */
-       BUFFER_EVENT_HIGHLIGHT_NEXT, /**< Accessibility - Move highlight to next */
-       BUFFER_EVENT_HIGHLIGHT_PREV, /**< Accessibility - Move highlight to prev */
-       BUFFER_EVENT_ACTIVATE, /**< Accessibility - Activate the highlighted object */
-       BUFFER_EVENT_ACTION_UP, /**< Accessibility - Make UP action */
-       BUFFER_EVENT_ACTION_DOWN, /**< Accessibility - Make Down action */
-       BUFFER_EVENT_SCROLL_UP, /**< Accessibility - Scroll up */
-       BUFFER_EVENT_SCROLL_MOVE, /**< Accessibility - Scroll move */
-       BUFFER_EVENT_SCROLL_DOWN, /**< Accessibility - Scroll down */
-       BUFFER_EVENT_UNHIGHLIGHT, /**< Accessibility - Remove highlight */
-
-       BUFFER_EVENT_ON_HOLD,   /**< To prevent from generating mouse clicked event */
-       BUFFER_EVENT_OFF_HOLD,  /**< Stopped holding. */
-       BUFFER_EVENT_ON_SCROLL, /**< On scrolling */
-       BUFFER_EVENT_OFF_SCROLL, /**< Scrolling stopped */
-
-       /* Accessibility event */
-       BUFFER_EVENT_VALUE_CHANGE,
-       BUFFER_EVENT_MOUSE,
-       BUFFER_EVENT_BACK,
-       BUFFER_EVENT_OVER,
-       BUFFER_EVENT_READ,
-       BUFFER_EVENT_ENABLE,
-       BUFFER_EVENT_DISABLE
-};
-
-struct buffer_event_data {
-       enum buffer_event type; /**< Mouse, Keyboard, Accessibility event type */
-       double timestamp; /**< Timestamp of events */
-
-       union input_data {
-               struct mouse {
-                       int x; /**< If the event type is for accessibility or mouse, coordinates of X for pointer */
-                       int y; /**< If the event type is for accessibility or mouse, coordinates of Y for pointer */
-               } pointer;
-
-               struct access {
-                       int x;
-                       int y;
-                       unsigned int mouse_type;
-                       unsigned int action_type;
-                       unsigned int action_by;
-                       int cycle;
-               } access;
-
-               unsigned int keycode; /**< If the event type is for keyboard, the value of keycode */
-       } info;
-};
-#endif
-
-/**
- * @brief Acquires a buffer for PD or LB, currently only the PD is supported.
- * @param[in] id Instance Id which is passed to you via the first parameter of every livebox_XXXX interface functions
- * @param[in] is_pd 1 for PD or 0 for livebox
- * @param[in] width Width in pixel
- * @param[in] height Height in pixel
- * @param[in] pixels Size of a pixel in bytes
- * @param[in] handler Event handling callback
- * @param[in] data User data for event handling callback
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return Buffer handle
- * @retval @c NULL Failed to acquire buffer
- * @retval handler Handle object
- * @pre Given instance must be specify its type as buffer. or this API will be fail.
- * @post Allocated buffer object must be released via livebox_release_buffer().
- * @see livebox_acquire_buffer()
- */
-extern struct livebox_buffer *livebox_acquire_buffer(const char *id, int is_pd, int width, int height, int pixels, int auto_align, int (*handler)(struct livebox_buffer *, struct buffer_event_data *, void *), void *data);
-
-/**
- * @brief Acquires the ID of pixmap resource.
- * @details Only if the provider uses pixmap for providing render buffer.
- * @remarks Pixmap Id can be destroyed if you call the livebox_release_buffer(). Then this pixmap Id is not guaranteed to use.
- * @param[in] handle Buffer handle
- * @privlevel N/P
- * @return unsigned log type
- * @retval positive Pixmap Id
- * @retval 0 Failed to get pixmap Id
- * @pre The system must be set to use the pixmap method for content sharing.
- * @see livebox_acquire_buffer()
- */
-extern unsigned long livebox_pixmap_id(struct livebox_buffer *handle);
-
-/**
- * @brief Releases the buffer of livebox.
- * @param[in] handle Buffer handle
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #LB_STATUS_ERROR_INVALID Invalid argument
- * @retval #LB_STATUS_SUCCESS Successfully released
- * @pre Handle must be created using livebox_acquire_buffer().
- * @see livebox_acquire_buffer()
- */
-extern int livebox_release_buffer(struct livebox_buffer *handle);
-
-/**
- * @brief Gets the address of S/W render buffer.
- * @details If you try to use this, after livebox_create_hw_buffer(), you will get @c NULL.
- * @param[in] handle Buffer handle
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return void* address of the render buffer
- * @retval @c NULL If it falis to get buffer address
- * @retval address If it succeed to get the buffer address
- * @see livebox_unref_buffer()
- */
-extern void *livebox_ref_buffer(struct livebox_buffer *handle);
-
-/**
- * @brief Releases the S/W render buffer.
- * @param[in] buffer Address of render buffer
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #LB_STATUS_ERROR_INVALID Invalid handle
- * @retval #LB_STATUS_SUCCESS Successfully unreference
- * @pre livebox_ref_buffer() must be called.
- * @see livebox_ref_buffer()
- */
-extern int livebox_unref_buffer(void *buffer);
-
-/**
- * @brief Synchronizes the updated buffer.
- * @details This is only needed for non-H/W accelerated buffer.
- * @param[in] handle Buffer handle
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #LB_STATUS_SUCCESS Successfully sync'd
- * @retval #LB_STATUS_ERROR_INVALID Invalid argument
- * @see livebox_acquire_buffer()
- */
-extern int livebox_sync_buffer(struct livebox_buffer *handle);
-
-/**
- * @brief Requests to schedule the update operation to a provider.
- * @param[in] id Instance Id which is passed to you via the first parameter of every livebox_XXXX interface functions
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return If succes returns 0 or return less than 0
- * @retval #LB_STATUS_SUCCESS Successfully triggered
- * @retval #LB_STATUS_ERROR_INVALID Invalid argument
- * @retval #LB_STATUS_ERROR_MEMORY Not enough memory
- * @retval #LB_STATUS_ERROR_NOT_EXIST Given id instance is not exist
- */
-extern int livebox_request_update(const char *id);
-
-/**
- * @brief Checks whether the livebox supports H/W acceleration or not.
- * @param[in] handle Buffer handle
- * @privlevel N/P
- * @return int type
- * @retval 1 If the buffer handle support the H/W acceleration buffer
- * @retval 0 If it doesn not supported
- * @see livebox_acquire_buffer()
- */
-extern int livebox_support_hw_buffer(struct livebox_buffer *handle);
-
-/**
- * @brief Creates the H/W accelerated buffer.
- * @param[in] handle Buffer handle
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #LB_STATUS_ERROR_ALREADY H/W buffer is already created
- * @retval #LB_STATUS_ERROR_INVALID Invalid argument
- * @retval #LB_STATUS_SUCCESS Successfully created
- * @pre Must be checked whether the H/W buffer is supported or not.
- * @post Must be destroyed if it is not necessary.
- * @see livebox_support_hw_buffer()
- */
-extern int livebox_create_hw_buffer(struct livebox_buffer *handle);
-
-/**
- * @brief Destroys the H/W accelerated buffer.
- * @param[in] handle Buffer handle
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #LB_STATUS_SUCCESS Successfully destroyed
- * @retval #LB_STATUS_ERROR_INVALID Invalid argument
- * @pre Must be created h/w buffer using livebox_create_hw_buffer.
- * @see livebox_create_hw_buffer()
- */
-extern int livebox_destroy_hw_buffer(struct livebox_buffer *handle);
-
-/**
- * @brief Gets the address of the accelerated H/W buffer.
- * @param[in] handle Buffer handle
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return void* type
- * @retval @c NULL Failed to get H/W accelerated buffer address
- * @retval addr H/W accelerated buffer address
- * @see livebox_create_hw_buffer()
- */
-extern void *livebox_buffer_hw_buffer(struct livebox_buffer *handle);
-
-/**
- * @brief Get the stride information from the buffer info
- * @param[in] handle Buffer handle
- * @privlevel N/P
- * @return int stride size
- * @retval positive_value length of stride
- * @return LB_STATUS_ERROR_INVALID Invalid parameter
- * @return LB_STATUS_ERROR_FAULT Unrecoverable error
- * @see livebox_create_hw_buffer()
- */
-extern int livebox_buffer_stride(struct livebox_buffer *handle);
-
-/**
- * @brief Pre-processes for rendering content.
- * @details This is only needed for accessing H/W accelerated buffer.
- * @param[in] handle Buffer handle
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #LB_STATUS_ERROR_INVALID Invalid handle
- * @retval #LB_STATUS_SUCCESS Successfully done
- * @post livebox_buffer_post_render must be called after the rendering (accessing buffer) is completed.
- * @see livebox_support_hw_buffer()
- * @see livebox_buffer_post_render()
- */
-extern int livebox_buffer_pre_render(struct livebox_buffer *handle);
-
-/**
- * @brief Post-processes for rendering content.
- * @param[in] handle Buffer handle
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return If succes returns 0 or return less than 0
- * @retval #LB_STATUS_SUCCESS If succeed
- * @retval #LB_STATUS_ERROR_INVALID Invalid argument
- * @pre livebox_buffer_pre_render must be called.
- * @see livebox_support_hw_buffer()
- * @see livebox_buffer_pre_render()
- */
-extern int livebox_buffer_post_render(struct livebox_buffer *handle);
-
-/**
- * @brief Sends a request to the viewer (homescreen) to close the PD.
- * @details Even though you call this function. the homescreen can ignore it.
- * @param[in] pkgname Livebox Package Id
- * @param[in] id Instance Id which is passed to you via the first parameter of every livebox_XXXX interface functions
- * @param[in] reason LB_STATUS_SUCCESS(0)
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #LB_STATUS_ERROR_INVALID Invalid parameters
- * @retval #LB_STATUS_ERROR_MEMORY Out of memory
- * @retval #LB_STATUS_ERROR_FAULT Failed to send a request
- * @retval #LB_STATUS_SUCCESS Successfully requested
- */
-extern int livebox_request_close_pd(const char *pkgname, const char *id, int reason);
-
-/**
- * @brief Send a freeze request to the viewer (homescreen)
- * @details
- *        The viewer will get this request via event callback.
- *        Then it should freeze its scroller or stop moving the livebox.
- * @remarks If the viewer doesn't care this request, this will has no effect.
- * @param[in] pkgname Livebox Package Id
- * @param[in] id Instance Id which is passed to you via the first parameter of every livebox_XXXX interface functions
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #LB_STATUS_ERROR_INVALID Invalid parameters
- * @retval #LB_STATUS_ERROR_MEMORY Out of memory
- * @retval #LB_STATUS_ERROR_FAULT Failed to send requet
- * @retval #LB_STATUS_SUCCESS Successfully requested
- * @see livebox_release_scroller()
- */
-extern int livebox_freeze_scroller(const char *pkgname, const char *id);
-
-/**
- * @brief Send a release request to the viewer (homescreen)
- * @details
- *        The viewer will get this request via event callback.
- *        Then it should release its scroller or continue moving the livebox.
- * @remarks If the viewer doesn't care this request, this will has no effect.
- * @param[in] pkgname Livebox Package Id
- * @param[in] id Instance Id which is passed to you via the first parameter of every livebox_XXXX interface functions
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #LB_STATUS_ERROR_INVALID Invalid parameters
- * @retval #LB_STATUS_ERROR_MEMORY Out of memory
- * @retval #LB_STATUS_ERROR_FAULT Failed to send requet
- * @retval #LB_STATUS_SUCCESS Successfully requested
- * @see livebox_freeze_scroller()
- */
-extern int livebox_release_scroller(const char *pkgname, const char *id);
-
-/**
- * @brief Get the configuration value for premultiplied alpha.
- * @details
- *     If the system uses the premultiplied alpha for content,
- *     This function will returns 1.
- * @remarks This function only works with the inhouse provider.
- * @privlevel N/P
- * @return status of premultiplied alpha.
- * @retval 1 Content rendered with premultiplied alpha.
- * @retval 0 Content doesn't rendered with premultiplied alpha.
- */
-extern int livebox_conf_premultiplied_alpha(void);
-
-/**
- * @brief Get the configuration value for AUTO Alignment of canvas buffer.
- * @details
- *      If the UIFW does not support the STRIDE information for rendering frame,
- *      This function will returns 1, then the livebox will automatically aligning the buffer.
- * @privlevel N/P
- * @return status of auto alignment.
- * @retval 1 Content will be automatically aligned by livebox.
- * @retval 0 Content will be aligned by UIFW, using stride information.
- */
-extern int livebox_conf_auto_align(void);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* End of a file */
diff --git a/livebox.pc.in b/livebox.pc.in
deleted file mode 100644 (file)
index 60193d3..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
-
-Name: livebox
-Description: livebox supporting library
-Version: @VERSION@
-Libs: -L${libdir} -llivebox
-Cflags: -I${includedir}
-cppflags: -I${includedir}
similarity index 75%
rename from packaging/liblivebox.spec
rename to packaging/libdynamicbox.spec
index 084bc53..61acda0 100644 (file)
@@ -1,17 +1,17 @@
 %bcond_with wayland
 
-Name: liblivebox
-Summary: Livebox development library
-Version: 0.9.7
+Name: libdynamicbox
+Summary: Dynamicbox development library
+Version: 1.0.0
 Release: 1
-Group: HomeTF/Livebox
+Group: HomeTF/DynamicBox
 License: Flora
 Source0: %{name}-%{version}.tar.gz
 Source1001: %{name}.manifest
 BuildRequires: cmake, gettext-tools, coreutils
 BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(livebox-service)
-BuildRequires: pkgconfig(provider)
+BuildRequires: pkgconfig(dynamicbox_service)
+BuildRequires: pkgconfig(dynamicbox_provider)
 BuildRequires: pkgconfig(ecore)
 BuildRequires: pkgconfig(evas)
 BuildRequires: pkgconfig(elementary)
@@ -26,15 +26,15 @@ ExclusiveArch:
 %endif
 
 %description
-Library for the development of a livebox 
+Library for the development of a dynamicbox 
 
 %package devel
-Summary: Livebox development library (dev)
+Summary: Dynamic Box development library (dev)
 Group: Development/Libraries
 Requires: %{name} = %{version}-%{release}
 
 %description devel
-Header & Package configuration files for livebox development
+Header & Package configuration files for dynamicbox development
 
 %prep
 %setup -q
@@ -69,20 +69,19 @@ rm -rf %{buildroot}
 %make_install
 mkdir -p %{buildroot}/%{_datarootdir}/license
 
-%post -n liblivebox -p /sbin/ldconfig
-%postun -n liblivebox -p /sbin/ldconfig
+%post -n %{name} -p /sbin/ldconfig
+%postun -n %{name} -p /sbin/ldconfig
 
-%files -n liblivebox
-%manifest %{name}.manifest
+%files -n %{name}
 %defattr(-,root,root,-)
+%manifest %{name}.manifest
 %{_libdir}/*.so*
 %{_datarootdir}/license/*
 
 %files devel
-%manifest %{name}.manifest
 %defattr(-,root,root,-)
-%{_includedir}/livebox/livebox.h
-%{_includedir}/livebox/livebox_product.h
+%manifest %{name}.manifest
+%{_includedir}/dynamicbox/dynamicbox.h
 %{_libdir}/pkgconfig/*.pc
 
 # End of a file
index 5d01178..c0390ed 100644 (file)
 #include <dlfcn.h>
 
 #include <dlog.h>
-#include <provider.h>
-#include <provider_buffer.h>
-
-/*
-#include <dynamicbox_service.h>
 #include <dynamicbox_errno.h>
-*/
-
-#include <livebox-service.h>
+#include <dynamicbox_service.h>
+#include <dynamicbox_provider.h>
+#include <dynamicbox_provider_buffer.h>
+#include <Evas.h>
 
 #include "debug.h"
 #include "dlist.h"
 #include "util.h"
-#include "livebox_product.h"
-#include "livebox.h"
 #include "dynamicbox.h"
 
 #define PUBLIC __attribute__((visibility("default")))
 
 #define FILE_SCHEMA    "file://"
 
-/* Must has to sync'd with data-provider-slave */
-struct conf {
-       int width;
-       int height;
-
-       int base_width;
-       int base_height;
-       double minimum_period;
-
-       struct {
-               char *script;
-               char *abi;
-               char *pd_group;
-               double period;
-               int pixels;
-       } default_conf;
-
-       struct {
-               char *name;
-               char *secured;
-               char *abi;
-       } launch_key;
-
-       double default_packet_time;
-
-       char *empty_content;
-       char *empty_title;
-
-       char *default_content;
-       char *default_title;
-
-       unsigned long minimum_space;
-
-       char *replace_tag;
-
-       double slave_ttl;
-       double slave_activate_time;
-       double slave_relaunch_time;
-       int slave_relaunch_count;
-
-       int max_log_line;
-       int max_log_file;
-
-       unsigned long sqlite_flush_max;
-
-       struct {
-               char *conf;
-               char *image;
-               char *script;
-               char *root;
-               char *script_port;
-               char *slave_log;
-               char *reader;
-               char *always;
-               char *db;
-               char *input;
-       } path;
-
-       int max_size_type;
-
-       int slave_max_load;
-
-       double ping_time;
-
-       char *vconf_sys_cluster;
-       int max_pended_ctx_events;
-
-       int use_sw_backend;
-       char *provider_method;
-       int debug_mode;
-       int overwrite_content;
-       int com_core_thread;
-       int use_xmonitor;
-       int premultiplied;
-
-       double scale_width_factor;
-       double scale_height_factor;
-
-       double pd_request_timeout;
-
-       char *emergency_disk;
-       char *services;
-       int auto_align;
-       int use_event_time;
-};
-
 struct block {
        unsigned int idx;
 
@@ -153,11 +61,11 @@ struct dynamicbox_desc {
 };
 
 struct dynamicbox_buffer_data {
-       int is_pd;
+       int is_gbar;
        int accelerated;
 
        /* for Buffer event wrapper */
-       int (*handler)(struct dynamicbox_buffer *, struct dbox_buffer_event_data *, void *);
+       int (*handler)(dynamicbox_buffer_h , dynamicbox_buffer_event_data_t, void *);
        void *cbdata;
 
        char *content;
@@ -166,6 +74,201 @@ struct dynamicbox_buffer_data {
        char *name;
 };
 
+/**
+ * @brief These functions are defined in the data-provider-slave
+ */
+static struct info {
+       const char *(*find_pkgname)(const char *filename);
+       int (*request_update_by_id)(const char *uri);
+       int (*trigger_update_monitor)(const char *id, int is_gbar);
+       int (*update_extra_info)(const char *id, const char *content, const char *title, const char *icon, const char *name);
+
+       int is_slave;
+       union _updated {
+               struct _slave {
+                       int (*dbox)(const char *pkgname, const char *id, int x, int y, int w, int h);
+                       int (*gbar)(const char *pkgname, const char *id, const char *descfile, int x, int y, int w, int h);
+               } slave;
+
+               struct _app {
+                       int (*dbox)(const char *id, int x, int y, int w, int h);
+                       int (*gbar)(const char *id, int x, int y, int w, int h);
+               } app;
+       } updated;
+} s_info = {
+       .find_pkgname = NULL,
+       .request_update_by_id = NULL,
+       .trigger_update_monitor = NULL,
+       .update_extra_info = NULL,
+       .is_slave = -1, /* Not initialized */
+};
+
+static int send_dbox_updated(const char *pkgname, const char *id, int x, int y, int w, int h)
+{
+       int ret = DBOX_STATUS_ERROR_INVALID_PARAMETER;
+
+       if (s_info.is_slave < 0) {
+               /* Must to be checked the slave function first. */
+               s_info.updated.slave.dbox = dlsym(RTLD_DEFAULT, "dynamicbox_send_updated");
+               s_info.updated.slave.gbar = dlsym(RTLD_DEFAULT, "dynamicbox_send_desc_updated");
+               if (s_info.updated.slave.dbox && s_info.updated.slave.gbar) {
+                       s_info.is_slave = 1;
+                       DbgPrint("Slave detected\n");
+               } else {
+                       s_info.updated.app.dbox = dlsym(RTLD_DEFAULT, "dynamicbox_provider_app_dbox_updated");
+                       s_info.updated.app.gbar = dlsym(RTLD_DEFAULT, "dynamicbox_provider_app_gbar_updated");
+                       if (s_info.updated.app.dbox && s_info.updated.app.gbar) {
+                               s_info.is_slave = 0;
+                               DbgPrint("App detected\n");
+                       }
+               }
+       }
+
+       if (s_info.is_slave == 0) {
+               ret = s_info.updated.app.dbox(id, x, y, w, h);
+       } else if (s_info.is_slave == 1) {
+               ret = s_info.updated.slave.dbox(pkgname, id, x, y, w, h);
+       } else {
+               dynamicbox_damage_region_t region = {
+                       .x = x,
+                       .y = y,
+                       .w = w,
+                       .h = h,
+               };
+               ret = dynamicbox_provider_send_updated(pkgname, id, &region);
+       }
+
+       return ret;
+}
+
+static int send_gbar_updated(const char *pkgname, const char *id, const char *descfile, int x, int y, int w, int h)
+{
+       int ret = DBOX_STATUS_ERROR_INVALID_PARAMETER;
+
+       if (s_info.is_slave < 0) {
+               /* Must to be checked the slave function first. */
+               s_info.updated.slave.dbox = dlsym(RTLD_DEFAULT, "dynamicbox_send_updated");
+               s_info.updated.slave.gbar = dlsym(RTLD_DEFAULT, "dynamicbox_send_desc_updated");
+               if (s_info.updated.slave.dbox && s_info.updated.slave.gbar) {
+                       s_info.is_slave = 1;
+                       DbgPrint("Slave detected\n");
+               } else {
+                       s_info.updated.app.dbox = dlsym(RTLD_DEFAULT, "dynamicbox_provider_app_dbox_updated");
+                       s_info.updated.app.gbar = dlsym(RTLD_DEFAULT, "dynamicbox_provider_app_gbar_updated");
+                       if (s_info.updated.app.dbox && s_info.updated.app.gbar) {
+                               s_info.is_slave = 0;
+                               DbgPrint("App detected\n");
+                       }
+               }
+       }
+
+       if (s_info.is_slave == 0) {
+               ret = s_info.updated.app.gbar(id, x, y, w, h);
+       } else if (s_info.is_slave == 1) {
+               ret = s_info.updated.slave.gbar(pkgname, id, descfile, x, y, w, h);
+       } else {
+               dynamicbox_damage_region_t region = {
+                       .x = x,
+                       .y = y,
+                       .w = w,
+                       .h = h,
+               };
+               ret = dynamicbox_provider_send_desc_updated(pkgname, id, descfile, &region);
+       }
+
+       return ret;
+}
+
+static char *id_to_uri(const char *id)
+{
+       char *uri;
+       int uri_len;
+
+       uri_len = strlen(id) + strlen(FILE_SCHEMA) + 1;
+
+       uri = malloc(uri_len);
+       if (!uri) {
+               return NULL;
+       }
+
+       snprintf(uri, uri_len, FILE_SCHEMA "%s", id);
+       return uri;
+}
+
+static inline int event_handler_wrapper(dynamicbox_buffer_h buffer, dynamicbox_buffer_event_data_t event_info, void *data)
+{
+       const char *pkgname;
+       const char *id;
+       struct dynamicbox_buffer_data *cbdata = data;
+       int ret;
+
+       pkgname = dynamicbox_provider_buffer_pkgname(buffer);
+       if (!pkgname) {
+               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;
+       }
+
+       if (cbdata->handler) {
+               ret = cbdata->handler(buffer, event_info, cbdata->cbdata);
+       } else {
+               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;
+       }
+
+       return ret;
+}
+
+static inline int default_event_handler(dynamicbox_buffer_h buffer, dynamicbox_buffer_event_data_t event_info, void *data)
+{
+       /* NOP */
+       return 0;
+}
+
 PUBLIC const int DBOX_DONE = 0x00;
 PUBLIC const int DBOX_OUTPUT_UPDATED = 0x02;
 PUBLIC const int DBOX_USE_NET = 0x04;
@@ -187,32 +290,235 @@ PUBLIC const int DBOX_SYS_EVENT_DELETED = 0x0800;
 
 PUBLIC struct dynamicbox_desc *dynamicbox_desc_open(const char *filename, int for_pd)
 {
-       return (struct dynamicbox_desc *)livebox_desc_open(filename, for_pd);
+       struct dynamicbox_desc *handle;
+       char *new_fname;
+
+       handle = calloc(1, sizeof(*handle));
+       if (!handle) {
+               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);
+       } else {
+               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");
+
+       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;
+       }
+
+       return handle;
 }
 
 PUBLIC int dynamicbox_desc_close(struct dynamicbox_desc *handle)
 {
-       return livebox_desc_close((struct livebox_desc *)handle);
+       struct dlist *l;
+       struct dlist *n;
+       struct block *block;
+
+       if (!handle) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       dlist_foreach_safe(handle->block_list, l, n, block) {
+               handle->block_list = dlist_remove(handle->block_list, l);
+
+               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->data) {
+                       fprintf(handle->fp, "data=%s\n", block->data);
+               }
+
+               if (block->option) {
+                       fprintf(handle->fp, "option=%s\n", block->option);
+               }
+
+               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");
+
+               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));
+       }
+       free(handle);
+       return DBOX_STATUS_ERROR_NONE;
 }
 
 PUBLIC int dynamicbox_desc_set_category(struct dynamicbox_desc *handle, const char *id, const char *category)
 {
-       return livebox_desc_set_category((struct livebox_desc *)handle, id, category);
+       struct block *block;
+
+       if (!handle || !category) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       block = calloc(1, sizeof(*block));
+       if (!block) {
+               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;
+       }
+
+       block->part = strdup("category");
+       if (!block->part) {
+               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;
+       }
+
+       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->idx = handle->last_idx++;
+       handle->block_list = dlist_append(handle->block_list, block);
+       return block->idx;
 }
 
 PUBLIC int dynamicbox_desc_set_size(struct dynamicbox_desc *handle, const char *id, int w, int h)
 {
-       return livebox_desc_set_size((struct livebox_desc *)handle, id, w, h);
-}
-
-PUBLIC char *dynamicbox_util_nl2br(const char *str)
-{
-       return livebox_util_nl2br(str);
+       struct block *block;
+       char buffer[BUFSIZ];
+
+       if (!handle) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       block = calloc(1, sizeof(*block));
+       if (!block) {
+               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;
+       }
+
+       block->part = strdup("size");
+       if (!block->part) {
+               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;
+               }
+       }
+
+       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;
+       }
+
+       block->idx = handle->last_idx++;
+       handle->block_list = dlist_append(handle->block_list, block);
+       return block->idx;
 }
 
 PUBLIC int dynamicbox_desc_set_id(struct dynamicbox_desc *handle, int idx, const char *id)
 {
-       return livebox_desc_set_id((struct livebox_desc *)handle, idx, id);
+       struct dlist *l;
+       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;
+                       }
+
+                       free(block->target_id);
+                       block->target_id = NULL;
+
+                       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;
+                       }
+
+                       return DBOX_STATUS_ERROR_NONE;
+               }
+       }
+
+       return DBOX_STATUS_ERROR_NOT_EXIST;
 }
 
 /*!
@@ -220,118 +526,690 @@ PUBLIC int dynamicbox_desc_set_id(struct dynamicbox_desc *handle, int idx, const
  */
 PUBLIC int dynamicbox_desc_add_block(struct dynamicbox_desc *handle, const char *id, const char *type, const char *part, const char *data, const char *option)
 {
-       return livebox_desc_add_block((struct livebox_desc *)handle, id, type, part, data, option);
+       struct block *block;
+
+       if (!handle || !type) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!part) {
+               part = "";
+       }
+
+       if (!data) {
+               data = "";
+       }
+
+       block = calloc(1, sizeof(*block));
+       if (!block) {
+               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;
+       }
+
+       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;
+       }
+
+       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;
+       }
+
+       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;
+               }
+       }
+
+       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->idx = handle->last_idx++;
+       handle->block_list = dlist_append(handle->block_list, block);
+       return block->idx;
 }
 
 PUBLIC int dynamicbox_desc_del_block(struct dynamicbox_desc *handle, int idx)
 {
-       return livebox_desc_del_block((struct livebox_desc *)handle, idx);
+       struct dlist *l;
+       struct block *block;
+
+       if (!handle || idx < 0) {
+               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;
+               }
+       }
+
+       return DBOX_STATUS_ERROR_NOT_EXIST;
 }
 
-PUBLIC struct dynamicbox_buffer *dynamicbox_acquire_buffer(const char *filename, int is_pd, int width, int height, int pixels, int auto_align, int (*handler)(struct dynamicbox_buffer *, struct dbox_buffer_event_data *, void *), void *data)
+PUBLIC dynamicbox_buffer_h dynamicbox_acquire_buffer(const char *filename, int is_gbar, int width, int height, int pixels, int auto_align, int (*handler)(dynamicbox_buffer_h , dynamicbox_buffer_event_data_t, void *), void *data)
 {
-       typedef int (*handler_t)(struct livebox_buffer *, struct buffer_event_data *, void *);
-       return (struct dynamicbox_buffer *)livebox_acquire_buffer(filename, is_pd, width, height, pixels, auto_align, (handler_t)handler, data);
+       struct dynamicbox_buffer_data *user_data;
+       const char *pkgname;
+       dynamicbox_buffer_h handle;
+       char *uri;
+
+       if (!filename || !width || !height) {
+               ErrPrint("Invalid argument: %p(%dx%d)\n", filename, width, height);
+               return NULL;
+       }
+
+       user_data = calloc(1, sizeof(*user_data));
+       if (!user_data) {
+               ErrPrint("Heap: %s\n", strerror(errno));
+               return NULL;
+       }
+
+       user_data->is_gbar = is_gbar;
+       user_data->handler = handler ? handler : default_event_handler;
+       user_data->cbdata = data;
+
+       uri = id_to_uri(filename);
+       if (!uri) {
+               ErrPrint("Heap: %s\n", strerror(errno));
+               free(user_data);
+               return NULL;
+       }
+
+       if (!s_info.find_pkgname) {
+               s_info.find_pkgname = dlsym(RTLD_DEFAULT, "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;
+       }
+
+       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;
+       }
+
+       if (dynamicbox_provider_buffer_acquire(handle, width, height, pixels) < 0) {
+               dynamicbox_provider_buffer_destroy(handle);
+               free(user_data);
+               return NULL;
+       }
+
+       (void)dynamicbox_provider_buffer_set_user_data(handle, user_data);
+       return handle;
 }
 
 PUBLIC int dynamicbox_request_update(const char *filename)
 {
-       return livebox_request_update(filename);
+       char *uri;
+       int ret;
+
+       if (!filename) {
+               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;
+       }
+
+       if (!s_info.request_update_by_id) {
+               s_info.request_update_by_id = dlsym(RTLD_DEFAULT, "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);
+       free(uri);
+       return ret;
 }
 
-PUBLIC int dynamicbox_conf_auto_align(void)
+PUBLIC unsigned int dynamicbox_resource_id(dynamicbox_buffer_h handle)
 {
-       return livebox_conf_auto_align();
+       return dynamicbox_provider_buffer_resource_id(handle);
 }
 
-PUBLIC int dynamicbox_conf_premultiplied_alpha(void)
+PUBLIC int dynamicbox_release_buffer(dynamicbox_buffer_h handle)
 {
-       return livebox_conf_premultiplied_alpha();
+       struct dynamicbox_buffer_data *user_data;
+
+       if (!handle) {
+               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);
+       }
+
+       (void)dynamicbox_provider_buffer_release(handle);
+       (void)dynamicbox_provider_buffer_destroy(handle);
+
+       DbgPrint("Release buffer\n");
+       return 0;
 }
 
-PUBLIC unsigned int dynamicbox_resource_id(struct dynamicbox_buffer *handle)
+PUBLIC void *dynamicbox_ref_buffer(dynamicbox_buffer_h handle)
 {
-       return (unsigned int)livebox_pixmap_id((struct livebox_buffer *)handle);
+       struct dynamicbox_buffer_data *user_data;
+       void *data;
+       int w, h, size;
+       int ret;
+
+       if (!handle) {
+               return NULL;
+       }
+
+       user_data = dynamicbox_provider_buffer_user_data(handle);
+       if (!user_data) {
+               return NULL;
+       }
+
+       if (user_data->accelerated) {
+               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);
+       }
+
+       DbgPrint("Ref buffer %ds%d(%d)\n", w, h, size);
+       return data;
 }
 
-PUBLIC int dynamicbox_release_buffer(struct dynamicbox_buffer *handle)
+PUBLIC int dynamicbox_unref_buffer(void *buffer)
 {
-       return livebox_release_buffer((struct livebox_buffer *)handle);
-}
+       if (!buffer) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
 
-PUBLIC void *dynamicbox_ref_buffer(struct dynamicbox_buffer *handle)
-{
-       return livebox_ref_buffer((struct livebox_buffer *)handle);
+       DbgPrint("Unref buffer\n");
+       return dynamicbox_provider_buffer_unref(buffer);
 }
 
-PUBLIC int dynamicbox_unref_buffer(void *buffer)
+PUBLIC int dynamicbox_sync_buffer(dynamicbox_buffer_h handle)
 {
-       return livebox_unref_buffer(buffer);
+       struct dynamicbox_buffer_data *user_data;
+       const char *pkgname;
+       const char *id;
+       int w;
+       int h;
+       int pixel_size;
+
+       if (!handle) {
+               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;
+       }
+
+       if (user_data->accelerated) {
+               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;
+       }
+
+       id = dynamicbox_provider_buffer_id(handle);
+       if (!id) {
+               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);
+       }
+
+       /**
+        * @todo
+        * manipulate the damaged region, so send update event only for the damaged region.
+        * to make more efficient updates
+        */
+
+       if (user_data->is_gbar == 1) {
+               if (send_gbar_updated(pkgname, id, NULL, 0, 0, w, h) < 0) {
+                       ErrPrint("Failed to send PD updated (%s)\n", id);
+               }
+       } else {
+               if (send_dbox_updated(pkgname, id, 0, 0, w, h) < 0) {
+                       ErrPrint("Failed to send updated (%s)\n", id);
+               }
+       }
+
+       return DBOX_STATUS_ERROR_NONE;
 }
 
-PUBLIC int dynamicbox_sync_buffer(struct dynamicbox_buffer *handle)
+PUBLIC int dynamicbox_support_hw_buffer(dynamicbox_buffer_h handle)
 {
-       return livebox_sync_buffer((struct livebox_buffer *)handle);
-}
+       if (!handle) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
 
-PUBLIC int dynamicbox_support_hw_buffer(struct dynamicbox_buffer *handle)
-{
-       return livebox_support_hw_buffer((struct livebox_buffer *)handle);
+       return dynamicbox_provider_buffer_is_support_hw(handle);
 }
 
-PUBLIC int dynamicbox_create_hw_buffer(struct dynamicbox_buffer *handle)
+PUBLIC int dynamicbox_create_hw_buffer(dynamicbox_buffer_h handle)
 {
-       return livebox_create_hw_buffer((struct livebox_buffer *)handle);
+       struct dynamicbox_buffer_data *user_data;
+       int ret;
+
+       if (!handle) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       user_data = dynamicbox_provider_buffer_user_data(handle);
+       if (!user_data) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       if (user_data->accelerated) {
+               return DBOX_STATUS_ERROR_ALREADY;
+       }
+
+       ret = dynamicbox_provider_buffer_create_hw(handle);
+       user_data->accelerated = (ret == 0);
+       return ret;
 }
 
-PUBLIC int dynamicbox_destroy_hw_buffer(struct dynamicbox_buffer *handle)
+PUBLIC int dynamicbox_destroy_hw_buffer(dynamicbox_buffer_h handle)
 {
-       return livebox_destroy_hw_buffer((struct livebox_buffer *)handle);
+       struct dynamicbox_buffer_data *user_data;
+
+       if (!handle) {
+               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;
+       }
+
+       user_data->accelerated = 0;
+
+       return dynamicbox_provider_buffer_destroy_hw(handle);
 }
 
-PUBLIC void *dynamicbox_buffer_hw_buffer(struct dynamicbox_buffer *handle)
+PUBLIC void *dynamicbox_buffer_hw_buffer(dynamicbox_buffer_h handle)
 {
-       return livebox_buffer_hw_buffer((struct livebox_buffer *)handle);
+       struct dynamicbox_buffer_data *user_data;
+
+       if (!handle) {
+               return NULL;
+       }
+
+       user_data = dynamicbox_provider_buffer_user_data(handle);
+       if (!user_data || !user_data->accelerated) {
+               return NULL;
+       }
+
+       return dynamicbox_provider_buffer_hw_addr(handle);
 }
 
-PUBLIC int dynamicbox_buffer_pre_render(struct dynamicbox_buffer *handle)
+PUBLIC int dynamicbox_buffer_pre_render(dynamicbox_buffer_h handle)
 {
-       return livebox_buffer_pre_render((struct livebox_buffer *)handle);
+       struct dynamicbox_buffer_data *user_data;
+
+       if (!handle) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       user_data = dynamicbox_provider_buffer_user_data(handle);
+       if (!user_data) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!user_data->accelerated) {
+               return DBOX_STATUS_ERROR_NONE;
+       }
+
+       /*!
+        * \note
+        * Do preprocessing for accessing the H/W render buffer
+        */
+       return dynamicbox_provider_buffer_pre_render(handle);
 }
 
-PUBLIC int dynamicbox_buffer_post_render(struct dynamicbox_buffer *handle)
+PUBLIC int dynamicbox_buffer_post_render(dynamicbox_buffer_h handle)
 {
-       return livebox_buffer_post_render((struct livebox_buffer *)handle);
+       int ret;
+       const char *pkgname;
+       const char *id;
+       struct dynamicbox_buffer_data *user_data;
+       int w;
+       int h;
+       int pixel_size;
+
+       if (!handle) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       user_data = dynamicbox_provider_buffer_user_data(handle);
+       if (!user_data) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       if (!user_data->accelerated) {
+               return DBOX_STATUS_ERROR_NONE;
+       }
+
+       pkgname = dynamicbox_provider_buffer_pkgname(handle);
+       if (!pkgname) {
+               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;
+       }
+
+       ret = dynamicbox_provider_buffer_post_render(handle);
+       if (ret < 0) {
+               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);
+       }
+
+       /**
+        * @todo
+        * manipulate the damaged region, so send update event only for the damaged region.
+        * to make more efficient updates
+        */
+
+       if (user_data->is_gbar == 1) {
+               if (send_gbar_updated(pkgname, id, NULL, 0, 0, w, h) < 0) {
+                       ErrPrint("Failed to send PD updated (%s)\n", id);
+               }
+       } else {
+               if (send_dbox_updated(pkgname, id, 0, 0, w, h) < 0) {
+                       ErrPrint("Failed to send updated (%s)\n", id);
+               }
+       }
+
+       return DBOX_STATUS_ERROR_NONE;
 }
 
-PUBLIC int dynamicbox_buffer_stride(struct dynamicbox_buffer *handle)
+PUBLIC int dynamicbox_buffer_stride(dynamicbox_buffer_h handle)
 {
-       return livebox_buffer_stride((struct livebox_buffer *)handle);
+       if (!handle) {
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
+       }
+
+       return dynamicbox_provider_buffer_stride(handle);
 }
 
-PUBLIC int dynamicbox_content_is_updated(const char *filename, int is_pd)
+PUBLIC int dynamicbox_content_is_updated(const char *filename, int is_gbar)
 {
-       return livebox_content_is_updated(filename, is_pd);
+       if (!s_info.trigger_update_monitor) {
+               s_info.trigger_update_monitor = dlsym(RTLD_DEFAULT, "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);
 }
 
-PUBLIC int dynamicbox_request_close_pd(const char *pkgname, const char *id, int reason)
+PUBLIC int dynamicbox_request_close_gbar(const char *pkgname, const char *id, int reason)
 {
-       return livebox_request_close_pd(pkgname, id, reason);
+       char *uri;
+       int schema_len = strlen(FILE_SCHEMA);
+       int ret;
+
+       if (!pkgname || !id) {
+               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;
+               }
+       } else {
+               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);
+       free(uri);
+       return ret;
 }
 
 PUBLIC int dynamicbox_freeze_scroller(const char *pkgname, const char *id)
 {
-       return livebox_freeze_scroller(pkgname, id);
+       char *uri;
+       int ret;
+
+       uri = id_to_uri(id);
+       if (!uri) {
+               ErrPrint("Heap: %s\n", strerror(errno));
+               return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       }
+
+       ret = dynamicbox_provider_send_hold_scroll(pkgname, uri, 1);
+       free(uri);
+       return ret;
 }
 
 PUBLIC int dynamicbox_thaw_scroller(const char *pkgname, const char *id)
 {
-       return livebox_release_scroller(pkgname, id);
+       char *uri;
+       int ret;
+
+       uri = id_to_uri(id);
+       if (!uri) {
+               ErrPrint("Heap: %s\n", strerror(errno));
+               return DBOX_STATUS_ERROR_OUT_OF_MEMORY;
+       }
+
+       ret = dynamicbox_provider_send_hold_scroll(pkgname, uri, 0);
+       free(uri);
+       return ret;
 }
 
 PUBLIC int dynamicbox_set_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name)
 {
-       return livebox_set_extra_info(id, content, title, icon, name);
+       dynamicbox_buffer_h handle;
+       const char *pkgname;
+       char *uri;
+
+       uri = id_to_uri(id);
+       if (!uri) {
+               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, "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;
+       }
+
+       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;
+       }
+       free(uri);
+
+       if (!s_info.update_extra_info) {
+               s_info.update_extra_info = dlsym(RTLD_DEFAULT, "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);
 }
 
 /* End of a file */
diff --git a/src/livebox.c b/src/livebox.c
deleted file mode 100644 (file)
index f89b2ea..0000000
+++ /dev/null
@@ -1,1384 +0,0 @@
-/*
- * Copyright 2013  Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h> /* malloc */
-#include <string.h> /* strdup */
-#include <libgen.h>
-#include <unistd.h> /* access */
-#define __USE_GNU
-#include <dlfcn.h>
-
-#include <dlog.h>
-#include <livebox-service.h>
-#include <provider.h>
-#include <provider_buffer.h>
-#include <livebox-errno.h>
-
-#include "debug.h"
-#include "livebox.h"
-#include "dlist.h"
-#include "util.h"
-
-#define PUBLIC __attribute__((visibility("default")))
-
-#define FILE_SCHEMA    "file://"
-
-/* Must has to sync'd with data-provider-slave */
-struct conf {
-       int width;
-       int height;
-
-       int base_width;
-       int base_height;
-       double minimum_period;
-
-       struct {
-               char *script;
-               char *abi;
-               char *pd_group;
-               double period;
-               int pixels;
-       } default_conf;
-
-       struct {
-               char *name;
-               char *secured;
-               char *abi;
-       } launch_key;
-
-       double default_packet_time;
-
-       char *empty_content;
-       char *empty_title;
-
-       char *default_content;
-       char *default_title;
-
-       unsigned long minimum_space;
-
-       char *replace_tag;
-
-       double slave_ttl;
-       double slave_activate_time;
-       double slave_relaunch_time;
-       int slave_relaunch_count;
-
-       int max_log_line;
-       int max_log_file;
-
-       unsigned long sqlite_flush_max;
-
-       struct {
-               char *conf;
-               char *image;
-               char *script;
-               char *root;
-               char *script_port;
-               char *slave_log;
-               char *reader;
-               char *always;
-               char *db;
-               char *input;
-       } path;
-
-       int max_size_type;
-
-       int slave_max_load;
-
-       double ping_time;
-
-       char *vconf_sys_cluster;
-       int max_pended_ctx_events;
-
-       int use_sw_backend;
-       char *provider_method;
-       int debug_mode;
-       int overwrite_content;
-       int com_core_thread;
-       int use_xmonitor;
-       int premultiplied;
-
-       double scale_width_factor;
-       double scale_height_factor;
-
-       double pd_request_timeout;
-
-       char *emergency_disk;
-       char *services;
-       int auto_align;
-       int use_event_time;
-       int check_lcd;
-};
-
-/*!
- * \brief This function is defined by the data-provider-slave
- */
-static struct info {
-       const char *(*find_pkgname)(const char *filename);
-       int (*request_update_by_id)(const char *uri);
-       int (*trigger_update_monitor)(const char *id, int is_pd);
-       int (*update_extra_info)(const char *id, const char *content, const char *title, const char *icon, const char *name);
-
-       int is_slave;
-       union _updated {
-               struct _slave {
-                       int (*lb)(const char *pkgname, const char *id, int w, int h);
-                       int (*pd)(const char *pkgname, const char *id, const char *descfile);
-               } slave;
-
-               struct _app {
-                       int (*lb)(const char *id, int w, int h);
-                       int (*pd)(const char *id);
-               } app;
-       } updated;
-
-       struct conf *conf;
-} s_info = {
-       .find_pkgname = NULL,
-       .request_update_by_id = NULL,
-       .trigger_update_monitor = NULL,
-       .update_extra_info = NULL,
-       .is_slave = -1, /* Not initialized */
-       .conf = NULL,
-};
-
-struct block {
-       unsigned int idx;
-
-       char *type;
-       char *part;
-       char *data;
-       char *option;
-       char *id;
-       char *file;
-       char *target_id;
-};
-
-struct livebox_desc {
-       FILE *fp;
-       int for_pd;
-
-       unsigned int last_idx;
-
-       struct dlist *block_list;
-};
-
-struct livebox_buffer_data {
-       int is_pd;
-       int accelerated;
-
-       /* for Buffer event wrapper */
-       int (*handler)(struct livebox_buffer *, struct buffer_event_data *, void *);
-       void *cbdata;
-
-       char *content;
-       char *title;
-       char *icon;
-       char *name;
-};
-
-PUBLIC const int DONE = 0x00;
-PUBLIC const int OUTPUT_UPDATED = 0x02;
-PUBLIC const int USE_NET = 0x04;
-
-PUBLIC const int NEED_TO_SCHEDULE = 0x01;
-PUBLIC const int NEED_TO_CREATE = 0x01;
-PUBLIC const int NEED_TO_DESTROY = 0x01;
-PUBLIC const int NEED_TO_UPDATE = 0x01;
-PUBLIC const int FORCE_TO_SCHEDULE = 0x08;
-
-PUBLIC const int LB_SYS_EVENT_FONT_CHANGED = 0x01;
-PUBLIC const int LB_SYS_EVENT_LANG_CHANGED = 0x02;
-PUBLIC const int LB_SYS_EVENT_TIME_CHANGED = 0x04;
-PUBLIC const int LB_SYS_EVENT_REGION_CHANGED = 0x08;
-PUBLIC const int LB_SYS_EVENT_TTS_CHANGED = 0x10;
-PUBLIC const int LB_SYS_EVENT_PAUSED = 0x0100;
-PUBLIC const int LB_SYS_EVENT_RESUMED = 0x0200;
-PUBLIC const int LB_SYS_EVENT_MMC_STATUS_CHANGED = 0x0400;
-PUBLIC const int LB_SYS_EVENT_DELETED = 0x0800;
-
-static int send_lb_updated(const char *pkgname, const char *id, int w, int h)
-{
-       int ret = LB_STATUS_ERROR_INVALID;
-
-       if (s_info.is_slave < 0) {
-               /* Must to be checked the slave function first. */
-               s_info.updated.slave.lb = dlsym(RTLD_DEFAULT, "livebox_send_updated");
-               s_info.updated.slave.pd = dlsym(RTLD_DEFAULT, "livebox_send_desc_updated");
-               if (s_info.updated.slave.lb && s_info.updated.slave.pd) {
-                       s_info.is_slave = 1;
-                       DbgPrint("Slave detected\n");
-               } else {
-                       s_info.updated.app.lb = dlsym(RTLD_DEFAULT, "provider_app_lb_updated");
-                       s_info.updated.app.pd = dlsym(RTLD_DEFAULT, "provider_app_pd_updated");
-                       if (s_info.updated.app.lb && s_info.updated.app.pd) {
-                               s_info.is_slave = 0;
-                               DbgPrint("App detected\n");
-                       }
-               }
-       }
-
-       if (s_info.is_slave == 0) {
-               ret = s_info.updated.app.lb(id, w, h);
-       } else if (s_info.is_slave == 1) {
-               ret = s_info.updated.slave.lb(pkgname, id, w, h);
-       } else {
-               ret = provider_send_updated(pkgname, id, w, h);
-       }
-
-       return ret;
-}
-
-static int send_pd_updated(const char *pkgname, const char *id, const char *descfile)
-{
-       int ret = LB_STATUS_ERROR_INVALID;
-
-       if (s_info.is_slave < 0) {
-               /* Must to be checked the slave function first. */
-               s_info.updated.slave.lb = dlsym(RTLD_DEFAULT, "livebox_send_updated");
-               s_info.updated.slave.pd = dlsym(RTLD_DEFAULT, "livebox_send_desc_updated");
-               if (s_info.updated.slave.lb && s_info.updated.slave.pd) {
-                       s_info.is_slave = 1;
-                       DbgPrint("Slave detected\n");
-               } else {
-                       s_info.updated.app.lb = dlsym(RTLD_DEFAULT, "provider_app_lb_updated");
-                       s_info.updated.app.pd = dlsym(RTLD_DEFAULT, "provider_app_pd_updated");
-                       if (s_info.updated.app.lb && s_info.updated.app.pd) {
-                               s_info.is_slave = 0;
-                               DbgPrint("App detected\n");
-                       }
-               }
-       }
-
-       if (s_info.is_slave == 0) {
-               ret = s_info.updated.app.pd(id);
-       } else if (s_info.is_slave == 1) {
-               ret = s_info.updated.slave.pd(pkgname, id, descfile);
-       } else {
-               ret = provider_send_desc_updated(pkgname, id, descfile);
-       }
-
-       return ret;
-}
-
-static char *id_to_uri(const char *id)
-{
-       char *uri;
-       int uri_len;
-
-       uri_len = strlen(id) + strlen(FILE_SCHEMA) + 1;
-
-       uri = malloc(uri_len);
-       if (!uri) {
-               return NULL;
-       }
-
-       snprintf(uri, uri_len, FILE_SCHEMA "%s", id);
-       return uri;
-}
-
-PUBLIC struct livebox_desc *livebox_desc_open(const char *filename, int for_pd)
-{
-       struct livebox_desc *handle;
-       char *new_fname;
-
-       handle = calloc(1, sizeof(*handle));
-       if (!handle) {
-               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);
-       } else {
-               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");
-
-       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;
-       }
-
-       return handle;
-}
-
-PUBLIC int livebox_desc_close(struct livebox_desc *handle)
-{
-       struct dlist *l;
-       struct dlist *n;
-       struct block *block;
-
-       if (!handle) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       dlist_foreach_safe(handle->block_list, l, n, block) {
-               handle->block_list = dlist_remove(handle->block_list, l);
-
-               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->data) {
-                       fprintf(handle->fp, "data=%s\n", block->data);
-               }
-
-               if (block->option) {
-                       fprintf(handle->fp, "option=%s\n", block->option);
-               }
-
-               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");
-
-               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));
-       }
-       free(handle);
-       return LB_STATUS_SUCCESS;
-}
-
-PUBLIC int livebox_desc_set_category(struct livebox_desc *handle, const char *id, const char *category)
-{
-       struct block *block;
-
-       if (!handle || !category) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       block = calloc(1, sizeof(*block));
-       if (!block) {
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       block->type = strdup(LB_DESC_TYPE_INFO);
-       if (!block->type) {
-               free(block);
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       block->part = strdup("category");
-       if (!block->part) {
-               free(block->type);
-               free(block);
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       block->data = strdup(category);
-       if (!block->data) {
-               free(block->type);
-               free(block->part);
-               free(block);
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       if (id) {
-               block->id = strdup(id);
-               if (!block->id) {
-                       free(block->data);
-                       free(block->type);
-                       free(block->part);
-                       free(block);
-                       return LB_STATUS_ERROR_MEMORY;
-               }
-       }
-
-       block->idx = handle->last_idx++;
-       handle->block_list = dlist_append(handle->block_list, block);
-       return block->idx;
-}
-
-PUBLIC int livebox_desc_set_size(struct livebox_desc *handle, const char *id, int w, int h)
-{
-       struct block *block;
-       char buffer[BUFSIZ];
-
-       if (!handle) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       block = calloc(1, sizeof(*block));
-       if (!block) {
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       block->type = strdup(LB_DESC_TYPE_INFO);
-       if (!block->type) {
-               free(block);
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       block->part = strdup("size");
-       if (!block->part) {
-               free(block->type);
-               free(block);
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       if (id) {
-               block->id = strdup(id);
-               if (!block->id) {
-                       free(block->part);
-                       free(block->type);
-                       free(block);
-                       return LB_STATUS_ERROR_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 LB_STATUS_ERROR_MEMORY;
-       }
-
-       block->idx = handle->last_idx++;
-       handle->block_list = dlist_append(handle->block_list, block);
-       return block->idx;
-}
-
-PUBLIC char *livebox_util_nl2br(const char *str)
-{
-       int len;
-       register int i;
-       char *ret;
-       char *ptr;
-
-       if (!str) {
-               return NULL;
-       }
-
-       len = strlen(str);
-       if (!len) {
-               return NULL;
-       }
-
-       ret = malloc(len + 1);
-       if (!ret) {
-               return NULL;
-       }
-
-       ptr = ret;
-       i = 0;
-       while (*str) {
-               switch (*str) {
-               case '\n':
-                       if (len - i < 5) {
-                               char *tmp;
-                               len += len;
-
-                               tmp = realloc(ret, len + 1);
-                               if (!tmp) {
-                                       free(ret);
-                                       return NULL;
-                               }
-
-                               ret = tmp;
-                               ptr = tmp + i;
-                       }
-
-                       strcpy(ptr, "<br>");
-                       ptr += 4;
-                       i += 4;
-                       break;
-               default:
-                       *ptr++ = *str;
-                       i++;
-                       break;
-               }
-
-               str++;
-       }
-       *ptr = '\0';
-
-       return ret;
-}
-
-PUBLIC int livebox_desc_set_id(struct livebox_desc *handle, int idx, const char *id)
-{
-       struct dlist *l;
-       struct block *block;
-
-       dlist_foreach(handle->block_list, l, block) {
-               if (block->idx == idx) {
-                       if (strcasecmp(block->type, LB_DESC_TYPE_SCRIPT)) {
-                               ErrPrint("Invalid block is used\n");
-                               return LB_STATUS_ERROR_INVALID;
-                       }
-
-                       free(block->target_id);
-                       block->target_id = NULL;
-
-                       if (!id || !strlen(id)) {
-                               return LB_STATUS_SUCCESS;
-                       }
-
-                       block->target_id = strdup(id);
-                       if (!block->target_id) {
-                               ErrPrint("Heap: %s\n", strerror(errno));
-                               return LB_STATUS_ERROR_MEMORY;
-                       }
-
-                       return LB_STATUS_SUCCESS;
-               }
-       }
-
-       return LB_STATUS_ERROR_NOT_EXIST;
-}
-
-/*!
- * \return idx
- */
-PUBLIC int livebox_desc_add_block(struct livebox_desc *handle, const char *id, const char *type, const char *part, const char *data, const char *option)
-{
-       struct block *block;
-
-       if (!handle || !type) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       if (!part) {
-               part = "";
-       }
-
-       if (!data) {
-               data = "";
-       }
-
-       block = calloc(1, sizeof(*block));
-       if (!block) {
-               ErrPrint("Heap: %s\n", strerror(errno));
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       block->type = strdup(type);
-       if (!block->type) {
-               ErrPrint("Heap: %s\n", strerror(errno));
-               free(block);
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       block->part = strdup(part);
-       if (!block->part) {
-               ErrPrint("Heap: %s\n", strerror(errno));
-               free(block->type);
-               free(block);
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       block->data = strdup(data);
-       if (!block->data) {
-               ErrPrint("Heap: %s\n", strerror(errno));
-               free(block->type);
-               free(block->part);
-               free(block);
-               return LB_STATUS_ERROR_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 LB_STATUS_ERROR_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 LB_STATUS_ERROR_MEMORY;
-               }
-       }
-
-       block->idx = handle->last_idx++;
-       handle->block_list = dlist_append(handle->block_list, block);
-       return block->idx;
-}
-
-PUBLIC int livebox_desc_del_block(struct livebox_desc *handle, int idx)
-{
-       struct dlist *l;
-       struct block *block;
-
-       if (!handle || idx < 0) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       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 LB_STATUS_SUCCESS;
-               }
-       }
-
-       return LB_STATUS_ERROR_NOT_EXIST;
-}
-
-static inline int event_handler_wrapper(struct livebox_buffer *buffer, struct buffer_event_data *event_info, void *data)
-{
-       const char *pkgname;
-       const char *id;
-       struct livebox_buffer_data *cbdata = data;
-       int ret;
-
-       pkgname = provider_buffer_pkgname(buffer);
-       if (!pkgname) {
-               ErrPrint("pkgname is not valid\n");
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       id = provider_buffer_id(buffer);
-       if (!id) {
-               ErrPrint("id is not valid[%s]\n", pkgname);
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       if (cbdata->handler) {
-               ret = cbdata->handler(buffer, event_info, cbdata->cbdata);
-       } else {
-               ret = LB_STATUS_ERROR_FAULT;
-       }
-
-       switch (event_info->type) {
-       case BUFFER_EVENT_HIGHLIGHT:
-       case BUFFER_EVENT_HIGHLIGHT_NEXT:
-       case BUFFER_EVENT_HIGHLIGHT_PREV:
-       case BUFFER_EVENT_ACTIVATE:
-       case BUFFER_EVENT_ACTION_UP:
-       case BUFFER_EVENT_ACTION_DOWN:
-       case BUFFER_EVENT_SCROLL_UP:
-       case BUFFER_EVENT_SCROLL_MOVE:
-       case BUFFER_EVENT_SCROLL_DOWN:
-       case BUFFER_EVENT_UNHIGHLIGHT:
-       case BUFFER_EVENT_VALUE_CHANGE:
-       case BUFFER_EVENT_MOUSE:
-       case BUFFER_EVENT_BACK:
-       case BUFFER_EVENT_OVER:
-       case BUFFER_EVENT_READ:
-       case BUFFER_EVENT_ENABLE:
-       case BUFFER_EVENT_DISABLE:
-               DbgPrint("Accessibility event: %d\n", event_info->type);
-               if (ret < 0) {
-                       (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
-               } else {
-                       (void)provider_send_access_status(pkgname, id, ret);
-               }
-               break;
-       case BUFFER_EVENT_KEY_UP:
-       case BUFFER_EVENT_KEY_DOWN:
-       case BUFFER_EVENT_KEY_FOCUS_IN:
-       case BUFFER_EVENT_KEY_FOCUS_OUT:
-               DbgPrint("Key event: %d\n", event_info->type);
-               if (ret < 0) {
-                       (void)provider_send_key_status(pkgname, id, LB_KEY_STATUS_ERROR);
-               } else {
-                       (void)provider_send_key_status(pkgname, id, ret);
-               }
-               break;
-       default:
-               break;
-       }
-
-       return ret;
-}
-
-static inline int default_event_handler(struct livebox_buffer *buffer, struct buffer_event_data *event_info, void *data)
-{
-       /* NOP */
-       return 0;
-}
-
-PUBLIC struct livebox_buffer *livebox_acquire_buffer(const char *filename, int is_pd, int width, int height, int pixels, int auto_align, int (*handler)(struct livebox_buffer *, struct buffer_event_data *, void *), void *data)
-{
-       struct livebox_buffer_data *user_data;
-       const char *pkgname;
-       struct livebox_buffer *handle;
-       char *uri;
-
-       if (!filename || !width || !height) {
-               ErrPrint("Invalid argument: %p(%dx%d)\n", filename, width, height);
-               return NULL;
-       }
-
-       user_data = calloc(1, sizeof(*user_data));
-       if (!user_data) {
-               ErrPrint("Heap: %s\n", strerror(errno));
-               return NULL;
-       }
-
-       user_data->is_pd = is_pd;
-       user_data->handler = handler ? handler : default_event_handler;
-       user_data->cbdata = data;
-
-       uri = id_to_uri(filename);
-       if (!uri) {
-               ErrPrint("Heap: %s\n", strerror(errno));
-               free(user_data);
-               return NULL;
-       }
-
-       if (!s_info.find_pkgname) {
-               s_info.find_pkgname = dlsym(RTLD_DEFAULT, "livebox_find_pkgname");
-               if (!s_info.find_pkgname) {
-                       ErrPrint("Failed to find a \"livebox_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;
-       }
-
-       handle = provider_buffer_create((!!is_pd) ? TYPE_PD : TYPE_LB, pkgname, uri, auto_align, event_handler_wrapper, user_data);
-       free(uri);
-       if (!handle) {
-               free(user_data);
-               return NULL;
-       }
-
-       if (provider_buffer_acquire(handle, width, height, pixels) < 0) {
-               provider_buffer_destroy(handle);
-               free(user_data);
-               return NULL;
-       }
-
-       (void)provider_buffer_set_user_data(handle, user_data);
-       return handle;
-}
-
-PUBLIC int livebox_request_update(const char *filename)
-{
-       char *uri;
-       int ret;
-
-       if (!filename) {
-               ErrPrint("Invalid argument\n");
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       uri = id_to_uri(filename);
-       if (!uri) {
-               ErrPrint("Heap: %s\n", strerror(errno));
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       if (!s_info.request_update_by_id) {
-               s_info.request_update_by_id = dlsym(RTLD_DEFAULT, "livebox_request_update_by_id");
-               if (!s_info.request_update_by_id) {
-                       ErrPrint("\"livebox_request_update_by_id\" is not exists\n");
-                       free(uri);
-                       return LB_STATUS_ERROR_FAULT;
-               }
-       }
-       ret = s_info.request_update_by_id(uri);
-       free(uri);
-       return ret;
-}
-
-int livebox_conf_auto_align(void)
-{
-       if (!s_info.conf) {
-               struct conf *(*livebox_conf_get_conf)(void);
-               livebox_conf_get_conf = dlsym(RTLD_DEFAULT, "livebox_conf_get_conf");
-               if (!livebox_conf_get_conf) {
-                       ErrPrint("g_conf is not found\n");
-                       return 1;
-               }
-
-               s_info.conf = livebox_conf_get_conf();
-               if (!s_info.conf) {
-                       ErrPrint("g_conf is not found\n");
-                       return 1;
-               }
-
-               DbgPrint("Auto align: %d\n", s_info.conf->auto_align);
-       }
-
-       return s_info.conf->auto_align;
-}
-
-PUBLIC int livebox_conf_premultiplied_alpha(void)
-{
-       if (!s_info.conf) {
-               struct conf *(*livebox_conf_get_conf)(void);
-               livebox_conf_get_conf = dlsym(RTLD_DEFAULT, "livebox_conf_get_conf");
-               if (!livebox_conf_get_conf) {
-                       ErrPrint("g_conf is not found\n");
-                       return 1;
-               }
-
-               s_info.conf = livebox_conf_get_conf();
-               if (!s_info.conf) {
-                       ErrPrint("g_conf is not found\n");
-                       return 1;
-               }
-
-               DbgPrint("Premultiplied alpha: %d\n", s_info.conf->premultiplied);
-       }
-
-       return s_info.conf->premultiplied;
-}
-
-PUBLIC unsigned long livebox_pixmap_id(struct livebox_buffer *handle)
-{
-       return provider_buffer_pixmap_id(handle);
-}
-
-PUBLIC int livebox_release_buffer(struct livebox_buffer *handle)
-{
-       struct livebox_buffer_data *user_data;
-
-       if (!handle) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       user_data = 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);
-               provider_buffer_set_user_data(handle, NULL);
-       }
-
-       (void)provider_buffer_release(handle);
-       (void)provider_buffer_destroy(handle);
-
-       DbgPrint("Release buffer\n");
-       return 0;
-}
-
-PUBLIC void *livebox_ref_buffer(struct livebox_buffer *handle)
-{
-       struct livebox_buffer_data *user_data;
-       void *data;
-       int w, h, size;
-       int ret;
-
-       if (!handle) {
-               return NULL;
-       }
-
-       user_data = provider_buffer_user_data(handle);
-       if (!user_data) {
-               return NULL;
-       }
-
-       if (user_data->accelerated) {
-               DbgPrint("H/W accelerated buffer is allocated\n");
-               return NULL;
-       }
-
-       ret = provider_buffer_get_size(handle, &w, &h, &size);
-
-       data = provider_buffer_ref(handle);
-       if (data && !ret && w > 0 && h > 0 && size > 0) {
-               memset(data, 0, w * h * size);
-               (void)provider_buffer_sync(handle);
-       }
-
-       DbgPrint("Ref buffer %ds%d(%d)\n", w, h, size);
-       return data;
-}
-
-PUBLIC int livebox_unref_buffer(void *buffer)
-{
-       if (!buffer) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       DbgPrint("Unref buffer\n");
-       return provider_buffer_unref(buffer);
-}
-
-PUBLIC int livebox_sync_buffer(struct livebox_buffer *handle)
-{
-       struct livebox_buffer_data *user_data;
-       const char *pkgname;
-       const char *id;
-
-       if (!handle) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       user_data = provider_buffer_user_data(handle);
-       if (!user_data) {
-               ErrPrint("Invalid buffer\n");
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       if (user_data->accelerated) {
-               DbgPrint("H/W Buffer allocated. skip the sync buffer\n");
-               return LB_STATUS_SUCCESS;
-       }
-
-       pkgname = provider_buffer_pkgname(handle);
-       if (!pkgname) {
-               ErrPrint("Invalid buffer handler\n");
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       id = provider_buffer_id(handle);
-       if (!id) {
-               ErrPrint("Invalid buffer handler\n");
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       (void)provider_buffer_sync(handle);
-
-       if (user_data->is_pd == 1) {
-               if (send_pd_updated(pkgname, id, NULL) < 0) {
-                       ErrPrint("Failed to send PD updated (%s)\n", id);
-               }
-       } else {
-               int w;
-               int h;
-               int pixel_size;
-
-               if (provider_buffer_get_size(handle, &w, &h, &pixel_size) < 0) {
-                       ErrPrint("Failed to get size (%s)\n", id);
-               }
-
-               if (send_lb_updated(pkgname, id, w, h) < 0) {
-                       ErrPrint("Failed to send updated (%s)\n", id);
-               }
-       }
-
-       return LB_STATUS_SUCCESS;
-}
-
-PUBLIC int livebox_support_hw_buffer(struct livebox_buffer *handle)
-{
-       if (!handle) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       return provider_buffer_pixmap_is_support_hw(handle);
-}
-
-PUBLIC int livebox_create_hw_buffer(struct livebox_buffer *handle)
-{
-       struct livebox_buffer_data *user_data;
-       int ret;
-
-       if (!handle) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       user_data = provider_buffer_user_data(handle);
-       if (!user_data) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       if (user_data->accelerated) {
-               return LB_STATUS_ERROR_ALREADY;
-       }
-
-       ret = provider_buffer_pixmap_create_hw(handle);
-       user_data->accelerated = (ret == 0);
-       return ret;
-}
-
-PUBLIC int livebox_destroy_hw_buffer(struct livebox_buffer *handle)
-{
-       struct livebox_buffer_data *user_data;
-
-       if (!handle) {
-               LOGD("handle is NULL\n");
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       user_data = provider_buffer_user_data(handle);
-       if (!user_data || !user_data->accelerated) {
-               LOGD("user_data is NULL\n");
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       user_data->accelerated = 0;
-
-       return provider_buffer_pixmap_destroy_hw(handle);
-}
-
-PUBLIC void *livebox_buffer_hw_buffer(struct livebox_buffer *handle)
-{
-       struct livebox_buffer_data *user_data;
-
-       if (!handle) {
-               return NULL;
-       }
-
-       user_data = provider_buffer_user_data(handle);
-       if (!user_data || !user_data->accelerated) {
-               return NULL;
-       }
-
-       return provider_buffer_pixmap_hw_addr(handle);
-}
-
-PUBLIC int livebox_buffer_pre_render(struct livebox_buffer *handle)
-{
-       struct livebox_buffer_data *user_data;
-
-       if (!handle) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       user_data = provider_buffer_user_data(handle);
-       if (!user_data) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       if (!user_data->accelerated) {
-               return LB_STATUS_SUCCESS;
-       }
-
-       /*!
-        * \note
-        * Do preprocessing for accessing the H/W render buffer
-        */
-       return provider_buffer_pre_render(handle);
-}
-
-PUBLIC int livebox_buffer_post_render(struct livebox_buffer *handle)
-{
-       int ret;
-       const char *pkgname;
-       const char *id;
-       struct livebox_buffer_data *user_data;
-
-       if (!handle) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       user_data = provider_buffer_user_data(handle);
-       if (!user_data) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       if (!user_data->accelerated) {
-               return LB_STATUS_SUCCESS;
-       }
-
-       pkgname = provider_buffer_pkgname(handle);
-       if (!pkgname) {
-               ErrPrint("Invalid buffer handle\n");
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       id = provider_buffer_id(handle);
-       if (!id) {
-               ErrPrint("Invalid buffer handler\n");
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       ret = provider_buffer_post_render(handle);
-       if (ret < 0) {
-               ErrPrint("Failed to post render processing\n");
-               return ret;
-       }
-
-       if (user_data->is_pd == 1) {
-               if (send_pd_updated(pkgname, id, NULL) < 0) {
-                       ErrPrint("Failed to send PD updated (%s)\n", id);
-               }
-       } else {
-               int w;
-               int h;
-               int pixel_size;
-
-               if (provider_buffer_get_size(handle, &w, &h, &pixel_size) < 0) {
-                       ErrPrint("Failed to get size (%s)\n", id);
-               }
-
-               if (send_lb_updated(pkgname, id, w, h) < 0) {
-                       ErrPrint("Failed to send updated (%s)\n", id);
-               }
-       }
-
-       return LB_STATUS_SUCCESS;
-}
-
-PUBLIC int livebox_buffer_stride(struct livebox_buffer *handle)
-{
-       if (!handle) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       return provider_buffer_stride(handle);
-}
-
-PUBLIC int livebox_content_is_updated(const char *filename, int is_pd)
-{
-       if (!s_info.trigger_update_monitor) {
-               s_info.trigger_update_monitor = dlsym(RTLD_DEFAULT, "livebox_trigger_update_monitor");
-               if (!s_info.trigger_update_monitor) {
-                       ErrPrint("Trigger update monitor function is not exists\n");
-                       return LB_STATUS_ERROR_FAULT;
-               }
-       }
-
-       return s_info.trigger_update_monitor(filename, is_pd);
-}
-
-PUBLIC int livebox_request_close_pd(const char *pkgname, const char *id, int reason)
-{
-       char *uri;
-       int schema_len = strlen(FILE_SCHEMA);
-       int ret;
-
-       if (!pkgname || !id) {
-               ErrPrint("Invalid parameters (%s) (%s)\n", pkgname, id);
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       if (strncmp(id, FILE_SCHEMA, schema_len)) {
-               uri = id_to_uri(id);
-               if (!uri) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
-                       return LB_STATUS_ERROR_MEMORY;
-               }
-       } else {
-               uri = strdup(id);
-               if (!uri) {
-                       ErrPrint("Heap: %s\n", strerror(errno));
-                       return LB_STATUS_ERROR_MEMORY;
-               }
-       }
-
-       ret = provider_send_request_close_pd(pkgname, uri, reason);
-       free(uri);
-       return ret;
-}
-
-PUBLIC int livebox_freeze_scroller(const char *pkgname, const char *id)
-{
-       char *uri;
-       int ret;
-
-       uri = id_to_uri(id);
-       if (!uri) {
-               ErrPrint("Heap: %s\n", strerror(errno));
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       ret = provider_send_hold_scroll(pkgname, uri, 1);
-       free(uri);
-       return ret;
-}
-
-PUBLIC int livebox_release_scroller(const char *pkgname, const char *id)
-{
-       char *uri;
-       int ret;
-
-       uri = id_to_uri(id);
-       if (!uri) {
-               ErrPrint("Heap: %s\n", strerror(errno));
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       ret = provider_send_hold_scroll(pkgname, uri, 0);
-       free(uri);
-       return ret;
-}
-
-PUBLIC int livebox_set_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name)
-{
-       struct livebox_buffer *handle;
-       const char *pkgname;
-       char *uri;
-
-       uri = id_to_uri(id);
-       if (!uri) {
-               ErrPrint("Heap: %s\n", strerror(errno));
-               return LB_STATUS_ERROR_MEMORY;
-       }
-
-       if (!s_info.find_pkgname) {
-               s_info.find_pkgname = dlsym(RTLD_DEFAULT, "livebox_find_pkgname");
-               if (!s_info.find_pkgname) {
-                       ErrPrint("Failed to find a \"livebox_find_pkgname\"\n");
-                       free(uri);
-                       return LB_STATUS_ERROR_FAULT;
-               }
-       }
-
-       pkgname = s_info.find_pkgname(uri);
-       if (!pkgname) {
-               ErrPrint("Failed to find a package (%s)\n", uri);
-               free(uri);
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       handle = provider_buffer_find_buffer(TYPE_LB, pkgname, uri);
-       if (handle) {
-               struct livebox_buffer_data *user_data;
-
-               user_data = provider_buffer_user_data(handle);
-               if (!user_data) {
-                       ErrPrint("User data is not available\n");
-                       free(uri);
-                       return LB_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 (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 LB_STATUS_SUCCESS;
-       }
-       free(uri);
-
-       if (!s_info.update_extra_info) {
-               s_info.update_extra_info = dlsym(RTLD_DEFAULT, "livebox_update_extra_info");
-               if (!s_info.update_extra_info) {
-                       ErrPrint("Failed to find a \"livebox_update_extra_info\"\n");
-                       return LB_STATUS_ERROR_INVALID;
-               }
-       }
-
-       return s_info.update_extra_info(id, content, title, icon, name);
-}
-
-/* End of a file */
index f1187d1..3b7ad24 100644 (file)
@@ -1,21 +1,24 @@
+#include <Elementary.h>
 #include <Ecore_Evas.h>
 #include <Evas.h>
 #include <Ecore.h>
 #include <unistd.h>
 
 #include <dlog.h>
-#include <livebox-service.h>
-#include <livebox-errno.h>
+#include <dynamicbox_service.h>
+#include <dynamicbox_errno.h>
 
-#include "livebox.h"
+#include "dynamicbox.h"
 #include "debug.h"
 
 #define QUALITY_N_COMPRESS "quality=100 compress=1"
 #define PUBLIC __attribute__((visibility("default")))
 
+
+
 struct snapshot_info {
        char *id;
-       void (*flush_cb)(Evas_Object *snapshot_window, const char *id, int status, void *data);
+       dynamicbox_flush_cb flush_cb;
        void *data;
 
        Ecore_Timer *flush_timer;
@@ -37,7 +40,7 @@ static inline Evas *create_virtual_canvas(int w, int h)
         // Create virtual canvas
         internal_ee = ecore_evas_buffer_new(w, h);
         if (!internal_ee) {
-                LOGD("Failed to create a new canvas buffer\n");
+                DbgPrint("Failed to create a new canvas buffer\n");
                 return NULL;
         }
 
@@ -48,7 +51,7 @@ static inline Evas *create_virtual_canvas(int w, int h)
         internal_e = ecore_evas_get(internal_ee);
         if (!internal_e) {
                 ecore_evas_free(internal_ee);
-                LOGD("Faield to get Evas object\n");
+                DbgPrint("Faield to get Evas object\n");
                 return NULL;
         }
 
@@ -63,8 +66,8 @@ static inline int flush_data_to_file(Evas *e, char *data, const char *filename,
 
         output = evas_object_image_add(e);
         if (!output) {
-               LOGD("Failed to create an image object\n");
-                return LB_STATUS_ERROR_FAULT;
+               DbgPrint("Failed to create an image object\n");
+                return DBOX_STATUS_ERROR_FAULT;
         }
 
         evas_object_image_data_set(output, NULL);
@@ -78,19 +81,19 @@ static inline int flush_data_to_file(Evas *e, char *data, const char *filename,
 
         if (evas_object_image_save(output, filename, NULL, QUALITY_N_COMPRESS) == EINA_FALSE) {
                 evas_object_del(output);
-               SECURE_LOGD("Faield to save a captured image (%s)\n", filename);
-                return LB_STATUS_ERROR_IO;
+               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) {
-               SECURE_LOGD("File %s is not found\n", filename);
-                return LB_STATUS_ERROR_IO;
+               DbgPrint("File %s is not found\n", filename);
+                return DBOX_STATUS_ERROR_IO_ERROR;
         }
 
-       SECURE_LOGD("Flush data to a file (%s)\n", filename);
-       return LB_STATUS_SUCCESS;
+       DbgPrint("Flush data to a file (%s)\n", filename);
+       return DBOX_STATUS_ERROR_NONE;
 }
 
 
@@ -101,12 +104,12 @@ static inline int destroy_virtual_canvas(Evas *e)
 
         ee = ecore_evas_ecore_evas_get(e);
         if (!ee) {
-               LOGD("Failed to ecore evas object\n");
-                return LB_STATUS_ERROR_FAULT;
+               DbgPrint("Failed to ecore evas object\n");
+                return DBOX_STATUS_ERROR_FAULT;
         }
 
         ecore_evas_free(ee);
-        return LB_STATUS_SUCCESS;
+        return DBOX_STATUS_ERROR_NONE;
 }
 
 
@@ -119,15 +122,15 @@ static inline int flush_to_file(void *canvas, const char *filename, int w, int h
 
        shot_e = create_virtual_canvas(w, h);
        if (!shot_e) {
-               LOGE("Unable to create a new virtual window\n");
-               return LB_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) {
-               LOGE("Unable to get Ecore_Evas\n");
+               ErrPrint("Unable to get Ecore_Evas\n");
                destroy_virtual_canvas(shot_e);
-               return LB_STATUS_ERROR_FAULT;
+               return DBOX_STATUS_ERROR_FAULT;
        }
 
        ecore_evas_manual_render_set(shot_ee, EINA_TRUE);
@@ -140,106 +143,129 @@ static inline int flush_to_file(void *canvas, const char *filename, int w, int h
 
 
 
-static void del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static Eina_Bool snapshot_cb(void *data)
 {
+       Evas_Object *snapshot_win = data;
        struct snapshot_info *info;
-
-       info = evas_object_data_del(obj, "snapshot,info");
-       if (!info) {
-               return;
-       }
-
-       SECURE_LOGD("Delete object (%s)\n", info->id);
-
-       if (info->flush_cb) {
-               info->flush_cb(obj, info->id, LB_STATUS_ERROR_CANCEL, info->data);
-               LOGD("Flush is canceled\n");
-       }
-
-       /*!
-        * \note
-        * Render callback will be deleted.
-        */
-       destroy_virtual_canvas(e);
-       free(info->id);
-       free(info);
-}
-
-
-
-static Eina_Bool direct_snapshot_cb(void *data)
-{
        Evas *e;
        Ecore_Evas *ee;
        void *canvas;
-       int status;
-       int w;
-       int h;
-       void (*flush_cb)(Evas_Object *snapshot_window, const char *id, int status, void *data);
-       Evas_Object *snapshot_win = data;
-       struct snapshot_info *info;
+       dynamicbox_flush_cb flush_cb;
+       int status = DBOX_STATUS_ERROR_NONE;
 
        info = evas_object_data_get(snapshot_win, "snapshot,info");
        if (!info) {
-               LOGE("Unable to get snapshot info\n");
+               ErrPrint("Invalid object\n");
                return ECORE_CALLBACK_CANCEL;
        }
 
-       info->flush_timer = NULL;
+       if (info->flush_timer) {
+               info->flush_timer = NULL;
+       } else {
+               status = DBOX_STATUS_ERROR_CANCEL;
+       }
+
        flush_cb = info->flush_cb;
        info->flush_cb = NULL; /* To prevent call this from the delete callback */
 
        e = evas_object_evas_get(snapshot_win);
        if (!e) {
-               LOGE("Invalid object, failed to get Evas\n");
+               ErrPrint("Invalid object\n");
                if (flush_cb) {
-                       flush_cb(snapshot_win, info->id, LB_STATUS_ERROR_FAULT, info->data);
+                       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) {
-               LOGE("Unable to get Ecore_Evas object\n");
+               ErrPrint("Invalid object (ee)\n");
                if (flush_cb) {
-                       flush_cb(snapshot_win, info->id, LB_STATUS_ERROR_FAULT, info->data);
+                       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);
-       ecore_evas_manual_render_set(ee, EINA_TRUE);
-
-       canvas = ecore_evas_buffer_pixels_get(ee);
+       canvas = (void*)ecore_evas_buffer_pixels_get(ee);
        if (!canvas) {
-               LOGE("Failed to get canvas\n");
+               DbgPrint("Failed to get pixel canvas\n");
                if (flush_cb) {
-                       flush_cb(snapshot_win, info->id, LB_STATUS_ERROR_FAULT, info->data);
+                       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) {
+               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 Eina_Bool snapshot_cb(void *data)
+static void del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-       Evas_Object *snapshot_win = data;
        struct snapshot_info *info;
+
+       info = evas_object_data_del(obj, "snapshot,info");
+       if (!info) {
+               return;
+       }
+
+       DbgPrint("Delete object (%s)\n", info->id);
+
+       evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, post_render_cb);
+       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;
+
+               (void)snapshot_cb(obj);
+               DbgPrint("Flush is canceled\n");
+       }
+
+       /**
+        * @note
+        * Render callback will be deleted.
+        */
+       free(info->id);
+       free(info);
+}
+
+
+
+static Eina_Bool direct_snapshot_cb(void *data)
+{
        Evas *e;
        Ecore_Evas *ee;
        void *canvas;
-       void (*flush_cb)(Evas_Object *snapshot_window, const char *id, int status, void *data);
+       int status;
+       int w;
+       int h;
+       dynamicbox_flush_cb flush_cb;
+       Evas_Object *snapshot_win = data;
+       struct snapshot_info *info;
 
        info = evas_object_data_get(snapshot_win, "snapshot,info");
        if (!info) {
-               LOGE("Invalid object\n");
+               ErrPrint("Unable to get snapshot info\n");
                return ECORE_CALLBACK_CANCEL;
        }
 
@@ -249,47 +275,38 @@ static Eina_Bool snapshot_cb(void *data)
 
        e = evas_object_evas_get(snapshot_win);
        if (!e) {
-               LOGE("Invalid object\n");
+               ErrPrint("Invalid object, failed to get Evas\n");
                if (flush_cb) {
-                       flush_cb(snapshot_win, info->id, LB_STATUS_ERROR_FAULT, info->data);
+                       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) {
-               LOGE("Invalid object (ee)\n");
+               ErrPrint("Unable to get Ecore_Evas object\n");
                if (flush_cb) {
-                       flush_cb(snapshot_win, info->id, LB_STATUS_ERROR_FAULT, info->data);
+                       flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
                }
                return ECORE_CALLBACK_CANCEL;
        }
 
-       canvas = (void*)ecore_evas_buffer_pixels_get(ee);
+       ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
+       ecore_evas_manual_render_set(ee, EINA_TRUE);
+
+       canvas = ecore_evas_buffer_pixels_get(ee);
        if (!canvas) {
-               LOGD("Failed to get pixel canvas\n");
+               ErrPrint("Failed to get canvas\n");
                if (flush_cb) {
-                       flush_cb(snapshot_win, info->id, LB_STATUS_ERROR_FAULT, info->data);
+                       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) {
-               int w;
-               int h;
-               int status;
-
-               ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
-
-               SECURE_LOGD("Flush size: %dx%d\n", w, h);
-               status = flush_to_file(canvas, info->id, w, h);
-
                flush_cb(snapshot_win, info->id, status, info->data);
-               /*!
-                * Do not access info after this.
-                */
        }
-
        return ECORE_CALLBACK_CANCEL;
 }
 
@@ -302,23 +319,24 @@ static void post_render_cb(void *data, Evas *e, void *event_info)
 
        info = evas_object_data_get(snapshot_win, "snapshot,info");
        if (!info) {
-               LOGE("snapshot info is not valid\n");
+               ErrPrint("snapshot info is not valid\n");
                return;
        }
 
        info->render_cnt++;
 
        if (info->flush_timer) {
-               /*!
+               /**
+                * @note
                 * This has not to be happens.
                 */
-               LOGE("Flush timer is not cleared\n");
+               ErrPrint("Flush timer is not cleared\n");
                ecore_timer_del(info->flush_timer);
                info->flush_timer = NULL;
        }
 
        if (!info->flush_cb) {
-               LOGD("Flush request is not initiated yet\n");
+               DbgPrint("Flush request is not initiated yet\n");
                return;
        }
 
@@ -329,16 +347,18 @@ static void post_render_cb(void *data, Evas *e, void *event_info)
         * Or we can met unexpected problems.
         * To avoid it, use the 0.0001f to get timer callback ASAP, not in this function.
         */
-       LOGD("Fire the flush timer %lf (%d)\n", info->timeout, info->render_cnt);
+       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) {
-               void (*flush_cb)(Evas_Object *snapshot_window, const char *id, int status, void *data);
+               dynamicbox_flush_cb flush_cb;
 
-               LOGE("Unalbe to add timer for getting the snapshot\n");
+               ErrPrint("Unalbe to add timer for getting the snapshot\n");
                flush_cb = info->flush_cb;
                info->flush_cb = NULL;
 
-               flush_cb(snapshot_win, info->id, LB_STATUS_ERROR_FAULT, info->data);
+               if (flush_cb) {
+                       flush_cb(snapshot_win, info->id, DBOX_STATUS_ERROR_FAULT, info->data);
+               }
                /*!
                 * \note
                 * Do not access info after from here.
@@ -355,73 +375,44 @@ static void pre_render_cb(void *data, Evas *e, void *event_info)
 
        info = evas_object_data_get(snapshot_win, "snapshot,info");
        if (!info) {
-               LOGE("snapshot info is not valid\n");
+               ErrPrint("snapshot info is not valid\n");
                return;
        }
 
        if (info->flush_timer) {
                ecore_timer_del(info->flush_timer);
                info->flush_timer = NULL;
-               LOGD("Clear the flush timer\n");
+               DbgPrint("Clear the flush timer\n");
        }
 
-       LOGD("Pre-render callback\n");
+       DbgPrint("Pre-render callback\n");
 }
 
 
 
-static void resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
-{
-       Ecore_Evas *ee;
-       int w;
-       int h;
-       int ow;
-       int oh;
-
-       ee = ecore_evas_ecore_evas_get(e);
-       if (!ee) {
-               return;
-       }
-
-       ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
-       evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
-       if (ow == w && oh == h) {
-               SECURE_LOGD("Size is not changed: %dx%d\n", w, h);
-               return;
-       }
-
-       /*!
-        * Box(parent object) is resized.
-        * Try to resize the canvas too.
-        */
-       ecore_evas_resize(ee, w, h);
-       SECURE_LOGD("Canvas is resized to %dx%d\n", w, h);
-}
-
-
-
-PUBLIC Evas_Object *livebox_snapshot_window_add(const char *id, int size_type)
+PUBLIC void *dynamicbox_snapshot_window_add(const char *id, int size_type)
 {
        struct snapshot_info *info;
        Evas_Object *snapshot_win;
+       Evas_Object *parent;
        Evas *e;
        int w;
        int h;
 
-       if (livebox_service_get_size(size_type, &w, &h) != LB_STATUS_SUCCESS) {
-               LOGE("Invalid size\n");
+       if (dynamicbox_service_get_size(size_type, &w, &h) != DBOX_STATUS_ERROR_NONE) {
+               ErrPrint("Invalid size\n");
                return NULL;
        }
 
        info = malloc(sizeof(*info));
        if (!info) {
-               LOGE("Heap: %s\n", strerror(errno));
+               ErrPrint("Heap: %s\n", strerror(errno));
                return NULL;
        }
 
        info->id = strdup(id);
        if (!info->id) {
-               LOGE("Heap: %s\n", strerror(errno));
+               ErrPrint("Heap: %s\n", strerror(errno));
                free(info);
                return NULL;
        }
@@ -438,7 +429,16 @@ PUBLIC Evas_Object *livebox_snapshot_window_add(const char *id, int size_type)
                return NULL;
        }
 
-       snapshot_win = evas_object_rectangle_add(e);
+       parent = evas_object_rectangle_add(e);
+       if (!parent) {
+               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);
@@ -446,9 +446,8 @@ PUBLIC Evas_Object *livebox_snapshot_window_add(const char *id, int size_type)
                return NULL;
        }
 
-       SECURE_LOGD("Add new window %dx%d\n", w, h);
+       DbgPrint("Create a new window %dx%d for %s\n", w, h, id);
        evas_object_event_callback_add(snapshot_win, EVAS_CALLBACK_DEL, del_cb, NULL);
-       evas_object_event_callback_add(snapshot_win, EVAS_CALLBACK_RESIZE, resize_cb, NULL);
        evas_object_resize(snapshot_win, w, h);
        evas_object_show(snapshot_win);
 
@@ -462,19 +461,19 @@ PUBLIC Evas_Object *livebox_snapshot_window_add(const char *id, int size_type)
 
 
 
-PUBLIC int livebox_snapshot_window_flush(Evas_Object *snapshot_win, double timeout, void (*flush_cb)(Evas_Object *snapshot_window, const char *id, int status, void *data), void *data)
+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) {
-               LOGE("Invalid argument (%p, %lf)\n", flush_cb, timeout);
-               return LB_STATUS_ERROR_INVALID;
+               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) {
-               LOGE("Invalid argument\n");
-               return LB_STATUS_ERROR_INVALID;
+               ErrPrint("Invalid argument\n");
+               return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
        info->timeout = timeout;
@@ -487,7 +486,7 @@ PUBLIC int livebox_snapshot_window_flush(Evas_Object *snapshot_win, double timeo
                 */
                info->flush_timer = ecore_timer_add(0.0001f, direct_snapshot_cb, snapshot_win);
                if (!info->flush_timer) {
-                       return LB_STATUS_ERROR_FAULT;
+                       return DBOX_STATUS_ERROR_FAULT;
                }
        } else if (info->render_cnt) {
                /*!
@@ -497,33 +496,16 @@ PUBLIC int livebox_snapshot_window_flush(Evas_Object *snapshot_win, double timeo
                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 LB_STATUS_ERROR_FAULT;
+                       return DBOX_STATUS_ERROR_FAULT;
                }
        }
 
        info->flush_cb = flush_cb;
        info->data = data;
 
-       return LB_STATUS_SUCCESS;
-}
-
-
-
-PUBLIC int livebox_snapshot_window_del(Evas_Object *snapshot_win)
-{
-       Evas *e;
-       if (!snapshot_win || !evas_object_data_get(snapshot_win, "snapshot,info")) {
-               return LB_STATUS_ERROR_INVALID;
-       }
-
-       e = evas_object_evas_get(snapshot_win);
-       evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, post_render_cb);
-       evas_event_callback_del(e, EVAS_CALLBACK_RENDER_PRE, pre_render_cb);
-
-       evas_object_del(snapshot_win);
-       return LB_STATUS_SUCCESS;
+       return DBOX_STATUS_ERROR_NONE;
 }
 
 
 
-// End of a file
+/* End of a file */
index 1c42a7c..4f482ff 100644 (file)
 #include <X11/Xlib.h>
 
 #include <dlog.h>
-#include <livebox-errno.h>
-#include <livebox-service.h>
+#include <dynamicbox_errno.h>
+#include <dynamicbox_service.h>
+#include <dynamicbox_conf.h>
 
-#include "livebox.h"
-#include "livebox_product.h"
+#include "dynamicbox.h"
 #include "debug.h"
 
 #define IS_PD 1
 
 #define PUBLIC __attribute__((visibility("default")))
+#define DBOX_WIN_TAG "dynamic,box,win"
 
 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);
@@ -45,17 +46,17 @@ static struct static_info {
        .alloc_canvas_with_stride = NULL,
 };
 
-/*!
- * \brief
+/**
+ * @brief
  * Abstracted Data Type of Virtual Window
  */
 struct info {
-       char *id; /*!< Identification */
-       struct livebox_buffer *handle; /*!< Livebox buffer handle */
-       int is_hw; /*!< 1 if a buffer is created on the H/W accelerated place or 0 */
+       char *id; /**< Identification */
+       struct dynamicbox_buffer *handle; /**< Livebox buffer handle */
+       int is_hw; /**< 1 if a buffer is created on the H/W accelerated place or 0 */
        Ecore_Evas *ee;
        Evas *e;
-       int is_pd;
+       int is_gbar;
        int deleted;
        int w;
        int h;
@@ -72,11 +73,11 @@ static inline Evas_Object *get_highlighted_object(Evas_Object *obj)
        return ho;
 }
 
-/*!
- * \note
+/**
+ * @note
  * Every user event (mouse) on the buffer will be passed via this event callback
  */
-static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_data *event_info, void *data)
+static int event_handler_cb(struct dynamicbox_buffer *handler, struct dynamicbox_buffer_event_data *event_info, void *data)
 {
        struct info *info = data;
        Elm_Access_Action_Info action_info;
@@ -91,72 +92,82 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                return 0;
        }
 
-       /*!
-        * \note
+       /**
+        * @note
         * Feed up events
         */
        switch (event_info->type) {
-       case BUFFER_EVENT_ON_HOLD:
-               DbgPrint("ON_HOLD\n");
+       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 BUFFER_EVENT_OFF_HOLD:
+       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 BUFFER_EVENT_ON_SCROLL:
+       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 BUFFER_EVENT_OFF_SCROLL:
+       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 BUFFER_EVENT_ENTER:
+       case DBOX_BUFFER_EVENT_ENTER:
                evas_event_feed_mouse_in(info->e, event_info->timestamp * 1000, NULL);
                break;
-       case BUFFER_EVENT_LEAVE:
+       case DBOX_BUFFER_EVENT_LEAVE:
                evas_event_feed_mouse_out(info->e, event_info->timestamp * 1000, NULL);
                break;
-       case BUFFER_EVENT_DOWN:
-               /*!
-                * \note
-                * Calculate the event occurred X & Y on the buffer
+       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 BUFFER_EVENT_MOVE:
-               /*!
-                * \note
+       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 BUFFER_EVENT_UP:
+       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 BUFFER_EVENT_HIGHLIGHT:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
                action_type = ELM_ACCESS_ACTION_HIGHLIGHT;
-               /*!
-                * \note
+               /**
+                * @note
                 * Calculate the event occurred X & Y on the buffer
                 */
                action_info.x = event_info->info.access.x;
@@ -164,78 +175,78 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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 = LB_ACCESS_STATUS_ERROR;
+                               ErrPrint("Highlighted object is not found\n");
+                               ret = DBOX_ACCESS_STATUS_ERROR;
                        } else {
-                               LOGD("Highlighted object is found\n");
-                               ret = LB_ACCESS_STATUS_DONE;
+                               DbgPrint("Highlighted object is found\n");
+                               ret = DBOX_ACCESS_STATUS_DONE;
                        }
                } else {
-                       LOGE("Action error\n");
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ErrPrint("Action error\n");
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                }
                break;
-       case BUFFER_EVENT_HIGHLIGHT_NEXT:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_NEXT:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_LAST : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_LAST : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_HIGHLIGHT_PREV:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_PREV:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_FIRST : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_FIRST : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_ACTIVATE:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_ACTIVATE:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_ACTION_UP:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_ACTION_UP:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_ACTION_DOWN:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_ACTION_DOWN:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_SCROLL_UP:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_UP:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -244,12 +255,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_SCROLL_MOVE:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_MOVE:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -258,12 +269,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_SCROLL_DOWN:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_DOWN:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -272,23 +283,23 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_UNHIGHLIGHT:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_UNHIGHLIGHT:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_VALUE_CHANGE:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_VALUE_CHANGE:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -297,12 +308,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_MOUSE:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_MOUSE:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -311,12 +322,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_BACK:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_BACK:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -325,12 +336,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_OVER:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_OVER:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -339,12 +350,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_READ:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_READ:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -353,12 +364,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_ENABLE:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_ENABLE:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -367,12 +378,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_DISABLE:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_ACCESS_DISABLE:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -381,12 +392,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_KEY_DOWN:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_KEY_DOWN:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
 
@@ -402,12 +413,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                        XFree(key_name);
                        XFree(key_string);
                }
-               ret = LB_KEY_STATUS_ERROR;
+               ret = DBOX_KEY_STATUS_ERROR;
                break;
-       case BUFFER_EVENT_KEY_UP:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_KEY_UP:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
 
@@ -423,12 +434,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                        XFree(key_name);
                        XFree(key_string);
                }
-               ret = LB_KEY_STATUS_ERROR;
+               ret = DBOX_KEY_STATUS_ERROR;
                break;
-       case BUFFER_EVENT_KEY_FOCUS_IN:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_KEY_FOCUS_IN:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
 
@@ -444,12 +455,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                        XFree(key_name);
                        XFree(key_string);
                }
-               ret = LB_KEY_STATUS_ERROR;
+               ret = DBOX_KEY_STATUS_ERROR;
                break;
-       case BUFFER_EVENT_KEY_FOCUS_OUT:
-               parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
+       case DBOX_BUFFER_EVENT_KEY_FOCUS_OUT:
+               parent_elm = ecore_evas_data_get(info->ee, DBOX_WIN_TAG);
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
 
@@ -465,10 +476,10 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                        XFree(key_name);
                        XFree(key_string);
                }
-               ret = LB_KEY_STATUS_ERROR;
+               ret = DBOX_KEY_STATUS_ERROR;
                break;
        default:
-               LOGD("Unhandled buffer event (%d)\n", event_info->type);
+               DbgPrint("Unhandled buffer event (%d)\n", event_info->type);
                break;
        }
 
@@ -482,38 +493,38 @@ static void *alloc_fb(void *data, int size)
 
        if (info->ee) {
                ecore_evas_geometry_get(info->ee, NULL, NULL, &info->w, &info->h);
-               LOGD("Size of ee is updated: %dx%d (info: %p)\n", info->w, info->h, info);
+               DbgPrint("Size of ee is updated: %dx%d (info: %p)\n", info->w, info->h, info);
        }
 
-       /*!
+       /**
         * Acquire a buffer for canvas.
         */
-       info->handle = livebox_acquire_buffer(info->id, info->is_pd,
-                                       info->w, info->h, sizeof(int), (livebox_conf_auto_align() || !s_info.alloc_canvas_with_stride),
+       info->handle = dynamicbox_acquire_buffer(info->id, info->is_gbar,
+                                       info->w, info->h, sizeof(int), (dynamicbox_conf_auto_align() || !s_info.alloc_canvas_with_stride),
                                        event_handler_cb, info);
 
-       /*!
+       /**
         * If it supports the H/W accelerated buffer,
         * Use it.
         */
-       if (livebox_support_hw_buffer(info->handle)) {
-               if (livebox_create_hw_buffer(info->handle) == 0) {
-                       buffer = livebox_buffer_hw_buffer(info->handle);
+       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 %p, (%dx%d)\n", info, info->w, info->h);
+                               DbgPrint("HW Accelerated buffer is created %p, (%dx%d)\n", info, info->w, info->h);
                                info->is_hw = 1;
                                return buffer;
                        }
                }
 
-               LOGE("Failed to allocate HW Accelerated buffer\n");
+               ErrPrint("Failed to allocate HW Accelerated buffer\n");
        }
 
-       /*!
+       /**
         * Or use the buffer of a S/W backend.
         */
-       buffer = livebox_ref_buffer(info->handle);
-       LOGD("SW buffer is created (%dx%d)\n", info->w, info->h);
+       buffer = dynamicbox_ref_buffer(info->handle);
+       DbgPrint("SW buffer is created (%dx%d)\n", info->w, info->h);
        info->is_hw = 0;
        return buffer;
 }
@@ -528,7 +539,7 @@ static void *alloc_stride_fb(void *data, int size, int *stride, int *bpp)
                int _stride;
 
                *bpp = sizeof(int);
-               _stride = livebox_buffer_stride(info->handle);
+               _stride = dynamicbox_buffer_stride(info->handle);
                if (_stride < 0) {
                        _stride = info->w * *bpp;
                }
@@ -550,15 +561,15 @@ static void free_fb(void *data, void *ptr)
        }
 
        if (info->is_hw) {
-               if (livebox_destroy_hw_buffer(info->handle) == 0) {
-                       LOGD("HW Accelerated buffer is destroyed\n");
+               if (dynamicbox_destroy_hw_buffer(info->handle) == 0) {
+                       DbgPrint("HW Accelerated buffer is destroyed\n");
                }
        } else {
-               LOGD("SW buffer is destroyed, %p\n", info);
-               livebox_unref_buffer(ptr);
+               DbgPrint("SW buffer is destroyed, %p\n", info);
+               dynamicbox_unref_buffer(ptr);
        }
 
-       livebox_release_buffer(info->handle);
+       dynamicbox_release_buffer(info->handle);
        info->handle = NULL;
 
        if (info->deleted) {
@@ -577,7 +588,7 @@ static void pre_render_cb(void *data, Evas *e, void *event_info)
                return;
        }
 
-       if (livebox_conf_premultiplied_alpha()) {
+       if (dynamicbox_conf_premultiplied_alpha()) {
                Evas_Coord w;
                Evas_Coord h;
 
@@ -586,7 +597,7 @@ static void pre_render_cb(void *data, Evas *e, void *event_info)
        }
 
        if (info->is_hw) {
-               livebox_buffer_pre_render(info->handle);
+               dynamicbox_buffer_pre_render(info->handle);
        }
 }
 
@@ -598,7 +609,7 @@ static void post_render_cb(void *data, Evas *e, void *event_info)
                return;
        }
 
-       if (livebox_conf_premultiplied_alpha()) {
+       if (dynamicbox_conf_premultiplied_alpha()) {
                void *canvas;
                int x, y, w, h;
 
@@ -614,9 +625,9 @@ static void post_render_cb(void *data, Evas *e, void *event_info)
        }
 
        if (info->is_hw) {
-               livebox_buffer_post_render(info->handle);
+               dynamicbox_buffer_post_render(info->handle);
        } else {
-               livebox_sync_buffer(info->handle);
+               dynamicbox_sync_buffer(info->handle);
        }
 }
 
@@ -626,7 +637,7 @@ static void ecore_evas_free_cb(Ecore_Evas *ee)
 
        info = ecore_evas_data_get(ee, "dynamic,box,info");
        if (!info) {
-               LOGD("Info is not valid\n");
+               DbgPrint("Info is not valid\n");
                return;
        }
 
@@ -639,7 +650,7 @@ static void ecore_evas_free_cb(Ecore_Evas *ee)
        info->ee = NULL;
 }
 
-PUBLIC Evas_Object *livebox_get_evas_object(const char *id, int is_pd)
+PUBLIC void *dynamicbox_get_evas_object(const char *id, int is_gbar)
 {
        struct info *info;
        Evas_Object *rect;
@@ -679,17 +690,17 @@ PUBLIC Evas_Object *livebox_get_evas_object(const char *id, int is_pd)
                return NULL;
        }
 
-       info->is_pd = is_pd;
+       info->is_gbar = is_gbar;
 
-       /*!
+       /**
         * Size information must be initialized before call the ecore_evas_buffer_new.
         */
        info->w = 1;
        info->h = 1;
 
-       if (!livebox_conf_auto_align() && s_info.alloc_canvas_with_stride) {
+       if (!dynamicbox_conf_auto_align() && s_info.alloc_canvas_with_stride) {
                info->ee = s_info.alloc_canvas_with_stride(1, 1, alloc_stride_fb, free_fb, info);
-       } else {
+       } else if (s_info.alloc_canvas) {
                info->ee = s_info.alloc_canvas(1, 1, alloc_fb, free_fb, info);
        }
 
index 109170b..bbc240e 100644 (file)
@@ -5,10 +5,10 @@
 #include <Evas.h>
 
 #include <dlog.h>
-#include <livebox-errno.h>
-#include <livebox-service.h>
+#include <dynamicbox_errno.h>
+#include <dynamicbox_service.h>
 
-#include "livebox.h"
+#include "dynamicbox.h"
 #include "debug.h"
 
 #define IS_PD 1
  */
 struct info {
        char *id; /*!< Identification */
-       struct livebox_buffer *handle; /*!< Livebox buffer handle */
+       struct dynamicbox_buffer *handle; /*!< Livebox buffer handle */
        int is_hw; /*!< 1 if a buffer is created on the H/W accelerated place or 0 */
        Ecore_Evas *ee;
        Evas *e;
-       int is_pd;
+       int is_gbar;
 };
 
 static inline Evas_Object *get_highlighted_object(Evas_Object *obj)
@@ -43,7 +43,7 @@ static inline Evas_Object *get_highlighted_object(Evas_Object *obj)
  * \note
  * Every user event (mouse) on the buffer will be passed via this event callback
  */
-static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_data *event_info, void *data)
+static int event_handler_cb(struct dynamicbox_buffer *handler, struct dynamicbox_buffer_event_data *event_info, void *data)
 {
        struct info *info = data;
        Elm_Access_Action_Info action_info;
@@ -62,13 +62,13 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
         * Feed up events
         */
        switch (event_info->type) {
-       case BUFFER_EVENT_ENTER:
+       case DBOX_BUFFER_EVENT_ENTER:
                evas_event_feed_mouse_in(info->e, event_info->timestamp * 1000, NULL);
                break;
-       case BUFFER_EVENT_LEAVE:
+       case DBOX_BUFFER_EVENT_LEAVE:
                evas_event_feed_mouse_out(info->e, event_info->timestamp * 1000, NULL);
                break;
-       case BUFFER_EVENT_DOWN:
+       case DBOX_BUFFER_EVENT_DOWN:
                /*!
                 * \note
                 * Calculate the event occurred X & Y on the buffer
@@ -76,21 +76,21 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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 BUFFER_EVENT_MOVE:
+       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 BUFFER_EVENT_UP:
+       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 BUFFER_EVENT_HIGHLIGHT:
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -105,77 +105,77 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                if (ret == EINA_TRUE) {
                        if (!get_highlighted_object(parent_elm)) {
                                LOGE("Highlighted object is not found\n");
-                               ret = LB_ACCESS_STATUS_ERROR;
+                               ret = DBOX_ACCESS_STATUS_ERROR;
                        } else {
                                LOGD("Highlighted object is found\n");
-                               ret = LB_ACCESS_STATUS_DONE;
+                               ret = DBOX_ACCESS_STATUS_DONE;
                        }
                } else {
                        LOGE("Action error\n");
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                }
                break;
-       case BUFFER_EVENT_HIGHLIGHT_NEXT:
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_NEXT:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_LAST : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_LAST : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_HIGHLIGHT_PREV:
+       case DBOX_BUFFER_EVENT_ACCESS_HIGHLIGHT_PREV:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_FIRST : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_FIRST : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_ACTIVATE:
+       case DBOX_BUFFER_EVENT_ACCESS_ACTIVATE:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_ACTION_UP:
+       case DBOX_BUFFER_EVENT_ACCESS_ACTION_UP:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_ACTION_DOWN:
+       case DBOX_BUFFER_EVENT_ACCESS_ACTION_DOWN:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_SCROLL_UP:
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_UP:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -184,12 +184,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_SCROLL_MOVE:
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_MOVE:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -198,12 +198,12 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_SCROLL_DOWN:
+       case DBOX_BUFFER_EVENT_ACCESS_SCROLL_DOWN:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
                memset(&action_info, 0, sizeof(action_info));
@@ -212,54 +212,54 @@ static int event_handler_cb(struct livebox_buffer *handler, struct buffer_event_
                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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_UNHIGHLIGHT:
+       case DBOX_BUFFER_EVENT_ACCESS_UNHIGHLIGHT:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       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) ? LB_ACCESS_STATUS_ERROR : LB_ACCESS_STATUS_DONE;
+               ret = (ret == EINA_FALSE) ? DBOX_ACCESS_STATUS_ERROR : DBOX_ACCESS_STATUS_DONE;
                break;
-       case BUFFER_EVENT_KEY_DOWN:
+       case DBOX_BUFFER_EVENT_KEY_DOWN:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
 
-               ret = LB_KEY_STATUS_ERROR;
+               ret = DBOX_KEY_STATUS_ERROR;
                break;
-       case BUFFER_EVENT_KEY_UP:
+       case DBOX_BUFFER_EVENT_KEY_UP:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
 
-               ret = LB_KEY_STATUS_ERROR;
+               ret = DBOX_KEY_STATUS_ERROR;
                break;
-       case BUFFER_EVENT_KEY_FOCUS_IN:
+       case DBOX_BUFFER_EVENT_KEY_FOCUS_IN:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
 
-               ret = LB_KEY_STATUS_ERROR;
+               ret = DBOX_KEY_STATUS_ERROR;
                break;
-       case BUFFER_EVENT_KEY_FOCUS_OUT:
+       case DBOX_BUFFER_EVENT_KEY_FOCUS_OUT:
                parent_elm = ecore_evas_data_get(info->ee, "dynamic,box,win");
                if (!parent_elm) {
-                       ret = LB_ACCESS_STATUS_ERROR;
+                       ret = DBOX_ACCESS_STATUS_ERROR;
                        break;
                }
 
-               ret = LB_KEY_STATUS_ERROR;
+               ret = DBOX_KEY_STATUS_ERROR;
                break;
        default:
                LOGD("Unhandled buffer event (%d)\n", event_info->type);
@@ -286,7 +286,7 @@ static void *alloc_fb(void *data, int size)
        /*!
         * Acquire a buffer for canvas.
         */
-       info->handle = livebox_acquire_buffer_NEW(info->id, info->is_pd,
+       info->handle = dynamicbox_acquire_buffer(info->id, info->is_gbar,
                                        width, height,
                                        event_handler_cb, info);
 
@@ -294,9 +294,9 @@ static void *alloc_fb(void *data, int size)
         * If it supports the H/W accelerated buffer,
         * Use it.
         */
-       if (livebox_support_hw_buffer(info->handle)) {
-               if (livebox_create_hw_buffer(info->handle) == 0) {
-                       buffer = livebox_buffer_hw_buffer(info->handle);
+       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;
@@ -310,7 +310,7 @@ static void *alloc_fb(void *data, int size)
        /*!
         * Or use the buffer of a S/W backend.
         */
-       buffer = livebox_ref_buffer(info->handle);
+       buffer = dynamicbox_ref_buffer(info->handle);
        LOGD("SW buffer is created\n");
        info->is_hw = 0;
        return buffer;
@@ -325,16 +325,16 @@ static void free_fb(void *data, void *ptr)
        }
 
        if (info->is_hw) {
-               if (livebox_destroy_hw_buffer(info->handle) == 0) {
+               if (dynamicbox_destroy_hw_buffer(info->handle) == 0) {
                        LOGD("HW Accelerated buffer is destroyed\n");
                        goto out;
                }
        }
 
-       livebox_unref_buffer(ptr);
+       dynamicbox_unref_buffer(ptr);
        LOGD("SW buffer is destroyed\n");
 out:
-       livebox_release_buffer(info->handle);
+       dynamicbox_release_buffer(info->handle);
        info->handle = NULL;
 }
 
@@ -347,7 +347,7 @@ static void pre_render_cb(void *data, Evas *e, void *event_info)
        }
 
        if (info->is_hw) {
-               livebox_buffer_pre_render(info->handle);
+               dynamicbox_buffer_pre_render(info->handle);
        }
 }
 
@@ -360,13 +360,13 @@ static void post_render_cb(void *data, Evas *e, void *event_info)
        }
 
        if (info->is_hw) {
-               livebox_buffer_post_render(info->handle);
+               dynamicbox_buffer_post_render(info->handle);
        } else {
-               livebox_sync_buffer(info->handle);
+               dynamicbox_sync_buffer(info->handle);
        }
 }
 
-PUBLIC Evas_Object *livebox_get_evas_object(const char *id, int is_pd)
+PUBLIC void *dynamicbox_get_evas_object(const char *id, int is_gbar)
 {
        struct info *info;
        Evas_Object *rect;
@@ -389,7 +389,7 @@ PUBLIC Evas_Object *livebox_get_evas_object(const char *id, int is_pd)
                return NULL;
        }
 
-       info->is_pd = is_pd;
+       info->is_gbar = is_gbar;
 
        info->ee = ecore_evas_buffer_allocfunc_new(1, 1, alloc_fb, free_fb, info);
        if (!info->ee) {