* @details Viewer should send these events to dynamicbox.
* @since_tizen 2.3
*/
-enum dynamicbox_mouse_event_type {
+typedef enum dynamicbox_mouse_event_type {
DBOX_MOUSE_EVENT_MASK = 0x20000000, /**< Mask value for mouse event */
DBOX_MOUSE_EVENT_GBAR_MASK = 0x10000000, /**< Mask value for Glance Bar event */
DBOX_MOUSE_EVENT_DBOX_MASK = 0x40000000, /**< Mask value for Dynamic Box event */
DBOX_GBAR_MOUSE_UNSET = DBOX_MOUSE_EVENT_GBAR_MASK | DBOX_MOUSE_EVENT_MASK | DBOX_MOUSE_EVENT_UNSET, /**< Mouse event, stop feeding event by master */
DBOX_MOUSE_EVENT_MAX = 0xFFFFFFFF /**< Unknown event */
-};
+} dynamicbox_mouse_event_type_e;
-enum dynamicbox_key_event_type {
+typedef enum dynamicbox_key_event_type {
DBOX_KEY_EVENT_MASK = 0x80000000, /**< Mask value for key event */
DBOX_KEY_EVENT_GBAR_MASK = 0x10000000, /**< Mask value for Glance Bar event */
DBOX_KEY_EVENT_DBOX_MASK = 0x40000000, /**< Mask value for Dynamic Box event */
DBOX_GBAR_KEY_FOCUS_OUT = DBOX_KEY_EVENT_MASK | DBOX_KEY_EVENT_GBAR_MASK | DBOX_KEY_EVENT_FOCUS_OUT, /**< Key event, focus out */
DBOX_KEY_EVENT_MAX = 0xFFFFFFFF /**< Unknown event */
-};
+} dynamicbox_key_event_type_e;
/**
* @internal
* @details These events are sync'd with Tizen accessibility event set.
* @since_tizen 2.3
*/
-enum dynamicbox_access_event_type {
+typedef enum dynamicbox_access_event_type {
DBOX_ACCESS_EVENT_GBAR_MASK = 0x10000000, /**< Glance Bar Accessibilivent mask */
DBOX_ACCESS_EVENT_DBOX_MASK = 0x20000000, /**< Dynamic Box Accessibility event mask */
DBOX_GBAR_ACCESS_READ = DBOX_ACCESS_EVENT_GBAR_MASK | DBOX_ACCESS_EVENT_READ, /**< Highlight an object */
DBOX_GBAR_ACCESS_ENABLE = DBOX_ACCESS_EVENT_GBAR_MASK | DBOX_ACCESS_EVENT_ENABLE, /**< Enable highlight and read ability */
DBOX_GBAR_ACCESS_EVENT_MAX = 0xFFFFFFFF
-};
+} dynamicbox_access_event_type_e;
/**
* @internal
* @brief Enumeration for Dynamic Box content type.
* @since_tizen 2.3
*/
-enum dynamicbox_type {
+typedef enum dynamicbox_type {
DBOX_CONTENT_TYPE_IMAGE = 0x01, /**< Contents of a dynamicbox is based on the image file */
DBOX_CONTENT_TYPE_BUFFER = 0x02, /**< Contents of a dynamicbox is based on canvas buffer(shared) */
DBOX_CONTENT_TYPE_TEXT = 0x04, /**< Contents of a dynamicbox is based on formatted text file */
DBOX_CONTENT_TYPE_RESOURCE_ID = 0x08, /**< Contens of a dynamicbox is shared by the resource id(depends on window system) */
DBOX_CONTENT_TYPE_UIFW = 0x10, /**< Using UI F/W resource for sharing content & event */
DBOX_CONTENT_TYPE_INVALID = 0xFF /**< Unknown Dynamic Box type */
-};
+} dynamicbox_type_e;
/**
* @internal
* @details These events will be sent from the provider.
* @since_tizen 2.3
*/
-enum dynamicbox_event_type { /**< dynamicbox_event_handler_set Event list */
+typedef enum dynamicbox_event_type { /**< dynamicbox_event_handler_set Event list */
DBOX_EVENT_DBOX_UPDATED, /**< Contents of the given dynamicbox is updated */
DBOX_EVENT_GBAR_UPDATED, /**< Contents of the given pd is updated */
DBOX_EVENT_EXTRA_INFO_UPDATED, /**< Extra information is updated */
DBOX_EVENT_IGNORED = 0xFF /**< Request is ignored */
-};
+} dynamicbox_event_type_e;
/**
* @internal
* @brief Enumeration for Dynamicbox option types.
* @since_tizen 2.3
*/
-enum dynamicbox_option_type {
+typedef enum dynamicbox_option_type {
DBOX_OPTION_MANUAL_SYNC, /**< Sync frame manually */
DBOX_OPTION_FRAME_DROP_FOR_RESIZE, /**< Drop frames while resizing */
DBOX_OPTION_SHARED_CONTENT, /**< Use only one real instance for multiple fake instances if user creates dbox for same content */
DBOX_OPTION_DIRECT_UPDATE, /**< Use the private socket for receiving updated event */
DBOX_OPTION_ERROR = 0xFFFFFFFF /**< To specify the size of this enumeration type */
-};
+} dynamicbox_option_type_e;
/**
* @internal
* @brief Reason of faults
* @since_tizen 2.3
*/
-enum dynamicbox_fault_type {
+typedef enum dynamicbox_fault_type {
DBOX_FAULT_DEACTIVATED, /**< Dynamicbox is deactivated by its fault operation */
DBOX_FAULT_PROVIDER_DISCONNECTED, /**< Provider is disconnected */
DBOX_FAULT_MAX = 0xFF /**< To specify the size of this enumeration type, some compiler enjoy of this kind of notation */
-};
+} dynamicbox_fault_type_e;
/**
* @internal
* @details Must be sync'd with a provider.
* @since_tizen 2.3
*/
-enum dynamicbox_visible_state {
+typedef enum dynamicbox_visible_state {
DBOX_SHOW = 0x00, /**< Dynamicbox is shown. Default state */
DBOX_HIDE = 0x01, /**< Dynamicbox is hidden, Update timer will not be freezed. but you cannot receive any updates events. */
DBOX_HIDE_WITH_PAUSE = 0x02, /**< Dynamicbox is hidden, it will pause the update timer, but if a dynamicbox updates its contents, update event will be triggered */
DBOX_VISIBLE_ERROR = 0xFF /**< To specify the size of this enumeration type */
-};
+} dynamicbox_visible_state_e;
/**
* @internal
* @retval @c NULL if it fails to create a handle
* @see dynamicbox_ret_cb
*/
-extern dynamicbox_h dynamicbox_add(const char *dbox_id, const char *content, const char *cluster, const char *category, double period, enum dynamicbox_size_type type, dynamicbox_ret_cb cb, void *data);
+extern dynamicbox_h dynamicbox_add(const char *dbox_id, const char *content, const char *cluster, const char *category, double period, dynamicbox_size_type_e type, dynamicbox_ret_cb cb, void *data);
/**
* @internal
* @retval #DBOX_STATUS_ERROR_NONE Successfully sent, return callack will be called
* @see dynamicbox_ret_cb
*/
-extern int dynamicbox_del(dynamicbox_h handler, enum dynamicbox_delete_type type, dynamicbox_ret_cb cb, void *data);
+extern int dynamicbox_del(dynamicbox_h handler, dynamicbox_delete_type_e type, dynamicbox_ret_cb cb, void *data);
/**
* @internal
* @retval #DBOX_STATUS_ERROR_FAULT Failed to make a request
* @see dynamicbox_ret_cb
*/
-extern int dynamicbox_resize(dynamicbox_h handler, enum dynamicbox_size_type type, dynamicbox_ret_cb cb, void *data);
+extern int dynamicbox_resize(dynamicbox_h handler, dynamicbox_size_type_e type, dynamicbox_ret_cb cb, void *data);
/**
* @internal
* @retval #DBOX_CONTENT_TYPE_INVALID Invalid type
* @see dynamicbox_type()
*/
-extern enum dynamicbox_type dynamicbox_type(dynamicbox_h handler, int gbar);
+extern dynamicbox_type_e dynamicbox_type(dynamicbox_h handler, int gbar);
/**
* @internal
* @brief Gets the size of the Dynamicbox.
* @since_tizen 2.3
* @param[in] handler Handler of a dynamicbox instance
- * @return enum dynamicbox_size_type
+ * @return dynamicbox_size_type_e
* @retval #DBOX_SIZE_TYPE_NxM N by M size
* @retval #DBOX_SIZE_TYPE_UNKNOWN Invalid handler or size type is not defined yet
*/
-extern enum dynamicbox_size_type dynamicbox_size(dynamicbox_h handler);
+extern dynamicbox_size_type_e dynamicbox_size(dynamicbox_h handler);
/**
* @internal
* @see dynamicbox_feed_access_event()
* @see dynamicbox_feed_key_event()
*/
-extern int dynamicbox_feed_mouse_event(dynamicbox_h handler, enum dynamicbox_mouse_event_type type, dynamicbox_mouse_event_info_t info);
+extern int dynamicbox_feed_mouse_event(dynamicbox_h handler, dynamicbox_mouse_event_type_e type, dynamicbox_mouse_event_info_t info);
/**
* @internal
* @see dynamicbox_feed_mouse_event()
* @see dynamicbox_feed_key_event()
*/
-extern int dynamicbox_feed_access_event(dynamicbox_h handler, enum dynamicbox_access_event_type type, struct dynamicbox_access_event_info *info, dynamicbox_ret_cb cb, void *data);
+extern int dynamicbox_feed_access_event(dynamicbox_h handler, dynamicbox_access_event_type_e type, struct dynamicbox_access_event_info *info, dynamicbox_ret_cb cb, void *data);
/**
* @internal
* @see dynamicbox_feed_mouse_event()
* @see dynamicbox_feed_access_event()
*/
-extern int dynamicbox_feed_key_event(dynamicbox_h handler, enum dynamicbox_key_event_type type, dynamicbox_key_event_info_t info, dynamicbox_ret_cb cb, void *data);
+extern int dynamicbox_feed_key_event(dynamicbox_h handler, dynamicbox_key_event_type_e type, dynamicbox_key_event_info_t info, dynamicbox_ret_cb cb, void *data);
/**
* @internal
* @retval #DBOX_STATUS_ERROR_FAULT Unrecoverable error occurred
* @retval #DBOX_STATUS_ERROR_NONE Successfully done
*/
-extern int dynamicbox_set_visibility(dynamicbox_h handler, enum dynamicbox_visible_state state);
+extern int dynamicbox_set_visibility(dynamicbox_h handler, dynamicbox_visible_state_e state);
/**
* @internal
* @retval #DBOX_HIDE_WITH_PAUSE Dynamicbox is hidden, it will pause the update timer, but if a dynamicbox updates its contents, update event will occur
* @retval #DBOX_VISIBLE_ERROR To enlarge the size of this enumeration type
*/
-extern enum dynamicbox_visible_state dynamicbox_visibility(dynamicbox_h handler);
+extern dynamicbox_visible_state_e dynamicbox_visibility(dynamicbox_h handler);
/**
* @internal
* @see dynamicbox_get_option()
* @see dynamicbox_sync_fb()
*/
-extern int dynamicbox_set_option(enum dynamicbox_option_type option, int state);
+extern int dynamicbox_set_option(dynamicbox_option_type_e option, int state);
/**
* @internal
* @retval >=0 Value of given option (must be >=0)
* @see dynamicbox_set_option()
*/
-extern int dynamicbox_option(enum dynamicbox_option_type option);
+extern int dynamicbox_option(dynamicbox_option_type_e option);
/**
* @internal
void *data;
};
-extern void dbox_invoke_event_handler(struct dynamicbox *handler, enum dynamicbox_event_type event);
-extern void dbox_invoke_fault_handler(enum dynamicbox_fault_type type, const char *pkgname, const char *filename, const char *function);
+extern void dbox_invoke_event_handler(struct dynamicbox *handler, dynamicbox_event_type_e event);
+extern void dbox_invoke_fault_handler(dynamicbox_fault_type_e type, const char *pkgname, const char *filename, const char *function);
extern struct dynamicbox_common *dbox_find_common_handle(const char *pkgname, const char *filename);
extern struct dynamicbox *dbox_new_dynamicbox(const char *pkgname, const char *id, double timestamp, const char *cluster, const char *category);
extern int dbox_send_delete(struct dynamicbox *handler, int type, dynamicbox_ret_cb cb, void *data);
extern int dbox_delete_all(void);
-enum dynamicbox_state {
+typedef enum dynamicbox_state {
DBOX_STATE_CREATE = 0xBEEFbeef,
DBOX_STATE_DELETE = 0xDEADdead, /* Delete only for this client */
DBOX_STATE_DESTROYED = 0x00DEAD00
-};
+} dynamicbox_state_e;
struct dynamicbox_common {
- enum dynamicbox_state state;
+ dynamicbox_state_e state;
struct dlist *dynamicbox_list;
int refcnt;
char *name;
} alt;
- enum dynamicbox_delete_type delete_type;
+ dynamicbox_delete_type_e delete_type;
int is_user;
int is_gbar_created;
int is_pinned_up;
int is_active_update;
- enum dynamicbox_visible_state visible;
+ dynamicbox_visible_state_e visible;
struct {
- enum dynamicbox_dbox_type type;
+ dynamicbox_dbox_type_e type;
struct fb_info *fb;
int size_list;
} dbox;
struct {
- enum dynamicbox_gbar_type type;
+ dynamicbox_gbar_type_e type;
struct fb_info *fb;
int width;
};
struct dynamicbox {
- enum dynamicbox_state state;
+ dynamicbox_state_e state;
int refcnt;
int paused_updating;
- enum dynamicbox_visible_state visible;
+ dynamicbox_visible_state_e visible;
struct dynamicbox_common *common;
void *data;
dbox_invoke_event_handler(handle, DBOX_EVENT_DBOX_UPDATED);
}
-static int dbox_set_visibility(dynamicbox_h handler, enum dynamicbox_visible_state state)
+static int dbox_set_visibility(dynamicbox_h handler, dynamicbox_visible_state_e state)
{
struct packet *packet;
int need_to_add_job = 0;
return DBOX_STATUS_ERROR_NONE;
}
-EAPI dynamicbox_h dynamicbox_add(const char *pkgname, const char *content, const char *cluster, const char *category, double period, enum dynamicbox_size_type type, dynamicbox_ret_cb cb, void *data)
+EAPI dynamicbox_h dynamicbox_add(const char *pkgname, const char *content, const char *cluster, const char *category, double period, dynamicbox_size_type_e type, dynamicbox_ret_cb cb, void *data)
{
char *dboxid;
dynamicbox_h handler;
return ret;
}
-EAPI int dynamicbox_del(dynamicbox_h handler, enum dynamicbox_delete_type type, dynamicbox_ret_cb cb, void *data)
+EAPI int dynamicbox_del(dynamicbox_h handler, dynamicbox_delete_type_e type, dynamicbox_ret_cb cb, void *data)
{
struct cb_info *cbinfo;
return handler->common->is_active_update;
}
-EAPI int dynamicbox_resize(dynamicbox_h handler, enum dynamicbox_size_type type, dynamicbox_ret_cb cb, void *data)
+EAPI int dynamicbox_resize(dynamicbox_h handler, dynamicbox_size_type_e type, dynamicbox_ret_cb cb, void *data)
{
struct dynamicbox_common *common;
int w;
return ret;
}
-EAPI int dynamicbox_feed_access_event(dynamicbox_h handler, enum dynamicbox_access_event_type type, struct dynamicbox_access_event_info *info, dynamicbox_ret_cb cb, void *data)
+EAPI int dynamicbox_feed_access_event(dynamicbox_h handler, dynamicbox_access_event_type_e type, struct dynamicbox_access_event_info *info, dynamicbox_ret_cb cb, void *data)
{
int w = 1;
int h = 1;
return ret;
}
-EAPI int dynamicbox_feed_mouse_event(dynamicbox_h handler, enum dynamicbox_mouse_event_type type, struct dynamicbox_mouse_event_info *info)
+EAPI int dynamicbox_feed_mouse_event(dynamicbox_h handler, dynamicbox_mouse_event_type_e type, struct dynamicbox_mouse_event_info *info)
{
int w = 1;
int h = 1;
return send_mouse_event(handler, (const char *)&cmd, info->x * w, info->y * h);
}
-EAPI int dynamicbox_feed_key_event(dynamicbox_h handler, enum dynamicbox_key_event_type type, struct dynamicbox_key_event_info *info, dynamicbox_ret_cb cb, void *data)
+EAPI int dynamicbox_feed_key_event(dynamicbox_h handler, dynamicbox_key_event_type_e type, struct dynamicbox_key_event_info *info, dynamicbox_ret_cb cb, void *data)
{
int ret;
unsigned int cmd;
return DBOX_STATUS_ERROR_NONE;
}
-EAPI enum dynamicbox_size_type dynamicbox_size(dynamicbox_h handler)
+EAPI dynamicbox_size_type_e dynamicbox_size(dynamicbox_h handler)
{
int w;
int h;
return ret;
}
-EAPI enum dynamicbox_type dynamicbox_type(dynamicbox_h handler, int gbar)
+EAPI dynamicbox_type_e dynamicbox_type(dynamicbox_h handler, int gbar)
{
- enum dynamicbox_type type;
+ dynamicbox_type_e type;
if (!handler || handler->state != DBOX_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
return master_rpc_request_only(NULL, packet);
}
-EAPI int dynamicbox_set_visibility(dynamicbox_h handler, enum dynamicbox_visible_state state)
+EAPI int dynamicbox_set_visibility(dynamicbox_h handler, dynamicbox_visible_state_e state)
{
int old_state;
int ret;
return ret;
}
-EAPI enum dynamicbox_visible_state dynamicbox_visibility(dynamicbox_h handler)
+EAPI dynamicbox_visible_state_e dynamicbox_visibility(dynamicbox_h handler)
{
if (!handler || handler->state != DBOX_STATE_CREATE) {
ErrPrint("Handler is invalid\n");
return ret == 0 ? DBOX_STATUS_ERROR_NONE : DBOX_STATUS_ERROR_FAULT;
}
-EAPI int dynamicbox_set_option(enum dynamicbox_option_type option, int state)
+EAPI int dynamicbox_set_option(dynamicbox_option_type_e option, int state)
{
int ret = DBOX_STATUS_ERROR_NONE;
return ret;
}
-EAPI int dynamicbox_option(enum dynamicbox_option_type option)
+EAPI int dynamicbox_option(dynamicbox_option_type_e option)
{
int ret;