Remove porduct.h instead of it, use the @internal keyword
authorSung-jae Park <nicesj.park@samsung.com>
Mon, 11 Aug 2014 06:38:46 +0000 (15:38 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Mon, 11 Aug 2014 08:21:25 +0000 (17:21 +0900)
Replace PIXMAP with RESOURCE_ID
Pixmap is to tightly depends on Window Syste (eg, Xwindow)
So it should be replaced with RESOURCE_ID.

PD(Progressive Disclosure) is changed to GBAR (Glance Bar)

1. Replace ERROR_IO with ERROR_IO_ERROR, ERROR_INVALID with ERROR_INVALID_PARAMTER, ERROR_MEMORY, ERROR_OUT_OF_MEMORY
2. Add @since_tizen 2.3 tag
3. Replace "platform" level with "public" and mark it as "internal"
4. Remove livebox_doc.h
5. Add missing @brief tag
6. Replace "release_scroller" with "thaw_scroller"

Change-Id: Ic090e84431db607aa8e62badddfc887cd99a6743

CMakeLists.txt
doc/livebox_doc.h [deleted file]
include/dynamicbox.h
include/dynamicbox_product.h [deleted file]
packaging/liblivebox.spec
src/dynamicbox.c

index 10d1d0a..ece6c6a 100644 (file)
@@ -81,7 +81,6 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox.h DESTINATION include/${PROJEC
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox_product.h DESTINATION include/${PROJECT_NAME})
 
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/dynamicbox.h DESTINATION include/dynamicbox)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/dynamicbox_product.h DESTINATION include/dynamicbox)
 
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}")
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "libdynamicbox")
diff --git a/doc/livebox_doc.h b/doc/livebox_doc.h
deleted file mode 100644 (file)
index cc4d5c6..0000000
+++ /dev/null
@@ -1,90 +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_DOC_H__
-#define __LIVEBOX_DOC_H__
-
-/**
- * @defgroup DYNAMICBOX_UTILITY_MODULE dynamicbox
- * @brief Supports APIs for development of inhouse dynamic box
- * @ingroup CAPI_DYNAMICBOX_FRAMEWORK 
- * @section DYNAMICBOX_UTILITY_MODULE_HEADER Required Header
- *   \#include <livebox.h>
- * @section DYNAMICBOX_UTILITY_MODULE_OVERVIEW Overview
-<H1>Dynamic Box Utility functions</H1>
-
-<H2>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.
-It is called "Description Data Syntax"
-
-To generate it you have to use following functions.
-
-@code
-struct livebox_desc *desc_handle;
-int idx;
-
-desc_handle = livebox_desc_open(id, 0);
-if (!desc_handle) {
-       // Error
-}
-
-livebox_desc_set_size(desc_handle, id, 720, 360);
-
-// Loads sub-layout object into main layout
-idx = livebox_desc_add_block(desc_handle, NULL, LB_DESC_TYPE_SCRIPT, "sub,layout", "/usr/apps/com.samsung.my-app/shared/res/dbox.edj", "sub,group");
-livebox_desc_set_id(desc_handle, idx, "sub,layout");
-
-// Set a text for sub-layout object
-livebox_desc_add_block(desc_handle, "sub,layout", LB_DESC_TYPE_TEXT, "sub,layout,text", "Hello World", NULL);
-
-// Flushes changes, the content will be changed after close this handle.
-livebox_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.
-
-<H2>Window type Dynamic Box</H2>
-
-@code
-Evas_Object *parent;
-Evas_Object *win;
-
-parent = livebox_get_evas_object(id, 0);
-if (!parent) {
-       // Error
-}
-
-win = elm_win_add(parent, "Dynamic Box Window", ELM_WIN_DYNAMIC_BOX);
-evas_object_del(parent);
-if (!win) {
-       // Error
-}
-@endcode
-
-To create a window for dynamic box,
-You have to get the parent object using livebox_get_evas_object().
-And after creates a window for dynamic box, you have to delete the parent object.
-Its attributes will be passed to the newly created window. So you don't need keep the parent object anymore.
-You should delete it after create a window.
-
- */
-
-#endif /* __LIVEBOX_DOC_H__ */
index 0ad2811..130d25d 100644 (file)
@@ -26,6 +26,7 @@ extern "C" {
 /**
  * @file dynamicbox.h
  * @brief This file declares API of libdynamicbox library
+ * @since_tizen 2.3
  */
 
 /**
@@ -35,77 +36,92 @@ extern "C" {
 
 /**
  * @brief Definition for COLOR BLOCK.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_TYPE_COLOR "color"
 
 /**
  * @brief Definition for TEXT BLOCK.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_TYPE_TEXT "text"
 
 /**
  * @brief Definition for IMAGE BLOCK.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_TYPE_IMAGE "image"
 
 /**
  * @brief Definition for SIGNAL BLOCK.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_TYPE_SIGNAL "signal"
 
 /**
  * @brief Definition for INFO BLOCK.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_TYPE_INFO "info"
 
 /**
  * @brief Definition for DRAG BLOCK.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_TYPE_DRAG "drag"
 
 /**
  * @brief Definition for SCRIPT SCRIPT.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_TYPE_SCRIPT "script"
 
 /**
  * @brief Definition for ACCESSIBILITY INFORMATION BLOCK.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_TYPE_ACCESS "access"
 
 /**
  * @brief Definition for accessibility operation.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_TYPE_ACCESS_OPERATION        "access,operation"
 
 /**
  * @brief Definition for set highlight on specified part.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_SET "set,hl"
 
 /**
  * @brief Definition for remove highlight from specified part.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_UNSET "unset,hl"
 
 /**
  * @brief Definition for move the highlight to next part.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_NEXT "next,hl"
 
 /**
  * @brief Definition for move the highlight to previous part.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_PREV "prev,hl"
 
 /**
  * @brief Definition for reset the chain of accessibility highlight list.
+ * @since_tizen 2.3
  */
 #define DBOX_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.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_OPTION_ACCESS_HL_LOOP "cycle"
 
@@ -113,19 +129,22 @@ extern "C" {
  * @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.
+ * @since_tizen 2.3
  */
 #define DBOX_DESC_OPTION_ACCESS_HL_NOLOOP "no,cycle"
 
 /**
  * @brief Dynamic Box description data handle.
+ * @since_tizen 2.3
  */
 struct dynamicbox_desc;
 
 /**
  * @brief Updates a description file.
+ * @since_tizen 2.3
  * @remarks Must be used only by Inhouse Dynamic Box.
- * @param[in] filename
- * @param[in] for_pd
+ * @param[in] id Dynamic Box Instance Id
+ * @param[in] gbar 1 for Glance Bar or 0
  * @privlevel public
  * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
  * @return Handle of desc instance
@@ -133,18 +152,19 @@ 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 *filename, int for_pd);
+extern struct dynamicbox_desc *dynamicbox_desc_open(const char *id, int gbar);
 
 /**
  * @brief Completes the description file update.
- * @details Only if this API is called, the description data will be applied to the content of Dynamic Box (or PD).
+ * @details Only if this API is called, the description data will be applied to the content of Dynamic Box (or GBar).
+ * @since_tizen 2.3
  * @remarks Must be used only by Inhouse Dynamic Box.
  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
  * @privlevel public
  * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
  * @return int type
  * @retval #DBOX_STATUS_ERROR_NONE If the flushing description data is successfully done
- * @retval #DBOX_STATUS_ERROR_INVALID If the given handle is not valid
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER If the given handle is not valid
  * @pre Handle must be created by dynamicbox_desc_open()
  * @post Handle must not be used after return from this function.
  * @see dynamicbox_desc_open()
@@ -154,13 +174,13 @@ extern int dynamicbox_desc_close(struct dynamicbox_desc *handle);
 /**
  * @brief Sets the category information of current description data.
  * @details Creates a new description block for updating category information of layout object.
+ * @since_tizen 2.3
  * @param[in] handle Handle which is created by dynamicbox_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 #DBOX_STATUS_ERROR_INVALID Invalid handle
- * @retval #DBOX_STATUS_ERROR_MEMORY Memory is not enough to add this block
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid handle
+ * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Memory is not enough to add this block
  * @retval index Index(>=0) of added block, which can be used by dynamicbox_desc_set_id()
  * @pre Must be called after create a handle using dynamicbox_desc_open()
  * @see dynamicbox_desc_set_id()
@@ -170,14 +190,14 @@ extern int dynamicbox_desc_set_category(struct dynamicbox_desc *handle, const ch
 /**
  * @brief Sets the content size.
  * @details Sets the content size of layout.
+ * @since_tizen 2.3
  * @param[in] handle Handle which is created by dynamicbox_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 #DBOX_STATUS_ERROR_INVALID Invalid argument
- * @retval #DBOX_STATUS_ERROR_MEMORY Not enough memory to add a new block
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory to add a new block
  * @retval index Index(>=0) of added block Successfully added
  * @see dynamicbox_desc_open()
  * @see dynamicbox_desc_set_id()
@@ -187,13 +207,13 @@ extern int dynamicbox_desc_set_size(struct dynamicbox_desc *handle, const char *
 /**
  * @brief Sets the target id of the given block.
  * @details Only available for the script block.
+ * @since_tizen 2.3
  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
  * @param[in] idx Index of target block
  * @param[in] id Id String which will be used by other dynamicbox_desc_XXX functions
- * @privlevel N/P
  * @return int type
  * @retval #DBOX_STATUS_ERROR_NONE Id is successfully updated for given idx of desc block
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid argument
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
  * @retval #DBOX_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 dynamicbox_desc_XXXX functions.
@@ -204,16 +224,16 @@ extern int dynamicbox_desc_set_id(struct dynamicbox_desc *handle, int idx, const
 
 /**
  * @brief Adds a new block.
+ * @since_tizen 2.3
  * @param[in] handle Handle which is created by the dynamicbox_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 #DBOX_STATUS_ERROR_INVALID Invalid argument
- * @retval #DBOX_STATUS_ERROR_MEMORY Not enough memory to add a new desc block
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory to add a new desc block
  * @retval index Index(>=0) of added desc block
  * @pre Handle must be created using dynamicbox_desc_open.
  * @see dynamicbox_desc_set_id()
@@ -223,10 +243,10 @@ extern int dynamicbox_desc_add_block(struct dynamicbox_desc *handle, const char
 
 /**
  * @brief Deletes an added block.
+ * @since_tizen 2.3
  * @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 dynamicbox_desc_open() function
  * @param[in] idx Index of added block, returned from dynamicbox_desc_add_block(), dynamicbox_desc_set_size(), dynamicbox_desc_set_category(), etc
- * @privlevel N/P
  * @return int type
  * @retval #DBOX_STATUS_ERROR_NONE Successfully deleted
  * @retval #DBOX_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
@@ -239,15 +259,16 @@ extern int dynamicbox_desc_del_block(struct dynamicbox_desc *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.
+ * @since_tizen 2.3
  * @param[in] id Instance Id
- * @param[in] is_pd 1 if this object is created for PD or 0 (for LB)
+ * @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
  * @retval Address Valid evas object
  * @retval @c NULL failed to create
  */
-extern Evas_Object *dynamicbox_get_evas_object(const char *id, int is_pd);
+extern Evas_Object *dynamicbox_get_evas_object(const char *id, int gbar);
 
 /**
  * @brief Set extra information for updated content.
@@ -256,21 +277,564 @@ extern Evas_Object *dynamicbox_get_evas_object(const char *id, int is_pd);
  *      such as title, icon and name, this function can set them.
  *      provider will send those information to the viewer when the
  *      content is updated.
+ * @since_tizen 2.3
  * @remarks This function only works with the buffer type inhouse provider.
  * @param[in] id Dynamic Box Instance Id
  * @param[in] content Content string that will pass to a Dynamic Box via dynamicbox_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 #DBOX_STATUS_ERROR_MEMORY Out of memory
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid parameters
+ * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
  * @retval #DBOX_STATUS_ERROR_FAULT Unrecoverable error
  * @retval #DBOX_STATUS_ERROR_NONE Successfully sent
  */
 extern int dynamicbox_set_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name);
 
+
+/**
+ * @internal
+ * @brief Structure for a Dynamic Box buffer defined by a provider.
+ * @since_tizen 2.3
+ */
+struct dynamicbox_buffer;
+
+/**
+ * @internal
+ * @brief Return values of dynamicbox programming interfaces: Operation is successfully done.
+ * @since_tizen 2.3
+ */
+extern const int DONE;
+
+/**
+ * @internal
+ * @brief Return values of dynamicbox programming interfaces: Contents are updated.
+ * @since_tizen 2.3
+ */
+extern const int 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;
+
+/**
+ * @internal
+ * @brief Return values of dynamicbox programming interfaces: Need to do force update.
+ * @since_tizen 2.3
+ */
+extern const int 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;
+
+/**
+ * @internal
+ * @brief Return values of dynamicbox programming interfaces: Need to destroy this instance.
+ * @since_tizen 2.3
+ */
+extern const int NEED_TO_DESTROY;
+
+/**
+ * @internal
+ * @brief Return values of dynamicbox programming interfaces: Need to update.
+ * @since_tizen 2.3
+ */
+extern const int NEED_TO_UPDATE;
+
+/**
+ * @internal
+ * @brief Return values of dynamicbox programming interfaces: Using network.
+ * @since_tizen 2.3
+ */
+extern const int USE_NET;
+
+/**
+ * @internal
+ * @brief System event type: System font is changed.
+ * @since_tizen 2.3
+ */
+extern const int DBOX_SYS_EVENT_FONT_CHANGED;
+
+/**
+ * @internal
+ * @brief System event type: System language is changed.
+ * @since_tizen 2.3
+ */
+extern const int DBOX_SYS_EVENT_LANG_CHANGED;
+
+/**
+ * @internal
+ * @brief System event type: System time is changed.
+ * @since_tizen 2.3
+ */
+extern const int DBOX_SYS_EVENT_TIME_CHANGED;
+
+/**
+ * @internal
+ * @brief System event type: Region changed.
+ * @since_tizen 2.3
+ */
+extern const int DBOX_SYS_EVENT_REGION_CHANGED;
+
+/**
+ * @internal
+ * @brief System event type: Dynamic Box is paused.
+ * @since_tizen 2.3
+ */
+extern const int DBOX_SYS_EVENT_PAUSED;
+
+/**
+ * @internal
+ * @brief System event type: Dynamic Box is resumed.
+ * @since_tizen 2.3
+ */
+extern const int DBOX_SYS_EVENT_RESUMED;
+
+/**
+ * @internal
+ * @brief System event type: MMC Status change event.
+ * @since_tizen 2.3
+ */
+extern const int DBOX_SYS_EVENT_MMC_STATUS_CHANGED;
+
+/**
+ * @internal
+ * @brief System event type: Dynamic Box instance is removed from a viewer.
+ * @since_tizen 2.3
+ */
+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.
+ * @since_tizen 2.3
+ * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
+ * @param[in] gbar 1 for updating content of Glance Bar or 0(for content of Dynamic Box)
+ * @return int type
+ * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #DBOX_STATUS_ERROR_IO_ERROR I/O failed, Cannot access given resource file(id)
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully notified
+ * @pre This API only can be used after loaded into the data-provider-slave process.
+ */
+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 */
+};
+
+/**
+ * @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 dbox_input_data {
+               struct dbox_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;
+
+               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
+ * @param[in] gbar 1 for Glance Bar or 0 for Dynamic Box
+ * @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 public
+ * @privilege %http://tizen.org/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 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);
+
+/**
+ * @internal
+ * @brief Acquires the Id of Resource (window system).
+ * @details Only if the provider uses Resource for providing render buffer.
+ * @since_tizen 2.3
+ * @remarks Pixmap Id can be destroyed if you call the dynamicbox_release_buffer(). Then this Resource Id is not guaranteed to use.
+ * @param[in] handle Buffer handle
+ * @return unsigned int Resource Id
+ * @retval >0 Resource Id
+ * @retval 0 Failed to get Resource Id
+ * @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);
+
+/**
+ * @internal
+ * @brief Releases the buffer of dynamicbox.
+ * @since_tizen 2.3
+ * @param[in] handle Buffer handle
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return int type
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully released
+ * @pre Handle must be created using dynamicbox_acquire_buffer().
+ * @see dynamicbox_acquire_buffer()
+ */
+extern int dynamicbox_release_buffer(struct dynamicbox_buffer *handle);
+
+/**
+ * @internal
+ * @brief Gets the address of buffer for S/W rendering.
+ * @details If you try to use this, after dynamicbox_create_hw_buffer(), you will get @c NULL.
+ * @since_tizen 2.3
+ * @param[in] handle Buffer handle
+ * @privlevel public
+ * @privilege %http://tizen.org/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 dynamicbox_unref_buffer()
+ */
+extern void *dynamicbox_ref_buffer(struct dynamicbox_buffer *handle);
+
+/**
+ * @internal
+ * @brief Releases the S/W render buffer.
+ * @since_tizen 2.3
+ * @param[in] buffer Address of render buffer
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return int type
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid handle
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully unreference
+ * @pre dynamicbox_ref_buffer() must be called.
+ * @see dynamicbox_ref_buffer()
+ */
+extern int dynamicbox_unref_buffer(void *buffer);
+
+/**
+ * @internal
+ * @brief Synchronizes the updated buffer.
+ * @details This is only needed for non-H/W accelerated buffer.
+ * @since_tizen 2.3
+ * @param[in] handle Buffer handle
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return int type
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully sync'd
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @see dynamicbox_acquire_buffer()
+ */
+extern int dynamicbox_sync_buffer(struct dynamicbox_buffer *handle);
+
+/**
+ * @internal
+ * @brief Requests to schedule the update operation to a provider.
+ * @since_tizen 2.3
+ * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return If succes returns 0 or return less than 0
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully triggered
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory
+ * @retval #DBOX_STATUS_ERROR_NOT_EXIST Given id instance is not exist
+ */
+extern int dynamicbox_request_update(const char *id);
+
+/**
+ * @internal
+ * @brief Checks whether the dynamicbox supports H/W acceleration or not.
+ * @since_tizen 2.3
+ * @param[in] handle Buffer handle
+ * @return int type
+ * @retval 1 If the buffer handle support the H/W acceleration buffer
+ * @retval 0 If it doesn not supported
+ * @see dynamicbox_acquire_buffer()
+ */
+extern int dynamicbox_support_hw_buffer(struct dynamicbox_buffer *handle);
+
+/**
+ * @internal
+ * @brief Creates the H/W accelerated buffer.
+ * @since_tizen 2.3
+ * @param[in] handle Buffer handle
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return int type
+ * @retval #DBOX_STATUS_ERROR_ALREADY H/W buffer is already created
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #DBOX_STATUS_ERROR_NONE 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 dynamicbox_support_hw_buffer()
+ */
+extern int dynamicbox_create_hw_buffer(struct dynamicbox_buffer *handle);
+
+/**
+ * @internal
+ * @brief Destroys the H/W accelerated buffer.
+ * @since_tizen 2.3
+ * @param[in] handle Buffer handle
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return int type
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully destroyed
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @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);
+
+/**
+ * @internal
+ * @brief Gets the address of the accelerated H/W buffer.
+ * @since_tizen 2.3
+ * @param[in] handle Buffer handle
+ * @privlevel public
+ * @privilege %http://tizen.org/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 dynamicbox_create_hw_buffer()
+ */
+extern void *dynamicbox_buffer_hw_buffer(struct dynamicbox_buffer *handle);
+
+/**
+ * @internal
+ * @brief Get the stride information from the buffer info
+ * @since_tizen 2.3
+ * @param[in] handle Buffer handle
+ * @return int stride size
+ * @retval positive_value length of stride
+ * @return DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @return DBOX_STATUS_ERROR_FAULT Unrecoverable error
+ * @see dynamicbox_create_hw_buffer()
+ */
+extern int dynamicbox_buffer_stride(struct dynamicbox_buffer *handle);
+
+/**
+ * @internal
+ * @brief Pre-processes for rendering content.
+ * @details This is only needed for accessing H/W accelerated buffer.
+ * @since_tizen 2.3
+ * @param[in] handle Buffer handle
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return int type
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid handle
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully done
+ * @post dynamicbox_buffer_post_render must be called after the rendering (accessing buffer) is completed.
+ * @see dynamicbox_support_hw_buffer()
+ * @see dynamicbox_buffer_post_render()
+ */
+extern int dynamicbox_buffer_pre_render(struct dynamicbox_buffer *handle);
+
+/**
+ * @internal
+ * @brief Post-processes for rendering content.
+ * @since_tizen 2.3
+ * @param[in] handle Buffer handle
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return If succes returns 0 or return less than 0
+ * @retval #DBOX_STATUS_ERROR_NONE If succeed
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @pre dynamicbox_buffer_pre_render must be called.
+ * @see dynamicbox_support_hw_buffer()
+ * @see dynamicbox_buffer_pre_render()
+ */
+extern int dynamicbox_buffer_post_render(struct dynamicbox_buffer *handle);
+
+/**
+ * @internal
+ * @brief Sends a request to the viewer (homescreen) to close the GBar.
+ * @details Even though you call this function. the homescreen can ignore it.
+ * @since_tizen 2.3
+ * @param[in] dboxid Dynamic Box Package Id
+ * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
+ * @param[in] reason DBOX_STATUS_ERROR_NONE(0)
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return int type
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #DBOX_STATUS_ERROR_FAULT Failed to send a request
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
+ */
+extern int dynamicbox_request_close_gbar(const char *dboxid, const char *id, int reason);
+
+/**
+ * @internal
+ * @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 dynamicbox.
+ * @since_tizen 2.3
+ * @remarks If the viewer doesn't care this request, this will has no effect.
+ * @param[in] dboxid Dynamic Box Package Id
+ * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return int type
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #DBOX_STATUS_ERROR_FAULT Failed to send requet
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
+ * @see dynamicbox_release_scroller()
+ */
+extern int dynamicbox_freeze_scroller(const char *dboxid, const char *id);
+
+/**
+ * @internal
+ * @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 dynamicbox.
+ * @since_tizen 2.3
+ * @remarks If the viewer doesn't care this request, this will has no effect.
+ * @param[in] dboxid Dynamic Box Package Id
+ * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/core/dynamicbox.provider
+ * @return int type
+ * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #DBOX_STATUS_ERROR_FAULT Failed to send requet
+ * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
+ * @see dynamicbox_freeze_scroller()
+ */
+extern int dynamicbox_thaw_scroller(const char *dboxid, const char *id);
+
+/**
+ * @internal
+ * @brief Get the configuration value for premultiplied alpha.
+ * @details
+ *     If the system uses the premultiplied alpha for content,
+ *     This function will returns 1.
+ * @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.
+ */
+extern int dynamicbox_conf_premultiplied_alpha(void);
+
+/**
+ * @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.
+ * @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.
+ */
+extern int dynamicbox_conf_auto_align(void);
+
 /**
  * @}
  */
