* {
* int ret;
* ret = widget_init(NULL, 1, 0.0f, 1);
-- * if (ret != WIDGET_STATUS_ERROR_NONE) {
++ * if (ret != WIDGET_ERROR_NONE) {
* LOGE("Failed to initialize the widget viewer");
* }
* return true;
* It can be initialized only after getting the return callback with "ret == #WIDGET_STATUS_ERROR_NONE"
* This function is Asynchronous, so you will get result of add requst from @a cb, if you failed to send request to create a new widget,
* This function will returns proper error code
-- * If this returns @c NULL, you can get the reason of failure using widget_last_status()
++ * If this returns @c NULL, you can get the reason of failure using get_last_result()
* @param[in] widget_id widget Id
* @param[in] content Contents that will be given to the widget instance
-- * @param[in] cluster Main group
-- * @param[in] category Sub group
++ * @param[in] cluster Identifier to group widgets which will be decided in runtime.
++ * @param[in] category Identifier to group widgets declared in the manifest file by the widget provider.
* @param[in] period Update period (@c WIDGET_DEFAULT_PERIOD can be used for this; this argument will be used to specify the period of updating contents of a widget)
* @param[in] type Size type (defined from libwidget-service package)
* @param[in] cb After the request is sent to the master provider, this callback will be called
* @param[in] data Callback data
* @privlevel platform
* @privilege %http://tizen.org/privilege/widget.viewer
-- * @return #WIDGET_STATUS_ERROR_NONE on success,
++ * @return #WIDGET_STATUS_ERROR_NONE on success,
* otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
* @retval #WIDGET_STATUS_ERROR_NONE Successfully sent a request
* @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid argument
* @param[in] data User data for return callback
* @privlevel platform
* @privilege %http://tizen.org/privilege/widget.viewer
-- * @return #WIDGET_STATUS_ERROR_NONE on success,
++ * @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_BUSY Previous request of resize is in progress
/**
* @brief Checks whether the given widget is a text type or not.
* @remarks
-- * If this returns WIDGET_CONTENT_TYPE_INVALID, you can get the reason of failure using widget_last_status()
++ * If this returns WIDGET_CONTENT_TYPE_INVALID, you can get the reason of failure using get_last_result()
* @since_tizen 2.4
* @privlevel N/P
* @param[in] handle Handle of a widget instance
/**
* @brief Checks if the given widget is created by user or not.
-- * @remarks if this returns negative value, you can get the reason of failure using widget_last_status()
++ * @remarks if this returns negative value, you can get the reason of failure using get_last_result()
* @since_tizen 2.4
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
/**
* @internal
* @brief Gets content information string of the given widget.
-- * @remarks if this returns @c NULL, you can get the reason of failure using widget_last_status()
++ * @remarks if this returns @c NULL, you can get the reason of failure using get_last_result()
* @since_tizen 2.3
* @param[in] handle Handle of a widget instance
* @return const char *
* @remarks The title returned by this API can be read by TTS.
* But it is just recomendation for the homescreen.
* So, to read it or not depends on its implementation.
-- * if this returns @c NULL, you can get the reason of failure using widget_last_status()
++ * if this returns @c NULL, you can get the reason of failure using get_last_result()
* @param[in] handle Handle of a widget instance
* @return const char *
* @retval sub Cluster name
* @internal
* @brief Gets the filename of the given widget, if it is an IMAGE type widget.
* @details If the box is developed as an image format to represent its contents, the homescreen should know its image file name.
-- * @remarks if this returns @c NULL, you can get the reason of failure using widget_last_status()
++ * @remarks if this returns @c NULL, you can get the reason of failure using get_last_result()
* @since_tizen 2.3
* @param[in] handle Handle of a widget instance
* @return const char *
/**
* @brief Gets the package name of the given widget handle.
-- * @remarks if this returns @c NULL, you can get the reason of failure using widget_last_status()
++ * @remarks if this returns @c NULL, you can get the reason of failure using get_last_result()
* @since_tizen 2.4
* @privlevel N/P
* @param[in] handle Handle of a widget instance
/**
* @brief Gets the priority of a current content.
-- * @remarks if this returns negative value, you can get the reason of failure using widget_last_status()
++ * @remarks if this returns negative value, you can get the reason of failure using get_last_result()
* @since_tizen 2.4
* @privlevel N/P
* @param[in] handle Handle of a widget instance
/**
* @brief Gets the size of the widget.
* @remarks
-- * If this returns WIDGET_SIZE_TYPE_UNKNOWN, you can get the reason of failure using widget_last_status()
++ * If this returns WIDGET_SIZE_TYPE_UNKNOWN, you can get the reason of failure using get_last_result()
* @since_tizen 2.4
* @privlevel public
* @privilege %http://tizen.org/privilege/widget.viewer
* @param[in] handle Handle of a widget instance
* @param[out] w Width of glance bar in pixels
* @param[out] h Height of glance bar in pixels
-- * @return #WIDGET_STATUS_ERROR_NONE on success,
++ * @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 are used
* @retval #WIDGET_STATUS_ERROR_NONE Successfully done
* @param[in] cnt size of array
* @param[out] cnt Count of returned size types
* @param[out] size_list Array of size types
-- * @return #WIDGET_STATUS_ERROR_NONE on success,
++ * @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_NONE Successfully done
* @internal
* @brief Gets the current visible state of a widget.
* @remarks
-- * If this returns WIDGET_VISIBLE_ERROR, you can get the reason of failure using widget_last_status()
++ * If this returns WIDGET_VISIBLE_ERROR, you can get the reason of failure using get_last_result()
* @since_tizen 2.3
* @param[in] handle Handle of a widget instance
* @return widget_visible_state
* @internal
* @brief Checks the active update mode of the given widget.
* @remarks
-- * If this returns negative value, you can get the reason of failure using widget_last_status()
++ * If this returns negative value, you can get the reason of failure using get_last_result()
* @since_tizen 2.3
* @param[in] handle Handle of a widget instance
* @return int
* @brief Gets an alternative icon of the given widget instance.
* @details If the box should be represented as a shortcut icon, this function will get the alternative icon.
* @remarks
-- * If this returns @c NULL, you can get the reason of failure using widget_last_status()
++ * If this returns @c NULL, you can get the reason of failure using get_last_result()
* @since_tizen 2.3
* @param[in] handle Handle of a widget instance
* @return const char *
* @brief Gets an alternative name of the given widget instance.
* @details If the box should be represented as a shortcut name, this function will get the alternative name.
* @remarks
-- * If this returns @c NULL, you can get the reason of failure using widget_last_status()
++ * If this returns @c NULL, you can get the reason of failure using get_last_result()
* @since_tizen 2.3
* @param[in] handle Handle of a widget instance
* @return const char *
* @internal
* @brief Gets options of a widget sub-system.
* @remarks
-- * If this returns negative value, you can get the reason of failure using widget_last_status()
++ * If this returns negative value, you can get the reason of failure using get_last_result()
* @since_tizen 2.3
* @param[in] option Type of option
* @return int
* @since_tizen 2.3
* @param[in] launch_handler Handle for launching an app manually
* @param[in] data Callback data which will be given a data for launch_handler
-- * @return #WIDGET_STATUS_ERROR_NONE on success,
++ * @return #WIDGET_STATUS_ERROR_NONE on success,
* otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
* @retval #WIDGET_STATUS_ERROR_NONE Succeed to set new handle. there is no other cases
*/
goto out;
}
-- if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (status == (int)WIDGET_ERROR_NONE) {
new_content = strdup(content);
if (new_content) {
free(common->content);
common->is_pinned_up = pinup;
} else {
ErrPrint("Heap: %s\n", strerror(errno));
-- status = WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ status = WIDGET_ERROR_OUT_OF_MEMORY;
}
}
handler->cbs.pinup.data = NULL;
cb(handler, status, cbdata);
-- } else if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ } else if (status == (int)WIDGET_ERROR_NONE) {
_widget_invoke_event_handler(handler, WIDGET_EVENT_PINUP_CHANGED);
}
}
handler->cbs.created.cb = NULL;
handler->cbs.created.data = NULL;
-- if (reason == (int)WIDGET_STATUS_ERROR_NONE) {
-- reason = WIDGET_STATUS_ERROR_CANCEL;
++ if (reason == (int)WIDGET_ERROR_NONE) {
++ reason = WIDGET_ERROR_CANCELED;
}
cb(handler, reason, cbdata);
ret = _widget_sync_widget_fb(common);
-- if (ret != (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret != (int)WIDGET_ERROR_NONE) {
ErrPrint("Failed to do sync FB (%s - %s) (%d)\n", pkgname, fbfile, ret);
} else {
struct dlist *l;
(void)_widget_set_gbar_fb(common, fbfile);
ret = _widget_sync_gbar_fb(common);
-- if (ret != (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret != (int)WIDGET_ERROR_NONE) {
ErrPrint("Failed to do sync FB (%s - %s) (%d)\n", pkgname, fbfile, ret);
} else {
struct dlist *l;
if (conf_frame_drop_for_resizing() && common->request.size_changed) {
/* Just for skipping the update event callback call, After request to resize buffer, update event will be discarded */
DbgPrint("Discards obsoloted update event\n");
-- ret = WIDGET_STATUS_ERROR_BUSY;
++ ret = WIDGET_ERROR_RESOURCE_BUSY;
} else {
if (!conf_manual_sync()) {
ret = _widget_sync_widget_fb(common);
-- if (ret != (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret != (int)WIDGET_ERROR_NONE) {
ErrPrint("Failed to do sync FB (%s - %s) (%d)\n", pkgname, util_basename(util_uri_to_path(id)), ret);
}
} else {
-- ret = WIDGET_STATUS_ERROR_NONE;
++ ret = WIDGET_ERROR_NONE;
}
}
}
-- if (!common->request.created && ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (!common->request.created && ret == (int)WIDGET_ERROR_NONE) {
struct dlist *l;
struct dlist *n;
if (conf_frame_drop_for_resizing() && common->request.size_changed) {
/* Just for skipping the update event callback call, After request to resize buffer, update event will be discarded */
DbgPrint("Discards obsoloted update event\n");
-- ret = WIDGET_STATUS_ERROR_BUSY;
++ ret = WIDGET_ERROR_RESOURCE_BUSY;
} else {
(void)_widget_set_widget_fb(common, fbfile);
if (!conf_manual_sync()) {
ret = _widget_sync_widget_fb(common);
-- if (ret != (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret != (int)WIDGET_ERROR_NONE) {
ErrPrint("Failed to do sync FB (%s - %s) (%d)\n", pkgname, util_basename(util_uri_to_path(id)), ret);
}
} else {
-- ret = WIDGET_STATUS_ERROR_NONE;
++ ret = WIDGET_ERROR_NONE;
}
}
} else {
-- ret = WIDGET_STATUS_ERROR_NONE;
++ ret = WIDGET_ERROR_NONE;
}
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE && !common->request.created) {
++ if (ret == (int)WIDGET_ERROR_NONE && !common->request.created) {
struct dlist *l;
struct dlist *n;
goto out;
}
-- common->is_gbar_created = (status == (int)WIDGET_STATUS_ERROR_NONE);
++ common->is_gbar_created = (status == (int)WIDGET_ERROR_NONE);
common->request.gbar_created = 0;
if (common->is_gbar_created) {
* Because, in the create callback, user can call create_gbar function again.
*/
cb(handler, status, cbdata);
-- } else if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ } else if (status == (int)WIDGET_ERROR_NONE) {
_widget_invoke_event_handler(handler, WIDGET_EVENT_GBAR_CREATED);
}
}
* Because, in the create callback, user can call destroy_gbar function again.
*/
cb(handler, status, cbdata);
-- } else if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ } else if (status == (int)WIDGET_ERROR_NONE) {
_widget_invoke_event_handler(handler, WIDGET_EVENT_GBAR_DESTROYED);
}
}
goto out;
}
-- if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (status == (int)WIDGET_ERROR_NONE) {
_widget_set_update_mode(common, active_mode);
}
handler->cbs.update_mode.data = NULL;
cb(handler, status, cbdata);
-- } else if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ } else if (status == (int)WIDGET_ERROR_NONE) {
_widget_invoke_event_handler(handler, WIDGET_EVENT_UPDATE_MODE_CHANGED);
}
}
* So the GBAR has no private resized event handler.
* Notify it via global event handler only.
*/
-- if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (status == (int)WIDGET_ERROR_NONE) {
struct dlist *l;
_widget_set_gbarsize(common, w, h);
struct dlist *l;
struct dlist *n;
-- if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (status == (int)WIDGET_ERROR_NONE) {
_widget_set_size(common, w, h);
/*!
handler->cbs.size_changed.data = NULL;
cb(handler, status, cbdata);
-- } else if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ } else if (status == (int)WIDGET_ERROR_NONE) {
_widget_invoke_event_handler(handler, WIDGET_EVENT_WIDGET_SIZE_CHANGED);
}
}
goto out;
}
-- if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (status == (int)WIDGET_ERROR_NONE) {
_widget_set_period(common, period);
}
handler->cbs.period_changed.data = NULL;
cb(handler, status, cbdata);
-- } else if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ } else if (status == (int)WIDGET_ERROR_NONE) {
_widget_invoke_event_handler(handler, WIDGET_EVENT_PERIOD_CHANGED);
}
}
goto out;
}
-- if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (status == (int)WIDGET_ERROR_NONE) {
(void)_widget_set_group(common, cluster, category);
}
handler->cbs.group_changed.data = NULL;
cb(handler, status, cbdata);
-- } else if (status == (int)WIDGET_STATUS_ERROR_NONE) {
++ } else if (status == (int)WIDGET_ERROR_NONE) {
_widget_invoke_event_handler(handler, WIDGET_EVENT_GROUP_CHANGED);
}
}
&widget_type, &gbar_type, &period, &title, &is_pinned_up);
if (ret != 22) {
ErrPrint("Invalid argument\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
handler = _widget_new_widget(pkgname, id, timestamp, cluster, category);
if (!handler) {
ErrPrint("Failed to create a new widget\n");
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
goto out;
}
common = handler->common;
* This is not possible!!!
*/
ErrPrint("Invalid handler\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
content, cluster, category,
widget_fname, gbar_fname);
-- ret = WIDGET_STATUS_ERROR_ALREADY;
++ ret = WIDGET_ERROR_ALREADY_EXIST;
goto out;
}
*/
}
} else if (handler->state != WIDGET_STATE_DELETE) {
-- handler->cbs.created.cb(handler, WIDGET_STATUS_ERROR_CANCEL, handler->cbs.created.data);
++ handler->cbs.created.cb(handler, WIDGET_ERROR_CANCELED, handler->cbs.created.data);
_widget_unref(handler, 1);
}
} else {
* Do not clear this to use this from the deleted event callback.
* if this value is not cleared when the deleted event callback check it,
* it means that the created function is not called yet.
-- * Then the call the deleted event callback with WIDGET_STATUS_ERROR_CANCEL errno.
++ * Then the call the deleted event callback with WIDGET_ERROR_CANCELED errno.
*/
}
s_info.fd = com_core_packet_client_init(client_addr(), 0, s_table);
if (s_info.fd < 0) {
ErrPrint("Try this again later\n");
-- return WIDGET_STATUS_ERROR_IO_ERROR;
++ return WIDGET_ERROR_IO_ERROR;
}
packet = packet_create((const char *)&cmd, "ds", util_timestamp(), client_direct_addr());
if (!packet) {
com_core_packet_client_fini(s_info.fd);
s_info.fd = -1;
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(NULL, packet, 1, acquire_cb, NULL);
ErrPrint("Master RPC returns %d\n", ret);
com_core_packet_client_fini(s_info.fd);
s_info.fd = -1;
-- return WIDGET_STATUS_ERROR_IO_ERROR;
++ return WIDGET_ERROR_IO_ERROR;
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int connected_cb(int handle, void *data)
}
DbgPrint("Master state: %d\n", state);
-- if (state == 1 && make_connection() == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (state == 1 && make_connection() == (int)WIDGET_ERROR_NONE) {
int ret;
ret = vconf_ignore_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb);
if (ret < 0) {
s_info.client_addr = strdup(CLIENT_SOCKET);
if (!s_info.client_addr) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
}
master_started_cb(NULL, NULL);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int client_fd(void)
free(s_info.direct_addr);
s_info.direct_addr = NULL;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
/* End of a file */
if (!block || !block->part || !block->data) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ops = is_gbar ? &handle->cbs.gbar_ops : &handle->cbs.widget_ops;
if (!block || !block->part) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ops = is_gbar ? &handle->cbs.gbar_ops : &handle->cbs.widget_ops;
if (!block || !block->part) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ops = is_gbar ? &handle->cbs.gbar_ops : &handle->cbs.widget_ops;
if (!block) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ops = is_gbar ? &handle->cbs.gbar_ops : &handle->cbs.widget_ops;
if (!block || !block->data || !block->part) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (sscanf(block->data, "%lfx%lf", &dx, &dy) != 2) {
ErrPrint("Invalid format of data\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ops = is_gbar ? &handle->cbs.gbar_ops : &handle->cbs.widget_ops;
if (!block || !block->part || !block->data) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ops = is_gbar ? &handle->cbs.gbar_ops : &handle->cbs.widget_ops;
if (sscanf(block->data, "%dx%d", &w, &h) != 2) {
ErrPrint("Invalid format (%s)\n", block->data);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (ops->update_info_size) {
if (!block) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ops = is_gbar ? &handle->cbs.gbar_ops : &handle->cbs.widget_ops;
if (!block) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ops = is_gbar ? &handle->cbs.gbar_ops : &handle->cbs.widget_ops;
if (!block) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ops = is_gbar ? &handle->cbs.gbar_ops : &handle->cbs.widget_ops;
filebuf = load_file(filename);
if (!filebuf) {
-- return WIDGET_STATUS_ERROR_IO_ERROR;
++ return WIDGET_ERROR_IO_ERROR;
}
fileptr = filebuf;
block_list = dlist_remove(block_list, l);
}
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
}
ErrPrint("End: Set content for object\n");
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
/* End of a file */
s_info.visual = DefaultVisualOfScreen(screen);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int fb_fini(void)
buffer = info->buffer;
if (!buffer) { /* Ignore this sync request */
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
if (buffer->state != WIDGET_FB_STATE_CREATED) {
ErrPrint("Invalid state of a FB\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (buffer->type != WIDGET_FB_TYPE_FILE) {
ErrPrint("Invalid buffer\n");
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
fd = open(util_uri_to_path(info->id), O_RDONLY);
*
* and then update it after it gots update events
*/
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
/**
*
* and then update it after it gots update events
*/
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
if (read(fd, ((unsigned int *)buffer->data) + index, width) != width) {
*
* and then update it after it gots update events
*/
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
}
} else {
*
* and then update it after it gots update events
*/
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
}
if (close(fd) < 0) {
ErrPrint("close: %s\n", strerror(errno));
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int sync_for_pixmap(struct fb_info *info, int x, int y, int w, int h)
buffer = info->buffer;
if (!buffer) { /*!< Ignore this sync request */
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
if (buffer->state != WIDGET_FB_STATE_CREATED) {
ErrPrint("Invalid state of a FB\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (buffer->type != WIDGET_FB_TYPE_PIXMAP) {
ErrPrint("Invalid buffer\n");
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
if (!s_info.disp) {
s_info.visual = DefaultVisualOfScreen(screen);
} else {
ErrPrint("Failed to open a display\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
}
if (info->handle == 0) {
ErrPrint("Pixmap ID is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (info->bufsz == 0) {
* To sync its contents.
*/
DbgPrint("Nothing can be sync\n");
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
si.shmid = shmget(IPC_PRIVATE, info->bufsz, IPC_CREAT | 0666);
if (si.shmid < 0) {
ErrPrint("shmget: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
si.readOnly = False;
ErrPrint("shmctl: %s\n", strerror(errno));
}
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
/*!
ErrPrint("shmctl: %s\n", strerror(errno));
}
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
xim->data = si.shmaddr;
ErrPrint("shmctl: %s\n", strerror(errno));
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int fb_sync(struct fb_info *info, int x, int y, int w, int h)
{
if (!info) {
ErrPrint("FB Handle is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!info->id || info->id[0] == '\0') {
DbgPrint("Ingore sync\n");
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
if (!strncasecmp(info->id, SCHEMA_FILE, strlen(SCHEMA_FILE))) {
return sync_for_pixmap(info, x, y, w, h);
} else if (!strncasecmp(info->id, SCHEMA_SHM, strlen(SCHEMA_SHM))) {
/* No need to do sync */
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
struct fb_info *fb_create(const char *id, int w, int h)
} else if (sscanf(info->id, SCHEMA_PIXMAP "%d:%d", &info->handle, &info->pixels) == 2) {
DbgPrint("PIXMAP-SHMID: %d is gotten (%d)\n", info->handle, info->pixels);
} else {
-- info->handle = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ info->handle = WIDGET_ERROR_INVALID_PARAMETER;
}
info->bufsz = 0;
{
if (!info) {
ErrPrint("Handle is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (info->buffer) {
free(info->id);
free(info);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int fb_is_created(struct fb_info *info)
if (!info) {
ErrPrint("info == NIL\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
buffer = calloc(1, sizeof(*buffer) + info->bufsz);
if (!buffer) {
ErrPrint("Heap: %s\n", strerror(errno));
-- widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY);
++ set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
info->bufsz = 0;
return NULL;
}
if (!buffer) {
ErrPrint("Heap: %s\n", strerror(errno));
info->bufsz = 0;
-- widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY);
++ set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
return NULL;
}
buffer = shmat(info->handle, NULL, 0);
if (buffer == (void *)-1) {
ErrPrint("shmat: %s (%d)\n", strerror(errno), info->handle);
-- widget_set_last_status(WIDGET_STATUS_ERROR_FAULT);
++ set_last_result(WIDGET_ERROR_FAULT);
return NULL;
}
return buffer->data;
} else {
ErrPrint("Buffer is not created (%s)\n", info->id);
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
}
break;
default:
DbgPrint("Unknwon FP: %d\n", buffer->type);
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
break;
}
if (!data) {
ErrPrint("buffer data == NIL\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
buffer = container_of(data, struct widget_fb, data);
if (buffer->state != WIDGET_FB_STATE_CREATED) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
switch (buffer->type) {
break;
default:
ErrPrint("Unknwon buffer type\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
break;
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int fb_refcnt(void *data)
int ret;
if (!data) {
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
buffer = container_of(data, struct widget_fb, data);
if (buffer->state != WIDGET_FB_STATE_CREATED) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
switch (buffer->type) {
case WIDGET_FB_TYPE_SHM:
if (shmctl(buffer->refcnt, IPC_STAT, &buf) < 0) {
ErrPrint("Error: %s\n", strerror(errno));
-- widget_set_last_status(WIDGET_STATUS_ERROR_FAULT);
-- return WIDGET_STATUS_ERROR_FAULT;
++ set_last_result(WIDGET_ERROR_FAULT);
++ return WIDGET_ERROR_FAULT;
}
ret = buf.shm_nattch;
ret = buffer->refcnt;
break;
default:
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
break;
}
{
if (!info) {
ErrPrint("Handle is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
*w = info->w;
*h = info->h;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int fb_size(struct fb_info *info)
{
if (!info) {
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return 0;
}
buffer = info->buffer;
if (!buffer) { /* Ignore this sync request */
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
if (buffer->state != CREATED) {
ErrPrint("Invalid state of a FB\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (buffer->type != WIDGET_BUFFER_TYPE_FILE) {
ErrPrint("Invalid buffer\n");
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
fd = open(util_uri_to_path(info->id), O_RDONLY);
*
* and then update it after it gots update events
*/
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
if (read(fd, buffer->data, info->bufsz) != info->bufsz) {
*
* and then update it after it gots update events
*/
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
if (close(fd) < 0) {
ErrPrint("close: %s\n", strerror(errno));
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int fb_sync(struct fb_info *info, int x, int y, int w, int h)
{
if (!info) {
ErrPrint("FB Handle is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!info->id || info->id[0] == '\0') {
DbgPrint("Ingore sync\n");
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
if (!strncasecmp(info->id, SCHEMA_FILE, strlen(SCHEMA_FILE))) {
} else if (!strncasecmp(info->id, SCHEMA_PIXMAP, strlen(SCHEMA_PIXMAP))) {
} else if (!strncasecmp(info->id, SCHEMA_SHM, strlen(SCHEMA_SHM))) {
/* No need to do sync */
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
struct fb_info *fb_create(const char *id, int w, int h)
free(info);
return NULL;
} else {
-- info->handle = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ info->handle = WIDGET_ERROR_INVALID_PARAMETER;
}
info->bufsz = 0;
{
if (!info) {
ErrPrint("Handle is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (info->buffer) {
free(info->id);
free(info);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int fb_is_created(struct fb_info *info)
if (!info) {
ErrPrint("info == NIL\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (!info->buffer) {
if (!strncasecmp(info->id, SCHEMA_PIXMAP, strlen(SCHEMA_PIXMAP))) {
ErrPrint("Unsupported Type\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
} else if (!strncasecmp(info->id, SCHEMA_FILE, strlen(SCHEMA_FILE))) {
update_fb_size(info);
if (!buffer) {
ErrPrint("Heap: %s\n", strerror(errno));
info->bufsz = 0;
-- widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY);
++ set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
return NULL;
}
buffer = shmat(info->handle, NULL, 0);
if (buffer == (void *)-1) {
ErrPrint("shmat: %s (%d)\n", strerror(errno), info->handle);
-- widget_set_last_status(WIDGET_STATUS_ERROR_FAULT);
++ set_last_result(WIDGET_ERROR_FAULT);
return NULL;
}
return buffer->data;
} else {
ErrPrint("Buffer is not created (%s)\n", info->id);
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
}
case WIDGET_BUFFER_TYPE_PIXMAP:
default:
DbgPrint("Unknwon FP: %d\n", buffer->type);
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
break;
}
if (!data) {
ErrPrint("buffer data == NIL\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
buffer = container_of(data, struct buffer, data);
if (buffer->state != CREATED) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
switch (buffer->type) {
case WIDGET_BUFFER_TYPE_PIXMAP:
default:
ErrPrint("Unknwon buffer type\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
break;
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int fb_refcnt(void *data)
int ret;
if (!data) {
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
buffer = container_of(data, struct buffer, data);
if (buffer->state != CREATED) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
switch (buffer->type) {
case WIDGET_BUFFER_TYPE_SHM:
if (shmctl(buffer->refcnt, IPC_STAT, &buf) < 0) {
ErrPrint("Error: %s\n", strerror(errno));
-- widget_set_last_status(WIDGET_STATUS_ERROR_FAULT);
-- return WIDGET_STATUS_ERROR_FAULT;
++ set_last_result(WIDGET_ERROR_FAULT);
++ return WIDGET_ERROR_FAULT;
}
ret = buf.shm_nattch;
break;
case WIDGET_BUFFER_TYPE_PIXMAP:
default:
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
break;
}
{
if (!info) {
ErrPrint("Handle is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
*w = info->w;
*h = info->h;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int fb_size(struct fb_info *info)
{
if (!info) {
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return 0;
}
*/
static void write_item_to_pipe(struct request_item *item, int ret)
{
-- item->ret = WIDGET_STATUS_ERROR_FAULT;
++ item->ret = WIDGET_ERROR_FAULT;
if (write(s_info.evt_pipe[PIPE_WRITE], &item, sizeof(item)) != sizeof(item)) {
ErrPrint("write: %s\n", strerror(errno));
free(item->filename);
head = malloc(recvsz);
if (!head) {
ErrPrint("Heap: %s\n", strerror(errno));
-- ret = WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ ret = WIDGET_ERROR_OUT_OF_MEMORY;
write_item_to_pipe(item, ret);
item = NULL;
break;
free(head);
head = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
write_item_to_pipe(item, ret);
item = NULL;
break;
head = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ ret = WIDGET_ERROR_OUT_OF_MEMORY;
write_item_to_pipe(item, ret);
item = NULL;
break;
free(head);
head = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
write_item_to_pipe(item, ret);
item = NULL;
break;
head = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_IO_ERROR;
++ ret = WIDGET_ERROR_IO_ERROR;
write_item_to_pipe(item, ret);
item = NULL;
break;
free(head);
head = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
write_item_to_pipe(item, ret);
item = NULL;
}
free(head);
head = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ ret = WIDGET_ERROR_OUT_OF_MEMORY;
write_item_to_pipe(item, ret);
item = NULL;
break;
free(body);
body = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
write_item_to_pipe(item, ret);
item = NULL;
break;
free(body);
body = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
write_item_to_pipe(item, ret);
item = NULL;
break;
body = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ ret = WIDGET_ERROR_OUT_OF_MEMORY;
write_item_to_pipe(item, ret);
item = NULL;
break;
body = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_IO_ERROR;
++ ret = WIDGET_ERROR_IO_ERROR;
write_item_to_pipe(item, ret);
item = NULL;
break;
if (close(file_fd) < 0) {
ErrPrint("close: %s\n", strerror(errno));
}
-- ret = WIDGET_STATUS_ERROR_NONE;
++ ret = WIDGET_ERROR_NONE;
write_item_to_pipe(item, ret);
item = NULL;
}
head = NULL;
recv_state = RECV_INIT;
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
write_item_to_pipe(item, ret);
item = NULL;
}
break;
default:
ErrPrint("Unknown event: %d\n", recv_state);
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
write_item_to_pipe(item, ret);
item = NULL;
break;
if (packet_get(packet, "i", &ret) != 1) {
ErrPrint("Invalid result packet\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
out:
if (!command) {
ErrPrint("Failed to create a command\n");
packet_unref(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
command->ret_cb = ret_cb;
}
packet_unref(packet);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int master_rpc_request_only(widget_h handler, struct packet *packet)
if (!command) {
ErrPrint("Failed to create a command\n");
packet_unref(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
command->ret_cb = NULL;
push_command(command);
packet_unref(packet);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int master_rpc_clear_fault_package(const char *pkgname)
struct command *command;
if (!pkgname) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
dlist_foreach_safe(s_info.cmd_list, l, n, command) {
if (result) {
if (packet_get(result, "i", &ret) != 1) {
ErrPrint("Invalid result packet\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
packet_unref(result);
} else {
ErrPrint("Failed to send a sync request\n");
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
}
packet_unref(packet);
name_len = strlen(filename);
while (--name_len >= 0 && *check_ptr) {
if (filename[name_len] != *check_ptr) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
check_ptr ++;
int ret;
if (!filename) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
desclen = strlen(filename) + 6; /* .desc */
descfile = malloc(desclen);
if (!descfile) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
ret = snprintf(descfile, desclen, "%s.desc", filename);
if (ret < 0) {
ErrPrint("Error: %s\n", strerror(errno));
free(descfile);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
(void)unlink(descfile);
free(descfile);
(void)unlink(filename);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
/* End of a file */
}
*/
-- return ret > 0 ? WIDGET_STATUS_ERROR_NONE : WIDGET_STATUS_ERROR_FAULT;
++ return ret > 0 ? WIDGET_ERROR_NONE : WIDGET_ERROR_FAULT;
}
static inline void default_create_cb(widget_h handle, int ret, void *data)
int ret;
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
goto errout;
} else if (packet_get(result, "i", &ret) != 1) {
ErrPrint("Invalid argument\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto errout;
}
handle->common->request.update_mode = 0;
if (handle->common->state != WIDGET_STATE_DELETE) {
-- if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
_widget_invoke_event_handler(handle, WIDGET_EVENT_DELETED);
_widget_unref(handle, 1);
}
int ret;
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
goto errout;
} else if (packet_get(result, "i", &ret) != 1) {
ErrPrint("Invalid argument\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto errout;
}
handle->common->request.size_changed = 0;
if (handle->common->state != WIDGET_STATE_DELETE) {
-- if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
_widget_invoke_event_handler(handle, WIDGET_EVENT_DELETED);
_widget_unref(handle, 1);
}
_widget_destroy_cb_info(info);
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
} else if (packet_get(result, "i", &ret) != 1) {
ErrPrint("Invalid argument\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
if (cb) {
int ret;
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
goto errout;
} else if (packet_get(result, "i", &ret) != 1) {
ErrPrint("Invalid argument\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto errout;
}
handle->common->request.group_changed = 0;
if (handle->common->state != WIDGET_STATE_DELETE) {
-- if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
_widget_invoke_event_handler(handle, WIDGET_EVENT_DELETED);
_widget_unref(handle, 1);
}
int ret;
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
goto errout;
} else if (packet_get(result, "i", &ret) != 1) {
ErrPrint("Invalid argument\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto errout;
}
handle->common->request.period_changed = 0;
if (handle->common->state != WIDGET_STATE_DELETE) {
-- if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
_widget_invoke_event_handler(handle, WIDGET_EVENT_DELETED);
_widget_unref(handle, 1);
}
int ret;
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
goto errout;
} else if (packet_get(result, "i", &ret) != 1) {
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto errout;
}
handle->common->request.gbar_created = 0;
if (handle->common->state != WIDGET_STATE_DELETE) {
-- if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
_widget_invoke_event_handler(handle, WIDGET_EVENT_DELETED);
_widget_unref(handle, 1);
}
_widget_destroy_cb_info(info);
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
} else if (packet_get(result, "is", &ret, &pkgname) != 2) {
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
if (cb) {
if (!result) {
ErrPrint("Result is NIL (may connection lost)\n");
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
} else if (packet_get(result, "i", &ret) != 1) {
ErrPrint("Invalid parameter\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret == (int)WIDGET_ERROR_NONE) {
handle->cbs.gbar_destroyed.cb = cb;
handle->cbs.gbar_destroyed.data = cbdata;
} else {
_widget_destroy_cb_info(info);
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
} else if (packet_get(result, "i", &ret) != 1) {
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
if (cb) {
_widget_destroy_cb_info(info);
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
} else if (packet_get(result, "i", &ret) != 1) {
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
if (cb) {
id = fb_id(handle->common->widget.fb);
if (!id || strncasecmp(id, SCHEMA_PIXMAP, strlen(SCHEMA_PIXMAP))) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
packet = packet_create((const char *)&cmd, "ss", handle->common->pkgname, handle->common->id);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
packet_destroy(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(handle, packet, 0, widget_pixmap_acquired_cb, cbinfo);
static void widget_pixmap_acquired_cb(widget_h handle, const struct packet *result, void *data)
{
int pixmap;
-- int ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ int ret = WIDGET_ERROR_INVALID_PARAMETER;
widget_ret_cb cb;
void *cbdata;
struct cb_info *info = data;
pixmap = 0;
}
-- if (ret == (int)WIDGET_STATUS_ERROR_BUSY) {
++ if (ret == (int)WIDGET_ERROR_RESOURCE_BUSY) {
ret = _widget_acquire_widget_pixmap(handle, cb, cbdata);
DbgPrint("Busy, Try again: %d\n", ret);
/* Try again */
-- } else if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ } else if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
if (cb) {
cb(handle, pixmap, cbdata);
}
static void widget_xpixmap_acquired_cb(widget_h handle, const struct packet *result, void *data)
{
int pixmap;
-- int ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ int ret = WIDGET_ERROR_INVALID_PARAMETER;
widget_ret_cb cb;
void *cbdata;
struct cb_info *info = data;
}
if (handle->common->state != WIDGET_STATE_DELETE) {
-- if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
_widget_invoke_event_handler(handle, WIDGET_EVENT_DELETED);
_widget_unref(handle, 1);
}
packet = packet_create((const char *)&cmd, "ssi", handle->common->pkgname, handle->common->id, idx);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
packet_destroy(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(handle, packet, 0, gbar_xpixmap_acquired_cb, cbinfo);
packet = packet_create((const char *)&cmd, "ssi", handle->common->pkgname, handle->common->id, idx);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
packet_destroy(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(handle, packet, 0, widget_xpixmap_acquired_cb, cbinfo);
id = fb_id(handle->common->gbar.fb);
if (!id || strncasecmp(id, SCHEMA_PIXMAP, strlen(SCHEMA_PIXMAP))) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
packet = packet_create((const char *)&cmd, "ss", handle->common->pkgname, handle->common->id);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
packet_destroy(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(handle, packet, 0, gbar_pixmap_acquired_cb, cbinfo);
if (!result) {
pixmap = 0; /* PIXMAP 0 means error */
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
} else if (packet_get(result, "ii", &pixmap, &ret) != 2) {
pixmap = 0;
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
if (cb) {
}
if (handle->common->state != WIDGET_STATE_DELETE) {
-- if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
_widget_invoke_event_handler(handle, WIDGET_EVENT_DELETED);
_widget_unref(handle, 1);
}
if (!result) {
pixmap = 0; /* PIXMAP 0 means error */
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
} else if (packet_get(result, "ii", &pixmap, &ret) != 2) {
pixmap = 0;
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
-- if (ret == (int)WIDGET_STATUS_ERROR_BUSY) {
++ if (ret == (int)WIDGET_ERROR_RESOURCE_BUSY) {
ret = widget_acquire_gbar_pixmap(handle, cb, cbdata);
DbgPrint("Busy, Try again: %d\n", ret);
/* Try again */
-- } else if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ } else if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
if (cb) {
cb(handle, pixmap, cbdata);
}
int ret;
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
goto errout;
} else if (packet_get(result, "i", &ret) != 1) {
goto errout;
handle->common->request.pinup = 0;
if (handle->common->state != WIDGET_STATE_DELETE) {
-- if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
_widget_invoke_event_handler(handle, WIDGET_EVENT_DELETED);
_widget_unref(handle, 1);
}
int ret;
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
return;
}
if (packet_get(result, "i", &ret) != 1) {
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
return;
}
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
goto errout;
}
handle->common->request.key_event = 0;
if (handle->common->state != WIDGET_STATE_DELETE) {
-- if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
_widget_invoke_event_handler(handle, WIDGET_EVENT_DELETED);
_widget_unref(handle, 1);
}
int ret;
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
return;
}
if (packet_get(result, "i", &ret) != 1) {
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
return;
}
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
goto errout;
}
handle->common->request.access_event = 0;
if (handle->common->state != WIDGET_STATE_DELETE) {
-- if (ret == (int)WIDGET_STATUS_ERROR_NOT_EXIST && handle->refcnt == 2) {
++ if (ret == (int)WIDGET_ERROR_NOT_EXIST && handle->refcnt == 2) {
_widget_invoke_event_handler(handle, WIDGET_EVENT_DELETED);
_widget_unref(handle, 1);
}
packet = packet_create(event, "ssdiii", handle->common->pkgname, handle->common->id, timestamp, x, y, type);
if (!packet) {
ErrPrint("Failed to build packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_async_request(handle, packet, 0, access_ret_cb, NULL);
packet = packet_create(event, "ssdi", handle->common->pkgname, handle->common->id, timestamp, keycode);
if (!packet) {
ErrPrint("Failed to build packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_async_request(handle, packet, 0, key_ret_cb, NULL);
packet = packet_create_noack(event, "ssdii", handle->common->pkgname, handle->common->id, timestamp, x, y);
if (!packet) {
ErrPrint("Failed to build param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(handle, packet);
}
#endif
ret = widget_service_init();
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
return ret;
}
ret = fb_init(disp);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
widget_service_fini();
return ret;
}
ret = client_init(use_thread);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
fb_fini();
widget_service_fini();
return ret;
if (!job_cb) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
item = malloc(sizeof(*item));
if (!item) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
item->handle = _widget_ref(handle);
}
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static void new_ret_cb(widget_h handle, const struct packet *result, void *data)
_widget_destroy_cb_info(info);
if (!result) {
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
} else if (packet_get(result, "i", &ret) != 1) {
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
if (ret >= 0) {
common->widget.period, common->widget.width, common->widget.height);
if (!packet) {
ErrPrint("Failed to create a new packet\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_FAULT);
-- return WIDGET_STATUS_ERROR_FAULT;
++ set_last_result(WIDGET_ERROR_FAULT);
++ return WIDGET_ERROR_FAULT;
}
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
ErrPrint("Failed to create a cbinfo\n");
packet_destroy(packet);
-- widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY);
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
/*!
if (ret < 0) {
ErrPrint("Failed to send a new packet\n");
_widget_destroy_cb_info(cbinfo);
-- widget_set_last_status(WIDGET_STATUS_ERROR_FAULT);
-- return WIDGET_STATUS_ERROR_FAULT;
++ set_last_result(WIDGET_ERROR_FAULT);
++ return WIDGET_ERROR_FAULT;
}
handle->common->request.created = 1;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static void create_cb(widget_h handle, int ret, void *data)
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
ErrPrint("Failed to create a cbinfo\n");
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
-- if (job_add(handle, create_cb, WIDGET_STATUS_ERROR_NONE, cbinfo) != WIDGET_STATUS_ERROR_NONE) {
++ if (job_add(handle, create_cb, WIDGET_ERROR_NONE, cbinfo) != WIDGET_ERROR_NONE) {
_widget_destroy_cb_info(cbinfo);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static void refresh_for_paused_updating_cb(widget_h handle, int ret, void *data)
need_to_add_job = !!handle->paused_updating;
} else if (handle->common->visible == WIDGET_SHOW && state != WIDGET_SHOW) {
if (!!_widget_find_widget_in_show(handle->common)) {
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
} else if (handle->common->visible == WIDGET_SHOW && state == WIDGET_SHOW && handle->paused_updating) {
-- if (job_add(handle, refresh_for_paused_updating_cb, WIDGET_STATUS_ERROR_NONE, NULL) < 0) {
++ if (job_add(handle, refresh_for_paused_updating_cb, WIDGET_ERROR_NONE, NULL) < 0) {
ErrPrint("Unable to add a new job for refreshing box\n");
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
} else {
/*!
* \brief
* No need to send this to the master
*/
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
packet = packet_create_noack((const char *)&cmd, "ssi", handle->common->pkgname, handle->common->id, (int)state);
if (!packet) {
ErrPrint("Failed to create a packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_request_only(handle, packet);
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret == (int)WIDGET_ERROR_NONE) {
DbgPrint("[%s] visibility is changed 0x[%x]\n", handle->common->pkgname, state);
handle->common->visible = state;
if (need_to_add_job) {
-- if (job_add(handle, refresh_for_paused_updating_cb, WIDGET_STATUS_ERROR_NONE, NULL) < 0) {
++ if (job_add(handle, refresh_for_paused_updating_cb, WIDGET_ERROR_NONE, NULL) < 0) {
ErrPrint("Unable to add a new job for refreshing box\n");
}
}
if (handle->common->state != WIDGET_STATE_CREATE) {
DbgPrint("[%s] %d\n", handle->common->pkgname, handle->refcnt);
if (cb) {
-- cb(handle, WIDGET_STATUS_ERROR_NONE, data);
++ cb(handle, WIDGET_ERROR_NONE, data);
}
return;
* call it at here.
*/
if (cb) {
-- cb(handle, WIDGET_STATUS_ERROR_NONE, data);
++ cb(handle, WIDGET_ERROR_NONE, data);
}
}
_widget_send_delete(handle, type, cb, data);
} else {
if (cb) {
-- cb(handle, WIDGET_STATUS_ERROR_NONE, data);
++ cb(handle, WIDGET_ERROR_NONE, data);
}
DbgPrint("Before unref: %d\n", handle->common->refcnt);
{
if (s_info.init_count > 0) {
s_info.init_count++;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
/*!
{
if (s_info.init_count <= 0) {
ErrPrint("Doesn't initialized\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
s_info.init_count--;
if (s_info.init_count > 0) {
ErrPrint("init count : %d\n", s_info.init_count);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
client_fini();
fb_fini();
widget_service_fini();
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI widget_h widget_viewer_add_widget(const char *pkgname, const char *content, const char *cluster, const char *category, double period, widget_size_type_e type, widget_ret_cb cb, void *data)
if (!pkgname || !cluster || !category) {
ErrPrint("Invalid arguments: pkgname[%p], cluster[%p], category[%p]\n",
pkgname, cluster, category);
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
widgetid = _widget_pkgname(pkgname);
if (!widgetid) {
ErrPrint("Invalid package: %s\n", pkgname);
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (widget_service_is_enabled(widgetid) == 0) {
DbgPrint("Livebox [%s](%s) is disabled package\n", widgetid, pkgname);
free(widgetid);
-- widget_set_last_status(WIDGET_STATUS_ERROR_DISABLED);
++ set_last_result(WIDGET_ERROR_DISABLED);
return NULL;
}
if (!handle) {
ErrPrint("Error: %s\n", strerror(errno));
free(widgetid);
-- widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY);
++ set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
return NULL;
}
EAPI int widget_viewer_get_period(widget_h handle, double *period)
{
-- int ret = WIDGET_STATUS_ERROR_NONE;
++ int ret = WIDGET_ERROR_NONE;
double result_period = -1.0f;
if (!handle || handle->state != WIDGET_STATE_CREATE || period == NULL) {
ErrPrint("Handler is not valid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (!handle->common->id) {
ErrPrint("Hnalder is not valid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->common->request.period_changed) {
ErrPrint("Previous request for changing period is not finished\n");
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
if (!handle->common->is_user) {
ErrPrint("CA Livebox is not able to change the period\n");
-- return WIDGET_STATUS_ERROR_PERMISSION_DENIED;
++ return WIDGET_ERROR_PERMISSION_DENIED;
}
if (handle->common->widget.period == period) {
DbgPrint("No changes\n");
-- return WIDGET_STATUS_ERROR_ALREADY;
++ return WIDGET_ERROR_ALREADY_EXIST;
}
packet = packet_create((const char *)&cmd, "ssd", handle->common->pkgname, handle->common->id, period);
if (!packet) {
ErrPrint("Failed to build a packet %s\n", handle->common->pkgname);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (!cb) {
}
ret = master_rpc_async_request(handle, packet, 0, period_ret_cb, NULL);
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret == (int)WIDGET_ERROR_NONE) {
handle->cbs.period_changed.cb = cb;
handle->cbs.period_changed.data = data;
handle->common->request.period_changed = 1;
if (!handle) {
ErrPrint("Handler is NIL\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is already deleted\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
handle->state = WIDGET_STATE_DELETE;
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
ErrPrint("Failed to create a cbinfo\n");
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
-- if (job_add(handle, _job_del_cb, type, cbinfo) != WIDGET_STATUS_ERROR_NONE) {
++ if (job_add(handle, _job_del_cb, type, cbinfo) != WIDGET_ERROR_NONE) {
ErrPrint("Failed to add a new job\n");
_widget_destroy_cb_info(cbinfo);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_add_fault_handler(widget_fault_handler_cb widget_cb, void *data)
{
if (!widget_cb) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return _widget_add_fault_handler(widget_cb, data);
{
if (!widget_cb) {
ErrPrint("Invalid argument widget_cb is nil\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return _widget_add_event_handler(widget_cb, data);
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is Invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is Invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is Invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->common->request.update_mode) {
ErrPrint("Previous update_mode cb is not finished yet\n");
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
if (handle->common->is_active_update == active_update) {
-- return WIDGET_STATUS_ERROR_ALREADY;
++ return WIDGET_ERROR_ALREADY_EXIST;
}
if (!handle->common->is_user) {
-- return WIDGET_STATUS_ERROR_PERMISSION_DENIED;
++ return WIDGET_ERROR_PERMISSION_DENIED;
}
packet = packet_create((const char *)&cmd, "ssi", handle->common->pkgname, handle->common->id, active_update);
if (!packet) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (!cb) {
}
ret = master_rpc_async_request(handle, packet, 0, update_mode_cb, NULL);
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret == (int)WIDGET_ERROR_NONE) {
handle->cbs.update_mode.cb = cb;
handle->cbs.update_mode.data = data;
handle->common->request.update_mode = 1;
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is Invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is Invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return handle->common->is_active_update;
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
/*!
*/
if (handle->cbs.size_changed.cb) {
ErrPrint("Previous resize request is not finished yet\n");
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
if (widget_service_get_size(type, &w, &h) != 0) {
ErrPrint("Invalid size type\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->common->widget.width == w && handle->common->widget.height == h) {
DbgPrint("No changes\n");
-- return WIDGET_STATUS_ERROR_ALREADY;
++ return WIDGET_ERROR_ALREADY_EXIST;
}
if (!handle->common->is_user) {
ErrPrint("CA Livebox is not able to be resized\n");
-- return WIDGET_STATUS_ERROR_PERMISSION_DENIED;
++ return WIDGET_ERROR_PERMISSION_DENIED;
}
if (handle->common->refcnt <= 1) {
packet = packet_create((const char *)&cmd, "ssii", handle->common->pkgname, handle->common->id, w, h);
if (!packet) {
ErrPrint("Failed to build param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (!cb) {
}
ret = master_rpc_async_request(handle, packet, 0, resize_cb, NULL);
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret == (int)WIDGET_ERROR_NONE) {
handle->cbs.size_changed.cb = cb;
handle->cbs.size_changed.data = data;
handle->common->request.size_changed = 1;
common = _widget_create_common_handle(handle, old_common->pkgname, old_common->cluster, old_common->category);
if (!common) {
ErrPrint("Failed to create common handle\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
_widget_set_size(common, w, h);
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
ErrPrint("Failed to create a cbinfo\n");
-- ret = WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ ret = WIDGET_ERROR_OUT_OF_MEMORY;
} else {
-- ret = job_add(handle, _resize_job_cb, WIDGET_STATUS_ERROR_NONE, cbinfo);
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ ret = job_add(handle, _resize_job_cb, WIDGET_ERROR_NONE, cbinfo);
++ if (ret == (int)WIDGET_ERROR_NONE) {
struct widget_common *old_common;
old_common = handle->common;
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->common->widget.auto_launch) {
packet = packet_create_noack((const char *)&cmd, "sssddd", handle->common->pkgname, handle->common->id, "clicked", timestamp, x, y);
if (!packet) {
ErrPrint("Failed to build param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_request_only(handle, packet);
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return !!handle->common->gbar.fb;
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->gbar.fb || !handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return handle->common->is_gbar_created;
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->gbar.fb || !handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
/*!
*/
if (handle->common->is_gbar_created) {
DbgPrint("GBAR is already created\n");
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
if (handle->common->request.gbar_created) {
ErrPrint("Previous request is not completed yet\n");
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
/*!
* Turn off the gbar_destroyed request flag
*/
if (handle->common->request.gbar_destroyed) {
-- if (job_add(handle, _turn_off_gbar_destroyed_flag_cb, WIDGET_STATUS_ERROR_CANCEL, NULL) < 0) {
++ if (job_add(handle, _turn_off_gbar_destroyed_flag_cb, WIDGET_ERROR_CANCELED, NULL) < 0) {
ErrPrint("Failed to add gbar_destroyed job\n");
}
}
packet = packet_create((const char *)&cmd, "ssdd", handle->common->pkgname, handle->common->id, x, y);
if (!packet) {
ErrPrint("Failed to build param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (!cb) {
DbgPrint("PERF_WIDGET\n");
ret = master_rpc_async_request(handle, packet, 0, gbar_create_cb, NULL);
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret == (int)WIDGET_ERROR_NONE) {
handle->cbs.gbar_created.cb = cb;
handle->cbs.gbar_created.data = data;
handle->common->request.gbar_created = 1;
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->gbar.fb || !handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->is_gbar_created) {
ErrPrint("GBAR is not created\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
packet = packet_create_noack((const char *)&cmd, "ssdd", handle->common->pkgname, handle->common->id, x, y);
if (!packet) {
ErrPrint("Failed to build param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(handle, packet);
int ret;
if (!pkgname) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
packet = packet_create((const char *)&cmd, "s", pkgname);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
ErrPrint("Unable to create cbinfo\n");
packet_destroy(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(NULL, packet, 0, activated_cb, cbinfo);
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->gbar.fb || !handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
/*!
*/
if (!handle->common->is_gbar_created && !handle->common->request.gbar_created) {
ErrPrint("GBAR is not created\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->common->request.gbar_destroyed) {
ErrPrint("GBAR destroy request is already sent\n");
-- return WIDGET_STATUS_ERROR_ALREADY;
++ return WIDGET_ERROR_ALREADY_EXIST;
}
/*!
* Disable the gbar_created request flag
*/
if (handle->common->request.gbar_created) {
-- if (job_add(handle, _turn_off_gbar_created_flag_cb, WIDGET_STATUS_ERROR_CANCEL, NULL) < 0) {
++ if (job_add(handle, _turn_off_gbar_created_flag_cb, WIDGET_ERROR_CANCELED, NULL) < 0) {
ErrPrint("Failed to add a new job\n");
}
}
packet = packet_create((const char *)&cmd, "ss", handle->common->pkgname, handle->common->id);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (!cb) {
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
packet_destroy(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(handle, packet, 0, gbar_destroy_cb, cbinfo);
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->common->request.access_event) {
ErrPrint("Previous access event is not yet done\n");
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
if (type & WIDGET_ACCESS_EVENT_GBAR_MASK) {
if (!handle->common->is_gbar_created) {
ErrPrint("GBAR is not created\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
w = handle->common->gbar.width;
ret = info->type;
break;
default:
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
} else if (type & WIDGET_ACCESS_EVENT_WIDGET_MASK) {
ret = info->type;
break;
default:
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
} else {
ErrPrint("Invalid event type\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!cb) {
}
ret = send_access_event(handle, (const char *)&cmd, info->x * w, info->y * h, ret);
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret == (int)WIDGET_ERROR_NONE) {
handle->cbs.access_event.cb = cb;
handle->cbs.access_event.data = data;
handle->common->request.access_event = 1;
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!(type & WIDGET_MOUSE_EVENT_MASK)) {
ErrPrint("Invalid content event is used\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (type & WIDGET_MOUSE_EVENT_GBAR_MASK) {
if (!handle->common->is_gbar_created) {
ErrPrint("GBAR is not created\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->gbar.fb) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (type & WIDGET_MOUSE_EVENT_MOVE) {
if (fabs(info->x - handle->common->gbar.x) < conf_event_filter() && fabs(info->y - handle->common->gbar.y) < conf_event_filter()) {
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
} else if (type & WIDGET_MOUSE_EVENT_SET) {
flag = 0;
break;
default:
ErrPrint("Invalid event type\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
} else if (type & WIDGET_MOUSE_EVENT_WIDGET_MASK) {
if (!handle->common->widget.fb) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (type & WIDGET_MOUSE_EVENT_MOVE) {
if (fabs(info->x - handle->common->widget.x) < conf_event_filter() && fabs(info->y - handle->common->widget.y) < conf_event_filter()) {
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
} else if (type & WIDGET_MOUSE_EVENT_SET) {
flag = 0;
break;
case WIDGET_MOUSE_EVENT_MOVE | WIDGET_MOUSE_EVENT_MASK:
if (!handle->common->widget.mouse_event) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
cmd = CMD_WIDGET_MOUSE_MOVE;
break;
case WIDGET_MOUSE_EVENT_SET | WIDGET_MOUSE_EVENT_MASK:
if (!handle->common->widget.mouse_event) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
cmd = CMD_WIDGET_MOUSE_SET;
break;
case WIDGET_MOUSE_EVENT_UNSET | WIDGET_MOUSE_EVENT_MASK:
if (!handle->common->widget.mouse_event) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
cmd = CMD_WIDGET_MOUSE_UNSET;
break;
break;
default:
ErrPrint("Invalid event type\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
} else {
ErrPrint("Invalid event type\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return send_mouse_event(handle, (const char *)&cmd, info->x * w, info->y * h);
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!(type & WIDGET_KEY_EVENT_MASK)) {
ErrPrint("Invalid key event is used\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->common->request.key_event) {
ErrPrint("Previous key event is not completed yet\n");
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
if (type & WIDGET_MOUSE_EVENT_GBAR_MASK) {
if (!handle->common->is_gbar_created) {
ErrPrint("GBAR is not created\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->gbar.fb) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (type & WIDGET_KEY_EVENT_DOWN) {
break;
default:
ErrPrint("Invalid event type\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
} else if (type & WIDGET_MOUSE_EVENT_WIDGET_MASK) {
if (!handle->common->widget.fb) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (type & WIDGET_KEY_EVENT_DOWN) {
break;
default:
ErrPrint("Invalid event type\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
} else {
ErrPrint("Invalid event type\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!cb) {
}
ret = send_key_event(handle, (const char *)&cmd, info->keycode);
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret == (int)WIDGET_ERROR_NONE) {
handle->cbs.key_event.cb = cb;
handle->cbs.key_event.data = data;
handle->common->request.key_event = 1;
}
/* Oooops */
-- widget_set_last_status(WIDGET_STATUS_ERROR_NONE);
++ set_last_result(WIDGET_ERROR_NONE);
return util_uri_to_path(handle->common->id);
}
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!w) {
*h = handle->common->gbar.height;
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_get_size_type(widget_h handle, widget_size_type_e *size_type)
{
int w;
int h;
-- int ret = WIDGET_STATUS_ERROR_NONE;
++ int ret = WIDGET_ERROR_NONE;
widget_size_type_e result_size_type = WIDGET_SIZE_TYPE_UNKNOWN;
if (!handle || handle->state != WIDGET_STATE_CREATE || size_type == NULL) {
ErrPrint("Handler is invalid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (!fb_is_created(handle->common->widget.fb)) {
w = 0;
h = 0;
-- ret = WIDGET_STATUS_ERROR_NOT_EXIST;
++ ret = WIDGET_ERROR_NOT_EXIST;
}
break;
default:
break;
}
-- if ((ret = widget_service_get_size_type(w, h, &result_size_type)) != WIDGET_STATUS_ERROR_NONE) {
++ if ((ret = widget_service_get_size_type(w, h, &result_size_type)) != WIDGET_ERROR_NONE) {
ErrPrint("widget_service_get_size_type failed : %d\n", ret);
goto out;
}
if (!handle) {
ErrPrint("Handler is NIL\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!cluster || !category || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->common->request.group_changed) {
ErrPrint("Previous group changing request is not finished yet\n");
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
if (!handle->common->is_user) {
ErrPrint("CA Livebox is not able to change the group\n");
-- return WIDGET_STATUS_ERROR_PERMISSION_DENIED;
++ return WIDGET_ERROR_PERMISSION_DENIED;
}
if (!strcmp(handle->common->cluster, cluster) && !strcmp(handle->common->category, category)) {
DbgPrint("No changes\n");
-- return WIDGET_STATUS_ERROR_ALREADY;
++ return WIDGET_ERROR_ALREADY_EXIST;
}
packet = packet_create((const char *)&cmd, "ssss", handle->common->pkgname, handle->common->id, cluster, category);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (!cb) {
}
ret = master_rpc_async_request(handle, packet, 0, set_group_ret_cb, NULL);
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret == (int)WIDGET_ERROR_NONE) {
handle->cbs.group_changed.cb = cb;
handle->cbs.group_changed.data = data;
handle->common->request.group_changed = 1;
{
if (!handle) {
ErrPrint("Handler is NIL\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!cluster || !category || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
*cluster = handle->common->cluster;
*category = handle->common->category;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_get_supported_sizes(widget_h handle, int *cnt, widget_size_type_e *size_list)
if (!handle || !size_list) {
ErrPrint("Invalid argument, handle(%p), size_list(%p)\n", handle, size_list);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!cnt || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
for (j = i = 0; i < WIDGET_NR_OF_SIZE_LIST; i++) {
}
*cnt = j;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI const char *widget_viewer_get_pkgname(widget_h handle)
{
if (!handle) {
ErrPrint("Handler is NIL\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
-- widget_set_last_status(WIDGET_STATUS_ERROR_NONE);
++ set_last_result(WIDGET_ERROR_NONE);
return handle->common->pkgname;
}
EAPI int widget_viewer_get_priority(widget_h handle, double *priority)
{
-- int ret = WIDGET_STATUS_ERROR_NONE;
++ int ret = WIDGET_ERROR_NONE;
double result_priority = -1.0f;
if (!handle || handle->state != WIDGET_STATE_CREATE || priority == NULL) {
ErrPrint("Handler is invalid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid (%p)\n", handle);
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
packet = packet_create((const char *)&cmd, "s", cluster);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
packet_destroy(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(NULL, packet, 0, _delete_cluster_cb, cbinfo);
packet = packet_create((const char *)&cmd, "ss", cluster, category);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
packet_destroy(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(NULL, packet, 0, _delete_category_cb, cbinfo);
EAPI int widget_viewer_get_type(widget_h handle, int gbar, widget_type_e *widget_type)
{
-- int ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ int ret = WIDGET_ERROR_INVALID_PARAMETER;
widget_type_e result_widget_type = WIDGET_CONTENT_TYPE_INVALID;
if (!handle || handle->state != WIDGET_STATE_CREATE || widget_type == NULL) {
ErrPrint("Handler is invalid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
result_widget_type = WIDGET_CONTENT_TYPE_INVALID;
goto out;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
result_widget_type = WIDGET_CONTENT_TYPE_INVALID;
goto out;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
result_widget_type = WIDGET_CONTENT_TYPE_INVALID;
goto out;
}
{
if (!handle) {
ErrPrint("Handler is NIL\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (gbar) {
memcpy(&handle->cbs.widget_ops, ops, sizeof(*ops));
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_acquire_extra_resource_id(widget_h handle, int gbar, int idx, widget_ret_cb cb, void *data)
{
if (idx < 0) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (gbar) {
* handle->common.gbar.type == unknown
*/
if (!handle->common->gbar.extra_buffer) {
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
if (idx >= conf_extra_buffer_count()) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return widget_acquire_gbar_extra_pixmap(handle, idx, cb, data);
*/
if (!handle->common->widget.extra_buffer) {
ErrPrint("Extra buffer is not prepared\n");
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
if (idx >= conf_extra_buffer_count()) {
ErrPrint("Invalid parameter: %d / %d\n", idx, conf_extra_buffer_count());
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return widget_acquire_widget_extra_pixmap(handle, idx, cb, data);
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (gbar) {
if (handle->common->gbar.type != GBAR_TYPE_SCRIPT && handle->common->gbar.type != GBAR_TYPE_BUFFER) {
ErrPrint("Handler is not valid type\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return widget_acquire_gbar_pixmap(handle, cb, data);
} else {
if (handle->common->widget.type != WIDGET_TYPE_SCRIPT && handle->common->widget.type != WIDGET_TYPE_BUFFER) {
ErrPrint("Handler is not valid type\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return _widget_acquire_widget_pixmap(handle, cb, data);
if (resource_id == 0 /* || handle->state != WIDGET_STATE_CREATE */) {
ErrPrint("Pixmap is invalid [%d]\n", resource_id);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (gbar) {
} else {
if (!handle->common /* || handle-common->state != WIDGET_STATE_CREATE */) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
/**
} else {
if (!handle->common /* || handle->common->state != WIDGET_STATE_CREATE */) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
/**
packet = packet_create_noack((const char *)&cmd, "ssi", pkgname, id, resource_id);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(handle, packet);
EAPI unsigned int widget_extra_resource_id(const widget_h handle, int gbar, int idx)
{
if (idx < 0) {
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return 0u;
}
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return 0u;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return 0u;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return 0u;
}
*/
if (!handle->common->gbar.extra_buffer || handle->common->gbar.last_extra_buffer_idx < 0) {
-- widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST);
++ set_last_result(WIDGET_ERROR_NOT_EXIST);
return 0u;
}
*/
if (!handle->common->widget.extra_buffer || handle->common->widget.last_extra_buffer_idx < 0) {
-- widget_set_last_status(WIDGET_STATUS_ERROR_NOT_EXIST);
++ set_last_result(WIDGET_ERROR_NOT_EXIST);
return 0u;
}
{
const char *id;
unsigned int pixmap = 0u;
-- int ret = WIDGET_STATUS_ERROR_NONE;
++ int ret = WIDGET_ERROR_NONE;
if (!handle || handle->state != WIDGET_STATE_CREATE || resouce_id == NULL) {
ErrPrint("Handler is invalid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
if (gbar) {
if (handle->common->gbar.type != GBAR_TYPE_SCRIPT && handle->common->gbar.type != GBAR_TYPE_BUFFER) {
ErrPrint("Invalid handle\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
id = fb_id(handle->common->gbar.fb);
if (id && sscanf(id, SCHEMA_PIXMAP "%u", &pixmap) != 1) {
ErrPrint("PIXMAP Id is not valid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
}
else {
if (handle->common->widget.type != WIDGET_TYPE_SCRIPT && handle->common->widget.type != WIDGET_TYPE_BUFFER) {
ErrPrint("Invalid handle\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
id = fb_id(handle->common->widget.fb);
if (id && sscanf(id, SCHEMA_PIXMAP "%u", &pixmap) != 1) {
ErrPrint("PIXMAP Id is not valid\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
goto out;
}
}
if (gbar) {
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (handle->common->gbar.type != GBAR_TYPE_SCRIPT && handle->common->gbar.type != GBAR_TYPE_BUFFER) {
ErrPrint("Handler is not valid type\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
} else {
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (handle->common->widget.type != WIDGET_TYPE_SCRIPT && handle->common->widget.type != WIDGET_TYPE_BUFFER) {
ErrPrint("Handler is not valid type\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (gbar) {
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return handle->common->is_user;
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->common->request.pinup) {
ErrPrint("Previous pinup request is not finished\n");
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
if (handle->common->is_pinned_up == flag) {
DbgPrint("No changes\n");
-- return WIDGET_STATUS_ERROR_ALREADY;
++ return WIDGET_ERROR_ALREADY_EXIST;
}
packet = packet_create((const char *)&cmd, "ssi", handle->common->pkgname, handle->common->id, flag);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (!cb) {
}
ret = master_rpc_async_request(handle, packet, 0, pinup_done_cb, NULL);
-- if (ret == (int)WIDGET_STATUS_ERROR_NONE) {
++ if (ret == (int)WIDGET_ERROR_NONE) {
handle->cbs.pinup.cb = cb;
handle->cbs.pinup.data = data;
handle->common->request.pinup = 1;
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return handle->common->is_pinned_up;
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return handle->common->widget.pinup_supported;
{
if (!handle) {
ErrPrint("Handler is NIL\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
handle->data = data;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI void *widget_viewer_get_data(widget_h handle)
{
if (!handle) {
ErrPrint("Handler is NIL\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
-- widget_set_last_status(WIDGET_STATUS_ERROR_NONE);
++ set_last_result(WIDGET_ERROR_NONE);
return handle->common->content;
}
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
-- widget_set_last_status(WIDGET_STATUS_ERROR_NONE);
++ set_last_result(WIDGET_ERROR_NONE);
return handle->common->title;
}
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (handle->common->widget.type != WIDGET_TYPE_TEXT && handle->common->gbar.type != GBAR_TYPE_TEXT) {
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!event_info) {
ErrPrint("Invalid event info\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
emission = event_info->emission;
event_info->geometry.ex, event_info->geometry.ey);
if (!packet) {
ErrPrint("Failed to build a param\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
cbinfo = _widget_create_cb_info(cb, data);
if (!cbinfo) {
packet_destroy(packet);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(handle, packet, 0, text_signal_cb, cbinfo);
packet = packet_create_noack((const char *)&cmd, "ss", cluster ? cluster : "", category ? category : "");
if (!packet) {
ErrPrint("Failed to create a packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(NULL, packet);
packet = packet_create_noack((const char *)&cmd, "ss", cluster ? cluster : "", category ? category : "");
if (!packet) {
ErrPrint("Failed to create a packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(NULL, packet);
unsigned int cmd = CMD_SUBSCRIBE_CATEGORY;
if (!category) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
packet = packet_create_noack((const char *)&cmd, "s", category);
if (!packet) {
ErrPrint("Failed to create a packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(NULL, packet);
unsigned int cmd = CMD_UNSUBSCRIBE_CATEGORY;
if (!category) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
packet = packet_create_noack((const char *)&cmd, "s", category);
if (!packet) {
ErrPrint("Failed to create a packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(NULL, packet);
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
packet = packet_create_noack((const char *)&cmd, "ssi", handle->common->pkgname, handle->common->id, force);
if (!packet) {
ErrPrint("Failed to create a packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(handle, packet);
if (!cluster || !category) {
ErrPrint("Invalid argument\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
packet = packet_create_noack((const char *)&cmd, "ssi", cluster, category, force);
if (!packet) {
ErrPrint("Failed to create a packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(NULL, packet);
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->is_user) {
/* System cluster widget cannot be changed its visible states */
if (state == WIDGET_HIDE_WITH_PAUSE) {
ErrPrint("CA Livebox is not able to change the visibility\n");
-- return WIDGET_STATUS_ERROR_PERMISSION_DENIED;
++ return WIDGET_ERROR_PERMISSION_DENIED;
}
}
if (handle->visible == state) {
DbgPrint("%s has no changes\n", handle->common->pkgname);
-- return WIDGET_STATUS_ERROR_ALREADY;
++ return WIDGET_ERROR_ALREADY_EXIST;
}
old_state = handle->visible;
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return WIDGET_VISIBLE_ERROR;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return WIDGET_VISIBLE_ERROR;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return WIDGET_VISIBLE_ERROR;
}
packet = packet_create_noack((const char *)&cmd, "d", util_timestamp());
if (!packet) {
ErrPrint("Failed to create a pause packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(NULL, packet);
packet = packet_create_noack((const char *)&cmd, "d", util_timestamp());
if (!packet) {
ErrPrint("Failed to create a resume packet\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
return master_rpc_request_only(NULL, packet);
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (gbar) {
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid[%p]\n", handle);
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid[%p]\n", handle);
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
return NULL;
}
EAPI int widget_viewer_acquire_buffer_lock(widget_h handle, int is_gbar)
{
-- int ret = WIDGET_STATUS_ERROR_NONE;
++ int ret = WIDGET_ERROR_NONE;
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid[%p]\n", handle);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Handler is not valid\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid[%p]\n", handle);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (is_gbar) {
ret = widget_service_acquire_lock(handle->common->widget.lock);
}
-- return ret == 0 ? WIDGET_STATUS_ERROR_NONE : WIDGET_STATUS_ERROR_FAULT;
++ return ret == 0 ? WIDGET_ERROR_NONE : WIDGET_ERROR_FAULT;
}
EAPI int widget_viewer_release_buffer_lock(widget_h handle, int is_gbar)
{
-- int ret = WIDGET_STATUS_ERROR_NONE;
++ int ret = WIDGET_ERROR_NONE;
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid[%p]\n", handle);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (is_gbar) {
ret = widget_service_release_lock(handle->common->widget.lock);
}
-- return ret == 0 ? WIDGET_STATUS_ERROR_NONE : WIDGET_STATUS_ERROR_FAULT;
++ return ret == 0 ? WIDGET_ERROR_NONE : WIDGET_ERROR_FAULT;
}
EAPI int widget_viewer_set_option(widget_option_type_e option, int state)
{
-- int ret = WIDGET_STATUS_ERROR_NONE;
++ int ret = WIDGET_ERROR_NONE;
switch (option) {
case WIDGET_OPTION_MANUAL_SYNC:
break;
case WIDGET_OPTION_EXTRA_BUFFER_CNT:
ErrPrint("Permission denied\n");
-- ret = WIDGET_STATUS_ERROR_PERMISSION_DENIED;
++ ret = WIDGET_ERROR_PERMISSION_DENIED;
break;
default:
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
break;
}
{
int ret;
-- widget_set_last_status(WIDGET_STATUS_ERROR_NONE);
++ set_last_result(WIDGET_ERROR_NONE);
switch (option) {
case WIDGET_OPTION_MANUAL_SYNC:
ret = conf_manual_sync();
ret = conf_extra_buffer_count();
break;
default:
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
-- widget_set_last_status(WIDGET_STATUS_ERROR_INVALID_PARAMETER);
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
++ set_last_result(WIDGET_ERROR_INVALID_PARAMETER);
break;
}
s_info.launch.handle = widget_launch_handler;
s_info.launch.data = data;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
-EAPI int widget_viewer_get_damaged_region(widget_h handle, int gbar, const widget_damage_region_t *region)
+EAPI int widget_viewer_get_damaged_region(widget_h handle, int gbar, const widget_damage_region_s *region)
{
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid[%p]\n", handle);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (gbar) {
region = &handle->common->gbar.last_damage;
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_get_affected_extra_buffer(widget_h handle, int gbar, int *idx, unsigned int *resource_id)
if (!handle || handle->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common || handle->common->state != WIDGET_STATE_CREATE) {
ErrPrint("Invalid handle\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!handle->common->id) {
ErrPrint("Handler is not valid[%p]\n", handle);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (!idx) {
if (gbar) {
if (!handle->common->gbar.extra_buffer || handle->common->gbar.last_extra_buffer_idx < 0) {
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
*idx = handle->common->gbar.last_extra_buffer_idx;
*resource_id = handle->common->gbar.extra_buffer[*idx];
} else {
if (!handle->common->widget.extra_buffer || handle->common->widget.last_extra_buffer_idx < 0) {
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
*idx = handle->common->widget.last_extra_buffer_idx;
*resource_id = handle->common->widget.extra_buffer[*idx];
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
/* End of a file */
if (!result) {
ErrPrint("Connection lost?\n");
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
} else if (packet_get(result, "i", &ret) != 1) {
ErrPrint("Invalid argument\n");
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
}
if (ret == 0) {
common = calloc(1, sizeof(*common));
if (!common) {
ErrPrint("Heap: %s\n", strerror(errno));
-- widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY);
++ set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
return NULL;
}
common->pkgname = strdup(pkgname);
if (!common->pkgname) {
free(common);
-- widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY);
++ set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
return NULL;
}
ErrPrint("Error: %s\n", strerror(errno));
free(common->pkgname);
free(common);
-- widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY);
++ set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
return NULL;
}
free(common->cluster);
free(common->pkgname);
free(common);
-- widget_set_last_status(WIDGET_STATUS_ERROR_OUT_OF_MEMORY);
++ set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
return NULL;
}
pc = strdup(cluster);
if (!pc) {
ErrPrint("Heap: %s (cluster: %s)\n", strerror(errno), cluster);
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
if (!ps) {
ErrPrint("Heap: %s (category: %s)\n", strerror(errno), category);
free(pc);
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
common->cluster = pc;
common->category = ps;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
void _widget_set_size(struct widget_common *common, int w, int h)
_widget_unref(handler, 1);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int _widget_set_content(struct widget_common *common, const char *content)
pc = strdup(content);
if (!pc) {
ErrPrint("heap: %s [%s]\n", strerror(errno), content);
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
free(common->content);
common->content = pc;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int _widget_set_title(struct widget_common *common, const char *title)
pt = strdup(title);
if (!pt) {
ErrPrint("heap: %s [%s]\n", strerror(errno), title);
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
}
free(common->title);
common->title = pt;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
void _widget_set_size_list(struct widget_common *common, int size_list)
struct fb_info *fb;
if (!common) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
fb = common->widget.fb;
if (fb && !strcmp(fb_id(fb), filename)) { /*!< BUFFER is not changed, */
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
common->widget.fb = NULL;
if (fb) {
fb_destroy(fb);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
common->widget.fb = fb_create(filename, common->widget.width, common->widget.height);
if (fb) {
fb_destroy(fb);
}
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (fb) {
fb_destroy(fb);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
int _widget_set_gbar_fb(struct widget_common *common, const char *filename)
struct fb_info *fb;
if (!common || common->state != WIDGET_STATE_CREATE) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
fb = common->gbar.fb;
if (fb && !strcmp(fb_id(fb), filename)) {
/* BUFFER is not changed, just update the content */
-- return WIDGET_STATUS_ERROR_EXIST;
++ return WIDGET_ERROR_ALREADY_EXIST;
}
common->gbar.fb = NULL;
if (fb) {
fb_destroy(fb);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
common->gbar.fb = fb_create(filename, common->gbar.width, common->gbar.height);
if (fb) {
fb_destroy(fb);
}
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (fb) {
fb_destroy(fb);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
struct fb_info *_widget_get_widget_fb(struct widget_common *common)
}
if (handler->cbs.created.cb) {
-- handler->cbs.created.cb(handler, WIDGET_STATUS_ERROR_FAULT, handler->cbs.created.data);
++ handler->cbs.created.cb(handler, WIDGET_ERROR_FAULT, handler->cbs.created.data);
handler->cbs.created.cb = NULL;
handler->cbs.created.data = NULL;
}
if (handler->cbs.deleted.cb) {
-- handler->cbs.deleted.cb(handler, WIDGET_STATUS_ERROR_FAULT, handler->cbs.deleted.data);
++ handler->cbs.deleted.cb(handler, WIDGET_ERROR_FAULT, handler->cbs.deleted.data);
handler->cbs.deleted.cb = NULL;
handler->cbs.deleted.data = NULL;
}
if (handler->cbs.pinup.cb) {
-- handler->cbs.pinup.cb(handler, WIDGET_STATUS_ERROR_FAULT, handler->cbs.pinup.data);
++ handler->cbs.pinup.cb(handler, WIDGET_ERROR_FAULT, handler->cbs.pinup.data);
handler->cbs.pinup.cb = NULL;
handler->cbs.pinup.data = NULL;
}
if (handler->cbs.group_changed.cb) {
-- handler->cbs.group_changed.cb(handler, WIDGET_STATUS_ERROR_FAULT, handler->cbs.group_changed.data);
++ handler->cbs.group_changed.cb(handler, WIDGET_ERROR_FAULT, handler->cbs.group_changed.data);
handler->cbs.group_changed.cb = NULL;
handler->cbs.group_changed.data = NULL;
}
if (handler->cbs.period_changed.cb) {
-- handler->cbs.period_changed.cb(handler, WIDGET_STATUS_ERROR_FAULT, handler->cbs.period_changed.data);
++ handler->cbs.period_changed.cb(handler, WIDGET_ERROR_FAULT, handler->cbs.period_changed.data);
handler->cbs.period_changed.cb = NULL;
handler->cbs.period_changed.data = NULL;
}
if (handler->cbs.size_changed.cb) {
-- handler->cbs.size_changed.cb(handler, WIDGET_STATUS_ERROR_FAULT, handler->cbs.size_changed.data);
++ handler->cbs.size_changed.cb(handler, WIDGET_ERROR_FAULT, handler->cbs.size_changed.data);
handler->cbs.size_changed.cb = NULL;
handler->cbs.size_changed.data = NULL;
}
if (handler->cbs.gbar_created.cb) {
-- handler->cbs.gbar_created.cb(handler, WIDGET_STATUS_ERROR_FAULT, handler->cbs.gbar_created.data);
++ handler->cbs.gbar_created.cb(handler, WIDGET_ERROR_FAULT, handler->cbs.gbar_created.data);
handler->cbs.gbar_created.cb = NULL;
handler->cbs.gbar_created.data = NULL;
}
if (handler->cbs.gbar_destroyed.cb) {
-- handler->cbs.gbar_destroyed.cb(handler, WIDGET_STATUS_ERROR_FAULT, handler->cbs.gbar_destroyed.data);
++ handler->cbs.gbar_destroyed.cb(handler, WIDGET_ERROR_FAULT, handler->cbs.gbar_destroyed.data);
handler->cbs.gbar_destroyed.cb = NULL;
handler->cbs.gbar_destroyed.data = NULL;
}
if (handler->cbs.update_mode.cb) {
-- handler->cbs.update_mode.cb(handler, WIDGET_STATUS_ERROR_FAULT, handler->cbs.update_mode.data);
++ handler->cbs.update_mode.cb(handler, WIDGET_ERROR_FAULT, handler->cbs.update_mode.data);
handler->cbs.update_mode.cb = NULL;
handler->cbs.update_mode.data = NULL;
}
if (handler->common->request.deleted) {
ErrPrint("Already in-progress\n");
if (cb) {
-- cb(handler, WIDGET_STATUS_ERROR_NONE, data);
++ cb(handler, WIDGET_ERROR_NONE, data);
}
-- return WIDGET_STATUS_ERROR_BUSY;
++ return WIDGET_ERROR_RESOURCE_BUSY;
}
if (!cb) {
if (!packet) {
ErrPrint("Failed to build a param\n");
if (cb) {
-- cb(handler, WIDGET_STATUS_ERROR_FAULT, data);
++ cb(handler, WIDGET_ERROR_FAULT, data);
}
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
cbinfo = _widget_create_cb_info(cb, data);
packet_destroy(packet);
ErrPrint("Failed to create cbinfo\n");
if (cb) {
-- cb(handler, WIDGET_STATUS_ERROR_FAULT, data);
++ cb(handler, WIDGET_ERROR_FAULT, data);
}
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = master_rpc_async_request(handler, packet, 0, del_ret_cb, cbinfo);
_widget_destroy_cb_info(cbinfo);
if (cb) {
-- cb(handler, WIDGET_STATUS_ERROR_FAULT, data);
++ cb(handler, WIDGET_ERROR_FAULT, data);
}
} else {
handler->common->request.deleted = 1;
info = malloc(sizeof(*info));
if (!info) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
info->handler = widget_cb;
info->is_deleted = 0;
s_info.event_list = dlist_append(s_info.event_list, info);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
void *_widget_remove_event_handler(widget_event_handler_cb widget_cb)
info = malloc(sizeof(*info));
if (!info) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
info->handler = widget_cb;
info->is_deleted = 0;
s_info.fault_list = dlist_append(s_info.fault_list, info);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
void *_widget_remove_fault_handler(widget_fault_handler_cb widget_cb)
#endif
#define WIDGET_VIEWER_EVAS_DEFAULT_PERIOD -1.0f /**< Default Update Period */
+
+/**
+ * @sine_tizen 2.4
+ * @brief Event names for smart callback of widget events. You can listen some events from widget by calling evas_object_smart_callback_add.
+ * @see #widget_evas_event_info_s
++ * @see evas_object_smart_callback_add
+ */
#define WIDGET_SMART_SIGNAL_WIDGET_CREATE_ABORTED "widget,create,aborted" /**< widget creation is aborted */
#define WIDGET_SMART_SIGNAL_WIDGET_CREATED "widget,created" /**< widget is created */
#define WIDGET_SMART_SIGNAL_WIDGET_RESIZE_ABORTED "widget,resize,aborted" /**< Resizing widget is aborted */
#define WIDGET_SMART_SIGNAL_WIDGET_RESIZED "widget,resized" /**< widget is resized */
#define WIDGET_SMART_SIGNAL_WIDGET_FAULTED "widget,faulted" /**< widget has faulted */
--#define WIDGET_SMART_SIGNAL_UPDATED "updated" /**< widget content is updated */
--#define WIDGET_SMART_SIGNAL_EXTRA_INFO_UPDATED "info,updated" /**< widget extra info is updated */
--#define WIDGET_SMART_SIGNAL_PROVIDER_DISCONNECTED "provider,disconnected" /**< Provider is disconnected */
--#define WIDGET_SMART_SIGNAL_CONTROL_SCROLLER "control,scroller" /**< Control Scroller */
++#define WIDGET_SMART_SIGNAL_UPDATED "updated" /**< widget content is updated */
++#define WIDGET_SMART_SIGNAL_EXTRA_INFO_UPDATED "info,updated" /**< widget extra info is updated */
++#define WIDGET_SMART_SIGNAL_PROVIDER_DISCONNECTED "provider,disconnected" /**< Provider is disconnected */
++#define WIDGET_SMART_SIGNAL_CONTROL_SCROLLER "control,scroller" /**< Control Scroller */
#define WIDGET_SMART_SIGNAL_WIDGET_DELETED "widget,deleted" /**< widget is deleted */
--#define WIDGET_SMART_SIGNAL_PERIOD_CHANGED "widget,period,changed" /**< Period is changed */
++#define WIDGET_SMART_SIGNAL_PERIOD_CHANGED "widget,period,changed" /**< Period is changed */
- * @brief Data structure for smart callback user parameter
+/**
+ * @sine_tizen 2.4
++ * @brief Data structure which will be sent as a parameter of smart callback for signals WIDGET_SMART_SIGNAL_XXX
++ * @see #WIDGET_SMART_SIGNAL_WIDGET_CREATE_ABORTED
++ * @see #WIDGET_SMART_SIGNAL_WIDGET_CREATED
++ * @see #WIDGET_SMART_SIGNAL_WIDGET_RESIZE_ABORTED
++ * @see #WIDGET_SMART_SIGNAL_WIDGET_RESIZED
++ * @see #WIDGET_SMART_SIGNAL_WIDGET_FAULTED
++ * @see #WIDGET_SMART_SIGNAL_UPDATED
++ * @see #WIDGET_SMART_SIGNAL_EXTRA_INFO_UPDATED
++ * @see #WIDGET_SMART_SIGNAL_PROVIDER_DISCONNECTED
++ * @see #WIDGET_SMART_SIGNAL_CONTROL_SCROLLER
++ * @see #WIDGET_SMART_SIGNAL_WIDGET_DELETED
++ * @see #WIDGET_SMART_SIGNAL_PERIOD_CHANGED
+ */
+typedef struct widget_evas_event_info {
+ const char *pkgname; /**< widget application id */
+ widget_event_type_e event; /**< event type for detail event information - WIDGET_EVENT_XXX, refer the widget_serivce.h */
+ int error; /**< Error type - WIDGET_ERROR_XXX, refer the widget_errno.h */
+} widget_evas_event_info_s;
+
+/**
+ * @sine_tizen 2.4
+ * @brief Data structure for smart callback user parameter
+ */
typedef enum widget_evas_raw_event_type {
WIDGET_VIEWER_EVAS_RAW_DELETE = 0x00,
WIDGET_VIEWER_EVAS_RAW_CREATE = 0x02,
extern int widget_viewer_evas_fini(void);
/**
- * @brief Create a new widget object
+ * @brief Creates a new widget object
* @since_tizen 2.4
- * @param[in] parent
- * @param[in] widget_id
- * @param[in] content_info
- * @param[in] cluster
- * @param[in] category
- * @param[in] period update period
+ * @param[in] parent Evas Object of parent
+ * @param[in] widget_id widget id
+ * @param[in] content_info Contents that will be given to the widget instance
- * @param[in] cluster Main group
- * @param[in] category Sub group
+ * @param[in] period Update period (@c WIDGET_DEFAULT_PERIOD can be used for this; this argument will be used to specify the period of updating contents of a widget)
* @return Evas_Object*
- * @retval NULL if it fails to create a new widget object and you can get the reason of failure using widget_last_status()
- * @retval NULL if it fails to create a new widget object
++ * @retval NULL if it fails to create a new widget object and you can get the reason of failure using get_last_result()
+ * @see #widget_service_get_widget_id
+ * @see #widget_service_get_content_string
+ * @see #widget_service_get_category
*/
--extern Evas_Object *widget_viewer_evas_add_widget(Evas_Object *parent, const char *widget_id, const char *content_info, const char *cluster, const char *category, double period);
--
- /**
- * @brief Subscribes an event for widgets only in a given cluster and sub-cluster.
- * @details If you wrote a view-only client,
- * you can receive the event of specific widgets which belong to a given cluster/category.
- * But you cannot modify their attributes (such as size, ...).
- * @since_tizen 2.4
- * @privlevel public
- * @privilege %http://tizen.org/privilege/widget.viewer
- * @param[in] cluster Cluster ("*" can be used for subscribe all cluster's widgets event; If you use the "*", value in the category will be ignored)
- * @param[in] category Category ("*" can be used for subscribe widgets events of all category(sub-cluster) in a given "cluster")
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_FAULT Unrecoverable error occurred
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully requested
- * @see widget_viewer_evas_unsubscribe_group()
- */
--extern int widget_viewer_evas_subscribe_group(const char *cluster, const char *sub_cluster);
-
-
- /**
- * @brief Unsubscribes an event for the widgets, but you will receive already added widgets events.
- * @since_tizen 2.3
- * @privlevel public
- * @privilege %http://tizen.org/privilege/widget.viewer
- * @param[in] cluster Cluster("*" can be used for subscribe all cluster's widgets event; If you use the "*", value in the category will be ignored)
- * @param[in] category Category ("*" can be used for subscribe all sub-cluster's widgets event in a given "cluster")
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_FAULT Unrecoverable error occurred
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully requested
- * @see widget_subscribe_group()
- */
--extern int widget_viewer_evas_unsubscribe_group(const char *cluster, const char *sub_cluster);
--
- /**
- * @brief Subscribes events of widgets which is categorized by given "category" string.
- * "category" is written in the XML file of each widget manifest file.
- * After subscribe the category, the master will send created event for all created widgets,
- * Also it will notify client when a new widget is created.
- * @since_tizen 2.4
- * @privlevel public
- * @privilege %http://tizen.org/privilege/widget.viewer
- * @param[in] category Category name
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_FAULT Unrecoverable error occurred
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully requested
- * @see widget_viewer_evas_unsubscribe_category()
- */
--extern int widget_viewer_evas_subscribe_category(const char *category);
-
- /**
- * @brief Unsubscribes events of widgets.
- * @since_tizen 2.4
- * @privlevel public
- * @privilege %http://tizen.org/privilege/widget.viewer
- * @param[in] category Category name
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_FAULT Unrecoverable error occurred
- * @retval #WIDGET_STATUS_ERROR_NONE Successfully requested
- * @see widget_viewer_evas_subscribe_category()
- */
--extern int widget_viewer_evas_unsubscribe_category(const char *category);
++extern Evas_Object *widget_viewer_evas_add_widget(Evas_Object *parent, const char *widget_id, const char *content_info, double period);
/**
- * @brief if a viewer is resumed, use this function to notify it to the providers.
- * @since_tizen 2.4
+ * @brief Notifies the status of a client ("it is paused") to the provider.
* @details if you call this, all providers will gets resumed event.
- * @return int
- * @see widget_viewer_evas_paused()
+ * @since_tizen 2.4
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/widget.viewer
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_FAULT if it failed to send state (paused) info
++ * @return #WIDGET_ERROR_NONE on success,
++ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
++ * @retval #WIDGET_ERROR_FAULT if it failed to send state (paused) info
+ * @see widget_viewer_evas_notify_paused_status_of_viewer()
*/
extern int widget_viewer_evas_notify_resumed_status_of_viewer(void);
/**
- * @brief If a viewer is paused, use this function to notify it to the providers
- * @since_tizen 2.4
+ * @brief Notifies the status of client ("it is resumed") to the provider.
* @detail if you call this, all providers will gets paused event.
- * @return int
+ * @since_tizen 2.4
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/widget.viewer
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_FAULT if it failed to send state (resumed) info
++ * @return #WIDGET_ERROR_NONE on success,
++ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
++ * @retval #WIDGET_ERROR_FAULT if it failed to send state (resumed) info
+ * @see widget_viewer_evas_notify_resumed_status_of_viewer()
*/
extern int widget_viewer_evas_notify_paused_status_of_viewer(void);
/**
- * @brief Change the state of each widget. if you want made a box should be paused, call this.
+ * @brief Changes the state of given widget. If you want to make a widget paused, call this function.
* @since_tizen 2.4
- * @param[in] widget widget object
- * @return int
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/widget.viewer
+ * @param[in] widget widget Evas object
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_FAULT if it failed to send state (resumed) info
++ * @return #WIDGET_ERROR_NONE on success,
++ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
++ * @retval #WIDGET_ERROR_FAULT if it failed to send state (resumed) info
*/
extern int widget_viewer_evas_pause_widget(Evas_Object *widget);
/**
- * @brief Change the state of each widget. If you want made a box should be resumed, call this.
+ * @brief Changes the state of given widget. If you want to make a widget resumed, call this function.
* @since_tizen 2.4
- * @param[in] widget widget object
- * @return int
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/widget.viewer
+ * @param[in] widget widget Evas object
- * @return #WIDGET_STATUS_ERROR_NONE on success,
- * otherwise an error code (see #WIDGET_STATUS_ERROR_XXX) on failure
- * @retval #WIDGET_STATUS_ERROR_FAULT if it failed to send state (resumed) info
++ * @return #WIDGET_ERROR_NONE on success,
++ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
++ * @retval #WIDGET_ERROR_FAULT if it failed to send state (resumed) info
*/
extern int widget_viewer_evas_resume_widget(Evas_Object *widget);
* @since_tizen 2.4
* @param[in] type Configuration item
* @param[in] value Its value
- * @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 option
- * @return int
++ * @return #WIDGET_ERROR_NONE on success,
++ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
++ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid option
+ * @see #widget_evas_conf
*/
extern int widget_viewer_evas_set_option(enum widget_evas_conf type, int value);
/**
- * @brief Content string of widget
+ * @brief Gets content string of widget
+ * @details This string can be used for creating contents of widget again after reboot a device or recovered from crash(abnormal status)
* @since_tizen 2.4
- * @details This string should be used for creating widget again after reboot device or recovered from crash(abnormal status)
* @param[in] widget widget object
- * @return const char * String of content
+ * @return content string to be recognize content of the widget
* @retval NULL if there is no specific content string.
*/
--extern const char *widget_viewer_evas_get_content_string(Evas_Object *widget);
++extern const char *widget_viewer_evas_get_content_info(Evas_Object *widget);
/**
- * @brief Summarized string of widget content.
+ * @brief Gets summarized string of the widget content for accessibility.
+ * @details If the accessibility feature is turned on, a viewer can use this text to describe the widget.
* @since_tizen 2.4
- * @details If the accessibility feature is turned on, the homescreen can read this text to describe the widget.
* @param[in] widget widget object
- * @return const char * Text should be read
- * @retval NULL if there is no summarized text for content of given widget
+ * @return title string to be used for summarizing the widget
+ * @retval NULL if there is no summarized text for content of given widget.
*/
extern const char *widget_viewer_evas_get_title_string(Evas_Object *widget);
*/
extern void widget_viewer_evas_set_permanent_delete(Evas_Object *widget, int flag);
++/**
++ * @brief Emits a text signal to the given widget only if it is a text type.
++ * @since_tizen 2.3.1
++ * @remarks
++ * This is an ASYNCHRONOUS API.
++ * This function is Asynchronous, so you will get the result from @a cb, if you failed to send request to create a new widget,
++ * This function will returns proper error code
++ * @param[in] handle Handle of a widget instance
++ * @param[in] emission Emission string
++ * @param[in] source Source string
++ * @param[in] sx Start X
++ * @param[in] sy Start Y
++ * @param[in] ex End X
++ * @param[in] ey End Y
++ * @param[in] cb Result callback
++ * @param[in] data Callback data
++ * @privlevel platform
++ * @privilege %http://tizen.org/privilege/widget.viewer
++ * @return int
++ * @retval #WIDGET_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
++ * @retval #WIDGET_STATUS_ERROR_FAULT Unrecoverable error occurred
++ * @retval #WIDGET_STATUS_ERROR_NONE Successfully emitted
++ * @see widget_ret_cb
++ */
++extern int widget_viewer_evas_emit_text_signal(widget_h handle, widget_text_event_s event_info, widget_ret_cb cb, void *data);
++
#ifdef __cplusplus
}
#endif
* @return int
*/
extern int widget_viewer_evas_dump_to_file(Evas_Object *widget, const char *filename);
++
++
++/**
++ * @brief Subscribes an event for widgets only in a given cluster and sub-cluster.
++ * @details If you wrote a view-only client,
++ * you can receive the event of specific widgets which belong to a given cluster/category.
++ * But you cannot modify their attributes (such as size, ...).
++ * @since_tizen 2.4
++ * @privlevel public
++ * @privilege %http://tizen.org/privilege/widget.viewer
++ * @param[in] cluster Cluster ("*" can be used for subscribe all cluster's widgets event; If you use the "*", value in the category will be ignored)
++ * @param[in] category Category ("*" can be used for subscribe widgets events of all category(sub-cluster) in a given "cluster")
++ * @return #WIDGET_ERROR_NONE on success,
++ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
++ * @retval #WIDGET_ERROR_FAULT Unrecoverable error occurred
++ * @retval #WIDGET_ERROR_NONE Successfully requested
++ * @see widget_viewer_evas_unsubscribe_group()
++ */
++extern int widget_viewer_evas_subscribe_group(const char *cluster, const char *sub_cluster);
++
++
++/**
++ * @brief Unsubscribes an event for the widgets, but you will receive already added widgets events.
++ * @since_tizen 2.3
++ * @privlevel public
++ * @privilege %http://tizen.org/privilege/widget.viewer
++ * @param[in] cluster Cluster("*" can be used for subscribe all cluster's widgets event; If you use the "*", value in the category will be ignored)
++ * @param[in] category Category ("*" can be used for subscribe all sub-cluster's widgets event in a given "cluster")
++ * @return #WIDGET_ERROR_NONE on success,
++ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
++ * @retval #WIDGET_ERROR_FAULT Unrecoverable error occurred
++ * @retval #WIDGET_ERROR_NONE Successfully requested
++ * @see widget_subscribe_group()
++ */
++extern int widget_viewer_evas_unsubscribe_group(const char *cluster, const char *sub_cluster);
++
++/**
++ * @brief Subscribes events of widgets which is categorized by given "category" string.
++ * "category" is written in the XML file of each widget manifest file.
++ * After subscribe the category, the master will send created event for all created widgets,
++ * Also it will notify client when a new widget is created.
++ * @since_tizen 2.4
++ * @privlevel public
++ * @privilege %http://tizen.org/privilege/widget.viewer
++ * @param[in] category Category name
++ * @return #WIDGET_ERROR_NONE on success,
++ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
++ * @retval #WIDGET_ERROR_FAULT Unrecoverable error occurred
++ * @retval #WIDGET_ERROR_NONE Successfully requested
++ * @see widget_viewer_evas_unsubscribe_category()
++ */
++extern int widget_viewer_evas_subscribe_category(const char *category);
++
++/**
++ * @brief Unsubscribes events of widgets.
++ * @since_tizen 2.4
++ * @privlevel public
++ * @privilege %http://tizen.org/privilege/widget.viewer
++ * @param[in] category Category name
++ * @return #WIDGET_ERROR_NONE on success,
++ * otherwise an error code (see #WIDGET_ERROR_XXX) on failure
++ * @retval #WIDGET_ERROR_FAULT Unrecoverable error occurred
++ * @retval #WIDGET_ERROR_NONE Successfully requested
++ * @see widget_viewer_evas_subscribe_category()
++ */
++extern int widget_viewer_evas_unsubscribe_category(const char *category);
++
++
++
#ifdef __cplusplus
}
#endif
so = malloc(sizeof(*so));
if (!so) {
ErrPrint("malloc: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
if (id) {
if (!so->id) {
ErrPrint("strdup: %s\n", strerror(errno));
free(so);
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
} else {
so->id = NULL;
}
elm_object_signal_callback_add(child, "*", "*", script_signal_forwarder, data);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static inline void reset_scroller(struct widget_data *data)
r + 2, g + 2, b + 2, a + 2); /* SHADOW */
if (ret != 12) {
DbgPrint("part[%s] rgba[%s]\n", part, data);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ret = edje_object_color_class_set(elm_layout_edje_get(layout), part,
r[1], g[1], b[1], a[1], /* OUTLINE */
r[2], g[2], b[2], a[2]); /* SHADOW */
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static void update_focus_chain(Evas_Object *parent, Evas_Object *ao)
ao = elm_access_object_register(edje_part, parent);
if (!ao) {
ErrPrint("Unable to register an access object(%s)\n", part);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
evas_object_data_set(edje_part, "ao", ao);
DbgPrint("[%s] Remove access object(%p)\n", part, ao);
elm_access_object_unregister(ao);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
utf8 = elm_entry_markup_to_utf8(text);
DbgPrint("[%s] Remove access object(%p)\n", part, ao);
elm_access_object_unregister(ao);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
elm_access_info_set(ao, ELM_ACCESS_INFO, utf8);
ErrPrint("Unable to get text part[%s]\n", part);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static void parse_aspect(struct image_option *img_opt, const char *value, int len)
ao = elm_access_object_register(edje_part, parent);
if (!ao) {
ErrPrint("Unable to register an access object(%s)\n", part);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
evas_object_data_set(edje_part, "ao", ao);
DbgPrint("[%s] Remove access object(%p)\n", part, ao);
elm_access_object_unregister(ao);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
utf8 = elm_entry_markup_to_utf8(text);
DbgPrint("[%s] Remove access object(%p)\n", part, ao);
elm_access_object_unregister(ao);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
elm_access_info_set(ao, ELM_ACCESS_INFO, utf8);
ErrPrint("Unable to get text part[%s]\n", part);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int do_text_update_image(Evas_Object *layout, const char *part, const char *data, const char *option)
if (!data || !strlen(data) || access(data, R_OK) != 0) {
ErrPrint("Skip image: %s, deleted\n", part);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
content = evas_object_image_add(evas_object_evas_get(layout));
if (!content) {
ErrPrint("Failed to add an image object\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
evas_object_image_preload(content, EINA_FALSE);
if (err != EVAS_LOAD_ERROR_NONE) {
ErrPrint("Load error: %s\n", evas_load_error_str(err));
evas_object_del(content);
-- return WIDGET_STATUS_ERROR_IO_ERROR;
++ return WIDGET_ERROR_IO_ERROR;
}
apply_shadow_effect(&img_opt, content);
if (!part_w || !part_h || !w || !h) {
evas_object_del(content);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
content = crop_image(content, data, part_w, part_h, w, h, &img_opt);
if (!part_w || !part_h || !w || !h) {
evas_object_del(content);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
content = crop_image(content, data, part_w, part_h, w, h, &img_opt);
if (!part_w || !part_h || !w || !h) {
evas_object_del(content);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
content = crop_image(content, data, part_w, part_h, w, h, &img_opt);
* This object is not registered as an access object.
* So the developer should add it to access list manually, using DESC_ACCESS block.
*/
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int do_text_update_script(struct widget_data *data, int gbar, Evas_Object *layout, const char *id, const char *part, const char *file, const char *group)
if (!file || !strlen(file) || access(file, R_OK) != 0) {
ErrPrint("path: %s (%s), Delete old object\n", file, strerror(errno));
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
content = elm_layout_add(layout);
if (!content) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (elm_layout_file_set(content, file, group) == EINA_FALSE) {
evas_object_del(content);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = append_script_object(data, gbar, id, layout, content);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
evas_object_del(content);
return ret;
}
*
* elm_object_signal_callback_add(obj, "*", "*", script_signal_cb, handle);
*/
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int do_text_operate_access(Evas_Object *layout, const char *part, const char *operation, const char *option)
content = elm_object_part_content_get(layout, part);
if (!content) {
ErrPrint("Invalid part: %s\n", part);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
evas_object_geometry_get(content, &x, &y, &w, &h);
} else if (option && sscanf(option, "%dx%d", &action_info.x, &action_info.y) == 2) {
} else {
ErrPrint("Insufficient info for HL\n");
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
DbgPrint("TXxTY: %dx%d\n", action_info.x, action_info.y);
DbgPrint("Reset Focus\n");
elm_object_focus_custom_chain_set(layout, NULL);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int gbar_text_update_begin(widget_h handle)
struct widget_data *data;
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
DbgPrint("Begin text update: [%s]\n", data->widget_id);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int gbar_text_update_end(widget_h handle)
struct widget_data *data;
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
DbgPrint("End text update: [%s]\n", data->widget_id);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int gbar_text_update_text(widget_h handle, const char *id, const char *part, const char *data)
widget_data = get_smart_data_from_handle(handle);
if (!widget_data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(widget_data, 1, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_update_text(widget_data->parent, layout, part, data);
widget_data = get_smart_data_from_handle(handle);
if (!widget_data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(widget_data, 1, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_update_image(layout, part, data, option);
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 1, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_update_script(data, 1, layout, new_id, part, file, group);
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 1, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
elm_object_signal_emit(layout, signal, emission);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int gbar_text_update_drag(widget_h handle, const char *id, const char *part, double dx, double dy)
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 1, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
edje_object_part_drag_value_set(elm_layout_edje_get(layout), part, dx, dy);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int gbar_text_update_info_size(widget_h handle, const char *id, int w, int h)
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 1, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
DbgPrint("Resize to %dx%d\n", w, h);
evas_object_resize(layout, w, h);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int gbar_text_update_info_category(widget_h handle, const char *id, const char *category)
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 1, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
DbgPrint("Update category: %s\n", category);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int gbar_text_update_access(widget_h handle, const char *id, const char *part, const char *text, const char *option)
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 1, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_update_access(data->parent, layout, part, text, option);
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 1, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_operate_access(layout, part, operation, option);
widget_data = get_smart_data_from_handle(handle);
if (!widget_data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(widget_data, 1, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_update_color(layout, part, data);
}
ret = append_script_object(data, 1, NULL, NULL, gbar_content);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
evas_object_del(gbar_content);
ErrPrint("Failed to append this to script object list\n");
return;
}
-- if (widget_viewer_set_text_handler(data->handle, 1, &operator) != WIDGET_STATUS_ERROR_NONE) {
++ if (widget_viewer_set_text_handler(data->handle, 1, &operator) != WIDGET_ERROR_NONE) {
evas_object_del(gbar_content);
ErrPrint("Failed to set text handler for [%s]\n", data->widget_id);
return;
return;
}
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
DbgPrint("Create GBAR: 0x%X\n", ret);
info.error = ret;
info.event = WIDGET_EVENT_GBAR_CREATED;
data->gbar_layout = elm_layout_add(data->parent);
if (!data->gbar_layout) {
ErrPrint("Failed to add an edje\n");
-- info.error = WIDGET_STATUS_ERROR_FAULT;
++ info.error = WIDGET_ERROR_FAULT;
info.event = WIDGET_EVENT_GBAR_CREATED;
info.pkgname = data->widget_id;
smart_callback_call(data, WIDGET_SMART_SIGNAL_GBAR_ABORTED, &info);
evas_object_del(data->gbar_layout);
data->gbar_layout = NULL;
-- info.error = WIDGET_STATUS_ERROR_IO_ERROR;
++ info.error = WIDGET_ERROR_IO_ERROR;
info.event = WIDGET_EVENT_GBAR_CREATED;
info.pkgname = data->widget_id;
smart_callback_call(data, WIDGET_SMART_SIGNAL_GBAR_ABORTED, &info);
case WIDGET_CONTENT_TYPE_UIFW:
ErrPrint("Not implemented - TYPE_UIFW for GBAR\n");
default:
-- info.error = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ info.error = WIDGET_ERROR_INVALID_PARAMETER;
info.event = WIDGET_EVENT_GBAR_CREATED;
info.pkgname = data->widget_id;
ret = widget_viewer_destroy_glance_bar(data->handle, __widget_destroy_gbar_cb, widget_ref(data));
}
data->is.field.gbar_created = 1;
-- info.error = WIDGET_STATUS_ERROR_NONE;
++ info.error = WIDGET_ERROR_NONE;
info.event = WIDGET_EVENT_GBAR_CREATED;
info.pkgname = data->widget_id;
smart_callback_call(data, WIDGET_SMART_SIGNAL_GBAR_CREATED, &info);
if (s_info.conf.field.support_gbar && data->is.field.flick_down && data->y - data->down.y < CLICK_REGION) {
DbgPrint("Flick down is canceled\n");
data->is.field.flick_down = 0;
-- info.error = WIDGET_STATUS_ERROR_CANCEL;
++ info.error = WIDGET_ERROR_CANCELED;
smart_callback_call(data, WIDGET_SMART_SIGNAL_FLICKDOWN_CANCELLED, &info);
}
elm_object_signal_emit(data->widget_layout, "tilt", "content");
}
DbgPrint("Flick down is canceled\n");
-- info.error = WIDGET_STATUS_ERROR_CANCEL;
++ info.error = WIDGET_ERROR_CANCELED;
smart_callback_call(data, WIDGET_SMART_SIGNAL_FLICKDOWN_CANCELLED, &info);
} else if (s_info.conf.field.support_gbar && !data->is.field.gbar_created) {
double rx;
int gbar_w;
int gbar_h;
-- if (widget_viewer_get_glance_bar_size(data->handle, &gbar_w, &gbar_h) != WIDGET_STATUS_ERROR_NONE) {
++ if (widget_viewer_get_glance_bar_size(data->handle, &gbar_w, &gbar_h) != WIDGET_ERROR_NONE) {
gbar_w = 0;
gbar_h = 0;
}
if (ret < 0) {
widget_unref(data);
DbgPrint("Flick down is canceled\n");
-- info.error = WIDGET_STATUS_ERROR_CANCEL;
++ info.error = WIDGET_ERROR_CANCELED;
smart_callback_call(data, WIDGET_SMART_SIGNAL_FLICKDOWN_CANCELLED, &info);
}
DbgPrint("Create GBAR: %d (%lfx%lf)\n", ret, rx, ry);
}
if (!data->is.field.flick_down) {
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
if (data->is.field.gbar_created) {
ret = widget_viewer_destroy_glance_bar(data->handle, __widget_destroy_gbar_cb, widget_ref(data));
if (ret < 0) {
data->is.field.flick_down = 0;
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_GBAR_CREATED;
-- info.error = WIDGET_STATUS_ERROR_CANCEL;
++ info.error = WIDGET_ERROR_CANCELED;
smart_callback_call(data, WIDGET_SMART_SIGNAL_FLICKDOWN_CANCELLED, &info);
}
data->is.field.flick_down = 0;
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_GBAR_CREATED;
-- info.error = WIDGET_STATUS_ERROR_CANCEL;
++ info.error = WIDGET_ERROR_CANCELED;
smart_callback_call(data, WIDGET_SMART_SIGNAL_FLICKDOWN_CANCELLED, &info);
DbgPrint("Flick down is canceled\n");
}
char *uiapp;
if (data->size_type == WIDGET_SIZE_TYPE_UNKNOWN) {
-- icon = widget_service_get_i18n_icon(data->widget_id, NULL);
++ icon = widget_service_get_icon(data->widget_id, NULL);
} else {
icon = widget_service_get_preview_image_path(data->widget_id, data->size_type);
}
__widget_overlay_disable(data, 1);
DbgPrint("Activated (%s): %d\n", data->widget_id, ret);
-- if (!data->is.field.deleted && (ret == WIDGET_STATUS_ERROR_NONE || ret == WIDGET_STATUS_ERROR_INVALID_PARAMETER)) {
++ if (!data->is.field.deleted && (ret == WIDGET_ERROR_NONE || ret == WIDGET_ERROR_INVALID_PARAMETER)) {
int type;
Evas_Coord w, h;
struct acquire_data acquire_data = {
}
if (!data->is.field.pressed) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
evas_object_geometry_get(data->widget, &x, &y, &w, &h);
data->is.field.flick_down = 0;
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_GBAR_CREATED;
-- info.error = WIDGET_STATUS_ERROR_CANCEL;
++ info.error = WIDGET_ERROR_CANCELED;
smart_callback_call(data, WIDGET_SMART_SIGNAL_FLICKDOWN_CANCELLED, &info);
DbgPrint("Flick down is canceled\n");
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static void __widget_move(Evas_Object *widget, Evas_Coord x, Evas_Coord y)
acquire_data.content = elm_plug_add(s_info.win);
if (!acquire_data.content) {
ErrPrint("Failed to add a plug object\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
DbgPrint("Try to connect to %s\n", widget_viewer_get_filename(data->handle));
if (!elm_plug_connect(acquire_data.content, widget_viewer_get_filename(data->handle), 0, EINA_TRUE)) {
ErrPrint("Cannot connect plug[%s]", widget_viewer_get_filename(data->handle));
evas_object_del(acquire_data.content);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
elm_object_part_content_set(data->widget_layout, "widget,content", acquire_data.content);
acquire_data.w = data->widget_width;
acquire_data.h = data->widget_height;
update_widget_geometry(&acquire_data);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int widget_create_image_object(struct widget_data *data)
acquire_data.content = elm_layout_add(data->parent);
if (!acquire_data.content) {
ErrPrint("Failed to create an edje object\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (elm_layout_file_set(acquire_data.content, WIDGET_VIEWER_EVAS_RESOURCE_EDJ, WIDGET_VIEWER_EVAS_RESOURCE_IMG) == EINA_FALSE) {
ErrPrint("Failed to load edje object: %s(%s)\n", WIDGET_VIEWER_EVAS_RESOURCE_EDJ, WIDGET_VIEWER_EVAS_RESOURCE_IMG);
evas_object_del(acquire_data.content);
-- return WIDGET_STATUS_ERROR_IO_ERROR;
++ return WIDGET_ERROR_IO_ERROR;
}
front_image = elm_image_add(acquire_data.content);
if (!front_image) {
ErrPrint("Failed to add front_image object\n");
evas_object_del(acquire_data.content);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
DbgPrint("Default size %dx%d\n", data->widget_width, data->widget_height);
front_image = elm_image_add(acquire_data.content);
if (!front_image) {
ErrPrint("Failed to add front_image object\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
elm_object_part_content_set(acquire_data.content, "front,content", front_image);
acquire_data.w = data->widget_width;
acquire_data.h = data->widget_height;
update_widget_geometry(&acquire_data);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int widget_create_buffer_object(struct widget_data *data)
widget_viewer_get_content_string = evas_object_image_filled_add(data->e);
if (!widget_viewer_get_content_string) {
ErrPrint("Failed to create an image object\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
evas_object_image_colorspace_set(widget_viewer_get_content_string, EVAS_COLORSPACE_ARGB8888);
elm_object_part_content_set(data->widget_layout, "widget,content", widget_viewer_get_content_string);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int widget_text_update_begin(widget_h handle)
struct widget_data *data;
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
DbgPrint("Begin text update: [%s]\n", data->widget_id);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int widget_text_update_end(widget_h handle)
struct widget_data *data;
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
DbgPrint("End text update: [%s]\n", data->widget_id);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int widget_text_update_text(widget_h handle, const char *id, const char *part, const char *data)
widget_data = get_smart_data_from_handle(handle);
if (!widget_data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(widget_data, 0, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_update_text(widget_data->parent, layout, part, data);
widget_data = get_smart_data_from_handle(handle);
if (!widget_data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(widget_data, 0, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_update_image(layout, part, data, option);
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 0, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_update_script(data, 0, layout, new_id, part, file, group);
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 0, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
elm_object_signal_emit(layout, signal, emission);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int widget_text_update_drag(widget_h handle, const char *id, const char *part, double dx, double dy)
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 0, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
edje_object_part_drag_value_set(elm_layout_edje_get(layout), part, dx, dy);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int widget_text_update_info_size(widget_h handle, const char *id, int w, int h)
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 0, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
DbgPrint("Resize to %dx%d\n", w, h);
evas_object_resize(layout, w, h);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int widget_text_update_info_category(widget_h handle, const char *id, const char *category)
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 0, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
DbgPrint("Update category: %s\n", category);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int widget_text_update_access(widget_h handle, const char *id, const char *part, const char *text, const char *option)
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 0, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_update_access(data->parent, layout, part, text, option);
data = get_smart_data_from_handle(handle);
if (!data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(data, 0, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_operate_access(layout, part, operation, option);
widget_data = get_smart_data_from_handle(handle);
if (!widget_data) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
layout = find_script_object(widget_data, 0, id);
if (!layout) {
ErrPrint("Target[%s] is not exists\n", id);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
return do_text_update_color(layout, part, data);
widget_viewer_get_content_string = elm_layout_add(data->widget_layout);
if (!widget_viewer_get_content_string) {
ErrPrint("Failed to create a layout object\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
script_file = widget_service_get_widget_script_path(data->widget_id);
if (!script_file || !script_group) {
evas_object_del(widget_viewer_get_content_string);
ErrPrint("Invalid script info ([%s] - [%s])\n", script_file, script_group);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (access(script_file, R_OK) != 0) {
ErrPrint("Unable to access [%s] - %s\n", script_file, strerror(errno));
evas_object_del(widget_viewer_get_content_string);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
if (elm_layout_file_set(widget_viewer_get_content_string, script_file, script_group) == EINA_FALSE) {
evas_object_del(widget_viewer_get_content_string);
ErrPrint("Failed to load an edje file ([%s] - [%s])\n", script_file, script_group);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
ret = append_script_object(data, 0, NULL, NULL, widget_viewer_get_content_string);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
evas_object_del(widget_viewer_get_content_string);
ErrPrint("Failed to append this to script object list\n");
return ret;
}
-- if (widget_viewer_set_text_handler(data->handle, 0, &operator) != WIDGET_STATUS_ERROR_NONE) {
++ if (widget_viewer_set_text_handler(data->handle, 0, &operator) != WIDGET_ERROR_NONE) {
evas_object_del(widget_viewer_get_content_string);
ErrPrint("Failed to set text handler for [%s]\n", data->widget_id);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
elm_object_part_content_set(data->widget_layout, "widget,content", widget_viewer_get_content_string);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static int widget_create_pixmap_object(struct widget_data *data)
widget_viewer_get_content_string = evas_object_image_filled_add(data->e);
if (!widget_viewer_get_content_string) {
ErrPrint("Failed to create an image object\n");
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
evas_object_image_colorspace_set(widget_viewer_get_content_string, EVAS_COLORSPACE_ARGB8888);
elm_object_part_content_set(data->widget_layout, "widget,content", widget_viewer_get_content_string);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
static void __widget_resize_pixmap_object(struct widget_data *data)
acquire_data->h = h;
ret = widget_viewer_acquire_resource_id(data->handle, 0, acquire_widget_pixmap_cb, acquire_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
widget_unref(data);
free(acquire_data);
} else {
if (data->state != WIDGET_DATA_CREATED) {
ErrPrint("Invalid widget data: %p, %s\n", data, widget_viewer_get_pkgname(handle));
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
widget_viewer_get_type(handle, 0, &widget_type);
break;
case WIDGET_CONTENT_TYPE_INVALID:
default:
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
break;
}
-- if (ret == WIDGET_STATUS_ERROR_NONE) {
-- info.error = WIDGET_STATUS_ERROR_NONE;
++ if (ret == WIDGET_ERROR_NONE) {
++ info.error = WIDGET_ERROR_NONE;
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_CREATED;
return;
}
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
DbgPrint("Failed to create: %X\n", ret);
data->handle = NULL;
DbgPrint("Display tap to load (%p) [%s]\n", data, data->widget_id);
smart_callback_call(data, WIDGET_SMART_SIGNAL_WIDGET_CREATE_ABORTED, &fault_event);
-- ret = WIDGET_STATUS_ERROR_FAULT;
++ ret = WIDGET_ERROR_FAULT;
} else {
-- ret = WIDGET_STATUS_ERROR_CANCEL;
++ ret = WIDGET_ERROR_CANCELED;
}
data->is.field.send_delete = 0;
break;
case WIDGET_CONTENT_TYPE_INVALID:
default:
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
break;
}
-- if (ret == WIDGET_STATUS_ERROR_NONE) {
-- info.error = WIDGET_STATUS_ERROR_NONE;
++ if (ret == WIDGET_ERROR_NONE) {
++ info.error = WIDGET_ERROR_NONE;
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_CREATED;
return;
}
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
info.error = ret;
info.event = WIDGET_EVENT_WIDGET_SIZE_CHANGED;
info.pkgname = data->widget_id;
if (type > 0 && type != WIDGET_SIZE_TYPE_UNKNOWN) {
ret = widget_viewer_resize_widget(data->handle, type, __widget_resize_cb, widget_ref(data));
} else {
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
/* This will be decreased soon ... */
widget_ref(data);
}
evas_object_resize(data->widget_layout, data->widget_width, data->widget_height);
-- if (ret == WIDGET_STATUS_ERROR_ALREADY) {
++ if (ret == WIDGET_ERROR_ALREADY_EXIST) {
DbgPrint("Same size\n");
widget_unref(data);
-- } else if (ret == WIDGET_STATUS_ERROR_NONE) {
++ } else if (ret == WIDGET_ERROR_NONE) {
DbgPrint("Resize request is successfully sent\n");
widget_service_get_need_of_touch_effect(data->widget_id, type, &need_of_touch_effect);
data->is.field.touch_effect = need_of_touch_effect;
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_EXTRA_INFO_UPDATED;
-- info.error = WIDGET_STATUS_ERROR_NONE;
++ info.error = WIDGET_ERROR_NONE;
smart_callback_call(data, WIDGET_SMART_SIGNAL_EXTRA_INFO_UPDATED, &info);
}
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_WIDGET_UPDATED;
-- info.error = WIDGET_STATUS_ERROR_NONE;
++ info.error = WIDGET_ERROR_NONE;
smart_callback_call(data, WIDGET_SMART_SIGNAL_UPDATED, &info);
}
acquire_data->data = widget_ref(data);
ret = widget_viewer_acquire_resource_id(data->handle, 1, acquire_gbar_pixmap_cb, acquire_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
ErrPrint("Failed to acquire gbar resource id\n");
free(acquire_data);
DbgPrint("Unref %p %s\n", data, data->widget_id);
return;
}
-- if (widget_viewer_get_glance_bar_size(data->handle, &w, &h) != WIDGET_STATUS_ERROR_NONE) {
++ if (widget_viewer_get_glance_bar_size(data->handle, &w, &h) != WIDGET_ERROR_NONE) {
ErrPrint("Failed to get gbar_size\n");
w = 0;
h = 0;
data->is.field.send_delete = 0;
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_DELETED;
-- info.error = data->is.field.faulted ? WIDGET_STATUS_ERROR_FAULT : WIDGET_STATUS_ERROR_NONE;
++ info.error = data->is.field.faulted ? WIDGET_ERROR_FAULT : WIDGET_ERROR_NONE;
/**
* Even if the widget object tries to be deleted from WIDGET_DELETED event callback,
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_PERIOD_CHANGED;
-- info.error = WIDGET_STATUS_ERROR_NONE;
++ info.error = WIDGET_ERROR_NONE;
smart_callback_call(data, WIDGET_SMART_SIGNAL_PERIOD_CHANGED, &info);
}
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_HOLD_SCROLL;
-- info.error = WIDGET_STATUS_ERROR_NONE;
++ info.error = WIDGET_ERROR_NONE;
smart_callback_call(data, WIDGET_SMART_SIGNAL_CONTROL_SCROLLER, &info);
}
info.pkgname = data->widget_id;
info.event = WIDGET_EVENT_RELEASE_SCROLL;
-- info.error = WIDGET_STATUS_ERROR_NONE;
++ info.error = WIDGET_ERROR_NONE;
smart_callback_call(data, WIDGET_SMART_SIGNAL_CONTROL_SCROLLER, &info);
}
Evas_Object *widget;
double period;
-- if (widget_viewer_get_group(handle, &cluster, &sub_cluster) != WIDGET_STATUS_ERROR_NONE) {
++ if (widget_viewer_get_group(handle, &cluster, &sub_cluster) != WIDGET_ERROR_NONE) {
ErrPrint("Unable to get the group info\n");
}
widget = widget_viewer_evas_add_widget(s_info.win,
widget_viewer_get_pkgname(handle), widget_viewer_get_content_string(handle),
-- cluster, sub_cluster,
period);
data = evas_object_smart_data_get(widget);
Eina_List *l;
struct subscribe_group *group;
-- if (widget_viewer_get_group(handle, &cluster, &sub_cluster) != WIDGET_STATUS_ERROR_NONE) {
-- return WIDGET_STATUS_ERROR_FAULT;
++ if (widget_viewer_get_group(handle, &cluster, &sub_cluster) != WIDGET_ERROR_NONE) {
++ return WIDGET_ERROR_FAULT;
}
if (!cluster || !sub_cluster) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
EINA_LIST_FOREACH(s_info.subscribed_group_list, l, group) {
if (!widget) {
ErrPrint("Failed to create a widget object\n");
(void)widget_viewer_delete_widget(handle, WIDGET_DELETE_PERMANENTLY, NULL, NULL);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
widget_viewer_set_data(handle, widget);
/* Emit RAW_CREATE event */
-- nr = invoke_raw_event_callback(WIDGET_VIEWER_EVAS_RAW_CREATE, widget_viewer_get_pkgname(handle), widget, WIDGET_STATUS_ERROR_NONE);
-- if (nr <= 0 || widget_system_created(handle, get_smart_data(widget)) != WIDGET_STATUS_ERROR_NONE) {
++ nr = invoke_raw_event_callback(WIDGET_VIEWER_EVAS_RAW_CREATE, widget_viewer_get_pkgname(handle), widget, WIDGET_ERROR_NONE);
++ if (nr <= 0 || widget_system_created(handle, get_smart_data(widget)) != WIDGET_ERROR_NONE) {
/*
* Deleting evas object will invoke delete callback.
* Then it will invoke the RAW_DELETE event and execute the proper procedures for deleting object
evas_object_del(widget);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
}
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
static inline int handle_subscribed_category(struct widget *handle)
category = widget_service_get_category(widget_viewer_get_pkgname(handle));
if (!category) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
EINA_LIST_FOREACH(s_info.subscribed_category_list, l, info) {
ErrPrint("Failed to create a widget object\n");
(void)widget_viewer_delete_widget(handle, WIDGET_DELETE_PERMANENTLY, NULL, NULL);
free(category);
-- return WIDGET_STATUS_ERROR_FAULT;
++ return WIDGET_ERROR_FAULT;
}
widget_viewer_set_data(handle, widget);
/* Subscribed object, Create this */
-- nr = invoke_raw_event_callback(WIDGET_VIEWER_EVAS_RAW_CREATE, widget_viewer_get_pkgname(handle), widget, WIDGET_STATUS_ERROR_NONE);
-- if (nr <= 0 || widget_system_created(handle, get_smart_data(widget)) != WIDGET_STATUS_ERROR_NONE) {
++ nr = invoke_raw_event_callback(WIDGET_VIEWER_EVAS_RAW_CREATE, widget_viewer_get_pkgname(handle), widget, WIDGET_ERROR_NONE);
++ if (nr <= 0 || widget_system_created(handle, get_smart_data(widget)) != WIDGET_ERROR_NONE) {
/* Delete widget, if no one cares it */
DbgPrint("No one cares\n");
widget_viewer_evas_set_permanent_delete(widget, EINA_TRUE);
}
free(category);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
}
free(category);
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
static int widget_event_handler(struct widget *handle, enum widget_event_type event, void *cbdata)
widget_viewer_set_data(handle, NULL);
if (event == WIDGET_EVENT_CREATED) {
-- if (handle_subscribed_group(handle) == WIDGET_STATUS_ERROR_NONE) {
++ if (handle_subscribed_group(handle) == WIDGET_ERROR_NONE) {
return 0;
}
-- if (handle_subscribed_category(handle) == WIDGET_STATUS_ERROR_NONE) {
++ if (handle_subscribed_category(handle) == WIDGET_ERROR_NONE) {
return 0;
}
return 0;
}
-- switch (event) {
++ switch ((int)event) {
case WIDGET_EVENT_WIDGET_EXTRA_BUFFER_CREATED:
widget_viewer_get_affected_extra_buffer(handle, 0, &idx, &resource_id);
DbgPrint("Extra buffer created for WIDGET: %d (%u)\n", idx, resource_id);
DbgPrint("Faulted: %s (%p)\n", pkgname, data);
data->is.field.faulted = 1;
__widget_overlay_faulted(data);
-- info.error = WIDGET_STATUS_ERROR_FAULT;
++ info.error = WIDGET_ERROR_FAULT;
info.pkgname = data->widget_id;
info.event = WIDGET_FAULT_DEACTIVATED;
smart_callback_call(data, WIDGET_SMART_SIGNAL_WIDGET_FAULTED, &info);
DbgPrint("Disconnected: %s (%p)\n", pkgname, data);
data->is.field.faulted = 1;
__widget_overlay_faulted(data);
-- info.error = WIDGET_STATUS_ERROR_FAULT;
++ info.error = WIDGET_ERROR_FAULT;
info.pkgname = data->widget_id;
info.event = WIDGET_FAULT_PROVIDER_DISCONNECTED;
smart_callback_call(data, WIDGET_SMART_SIGNAL_PROVIDER_DISCONNECTED, &info);
}
ret = widget_viewer_add_event_handler(widget_event_handler, NULL);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
ErrPrint("Failed to set handler\n");
widget_viewer_fini();
} else {
DbgPrint("Event handler registered\n");
ret = widget_viewer_add_fault_handler(widget_fault_handler, NULL);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
ErrPrint("Failed to set fault handler\n");
widget_viewer_remove_event_handler(widget_event_handler);
widget_viewer_fini();
return widget_viewer_notify_paused_status_of_viewer();
}
--EAPI Evas_Object *widget_viewer_evas_add_widget(Evas_Object *parent, const char *widget_id, const char *content_info, const char *cluster, const char *category, double period)
++EAPI Evas_Object *widget_viewer_evas_add_widget(Evas_Object *parent, const char *widget_id, const char *content_info, double period)
{
struct widget_data *data;
Evas_Object *widget;
char *_content_info;
char *_cluster;
char *_category;
++ char *cluster = DEFAULT_CLUSTER;
++ char *category = DEFAULT_CATEGORY;
if (!parent || !widget_id) {
return NULL;
}
-- if (!cluster) {
-- cluster = DEFAULT_CLUSTER;
-- }
--
-- if (!category) {
-- category = DEFAULT_CATEGORY;
-- }
--
_cluster = strdup(cluster);
if (!_cluster) {
ErrPrint("Heap: %s\n", strerror(errno));
data = get_smart_data(widget);
if (!data) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
data->view_port.x = x;
data->view_port.w = w;
data->view_port.h = h;
s_info.conf.field.user_view_port = 1;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_evas_get_view_port(Evas_Object *widget, int *x, int *y, int *w, int *h)
data = get_smart_data(widget);
if (!data) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
if (x) {
*h = data->view_port.h;
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_evas_set_option(enum widget_evas_conf type, int value)
break;
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_evas_pause_widget(Evas_Object *widget)
data = get_smart_data(widget);
if (!data || !data->is.field.created || !data->handle) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return widget_viewer_set_visibility(data->handle, WIDGET_HIDE_WITH_PAUSE);
data = get_smart_data(widget);
if (!data || !data->is.field.created || !data->handle) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return widget_viewer_set_visibility(data->handle, WIDGET_SHOW);
data = get_smart_data(widget);
if (!data || data->state != WIDGET_DATA_CREATED || !data->is.field.created || !data->handle || !data->is.field.gbar_created) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
ret = widget_viewer_destroy_glance_bar(data->handle, __widget_destroy_gbar_cb, widget_ref(data));
return ret;
}
--EAPI const char *widget_viewer_evas_get_content_string(Evas_Object *widget)
++EAPI const char *widget_viewer_evas_get_content_info(Evas_Object *widget)
{
struct widget_data *data;
data = get_smart_data(widget);
if (!data || !data->is.field.created || !data->handle) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
return do_force_mouse_up(data);
data = get_smart_data(widget);
if (!data || !data->is.field.created || !data->handle) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
evas_object_geometry_get(data->widget_layout, NULL, NULL, &w, &h);
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_HIGHLIGHT;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_HIGHLIGHT, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_UNHIGHLIGHT;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_HIGHLIGHT, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_HIGHLIGHT_NEXT;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_HIGHLIGHT, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_HIGHLIGHT_NEXT;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_HIGHLIGHT, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_NONE; /* meaningless */
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_ACTIVATE, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
case 0:
ainfo.type = WIDGET_ACCESS_TYPE_DOWN;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_SCROLL, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
case 1:
ainfo.type = WIDGET_ACCESS_TYPE_MOVE;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_SCROLL, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
case 2:
ainfo.type = WIDGET_ACCESS_TYPE_UP;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_SCROLL, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
default:
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
free(cb_data);
break;
}
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
cb_data->obj = widget;
ainfo.type = WIDGET_ACCESS_TYPE_NONE;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_MOUSE, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
cb_data->obj = widget;
ainfo.type = WIDGET_ACCESS_TYPE_UP;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_ACTION, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_DOWN;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_ACTION, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_NONE;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_VALUE_CHANGE, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_NONE;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_BACK, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_NONE;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_OVER, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_ENABLE;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_ENABLE, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
cb_data = calloc(1, sizeof(*cb_data));
if (!cb_data) {
ErrPrint("Heap: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cb_data->ret_cb = ret_cb;
ainfo.type = WIDGET_ACCESS_TYPE_DISABLE;
ret = widget_viewer_feed_access_event(data->handle, WIDGET_ACCESS_ENABLE, &ainfo, access_ret_cb, cb_data);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(cb_data);
}
break;
default:
-- ret = WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ ret = WIDGET_ERROR_INVALID_PARAMETER;
break;
}
cbdata = calloc(1, sizeof(*cbdata));
if (!cbdata) {
ErrPrint("calloc: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
cbdata->cb = cb;
break;
default:
free(cbdata);
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_evas_unset_raw_event_callback(enum widget_evas_raw_event_type type, void (*cb)(struct widget_evas_raw_event_info *info, void *data), void *data)
break;
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_evas_freeze_visibility(Evas_Object *widget, int status)
data = get_smart_data(widget);
if (!data) {
ErrPrint("Invalid object\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
data->is.field.freeze_visibility = 1;
data->freezed_visibility = status;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_evas_thaw_visibility(Evas_Object *widget)
data = get_smart_data(widget);
if (!data) {
ErrPrint("Invalid object\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
data->is.field.freeze_visibility = 0;
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_evas_get_freeze_visibility(Evas_Object *widget)
data = get_smart_data(widget);
if (!data) {
ErrPrint("Invalid object\n");
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
fp = fopen(filename, "w+");
fclose(fp);
}
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_evas_is_widget(Evas_Object *widget)
int ret;
if (!cluster || !sub_cluster) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
EINA_LIST_FOREACH(s_info.subscribed_group_list, l, group) {
if (!strcasecmp(group->cluster, cluster) && !strcasecmp(group->sub_cluster, sub_cluster)) {
-- return WIDGET_STATUS_ERROR_ALREADY;
++ return WIDGET_ERROR_ALREADY_EXIST;
}
}
group = calloc(1, sizeof(*group));
if (!group) {
ErrPrint("calloc: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
group->cluster = strdup(cluster);
if (!group->cluster) {
ErrPrint("strdup: %s\n", strerror(errno));
free(group);
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
group->sub_cluster = strdup(sub_cluster);
ErrPrint("strdup: %s\n", strerror(errno));
free(group->cluster);
free(group);
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
ret = widget_viewer_subscribe_group(cluster, sub_cluster);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(group->sub_cluster);
free(group->cluster);
free(group);
s_info.subscribed_group_list = eina_list_append(s_info.subscribed_group_list, group);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_evas_unsubscribe_group(const char *cluster, const char *sub_cluster)
Eina_List *n;
if (!cluster || !sub_cluster) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
EINA_LIST_FOREACH_SAFE(s_info.subscribed_group_list, l, n, group) {
}
}
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
}
EAPI int widget_viewer_evas_subscribe_category(const char *category)
int ret;
if (!category) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
EINA_LIST_FOREACH(s_info.subscribed_category_list, l, item) {
if (!strcmp(item->category, item->category)) {
-- return WIDGET_STATUS_ERROR_ALREADY;
++ return WIDGET_ERROR_ALREADY_EXIST;
}
}
item = calloc(1, sizeof(*item));
if (!item) {
ErrPrint("calloc: %s\n", strerror(errno));
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
item->category = strdup(category);
if (!item->category) {
ErrPrint("strdup: %s\n", strerror(errno));
free(item);
-- return WIDGET_STATUS_ERROR_OUT_OF_MEMORY;
++ return WIDGET_ERROR_OUT_OF_MEMORY;
}
ret = widget_viewer_subscribe_category(category);
-- if (ret != WIDGET_STATUS_ERROR_NONE) {
++ if (ret != WIDGET_ERROR_NONE) {
free(item->category);
free(item);
return ret;
}
s_info.subscribed_category_list = eina_list_append(s_info.subscribed_category_list, item);
-- return WIDGET_STATUS_ERROR_NONE;
++ return WIDGET_ERROR_NONE;
}
EAPI int widget_viewer_evas_unsubscribe_category(const char *category)
struct subscribe_category *item;
if (!category) {
-- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
++ return WIDGET_ERROR_INVALID_PARAMETER;
}
EINA_LIST_FOREACH_SAFE(s_info.subscribed_category_list, l, n, item) {
}
}
-- return WIDGET_STATUS_ERROR_NOT_EXIST;
++ return WIDGET_ERROR_NOT_EXIST;
++}
++
++EAPI int widget_viewer_evas_emit_text_signal(widget_h handle, widget_text_event_s event_info, widget_ret_cb cb, void *data)
++{
++ return widget_viewer_emit_text_signal(handle, event_info, cb, data);
}
/* End of a file */