@endcode
To create a window for widget,
-You have to get the parent object using widget_get_evas_object().
+You have to get the parent object using widget_get_evas().
And after creating a window for widget, 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.
*/
#include <widget_service.h>
+#include <Evas.h>
+#include <Ecore.h>
#ifndef __WIDGET_UILITY_H
#define __WIDGET_UILITY_H
*/
/**
- * @brief Event information type for widget_content_event()
- * @details definition is in widget_service.h file
- * @since_tizen 2.4
- */
-typedef struct widget_event_info *widget_event_info_t;
-
-/**
- * @brief Creates an evas to draw widget contents
+ * @brief Creates an Evas to draw widget contents
* @details Creating a new Object using widget frame buffer.
* @since_tizen 2.4
* @param[in] id Instance Id
- * @param[in] gbar 1 if this object is created for Glance Bar or 0 (for widget)
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
- * @return void* Object type
- * @retval Address Valid evas object
- * @retval @c NULL failed to create, widget_last_status() will returns reason of failure
- */
-extern void *widget_get_evas(const char *id, int gbar);
-
-/**
- * @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.
- * @since_tizen 2.4
- * @privlevel N/P
- * @feature http://tizen.org/feature/shell.appwidget
- * @remarks This function only works with the buffer type inhouse provider.
- * @param[in] id widget Instance Id
- * @param[in] content Content string that will pass to a widget via widget_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
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
- * @retval #WIDGET_STATUS_ERROR_FAULT Unrecoverable error
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully sent
- */
-extern int widget_set_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name);
-
-/**
- * @brief Return values of widget programming interfaces: Operation is successfully done.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_DONE;
-
-/**
- * @brief Return values of widget programming interfaces: Contents are updated.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_OUTPUT_UPDATED;
-
-/**
- * @brief Return values of widget programming interfaces: Need to call the widget_need_to_update and widget_update_content.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_NEED_TO_SCHEDULE;
-
-/**
- * @internal
- * @brief Return values of widget programming interfaces: Need to create a new instance.
- * @since_tizen 2.4
- */
-extern const int WIDGET_NEED_TO_CREATE;
-
-/**
- * @brief Return values of widget programming interfaces: Need to do force update.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_FORCE_TO_SCHEDULE;
-
-/**
- * @brief Return values of widget programming interfaces: Need to destroy this instance.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_NEED_TO_DESTROY;
-
-/**
- * @brief Return values of widget programming interfaces: Need to update.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_NEED_TO_UPDATE;
-
-/**
- * @brief System event type: System font is changed.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_SYS_EVENT_FONT_CHANGED;
-
-/**
- * @brief System event type: System language is changed.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_SYS_EVENT_LANG_CHANGED;
-
-/**
- * @brief System event type: System time is changed.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_SYS_EVENT_TIME_CHANGED;
-
-/**
- * @brief System event type: MMC Status change event.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_SYS_EVENT_MMC_STATUS_CHANGED;
-
-/**
- * @brief System event type: Region changed.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_SYS_EVENT_REGION_CHANGED;
-
-/**
- * @brief System event type: Accessibility mode changed.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_SYS_EVENT_TTS_CHANGED;
-
-/**
- * @brief System event type: widget is paused.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
+ * @return instance of Evas
+ * @retval Valid pointer of Evas instance on success,
+ * @retval @c NULL failed to create, get_last_result() will returns reason of failure
*/
-extern const int WIDGET_SYS_EVENT_PAUSED;
-
-/**
- * @brief System event type: widget is resumed.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_SYS_EVENT_RESUMED;
-
-/**
- * @brief System event type: widget instance is removed from a viewer.
- * @since_tizen 2.4
- * @feature http://tizen.org/feature/shell.appwidget
- */
-extern const int WIDGET_SYS_EVENT_DELETED;
+extern Evas *widget_get_evas(const char *id);
/**
* @brief Requests to schedule the update operation to a provider.
- * Your widget will get the update request, if the @a id is specified, specific box only will get it.
+ * @detail Insert a update event to event queue and it will be handled by update callback function.
* @since_tizen 2.4
* @param[in] id Instance Id which is passed to you via the first parameter of every widget_XXXX interface functions
* @feature http://tizen.org/feature/shell.appwidget
* @return If succes returns 0 or return less than 0
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully triggered
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
- * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Not enough memory
- * @retval #WIDGET_STATUS_ERROR_NOT_EXIST Given id instance is not exist
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_DISABLED in case of direct request for updating is disabled
+ * @retval #WIDGET_ERROR_NONE Successfully triggered
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #WIDGET_ERROR_OUT_OF_MEMORY Not enough memory
+ * @retval #WIDGET_ERROR_NOT_EXIST Given id instance is not exist
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_DISABLED in case of direct request for updating is disabled
*/
extern int widget_request_update(const char *id);
/**
- * @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 widget.
- * @since_tizen 2.4
- * @remarks If the viewer doesn't care this request, this will has no effect.
- * @param[in] widgetid widget Package Id
- * @param[in] id Instance Id which is passed to you via the first parameter of every widget_XXXX interface functions
- * @privlevel public
- * @privilege %http://tizen.org/privilege/widget.provider
- * @feature http://tizen.org/feature/shell.appwidget
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
- * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_FAULT Failed to send requet
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully requested
- * @see widget_release_scroller()
- */
-extern int widget_freeze_scroller(const char *widgetid, 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 widget.
- * @since_tizen 2.4
- * @remarks If the viewer doesn't care this request, this will has no effect.
- * @param[in] widgetid widget Package Id
- * @param[in] id Instance Id which is passed to you via the first parameter of every widget_XXXX interface functions
- * @privlevel public
- * @privilege %http://tizen.org/privilege/widget.provider
- * @feature http://tizen.org/feature/shell.appwidget
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
- * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #WIDGET_STATUS_ERROR_FAULT Failed to send requet
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully requested
- * @see widget_freeze_scroller()
- */
-extern int widget_thaw_scroller(const char *widgetid, const char *id);
-
-/**
* @}
*/
/**
* @internal
+ * @brief Return values of widget programming interfaces for the plug-in type widgets
+ * @since_tizen 2.4
+ * @feature http://tizen.org/feature/shell.appwidget
+ */
+typedef enum widget_api_result {
+ WIDGET_DONE = 0x00, /**< Operation is successfully done. */
+ WIDGET_OUTPUT_UPDATED = 0x01, /**< Contents are updated. */
+ WIDGET_NEED_TO_SCHEDULE = 0x02, /**< Need to call the widget_need_to_update and widget_update_content. */
+ WIDGET_NEED_TO_CREATE = 0x04, /**< Need to create a new instance. */
+ WIDGET_NEED_TO_DESTROY = 0x08, /**< Need to destroy this instance. */
+ WIDGET_FORCE_TO_SCHEDULE = 0x10, /**< Need to do force update. */
+} widget_api_result_e;
+
+/**
+ * @internal
+ * @brief System event type for the plug-in type widgets
+ * @since_tizen 2.4
+ * @feature http://tizen.org/feature/shell.appwidget
+ */
+typedef enum widget_system_event {
+ WIDGET_SYS_EVENT_FONT_CHANGED = 0x01, /**< System font is changed. */
+ WIDGET_SYS_EVENT_LANG_CHANGED = 0x02, /**< System language is changed. */
+ WIDGET_SYS_EVENT_TIME_CHANGED = 0x04, /**< System time is changed. */
+ WIDGET_SYS_EVENT_REGION_CHANGED = 0x08, /**< Region changed. */
+ WIDGET_SYS_EVENT_TTS_CHANGED = 0x10, /**< Accessibility mode changed. */
+ WIDGET_SYS_EVENT_PAUSED = 0x0100, /**< widget is paused. */
+ WIDGET_SYS_EVENT_RESUMED = 0x0200, /**< widget is resumed. */
+ WIDGET_SYS_EVENT_MMC_STATUS_CHANGED = 0x0400, /**< MMC Status change event. */
+ WIDGET_SYS_EVENT_DELETED = 0x0800, /**< widget instance is removed from a viewer. */
+} widget_system_event_e;
+
+/**
+ * @internal
* @brief widget description data handle.
* @since_tizen 2.3
*/
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
* @return Handle of desc instance
- * @retval @c NULL Failed to create a desc instance, widget_last_status() will returns reason of failure
+ * @retval @c NULL Failed to create a desc instance, get_last_result() will returns reason of failure
* @pre Should be loaded by data-provider-slave.
* @post Should be destroyed(flushed) using widget_desc_close() API.
* @see widget_desc_close()
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_NONE If the flushing description data is successfully done
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER If the given handle is not valid
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_NONE If the flushing description data is successfully done
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER If the given handle is not valid
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @pre Handle must be created by widget_desc_open()
* @post Handle must not be used after return from this function.
* @see widget_desc_open()
* @param[in] handle Handle which is created by widget_desc_open() function
* @param[in] id Id string of target object
* @param[in] category Category string that will be used by layout object
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid handle
- * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Memory is not enough to add this block
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid handle
+ * @retval #WIDGET_ERROR_OUT_OF_MEMORY Memory is not enough to add this block
* @retval index Index(>=0) of added block, which can be used by widget_desc_set_id()
* @pre Must be called after create a handle using widget_desc_open()
* @see widget_desc_set_id()
* @param[in] id Id string of target object
* @param[in] w Width in pixel
* @param[in] h Height in pixel
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
- * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Not enough memory to add a new block
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #WIDGET_ERROR_OUT_OF_MEMORY Not enough memory to add a new block
* @retval index Index(>=0) of added block Successfully added
* @see widget_desc_open()
* @see widget_desc_set_id()
* @param[in] handle Handle which is created by widget_desc_open() function
* @param[in] idx Index of target block
* @param[in] id Id String which will be used by other widget_desc_XXX functions
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_NONE Id is successfully updated for given idx of desc block
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
- * @retval #WIDGET_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_NONE Id is successfully updated for given idx of desc block
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #WIDGET_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 widget_desc_XXXX functions.
* @see widget_desc_open()
* @param[in] data Content for specified part
* @param[in] option Option for the block. (script: group, image: option, ...)
* @return Index of current description block
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
- * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Not enough memory to add a new desc block
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #WIDGET_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 widget_desc_open.
* @see widget_desc_set_id()
* @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 widget_desc_open() function
* @param[in] idx Index of added block, returned from widget_desc_add_block(), widget_desc_set_size(), widget_desc_set_category(), etc
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully deleted
- * @retval #WIDGET_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_NONE Successfully deleted
+ * @retval #WIDGET_ERROR_NOT_EXIST Given index of desc block is not exists
* @pre Index must be exists.
* @see widget_desc_add_block()
* @see widget_desc_open()
* @since_tizen 2.3
* @param[in] id Instance Id which is passed to you via the first parameter of every widget_XXXX interface functions
* @param[in] gbar 1 for updating content of Glance Bar or 0(for content of widget)
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Not enough memory
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
- * @retval #WIDGET_STATUS_ERROR_IO_ERROR I/O failed, Cannot access given resource file(id)
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully notified
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_OUT_OF_MEMORY Not enough memory
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #WIDGET_ERROR_IO_ERROR I/O failed, Cannot access given resource file(id)
+ * @retval #WIDGET_ERROR_NONE Successfully notified
* @pre This API only can be used after loaded into the data-provider-slave process.
*/
extern int widget_content_is_updated(const char *id, int gbar);
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
* @return Buffer handle
- * @retval @c NULL Failed to acquire buffer, widget_last_status() will returns reason of failure.
+ * @retval @c NULL Failed to acquire buffer, get_last_result() will returns reason of failure.
* @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 widget_release_buffer().
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
* @return int status
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully allocated
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WIDGET_STATUS_ERROR_FAULT Unrecoverable error occurred
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_NONE Successfully allocated
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WIDGET_ERROR_FAULT Unrecoverable error occurred
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @pre widget_create_buffer() must be called
* @see widget_create_buffer()
* @see widget_release_buffer()
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
* @return int status
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully released
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #WIDGET_ERROR_NONE Successfully released
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
* @pre Handle must be created using widget_acquire_buffer().
* @see widget_acquire_buffer()
*/
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
* @return int status
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMTER Invalid argument
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully destroyed
+ * @retval #WIDGET_ERROR_INVALID_PARAMTER Invalid argument
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_NONE Successfully destroyed
* @see widget_create_buffer()
*/
extern int widget_destroy_buffer(widget_buffer_h handle);
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
* @return void* address of the render buffer
- * @retval @c NULL If it falis to get buffer address, widget_last_status() will returns reason of failure.
+ * @retval @c NULL If it falis to get buffer address, get_last_result() will returns reason of failure.
* @retval address If it succeed to get the buffer address
* @see widget_unref_buffer()
*/
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid handle
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully unreference
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid handle
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_NONE Successfully unreference
* @pre widget_ref_buffer() must be called.
* @see widget_ref_buffer()
*/
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully sync'd
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_NONE Successfully sync'd
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @see widget_acquire_buffer()
*/
extern int widget_viewer_sync_buffer(widget_buffer_h handle);
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_ALREADY H/W buffer is already created
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully created
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_ALREADY_EXIST H/W buffer is already created
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_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 widget_support_hw_buffer()
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully destroyed
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_NONE Successfully destroyed
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @pre Must be created h/w buffer using widget_create_hw_buffer.
* @see widget_create_hw_buffer()
*/
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
* @return void* type
- * @retval @c NULL Failed to get H/W accelerated buffer address, widget_last_status() will returns reason of failure.
+ * @retval @c NULL Failed to get H/W accelerated buffer address, get_last_result() will returns reason of failure.
* @retval addr H/W accelerated buffer address
* @see widget_create_hw_buffer()
*/
* @param[in] handle Buffer handle
* @return int stride size
* @retval positive_value length of stride
- * @return #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameter
- * @return #WIDGET_STATUS_ERROR_FAULT Unrecoverable error
+ * @return #WIDGET_ERROR_INVALID_PARAMETER Invalid parameter
+ * @return #WIDGET_ERROR_FAULT Unrecoverable error
* @see widget_create_hw_buffer()
*/
extern int widget_buffer_stride(widget_buffer_h handle);
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid handle
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully done
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid handle
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_NONE Successfully done
* @post widget_buffer_post_render must be called after the rendering (accessing buffer) is completed.
* @see widget_support_hw_buffer()
* @see widget_buffer_post_render()
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
* @return If succes returns 0 or return less than 0
- * @retval #WIDGET_STATUS_ERROR_NONE If succeed
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
+ * @retval #WIDGET_ERROR_NONE If succeed
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
* @pre widget_buffer_pre_render must be called.
* @see widget_support_hw_buffer()
* @see widget_buffer_pre_render()
* @since_tizen 2.3
* @param[in] widgetid widget Package Id
* @param[in] id Instance Id which is passed to you via the first parameter of every widget_XXXX interface functions
- * @param[in] reason #WIDGET_STATUS_ERROR_NONE(0)
+ * @param[in] reason #WIDGET_ERROR_NONE(0)
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
- * @retval #WIDGET_STATUS_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #WIDGET_STATUS_ERROR_FAULT Failed to send a request
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully requested
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #WIDGET_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WIDGET_ERROR_FAULT Failed to send a request
+ * @retval #WIDGET_ERROR_NONE Successfully requested
*/
extern int widget_request_close_glance_bar(const char *widgetid, const char *id, int reason);
* @param[in] id
* @param[in] size_type
* @return void* window
- * @retval @c NULL failed to create a snapshot window, widget_last_status() will returns reason of failure.
+ * @retval @c NULL failed to create a snapshot window, get_last_result() will returns reason of failure.
* @retval Object window object (ex, elementary window)
* @see widget_snapshot_window_flush()
*/
* @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 #WIDGET_STATUS_ERROR_NONE Successfully flushed (flush timer added)
- * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid paramter
- * @retval #WIDGET_STATUS_ERROR_FAULT Failed to create a flush timer
+ * @retval #WIDGET_ERROR_NONE Successfully flushed (flush timer added)
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid paramter
+ * @retval #WIDGET_ERROR_FAULT Failed to create a flush timer
* @see widget_snapshot_window_add()
*/
extern int widget_snapshot_window_flush(void *snapshot_win, double timeout, widget_flush_cb flush_cb, void *data);
* @privilege %http://tizen.org/privilege/widget.provider
* @feature http://tizen.org/feature/shell.appwidget
* @return int status
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully sent
+ * @retval #WIDGET_ERROR_NONE Successfully sent
*/
extern int widget_send_updated_by_idx(widget_buffer_h handle, int idx);
/**
+ * @internal
+ * @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.
+ * @since_tizen 2.4
+ * @privlevel N/P
+ * @feature http://tizen.org/feature/shell.appwidget
+ * @remarks This function only works with the buffer type inhouse provider.
+ * @param[in] id widget Instance Id
+ * @param[in] content Content string that will pass to a widget via widget_create interface when it is re-created.
+ * @param[in] title Human readable text for accessibility, 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
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #WIDGET_ERROR_FAULT Unrecoverable error
+ * @retval #WIDGET_ERROR_NONE Successfully sent
+ * TODO: plug-in type
+ */
+extern int widget_set_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name);
+
+/**
+ * @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 widget.
+ * @since_tizen 2.4
+ * @remarks If the viewer doesn't care this request, this will has no effect.
+ * @param[in] widgetid widget Package Id
+ * @param[in] id Instance Id which is passed to you via the first parameter of every widget_XXXX interface functions
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/widget.provider
+ * @feature http://tizen.org/feature/shell.appwidget
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #WIDGET_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_FAULT Failed to send requet
+ * @retval #WIDGET_ERROR_NONE Successfully requested
+ * @see widget_release_scroller()
+ * TODO: plug-in type
+ */
+extern int widget_freeze_scroller(const char *widgetid, const char *id);
+
+/**
+ * @inernal
+ * @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 widget.
+ * @since_tizen 2.4
+ * @remarks If the viewer doesn't care this request, this will has no effect.
+ * @param[in] widgetid widget Package Id
+ * @param[in] id Instance Id which is passed to you via the first parameter of every widget_XXXX interface functions
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/widget.provider
+ * @feature http://tizen.org/feature/shell.appwidget
+ * @return #WIDGET_ERROR_NONE on success,
+ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
+ * @retval #WIDGET_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #WIDGET_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WIDGET_ERROR_FAULT Failed to send requet
+ * @retval #WIDGET_ERROR_NONE Successfully requested
+ * @see widget_freeze_scroller()
+ * TODO: plug-in type
+ */
+extern int widget_thaw_scroller(const char *widgetid, const char *id);
+/**
* @}
*/
Name: libwidget
Summary: widget development library
-Version: 1.0.0
+Version: 1.1.1
Release: 1
Group: HomeTF/widget
License: Flora
output = evas_object_image_add(e);
if (!output) {
DbgPrint("Failed to create an image object\n");
- return WIDGET_STATUS_ERROR_FAULT;
+ return WIDGET_ERROR_FAULT;
}
evas_object_image_data_set(output, NULL);
if (evas_object_image_save(output, filename, NULL, QUALITY_N_COMPRESS) == EINA_FALSE) {
evas_object_del(output);
DbgPrint("Faield to save a captured image (%s)\n", filename);
- return WIDGET_STATUS_ERROR_IO_ERROR;
+ return WIDGET_ERROR_IO_ERROR;
}
evas_object_del(output);
if (access(filename, F_OK) != 0) {
DbgPrint("File %s is not found\n", filename);
- return WIDGET_STATUS_ERROR_IO_ERROR;
+ return WIDGET_ERROR_IO_ERROR;
}
DbgPrint("Flush data to a file (%s)\n", filename);
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
static inline int destroy_virtual_canvas(Evas *e)
ee = ecore_evas_ecore_evas_get(e);
if (!ee) {
DbgPrint("Failed to ecore evas object\n");
- return WIDGET_STATUS_ERROR_FAULT;
+ return WIDGET_ERROR_FAULT;
}
ecore_evas_free(ee);
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
static inline int flush_to_file(const void *canvas, const char *filename, int w, int h)
shot_e = create_virtual_canvas(w, h);
if (!shot_e) {
ErrPrint("Unable to create a new virtual window\n");
- return WIDGET_STATUS_ERROR_FAULT;
+ return WIDGET_ERROR_FAULT;
}
shot_ee = ecore_evas_ecore_evas_get(shot_e);
if (!shot_ee) {
ErrPrint("Unable to get Ecore_Evas\n");
destroy_virtual_canvas(shot_e);
- return WIDGET_STATUS_ERROR_FAULT;
+ return WIDGET_ERROR_FAULT;
}
ecore_evas_manual_render_set(shot_ee, EINA_TRUE);
Ecore_Evas *ee;
void *canvas;
widget_flush_cb flush_cb;
- int status = WIDGET_STATUS_ERROR_NONE;
+ int status = WIDGET_ERROR_NONE;
info = evas_object_data_get(snapshot_win, "snapshot,info");
if (!info) {
if (info->flush_timer) {
info->flush_timer = NULL;
} else {
- status = WIDGET_STATUS_ERROR_CANCEL;
+ status = WIDGET_ERROR_CANCELED;
}
flush_cb = info->flush_cb;
if (!e) {
ErrPrint("Invalid object\n");
if (flush_cb) {
- flush_cb(snapshot_win, info->id, WIDGET_STATUS_ERROR_FAULT, info->data);
+ flush_cb(snapshot_win, info->id, WIDGET_ERROR_FAULT, info->data);
}
return ECORE_CALLBACK_CANCEL;
}
if (!ee) {
ErrPrint("Invalid object (ee)\n");
if (flush_cb) {
- flush_cb(snapshot_win, info->id, WIDGET_STATUS_ERROR_FAULT, info->data);
+ flush_cb(snapshot_win, info->id, WIDGET_ERROR_FAULT, info->data);
}
return ECORE_CALLBACK_CANCEL;
}
if (!canvas) {
DbgPrint("Failed to get pixel canvas\n");
if (flush_cb) {
- flush_cb(snapshot_win, info->id, WIDGET_STATUS_ERROR_FAULT, info->data);
+ flush_cb(snapshot_win, info->id, WIDGET_ERROR_FAULT, info->data);
}
return ECORE_CALLBACK_CANCEL;
}
DbgPrint("Flush size: %dx%d\n", w, h);
ret = flush_to_file(canvas, info->id, w, h);
- if (status == WIDGET_STATUS_ERROR_NONE) {
+ if (status == WIDGET_ERROR_NONE) {
status = ret;
}
if (!e) {
ErrPrint("Invalid object, failed to get Evas\n");
if (flush_cb) {
- flush_cb(snapshot_win, info->id, WIDGET_STATUS_ERROR_FAULT, info->data);
+ flush_cb(snapshot_win, info->id, WIDGET_ERROR_FAULT, info->data);
}
return ECORE_CALLBACK_CANCEL;
}
if (!ee) {
ErrPrint("Unable to get Ecore_Evas object\n");
if (flush_cb) {
- flush_cb(snapshot_win, info->id, WIDGET_STATUS_ERROR_FAULT, info->data);
+ flush_cb(snapshot_win, info->id, WIDGET_ERROR_FAULT, info->data);
}
return ECORE_CALLBACK_CANCEL;
}
if (!canvas) {
ErrPrint("Failed to get canvas\n");
if (flush_cb) {
- flush_cb(snapshot_win, info->id, WIDGET_STATUS_ERROR_FAULT, info->data);
+ flush_cb(snapshot_win, info->id, WIDGET_ERROR_FAULT, info->data);
}
return ECORE_CALLBACK_CANCEL;
}
info->flush_cb = NULL;
if (flush_cb) {
- flush_cb(snapshot_win, info->id, WIDGET_STATUS_ERROR_FAULT, info->data);
+ flush_cb(snapshot_win, info->id, WIDGET_ERROR_FAULT, info->data);
}
/*!
* \note
int w;
int h;
- if (widget_service_get_size(size_type, &w, &h) != WIDGET_STATUS_ERROR_NONE) {
+ if (widget_service_get_size(size_type, &w, &h) != WIDGET_ERROR_NONE) {
ErrPrint("Invalid size\n");
return NULL;
}
if (!flush_cb || timeout < 0.0f) {
ErrPrint("Invalid argument (%p, %lf)\n", flush_cb, timeout);
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
info = evas_object_data_get(snapshot_win, "snapshot,info");
if (!info) {
ErrPrint("Invalid argument\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
info->timeout = timeout;
*/
info->flush_timer = ecore_timer_add(0.0001f, direct_snapshot_cb, snapshot_win);
if (!info->flush_timer) {
- return WIDGET_STATUS_ERROR_FAULT;
+ return WIDGET_ERROR_FAULT;
}
} else if (info->render_cnt) {
/*!
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 WIDGET_STATUS_ERROR_FAULT;
+ return WIDGET_ERROR_FAULT;
}
}
info->flush_cb = flush_cb;
info->data = data;
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
/* End of a file */
#include <dlog.h>
#include <widget_errno.h>
#include <widget_service.h>
+#include <widget_service_internal.h>
#include <widget_conf.h>
#include <widget_buffer.h>
info->ee = NULL;
}
-PUBLIC void *widget_get_evas(const char *id, int is_gbar)
+#ifdef WIDGET_FEATURE_GBAR_SUPPORTED
+PUBLIC Evas *widget_get_evas(const char *id, int is_gbar)
+#else /* WIDGET_FEATURE_GBAR_SUPPORTED */
+PUBLIC Evas *widget_get_evas(const char *id)
+#endif /* WIDGET_FEATURE_GBAR_SUPPORTED */
{
vwin_info_t info;
Evas_Object *rect;
return NULL;
}
+#ifdef WIDGET_FEATURE_GBAR_SUPPORTED
info->is_gbar = is_gbar;
+#else
+ info->is_gbar = 0;
+#endif /* WIDGET_FEATURE_GBAR_SUPPORTED */
/**
* Acquire a buffer for canvas.
}
}
-PUBLIC void *widget_get_evas(const char *id, int is_gbar)
+PUBLIC Evas *widget_get_evas(const char *id, int is_gbar)
{
struct info *info;
Evas_Object *rect;
#include <dlog.h>
#include <widget_errno.h>
#include <widget_service.h>
+#include <widget_service_internal.h>
#include <widget_provider.h>
#include <widget_provider_buffer.h>
#include <widget_conf.h>
#include <widget_buffer.h>
-#include <Evas.h>
-#include <Ecore.h>
#include "debug.h"
#include "dlist.h"
static int send_updated(const char *pkgname, const char *id, widget_buffer_h handle, int idx, int x, int y, int w, int h, int gbar, const char *descfile)
{
- int ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ int ret = WIDGET_ERROR_INVALID_PARAMETER;
if (s_info.type == LOAD_TYPE_UNKNOWN) {
load_update_function();
*/
ret = s_info.updated.slave.send(pkgname, id, handle, idx, x, y, w, h, gbar, descfile);
} else {
- widget_damage_region_t region = {
+ widget_damage_region_s region = {
.x = x,
.y = y,
.w = w,
pkgname = widget_provider_buffer_pkgname(buffer);
if (!pkgname) {
ErrPrint("pkgname is not valid\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
id = widget_provider_buffer_id(buffer);
if (!id) {
ErrPrint("id is not valid[%s]\n", pkgname);
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (cbdata->handler) {
ret = cbdata->handler(buffer, event_info, cbdata->cbdata);
} else {
- ret = WIDGET_STATUS_ERROR_FAULT;
+ ret = WIDGET_ERROR_FAULT;
}
switch (event_info->type) {
return 0;
}
-PUBLIC const int WIDGET_DONE = 0x00;
-PUBLIC const int WIDGET_OUTPUT_UPDATED = 0x02;
-PUBLIC const int WIDGET_USE_NET = 0x04;
-
-PUBLIC const int WIDGET_NEED_TO_SCHEDULE = 0x01;
-PUBLIC const int WIDGET_NEED_TO_CREATE = 0x01;
-PUBLIC const int WIDGET_NEED_TO_DESTROY = 0x01;
-PUBLIC const int WIDGET_FORCE_TO_SCHEDULE = 0x08;
-
-PUBLIC const int WIDGET_SYS_EVENT_FONT_CHANGED = 0x01;
-PUBLIC const int WIDGET_SYS_EVENT_LANG_CHANGED = 0x02;
-PUBLIC const int WIDGET_SYS_EVENT_TIME_CHANGED = 0x04;
-PUBLIC const int WIDGET_SYS_EVENT_REGION_CHANGED = 0x08;
-PUBLIC const int WIDGET_SYS_EVENT_TTS_CHANGED = 0x10;
-PUBLIC const int WIDGET_SYS_EVENT_PAUSED = 0x0100;
-PUBLIC const int WIDGET_SYS_EVENT_RESUMED = 0x0200;
-PUBLIC const int WIDGET_SYS_EVENT_MMC_STATUS_CHANGED = 0x0400;
-PUBLIC const int WIDGET_SYS_EVENT_DELETED = 0x0800;
-
PUBLIC struct widget_desc *widget_desc_open(const char *filename, int for_pd)
{
struct widget_desc *handle;
struct block *block;
if (!handle) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
dlist_foreach_safe(handle->block_list, l, n, block) {
ErrPrint("fclose: %s\n", strerror(errno));
}
free(handle);
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
PUBLIC int widget_desc_set_category(struct widget_desc *handle, const char *id, const char *category)
struct block *block;
if (!handle || !category) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
block = calloc(1, sizeof(*block));
if (!block) {
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
block->type = strdup(WIDGET_DESC_TYPE_INFO);
if (!block->type) {
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
block->part = strdup("category");
if (!block->part) {
free(block->type);
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
block->data = strdup(category);
free(block->type);
free(block->part);
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
if (id) {
free(block->type);
free(block->part);
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
char buffer[BUFSIZ];
if (!handle) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
block = calloc(1, sizeof(*block));
if (!block) {
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
block->type = strdup(WIDGET_DESC_TYPE_INFO);
if (!block->type) {
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
block->part = strdup("size");
if (!block->part) {
free(block->type);
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
if (id) {
free(block->part);
free(block->type);
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
free(block->part);
free(block->type);
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
block->idx = handle->last_idx++;
if (block->idx == idx) {
if (strcasecmp(block->type, WIDGET_DESC_TYPE_SCRIPT)) {
ErrPrint("Invalid block is used\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
free(block->target_id);
block->target_id = NULL;
if (!id || !strlen(id)) {
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
block->target_id = strdup(id);
if (!block->target_id) {
ErrPrint("Heap: %s\n", strerror(errno));
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
}
- return WIDGET_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_ERROR_NOT_EXIST;
}
/*!
struct block *block;
if (!handle || !type) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!part) {
block = calloc(1, sizeof(*block));
if (!block) {
ErrPrint("Heap: %s\n", strerror(errno));
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
block->type = strdup(type);
if (!block->type) {
ErrPrint("Heap: %s\n", strerror(errno));
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
block->part = strdup(part);
ErrPrint("Heap: %s\n", strerror(errno));
free(block->type);
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
block->data = strdup(data);
free(block->type);
free(block->part);
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
if (option) {
free(block->type);
free(block->part);
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
free(block->type);
free(block->part);
free(block);
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
struct block *block;
if (!handle || idx < 0) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
dlist_foreach(handle->block_list, l, block) {
free(block->id);
free(block->target_id);
free(block);
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
}
- return WIDGET_STATUS_ERROR_NOT_EXIST;
+ return WIDGET_ERROR_NOT_EXIST;
}
PUBLIC int widget_viewer_acquire_buffer(widget_buffer_h handle, int idx, int width, int height, int pixel_size)
int ret;
if (!handle || width <= 0 || height <= 0 || pixel_size <= 0 || idx > WIDGET_CONF_EXTRA_BUFFER_COUNT) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (idx >= 0) {
if (!filename) {
ErrPrint("Invalid argument\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
uri = id_to_uri(filename);
if (!uri) {
ErrPrint("Heap: %s\n", strerror(errno));
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
if (!s_info.request_update_by_id) {
if (!s_info.request_update_by_id) {
ErrPrint("\"widget_request_update_by_id\" is not exists\n");
free(uri);
- return WIDGET_STATUS_ERROR_FAULT;
+ return WIDGET_ERROR_FAULT;
}
}
int ret;
if (!handle || idx > WIDGET_CONF_EXTRA_BUFFER_COUNT) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (idx >= 0) {
int ret;
if (!handle || idx > WIDGET_CONF_EXTRA_BUFFER_COUNT) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (idx >= 0) {
struct widget_buffer_data *user_data;
if (!handle) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
user_data = widget_provider_buffer_user_data(handle);
PUBLIC int widget_unref_buffer(void *buffer)
{
if (!buffer) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
DbgPrint("Unref buffer\n");
int ret;
if (!handle) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
user_data = widget_provider_buffer_user_data(handle);
if (!user_data) {
ErrPrint("Invalid buffer\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (user_data->accelerated) {
DbgPrint("H/W Buffer allocated. skip the sync buffer\n");
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
pkgname = widget_provider_buffer_pkgname(handle);
if (!pkgname) {
ErrPrint("Invalid buffer handler\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
id = widget_provider_buffer_id(handle);
if (!id) {
ErrPrint("Invalid buffer handler\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
(void)widget_provider_buffer_sync(handle);
user_data = widget_provider_buffer_user_data(handle);
if (!user_data) {
ErrPrint("Invalid buffer\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
pkgname = widget_provider_buffer_pkgname(handle);
if (!pkgname) {
ErrPrint("Invalid buffer handler\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
id = widget_provider_buffer_id(handle);
if (!id) {
ErrPrint("Invalid buffer handler\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (widget_provider_buffer_get_size(handle, &w, &h, &pixel_size) < 0) {
PUBLIC int widget_support_hw_buffer(widget_buffer_h handle)
{
if (!handle) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
return widget_provider_buffer_is_support_hw(handle);
int ret;
if (!handle) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
user_data = widget_provider_buffer_user_data(handle);
if (!user_data) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (user_data->accelerated) {
- return WIDGET_STATUS_ERROR_ALREADY;
+ return WIDGET_ERROR_ALREADY_EXIST;
}
ret = widget_provider_buffer_create_hw(handle);
if (!handle) {
LOGD("handle is NULL\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
user_data = widget_provider_buffer_user_data(handle);
if (!user_data || !user_data->accelerated) {
LOGD("user_data is NULL\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
user_data->accelerated = 0;
struct widget_buffer_data *user_data;
if (!handle) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
user_data = widget_provider_buffer_user_data(handle);
if (!user_data) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!user_data->accelerated) {
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
/*!
if (!handle) {
PERF_MARK("post_render");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
user_data = widget_provider_buffer_user_data(handle);
if (!user_data) {
PERF_MARK("post_render");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!user_data->accelerated) {
PERF_MARK("post_render");
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
pkgname = widget_provider_buffer_pkgname(handle);
if (!pkgname) {
ErrPrint("Invalid buffer handle\n");
PERF_MARK("post_render");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
id = widget_provider_buffer_id(handle);
if (!id) {
ErrPrint("Invalid buffer handler\n");
PERF_MARK("post_render");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
ret = widget_provider_buffer_post_render(handle);
PUBLIC int widget_buffer_stride(widget_buffer_h handle)
{
if (!handle) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
return widget_provider_buffer_stride(handle);
s_info.trigger_update_monitor = dlsym(RTLD_DEFAULT, FUNC_WIDGET_TRIGGER_UPDATE_MONITOR);
if (!s_info.trigger_update_monitor) {
ErrPrint("Trigger update monitor function is not exists\n");
- return WIDGET_STATUS_ERROR_FAULT;
+ return WIDGET_ERROR_FAULT;
}
}
if (!pkgname || !id) {
ErrPrint("Invalid parameters (%s) (%s)\n", pkgname, id);
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (strncmp(id, FILE_SCHEMA, schema_len)) {
uri = id_to_uri(id);
if (!uri) {
ErrPrint("Heap: %s\n", strerror(errno));
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
} else {
uri = strdup(id);
if (!uri) {
ErrPrint("Heap: %s\n", strerror(errno));
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
int ret;
if (!pkgname || !id) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
uri = id_to_uri(id);
if (!uri) {
ErrPrint("Heap: %s\n", strerror(errno));
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
ret = widget_provider_send_hold_scroll(pkgname, uri, 1);
int ret;
if (!pkgname || !id) {
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
uri = id_to_uri(id);
if (!uri) {
ErrPrint("Heap: %s\n", strerror(errno));
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
ret = widget_provider_send_hold_scroll(pkgname, uri, 0);
uri = id_to_uri(id);
if (!uri) {
ErrPrint("Heap: %s\n", strerror(errno));
- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
+ return WIDGET_ERROR_OUT_OF_MEMORY;
}
if (!s_info.find_pkgname) {
if (!s_info.find_pkgname) {
ErrPrint("Failed to find a \"widget_find_pkgname\"\n");
free(uri);
- return WIDGET_STATUS_ERROR_FAULT;
+ return WIDGET_ERROR_FAULT;
}
}
if (!pkgname) {
ErrPrint("Failed to find a package (%s)\n", uri);
free(uri);
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
handle = widget_provider_buffer_find_buffer(WIDGET_TYPE_WIDGET, pkgname, uri);
if (!user_data) {
ErrPrint("User data is not available\n");
free(uri);
- return WIDGET_STATUS_ERROR_FAULT;
+ return WIDGET_ERROR_FAULT;
}
if (content && strlen(content)) {
}
free(uri);
- return WIDGET_STATUS_ERROR_NONE;
+ return WIDGET_ERROR_NONE;
}
free(uri);
s_info.update_extra_info = dlsym(RTLD_DEFAULT, FUNC_WIDGET_UPDATE_EXTRA_INFO);
if (!s_info.update_extra_info) {
ErrPrint("Failed to find a \"widget_update_extra_info\"\n");
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
}