diff --git a/include/dynamicbox_product.h b/include/dynamicbox_product.h
deleted file mode 100644 (file)
index 1a9bc54..0000000
+++ /dev/null
@@ -1,454 +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 __DYNAMICBOX_UTILITY_PRODUCT_H
-#define __DYNAMICBOX_UTILITY_PRODUCT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file dynamicbox_product.h
- * @brief This file declares API of libdynamicbox library for product
- */
-
-/**
- * @addtogroup CAPI_LIVEBOX_HELPER_PRODUCT_MODULE
- * @{
- */
-
-/**
- * @brief Structure for a Dynamic Box buffer defined by a provider.
- */
-struct dynamicbox_buffer;
-
-extern const int DONE;/**<Return values of dynamicbox programming interfaces: Operation is successfully done.*/
-
-extern const int OUTPUT_UPDATED;/**<Return values of dynamicbox programming interfaces: Contents are updated.*/
-
-extern const int NEED_TO_SCHEDULE;/**<Return values of dynamicbox programming interfaces: Need to call the dynamicbox_need_to_update and dynamicbox_update_content.*/
-
-extern const int FORCE_TO_SCHEDULE;/**<Return values of dynamicbox programming interfaces: Need to do force update.*/
-
-extern const int NEED_TO_CREATE;/**<Return values of dynamicbox programming interfaces: Need to create a new instance.*/
-
-extern const int NEED_TO_DESTROY;/**<Return values of dynamicbox programming interfaces: Need to destroy this instance.*/
-
-extern const int NEED_TO_UPDATE;/**<Return values of dynamicbox programming interfaces: Need to update.*/
-
-extern const int USE_NET;/**<Return values of dynamicbox programming interfaces: Using network.*/
-
-extern const int DBOX_SYS_EVENT_FONT_CHANGED;/**<System event type: System font is changed.*/
-
-extern const int DBOX_SYS_EVENT_LANG_CHANGED;/**<System event type: System language is changed.*/
-
-extern const int DBOX_SYS_EVENT_TIME_CHANGED;/**<System event type: System time is changed.*/
-
-extern const int DBOX_SYS_EVENT_REGION_CHANGED;/**<System event type: Region changed.*/
-
-extern const int DBOX_SYS_EVENT_PAUSED;/**<System event type: Dynamic Box is paused.*/
-
-extern const int DBOX_SYS_EVENT_RESUMED;/**<System event type: Dynamic Box is resumed.*/
-
-extern const int DBOX_SYS_EVENT_MMC_STATUS_CHANGED;/**<System event type: MMC Status change event.*/
-
-extern const int DBOX_SYS_EVENT_DELETED;/**<System event type: Dynamic Box instance is removed from a viewer.*/
-
-/**
- * @brief Structure for extra event information for dynamicbox_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 dynamicbox_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 #DBOX_STATUS_ERROR_MEMORY Not enough memory
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid argument
- * @retval #DBOX_STATUS_ERROR_IO I/O failed, Cannot access given resource file(id)
- * @retval #DBOX_STATUS_ERROR_NONE Successfully notified
- * @pre This API only can be used after loaded into the data-provider-slave process.
- */
-extern int dynamicbox_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 *dynamicbox_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 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 */
-};
-
-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;
-
-               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 dynamicbox_XXXX interface functions
- * @param[in] is_pd 1 for PD or 0 for dynamicbox
- * @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 dynamicbox_release_buffer().
- * @see dynamicbox_acquire_buffer()
- */
-extern struct dynamicbox_buffer *dynamicbox_acquire_buffer(const char *id, 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);
-
-/**
- * @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 dynamicbox_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 dynamicbox_acquire_buffer()
- */
-extern unsigned long dynamicbox_pixmap_id(struct dynamicbox_buffer *handle);
-
-/**
- * @brief Releases the buffer of dynamicbox.
- * @param[in] handle Buffer handle
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid argument
- * @retval #DBOX_STATUS_ERROR_NONE Successfully released
- * @pre Handle must be created using dynamicbox_acquire_buffer().
- * @see dynamicbox_acquire_buffer()
- */
-extern int dynamicbox_release_buffer(struct dynamicbox_buffer *handle);
-
-/**
- * @brief Gets the address of S/W render buffer.
- * @details If you try to use this, after dynamicbox_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 dynamicbox_unref_buffer()
- */
-extern void *dynamicbox_ref_buffer(struct dynamicbox_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 #DBOX_STATUS_ERROR_INVALID Invalid handle
- * @retval #DBOX_STATUS_ERROR_NONE Successfully unreference
- * @pre dynamicbox_ref_buffer() must be called.
- * @see dynamicbox_ref_buffer()
- */
-extern int dynamicbox_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 #DBOX_STATUS_ERROR_NONE Successfully sync'd
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid argument
- * @see dynamicbox_acquire_buffer()
- */
-extern int dynamicbox_sync_buffer(struct dynamicbox_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 dynamicbox_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 #DBOX_STATUS_ERROR_NONE Successfully triggered
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid argument
- * @retval #DBOX_STATUS_ERROR_MEMORY Not enough memory
- * @retval #DBOX_STATUS_ERROR_NOT_EXIST Given id instance is not exist
- */
-extern int dynamicbox_request_update(const char *id);
-
-/**
- * @brief Checks whether the dynamicbox 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 dynamicbox_acquire_buffer()
- */
-extern int dynamicbox_support_hw_buffer(struct dynamicbox_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 #DBOX_STATUS_ERROR_ALREADY H/W buffer is already created
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid argument
- * @retval #DBOX_STATUS_ERROR_NONE 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 dynamicbox_support_hw_buffer()
- */
-extern int dynamicbox_create_hw_buffer(struct dynamicbox_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 #DBOX_STATUS_ERROR_NONE Successfully destroyed
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid argument
- * @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);
-
-/**
- * @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 dynamicbox_create_hw_buffer()
- */
-extern void *dynamicbox_buffer_hw_buffer(struct dynamicbox_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 DBOX_STATUS_ERROR_INVALID Invalid parameter
- * @return DBOX_STATUS_ERROR_FAULT Unrecoverable error
- * @see dynamicbox_create_hw_buffer()
- */
-extern int dynamicbox_buffer_stride(struct dynamicbox_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 #DBOX_STATUS_ERROR_INVALID Invalid handle
- * @retval #DBOX_STATUS_ERROR_NONE Successfully done
- * @post dynamicbox_buffer_post_render must be called after the rendering (accessing buffer) is completed.
- * @see dynamicbox_support_hw_buffer()
- * @see dynamicbox_buffer_post_render()
- */
-extern int dynamicbox_buffer_pre_render(struct dynamicbox_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 #DBOX_STATUS_ERROR_NONE If succeed
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid argument
- * @pre dynamicbox_buffer_pre_render must be called.
- * @see dynamicbox_support_hw_buffer()
- * @see dynamicbox_buffer_pre_render()
- */
-extern int dynamicbox_buffer_post_render(struct dynamicbox_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] dboxid Dynamic Box Package Id
- * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
- * @param[in] reason DBOX_STATUS_ERROR_NONE(0)
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid parameters
- * @retval #DBOX_STATUS_ERROR_MEMORY Out of memory
- * @retval #DBOX_STATUS_ERROR_FAULT Failed to send a request
- * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
- */
-extern int dynamicbox_request_close_pd(const char *dboxid, 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 dynamicbox.
- * @remarks If the viewer doesn't care this request, this will has no effect.
- * @param[in] dboxid Dynamic Box Package Id
- * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid parameters
- * @retval #DBOX_STATUS_ERROR_MEMORY Out of memory
- * @retval #DBOX_STATUS_ERROR_FAULT Failed to send requet
- * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
- * @see dynamicbox_release_scroller()
- */
-extern int dynamicbox_freeze_scroller(const char *dboxid, 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 dynamicbox.
- * @remarks If the viewer doesn't care this request, this will has no effect.
- * @param[in] dboxid Dynamic Box Package Id
- * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
- * @privlevel platform
- * @privilege %http://developer.samsung.com/privilege/core/dynamicbox.provider
- * @return int type
- * @retval #DBOX_STATUS_ERROR_INVALID Invalid parameters
- * @retval #DBOX_STATUS_ERROR_MEMORY Out of memory
- * @retval #DBOX_STATUS_ERROR_FAULT Failed to send requet
- * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
- * @see dynamicbox_freeze_scroller()
- */
-extern int dynamicbox_release_scroller(const char *dboxid, 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 dynamicbox_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 dynamicbox will automatically aligning the buffer.
- * @privlevel N/P
- * @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.
- */
-extern int dynamicbox_conf_auto_align(void);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* End of a file */
index 3269f30..0283a70 100644 (file)
@@ -86,6 +86,5 @@ mkdir -p %{buildroot}/%{_datarootdir}/license
 %{_libdir}/pkgconfig/*.pc
 
 %{_includedir}/dynamicbox/dynamicbox.h
-%{_includedir}/dynamicbox/dynamicbox_product.h
 
 # End of a file
index 5336b1f..ddf63e9 100644 (file)
 #include <livebox-service.h>
 
 #include "debug.h"
-#include "dynamicbox.h"
 #include "dlist.h"
 #include "util.h"
+#include "livebox_product.h"
+#include "livebox.h"
+#include "dynamicbox.h"
 
 #define PUBLIC __attribute__((visibility("default")))
 
@@ -129,23 +131,6 @@ struct conf {
        int use_event_time;
 };
 
-/*!
- * \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);
-       struct conf *conf;
-} s_info = {
-       .find_pkgname = NULL,
-       .request_update_by_id = NULL,
-       .trigger_update_monitor = NULL,
-       .update_extra_info = NULL,
-       .conf = NULL,
-};
-
 struct block {
        unsigned int idx;
 
@@ -201,7 +186,7 @@ PUBLIC const int DBOX_SYS_EVENT_DELETED = 0x0800;
 
 PUBLIC struct dynamicbox_desc *dynamicbox_desc_open(const char *filename, int for_pd)
 {
-       return livebox_desc_open(filename, for_pd);
+       return (struct dynamicbox_desc *)livebox_desc_open(filename, for_pd);
 }
 
 PUBLIC int dynamicbox_desc_close(struct dynamicbox_desc *handle)
@@ -245,7 +230,7 @@ PUBLIC int dynamicbox_desc_del_block(struct dynamicbox_desc *handle, int idx)
 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)
 {
        typedef int (*handler_t)(struct livebox_buffer *, struct buffer_event_data *, void *);
-       return livebox_acquire_buffer(filename, is_pd, width, height, pixels, auto_align, (handler_t)handler, data);
+       return (struct dynamicbox_buffer *)livebox_acquire_buffer(filename, is_pd, width, height, pixels, auto_align, (handler_t)handler, data);
 }
 
 PUBLIC int dynamicbox_request_update(const char *filename)
@@ -263,9 +248,9 @@ PUBLIC int dynamicbox_conf_premultiplied_alpha(void)
        return livebox_conf_premultiplied_alpha();
 }
 
-PUBLIC unsigned long dynamicbox_pixmap_id(struct dynamicbox_buffer *handle)
+PUBLIC unsigned int dynamicbox_resource_id(struct dynamicbox_buffer *handle)
 {
-       return livebox_pixmap_id((struct livebox_buffer *)handle);
+       return (unsigned int)livebox_pixmap_id((struct livebox_buffer *)handle);
 }
 
 PUBLIC int dynamicbox_release_buffer(struct dynamicbox_buffer *handle)
@@ -338,7 +323,7 @@ PUBLIC int dynamicbox_freeze_scroller(const char *pkgname, const char *id)
        return livebox_freeze_scroller(pkgname, id);
 }
 
-PUBLIC int dynamicbox_release_scroller(const char *pkgname, const char *id)
+PUBLIC int dynamicbox_thaw_scroller(const char *pkgname, const char *id)
 {
        return livebox_release_scroller(pkgname, id);
 }