Use the commonly defined enumeration value
authorSung-jae Park <nicesj.park@samsung.com>
Sun, 28 Sep 2014 12:54:24 +0000 (21:54 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Sun, 28 Sep 2014 12:54:24 +0000 (21:54 +0900)
instead of locally defined one.

[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: I6455ed865c18694b947722f537cfc39ad12b1908

include/dynamicbox.h
include/dynamicbox_internal.h
src/client.c
src/dynamicbox.c
src/dynamicbox_internal.c

index 481d9ad..2c6b377 100644 (file)
@@ -179,12 +179,12 @@ enum dynamicbox_access_event_type {
  * @since_tizen 2.3
  */
 enum dynamicbox_type {
-    DBOX_TYPE_IMAGE       = 0x01, /**< Contents of a dynamicbox is based on the image file */
-    DBOX_TYPE_BUFFER      = 0x02, /**< Contents of a dynamicbox is based on canvas buffer(shared) */
-    DBOX_TYPE_TEXT        = 0x04, /**< Contents of a dynamicbox is based on formatted text file */
-    DBOX_TYPE_RESOURCE_ID = 0x08, /**< Contens of a dynamicbox is shared by the resource id(depends on window system) */
-    DBOX_TYPE_UIFW        = 0x10, /**< Using UI F/W resource for sharing content & event */
-    DBOX_TYPE_INVALID     = 0xFF /**< Unknown Dynamic Box 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 */
 };
 
 /**
index 51bf782..5b8825e 100644 (file)
@@ -76,23 +76,6 @@ extern struct dynamicbox *dbox_unref(struct dynamicbox *handler, int destroy_com
 extern int dbox_send_delete(struct dynamicbox *handler, int type, dynamicbox_ret_cb cb, void *data);
 extern int dbox_delete_all(void);
 
-enum dbox_type { /*!< Must have to be sync with data-provider-master */
-       _DBOX_TYPE_NONE = 0x0,
-       _DBOX_TYPE_SCRIPT,
-       _DBOX_TYPE_FILE,
-       _DBOX_TYPE_TEXT,
-       _DBOX_TYPE_BUFFER,
-       _DBOX_TYPE_ELEMENTARY
-};
-
-enum gbar_type { /*!< Must have to be sync with data-provider-master */
-       _GBAR_TYPE_NONE = 0x0,
-       _GBAR_TYPE_SCRIPT,
-       _GBAR_TYPE_TEXT,
-       _GBAR_TYPE_BUFFER,
-       _GBAR_TYPE_ELEMENTARY
-};
-
 enum dynamicbox_state {
        DBOX_STATE_CREATE = 0xBEEFbeef,
        DBOX_STATE_DELETE = 0xDEADdead, /* Delete only for this client */
@@ -131,7 +114,7 @@ struct dynamicbox_common {
        enum dynamicbox_visible_state visible;
 
        struct {
-               enum dbox_type type;
+               enum dynamicbox_dbox_type type;
                struct fb_info *fb;
 
                int size_list;
@@ -154,7 +137,7 @@ struct dynamicbox_common {
        } dbox;
 
        struct {
-               enum gbar_type type;
+               enum dynamicbox_gbar_type type;
                struct fb_info *fb;
 
                int width;
index 020fbd7..9b6bfa0 100644 (file)
@@ -795,8 +795,8 @@ static struct packet *master_gbar_created(pid_t pid, int handle, const struct pa
                        (void)dbox_set_gbar_fb(common, buf_id);
 
                        switch (common->gbar.type) {
-                       case _GBAR_TYPE_SCRIPT:
-                       case _GBAR_TYPE_BUFFER:
+                       case GBAR_TYPE_SCRIPT:
+                       case GBAR_TYPE_BUFFER:
                                switch (fb_type(dbox_get_gbar_fb(common))) {
                                case DBOX_FB_TYPE_FILE:
                                case DBOX_FB_TYPE_SHM:
@@ -808,8 +808,8 @@ static struct packet *master_gbar_created(pid_t pid, int handle, const struct pa
                                        break;
                                }
                                break;
-                       case _GBAR_TYPE_ELEMENTARY:
-                       case _GBAR_TYPE_TEXT:
+                       case GBAR_TYPE_UIFW:
+                       case GBAR_TYPE_TEXT:
                        default:
                                break;
                        }
@@ -911,8 +911,8 @@ static struct packet *master_gbar_destroyed(pid_t pid, int handle, const struct
         * Lock file should be deleted after all callbacks are processed.
         */
        switch (common->gbar.type) {
-       case _GBAR_TYPE_SCRIPT:
-       case _GBAR_TYPE_BUFFER:
+       case GBAR_TYPE_SCRIPT:
+       case GBAR_TYPE_BUFFER:
                switch (fb_type(dbox_get_gbar_fb(common))) {
                case DBOX_FB_TYPE_FILE:
                case DBOX_FB_TYPE_SHM:
@@ -924,8 +924,8 @@ static struct packet *master_gbar_destroyed(pid_t pid, int handle, const struct
                        break;
                }
                break;
-       case _GBAR_TYPE_ELEMENTARY:
-       case _GBAR_TYPE_TEXT:
+       case GBAR_TYPE_UIFW:
+       case GBAR_TYPE_TEXT:
        default:
                break;
        }
@@ -1311,8 +1311,8 @@ static struct packet *master_created(pid_t pid, int handle, const struct packet
        int size_list;
        int user;
        int pinup_supported;
-       enum dbox_type dbox_type;
-       enum gbar_type gbar_type;
+       enum dynamicbox_dbox_type dbox_type;
+       enum dynamicbox_gbar_type gbar_type;
        double period;
        int is_pinned_up;
 
@@ -1396,11 +1396,11 @@ static struct packet *master_created(pid_t pid, int handle, const struct packet
        common->is_pinned_up = is_pinned_up;
 
        switch (dbox_type) {
-       case _DBOX_TYPE_ELEMENTARY:
-       case _DBOX_TYPE_FILE:
+       case DBOX_TYPE_UIFW:
+       case DBOX_TYPE_FILE:
                break;
-       case _DBOX_TYPE_SCRIPT:
-       case _DBOX_TYPE_BUFFER:
+       case DBOX_TYPE_SCRIPT:
+       case DBOX_TYPE_BUFFER:
                if (!strlen(dbox_fname)) {
                        break;
                }
@@ -1428,7 +1428,7 @@ static struct packet *master_created(pid_t pid, int handle, const struct packet
                        ErrPrint("Failed to do sync FB (%s - %s)\n", pkgname, util_basename(util_uri_to_path(id)));
                }
                break;
-       case _DBOX_TYPE_TEXT:
+       case DBOX_TYPE_TEXT:
                dbox_set_text_dbox(common);
                break;
        default:
@@ -1439,8 +1439,8 @@ static struct packet *master_created(pid_t pid, int handle, const struct packet
        dbox_set_gbarsize(common, gbar_w, gbar_h);
        dbox_set_default_gbarsize(common, gbar_w, gbar_h);
        switch (gbar_type) {
-       case _GBAR_TYPE_SCRIPT:
-       case _GBAR_TYPE_BUFFER:
+       case GBAR_TYPE_SCRIPT:
+       case GBAR_TYPE_BUFFER:
                if (!strlen(gbar_fname)) {
                        break;
                }
@@ -1459,10 +1459,10 @@ static struct packet *master_created(pid_t pid, int handle, const struct packet
                 */
 
                break;
-       case _GBAR_TYPE_TEXT:
+       case GBAR_TYPE_TEXT:
                dbox_set_text_gbar(common);
                break;
-       case _GBAR_TYPE_ELEMENTARY:
+       case GBAR_TYPE_UIFW:
        default:
                break;
        }
index 45bb84e..697916e 100644 (file)
@@ -2502,8 +2502,8 @@ EAPI int dynamicbox_size(dynamicbox_h handler)
        h = handler->common->dbox.height;
 
        switch (handler->common->dbox.type) {
-       case _DBOX_TYPE_BUFFER:
-       case _DBOX_TYPE_SCRIPT:
+       case DBOX_TYPE_BUFFER:
+       case DBOX_TYPE_SCRIPT:
                if (!fb_is_created(handler->common->dbox.fb)) {
                        w = 0;
                        h = 0;
@@ -2743,63 +2743,63 @@ EAPI enum dynamicbox_type dynamicbox_type(dynamicbox_h handler, int gbar)
 
        if (!handler || handler->state != DBOX_STATE_CREATE) {
                ErrPrint("Handler is invalid\n");
-               return DBOX_TYPE_INVALID;
+               return DBOX_CONTENT_TYPE_INVALID;
        }
 
        if (!handler->common || handler->common->state != DBOX_STATE_CREATE) {
                ErrPrint("Handler is invalid\n");
-               return DBOX_TYPE_INVALID;
+               return DBOX_CONTENT_TYPE_INVALID;
        }
 
        if (!handler->common->id) {
                ErrPrint("Handler is not valid\n");
-               return DBOX_TYPE_INVALID;
+               return DBOX_CONTENT_TYPE_INVALID;
        }
 
        if (gbar) {
                switch (handler->common->gbar.type) {
-               case _GBAR_TYPE_TEXT:
-                       return DBOX_TYPE_TEXT;
-               case _GBAR_TYPE_BUFFER:
-               case _GBAR_TYPE_SCRIPT:
+               case GBAR_TYPE_TEXT:
+                       return DBOX_CONTENT_TYPE_TEXT;
+               case GBAR_TYPE_BUFFER:
+               case GBAR_TYPE_SCRIPT:
                        {
                                const char *id;
                                id = fb_id(handler->common->gbar.fb);
                                if (id && !strncasecmp(id, SCHEMA_PIXMAP, strlen(SCHEMA_PIXMAP))) {
-                                       return DBOX_TYPE_RESOURCE_ID;
+                                       return DBOX_CONTENT_TYPE_RESOURCE_ID;
                                }
                        }
-                       return DBOX_TYPE_BUFFER;
-               case _GBAR_TYPE_ELEMENTARY:
-                       return DBOX_TYPE_UIFW;
+                       return DBOX_CONTENT_TYPE_BUFFER;
+               case GBAR_TYPE_UIFW:
+                       return DBOX_CONTENT_TYPE_UIFW;
                default:
                        break;
                }
 
-               return DBOX_TYPE_INVALID;
+               return DBOX_CONTENT_TYPE_INVALID;
        } else {
                switch (handler->common->dbox.type) {
-               case _DBOX_TYPE_FILE:
-                       return DBOX_TYPE_IMAGE;
-               case _DBOX_TYPE_BUFFER:
-               case _DBOX_TYPE_SCRIPT:
+               case DBOX_TYPE_FILE:
+                       return DBOX_CONTENT_TYPE_IMAGE;
+               case DBOX_TYPE_BUFFER:
+               case DBOX_TYPE_SCRIPT:
                        {
                                const char *id;
                                id = fb_id(handler->common->dbox.fb);
                                if (id && !strncasecmp(id, SCHEMA_PIXMAP, strlen(SCHEMA_PIXMAP))) {
-                                       return DBOX_TYPE_RESOURCE_ID;
+                                       return DBOX_CONTENT_TYPE_RESOURCE_ID;
                                }
                        }
-                       return DBOX_TYPE_BUFFER;
-               case _DBOX_TYPE_TEXT:
-                       return DBOX_TYPE_TEXT;
-               case _DBOX_TYPE_ELEMENTARY:
-                       return DBOX_TYPE_UIFW;
+                       return DBOX_CONTENT_TYPE_BUFFER;
+               case DBOX_TYPE_TEXT:
+                       return DBOX_CONTENT_TYPE_TEXT;
+               case DBOX_TYPE_UIFW:
+                       return DBOX_CONTENT_TYPE_UIFW;
                default:
                        break;
                }
 
-               return DBOX_TYPE_INVALID;
+               return DBOX_CONTENT_TYPE_INVALID;
        }
 
        return type;
@@ -2844,7 +2844,7 @@ EAPI unsigned int dynamicbox_acquire_resource_id(dynamicbox_h handler, int gbar,
                        return DBOX_STATUS_ERROR_INVALID_PARAMETER;
                }
 
-               if (handler->common->gbar.type != _GBAR_TYPE_SCRIPT && handler->common->gbar.type != _GBAR_TYPE_BUFFER) {
+               if (handler->common->gbar.type != GBAR_TYPE_SCRIPT && handler->common->gbar.type != GBAR_TYPE_BUFFER) {
                        ErrPrint("Handler is not valid type\n");
                        return DBOX_STATUS_ERROR_INVALID_PARAMETER;
                }
@@ -2866,7 +2866,7 @@ EAPI unsigned int dynamicbox_acquire_resource_id(dynamicbox_h handler, int gbar,
                        return DBOX_STATUS_ERROR_INVALID_PARAMETER;
                }
 
-               if (handler->common->dbox.type != _DBOX_TYPE_SCRIPT && handler->common->dbox.type != _DBOX_TYPE_BUFFER) {
+               if (handler->common->dbox.type != DBOX_TYPE_SCRIPT && handler->common->dbox.type != DBOX_TYPE_BUFFER) {
                        ErrPrint("Handler is not valid type\n");
                        return DBOX_STATUS_ERROR_INVALID_PARAMETER;
                }
@@ -2925,7 +2925,7 @@ EAPI int dynamicbox_release_resource_id(dynamicbox_h handler, int gbar, unsigned
                                return DBOX_STATUS_ERROR_INVALID_PARAMETER;
                        }
 
-                       if (handler->common->gbar.type != _GBAR_TYPE_SCRIPT && handler->common->gbar.type != _GBAR_TYPE_BUFFER) {
+                       if (handler->common->gbar.type != GBAR_TYPE_SCRIPT && handler->common->gbar.type != GBAR_TYPE_BUFFER) {
                                ErrPrint("Handler is not valid type\n");
                                return DBOX_STATUS_ERROR_INVALID_PARAMETER;
                        }
@@ -2965,7 +2965,7 @@ EAPI int dynamicbox_release_resource_id(dynamicbox_h handler, int gbar, unsigned
                                return DBOX_STATUS_ERROR_INVALID_PARAMETER;
                        }
 
-                       if (handler->common->dbox.type != _DBOX_TYPE_SCRIPT && handler->common->dbox.type != _DBOX_TYPE_BUFFER) {
+                       if (handler->common->dbox.type != DBOX_TYPE_SCRIPT && handler->common->dbox.type != DBOX_TYPE_BUFFER) {
                                ErrPrint("Handler is not valid type\n");
                                return DBOX_STATUS_ERROR_INVALID_PARAMETER;
                        }
@@ -3007,7 +3007,7 @@ EAPI unsigned int dynamicbox_resource_id(const dynamicbox_h handler, int gbar)
                        return 0;
                }
 
-               if (handler->common->gbar.type != _GBAR_TYPE_SCRIPT && handler->common->gbar.type != _GBAR_TYPE_BUFFER) {
+               if (handler->common->gbar.type != GBAR_TYPE_SCRIPT && handler->common->gbar.type != GBAR_TYPE_BUFFER) {
                        ErrPrint("Invalid handler\n");
                        return 0;
                }
@@ -3033,7 +3033,7 @@ EAPI unsigned int dynamicbox_resource_id(const dynamicbox_h handler, int gbar)
                        return 0;
                }
 
-               if (handler->common->dbox.type != _DBOX_TYPE_SCRIPT && handler->common->dbox.type != _DBOX_TYPE_BUFFER) {
+               if (handler->common->dbox.type != DBOX_TYPE_SCRIPT && handler->common->dbox.type != DBOX_TYPE_BUFFER) {
                        ErrPrint("Invalid handler\n");
                        return 0;
                }
@@ -3067,7 +3067,7 @@ EAPI void *dynamicbox_acquire_fb(dynamicbox_h handler, int gbar)
                        return NULL;
                }
 
-               if (handler->common->gbar.type != _GBAR_TYPE_SCRIPT && handler->common->gbar.type != _GBAR_TYPE_BUFFER) {
+               if (handler->common->gbar.type != GBAR_TYPE_SCRIPT && handler->common->gbar.type != GBAR_TYPE_BUFFER) {
                        ErrPrint("Handler is not valid type\n");
                        return NULL;
                }
@@ -3089,7 +3089,7 @@ EAPI void *dynamicbox_acquire_fb(dynamicbox_h handler, int gbar)
                        return NULL;
                }
 
-               if (handler->common->dbox.type != _DBOX_TYPE_SCRIPT && handler->common->dbox.type != _DBOX_TYPE_BUFFER) {
+               if (handler->common->dbox.type != DBOX_TYPE_SCRIPT && handler->common->dbox.type != DBOX_TYPE_BUFFER) {
                        ErrPrint("Handler is not valid type\n");
                        return NULL;
                }
@@ -3321,7 +3321,7 @@ EAPI int dynamicbox_emit_text_signal(dynamicbox_h handler, const char *emission,
                return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
 
-       if ((handler->common->dbox.type != _DBOX_TYPE_TEXT && handler->common->gbar.type != _GBAR_TYPE_TEXT) || !handler->common->id) {
+       if ((handler->common->dbox.type != DBOX_TYPE_TEXT && handler->common->gbar.type != GBAR_TYPE_TEXT) || !handler->common->id) {
                ErrPrint("Handler is not valid\n");
                return DBOX_STATUS_ERROR_INVALID_PARAMETER;
        }
index 26d7be1..e4b2c34 100644 (file)
@@ -209,8 +209,8 @@ struct dynamicbox_common *dbox_create_common_handle(dynamicbox_h handle, const c
        }
 
        /* Data provider will set this */
-       common->dbox.type = _DBOX_TYPE_FILE;
-       common->gbar.type = _GBAR_TYPE_SCRIPT;
+       common->dbox.type = DBOX_TYPE_FILE;
+       common->gbar.type = GBAR_TYPE_SCRIPT;
 
        /* Used for handling the mouse event on a box */
        common->dbox.mouse_event = 0;
@@ -557,7 +557,7 @@ void dbox_set_id(struct dynamicbox_common *common, const char *id)
 void dbox_set_filename(struct dynamicbox_common *common, const char *filename)
 {
        if (common->filename) {
-               if (common->dbox.type == _DBOX_TYPE_FILE || common->dbox.type == _DBOX_TYPE_TEXT) {
+               if (common->dbox.type == DBOX_TYPE_FILE || common->dbox.type == DBOX_TYPE_TEXT) {
                        if (common->filename[0] && unlink(common->filename) < 0) {
                                ErrPrint("unlink: %s (%s)\n", strerror(errno), common->filename);
                        }
@@ -699,22 +699,22 @@ void dbox_set_pinup(struct dynamicbox_common *common, int pinup_supported)
 
 void dbox_set_text_dbox(struct dynamicbox_common *common)
 {
-       common->dbox.type = _DBOX_TYPE_TEXT;
+       common->dbox.type = DBOX_TYPE_TEXT;
 }
 
 void dbox_set_text_gbar(struct dynamicbox_common *common)
 {
-       common->gbar.type = _GBAR_TYPE_TEXT;
+       common->gbar.type = GBAR_TYPE_TEXT;
 }
 
 int dbox_text_dbox(struct dynamicbox_common *common)
 {
-       return common->dbox.type == _DBOX_TYPE_TEXT;
+       return common->dbox.type == DBOX_TYPE_TEXT;
 }
 
 int dbox_text_gbar(struct dynamicbox_common *common)
 {
-       return common->gbar.type == _GBAR_TYPE_TEXT;
+       return common->gbar.type == GBAR_TYPE_TEXT;
 }
 
 void dbox_set_period(struct dynamicbox_common *common, double period)