Use the commonly defined enumeration
authorSung-jae Park <nicesj.park@samsung.com>
Sun, 28 Sep 2014 12:51:21 +0000 (21:51 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Mon, 29 Sep 2014 12:34:52 +0000 (21:34 +0900)
instead of local definitions.

[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: I489cc6e7a22658990a5971c8171754e03e976ee1

include/package.h
pkgmgr_dynamicbox/src/service_register.c
src/buffer_handler.c
src/instance.c
src/io.c
src/main.c
src/package.c
src/script_handler.c
src/slave_rpc.c

index 1359afb..492739f 100644 (file)
  * limitations under the License.
  */
 
-enum dbox_type {
-       DBOX_TYPE_NONE = 0x0,
-       DBOX_TYPE_SCRIPT,
-       DBOX_TYPE_FILE,
-       DBOX_TYPE_TEXT,
-       DBOX_TYPE_BUFFER
-};
-
-enum gbar_type {
-       GBAR_TYPE_NONE = 0x0,
-       GBAR_TYPE_SCRIPT,
-       GBAR_TYPE_TEXT,
-       GBAR_TYPE_BUFFER
-};
-
 enum alter_type {
        ALTER_CREATE,
        ALTER_DESTROY
@@ -84,8 +69,8 @@ extern int package_set_libexec(struct pkg_info *info, const char *libexec);
 extern void package_set_pinup(struct pkg_info *info, int pinup);
 extern void package_set_auto_launch(struct pkg_info *info, const char *auto_launch);
 extern void package_set_size_list(struct pkg_info *info, unsigned int size_list);
-extern void package_set_dbox_type(struct pkg_info *info, enum dbox_type type);
-extern void package_set_gbar_type(struct pkg_info *info, enum gbar_type type);
+extern void package_set_dbox_type(struct pkg_info *info, enum dynamicbox_dbox_type type);
+extern void package_set_gbar_type(struct pkg_info *info, enum dynamicbox_gbar_type type);
 extern int package_set_dbox_group(struct pkg_info *info, const char *group);
 extern int package_set_dbox_path(struct pkg_info *info, const char *path);
 extern int package_set_gbar_group(struct pkg_info *info, const char *group);
@@ -109,8 +94,8 @@ extern struct pkg_info * const package_ref(struct pkg_info *info);
 extern struct pkg_info * const package_unref(struct pkg_info *info);
 extern const int const package_refcnt(const struct pkg_info *info);
 
-extern const enum gbar_type const package_gbar_type(const struct pkg_info *info);
-extern const enum dbox_type const package_dbox_type(const struct pkg_info *info);
+extern const enum dynamicbox_gbar_type const package_gbar_type(const struct pkg_info *info);
+extern const enum dynamicbox_dbox_type const package_dbox_type(const struct pkg_info *info);
 
 extern int package_add_instance(struct pkg_info *info, struct inst_info *inst);
 extern int package_del_instance(struct pkg_info *info, struct inst_info *inst);
index 5607992..38ccf7b 100644 (file)
@@ -148,23 +148,6 @@ struct i18n {
        xmlChar *icon;
 };
 
-enum dbox_type {
-       DBOX_TYPE_NONE = 0x0,
-       DBOX_TYPE_SCRIPT,
-       DBOX_TYPE_FILE,
-       DBOX_TYPE_TEXT,
-       DBOX_TYPE_BUFFER,
-       DBOX_TYPE_ELEMENTARY
-};
-
-enum gbar_type {
-       GBAR_TYPE_NONE = 0x0,
-       GBAR_TYPE_SCRIPT,
-       GBAR_TYPE_TEXT,
-       GBAR_TYPE_BUFFER,
-       GBAR_TYPE_ELEMENTARY
-};
-
 struct dynamicbox {
        xmlChar *pkgid;
        int secured;
@@ -191,7 +174,7 @@ struct dynamicbox {
        int default_touch_effect;
        int default_need_frame;
 
-       enum dbox_type dbox_type;
+       enum dynamicbox_dbox_type dbox_type;
        xmlChar *dbox_src;
        xmlChar *dbox_group;
        int size_list; /* 1x1, 2x1, 2x2, 4x1, 4x2, 4x3, 4x4 */
@@ -201,7 +184,7 @@ struct dynamicbox {
        int need_frame[DBOX_NR_OF_SIZE_LIST]; /* Box needs frame which should be cared by viewer */
        int mouse_event[DBOX_NR_OF_SIZE_LIST];
 
-       enum gbar_type gbar_type;
+       enum dynamicbox_gbar_type gbar_type;
        xmlChar *gbar_src;
        xmlChar *gbar_group;
        xmlChar *gbar_size; /* Default PD size */
@@ -2151,7 +2134,7 @@ static inline void update_box(struct dynamicbox *dynamicbox, xmlNodePtr node)
                        } else if (!xmlStrcasecmp(type, (const xmlChar *)"script")) {
                                dynamicbox->dbox_type = DBOX_TYPE_SCRIPT;
                        } else if (!xmlStrcasecmp(type, (const xmlChar *)"elm")) {
-                               dynamicbox->dbox_type = DBOX_TYPE_ELEMENTARY;
+                               dynamicbox->dbox_type = DBOX_TYPE_UIFW;
                        } else { /* Default */
                                dynamicbox->dbox_type = DBOX_TYPE_FILE;
                        }
@@ -2476,7 +2459,7 @@ static inline void update_pd(struct dynamicbox *dynamicbox, xmlNodePtr node)
                } else if (!xmlStrcasecmp(type, (const xmlChar *)"buffer")) {
                        dynamicbox->gbar_type = GBAR_TYPE_BUFFER;
                } else if (!xmlStrcasecmp(type, (const xmlChar *)"elm")) {
-                       dynamicbox->gbar_type = GBAR_TYPE_ELEMENTARY;
+                       dynamicbox->gbar_type = GBAR_TYPE_UIFW;
                } else {
                        dynamicbox->gbar_type = GBAR_TYPE_SCRIPT;
                }
index f60c39e..c561c27 100644 (file)
@@ -44,6 +44,7 @@
 #include <packet.h>
 #include <dynamicbox_errno.h>
 #include <dynamicbox_buffer.h>
+#include <dynamicbox_service.h>
 
 #include "debug.h"
 #include "conf.h"
index 55a053e..574a5c7 100644 (file)
@@ -310,7 +310,7 @@ static inline void instance_send_update_mode_event(struct inst_info *inst, int a
 static inline void instance_send_resized_event(struct inst_info *inst, int is_gbar, int w, int h, int status)
 {
        struct packet *packet;
-       enum dbox_type dbox_type;
+       enum dynamicbox_dbox_type dbox_type;
        const char *pkgname;
        const char *id;
        unsigned int cmd = CMD_SIZE_CHANGED;
@@ -369,8 +369,8 @@ out:
 HAPI int instance_unicast_created_event(struct inst_info *inst, struct client_node *client)
 {
        struct packet *packet;
-       enum dbox_type dbox_type;
-       enum gbar_type gbar_type;
+       enum dynamicbox_dbox_type dbox_type;
+       enum dynamicbox_gbar_type gbar_type;
        const char *dbox_file;
        const char *gbar_file;
        unsigned int cmd = CMD_CREATED;
@@ -438,8 +438,8 @@ static int update_client_list(struct client_node *client, void *data)
 static int instance_broadcast_created_event(struct inst_info *inst)
 {
        struct packet *packet;
-       enum dbox_type dbox_type;
-       enum gbar_type gbar_type;
+       enum dynamicbox_dbox_type dbox_type;
+       enum dynamicbox_gbar_type gbar_type;
        const char *dbox_file;
        const char *gbar_file;
        unsigned int cmd = CMD_CREATED;
@@ -664,8 +664,8 @@ HAPI int instance_event_callback_del(struct inst_info *inst, enum instance_event
 static inline void destroy_instance(struct inst_info *inst)
 {
        struct pkg_info *pkg;
-       enum dbox_type dbox_type;
-       enum gbar_type gbar_type;
+       enum dynamicbox_dbox_type dbox_type;
+       enum dynamicbox_gbar_type gbar_type;
        struct slave_node *slave;
        struct event_item *item;
        struct tag_item *tag_item;
@@ -1007,8 +1007,8 @@ out:
 static void reactivate_cb(struct slave_node *slave, const struct packet *packet, void *data)
 {
        struct inst_info *inst = data;
-       enum dbox_type dbox_type;
-       enum gbar_type gbar_type;
+       enum dynamicbox_dbox_type dbox_type;
+       enum dynamicbox_gbar_type gbar_type;
        int ret;
        const char *content;
        const char *title;
@@ -1495,8 +1495,8 @@ static inline void release_resource_for_closing_gbar(struct pkg_info *info, stru
 
 HAPI int instance_state_reset(struct inst_info *inst)
 {
-       enum dbox_type dbox_type;
-       enum gbar_type gbar_type;
+       enum dynamicbox_dbox_type dbox_type;
+       enum dynamicbox_gbar_type gbar_type;
 
        if (!inst) {
                ErrPrint("Invalid instance handle\n");
@@ -1847,7 +1847,7 @@ HAPI void instance_dbox_updated_by_instance(struct inst_info *inst, const char *
 {
        struct packet *packet;
        const char *id = NULL;
-       enum dbox_type dbox_type;
+       enum dynamicbox_dbox_type dbox_type;
        unsigned int cmd = CMD_DBOX_UPDATED;
 
        if (inst->client && inst->visible != DBOX_SHOW) {
index fc038e0..31549cc 100644 (file)
--- a/src/io.c
+++ b/src/io.c
@@ -28,6 +28,7 @@
 #include <sqlite3.h>
 #include <db-util.h>
 #include <dynamicbox_errno.h>
+#include <dynamicbox_service.h>
 
 #include "debug.h"
 #include "conf.h"
index a20f4aa..d7aaaa4 100644 (file)
@@ -33,6 +33,9 @@
 #include <dlog.h>
 
 #if defined(HAVE_LIVEBOX)
+
+#include <dynamicbox_service.h>
+
 #include "slave_life.h"
 #include "slave_rpc.h"
 #include "client_life.h"
index e157ab5..c4c4443 100644 (file)
@@ -63,7 +63,7 @@ struct pkg_info {
        char *dbox_id;
 
        struct {
-               enum dbox_type type;
+               enum dynamicbox_dbox_type type;
 
                union {
                        struct {
@@ -93,7 +93,7 @@ struct pkg_info {
        } dbox;
 
        struct {
-               enum gbar_type type;
+               enum dynamicbox_gbar_type type;
 
                union {
                        struct {
@@ -1004,12 +1004,12 @@ HAPI const int const package_refcnt(const struct pkg_info *info)
        return info->refcnt;
 }
 
-HAPI const enum dbox_type package_dbox_type(const struct pkg_info *info)
+HAPI const enum dynamicbox_dbox_type package_dbox_type(const struct pkg_info *info)
 {
        return info ? info->dbox.type : DBOX_TYPE_NONE;
 }
 
-HAPI void package_set_dbox_type(struct pkg_info *info, enum dbox_type type)
+HAPI void package_set_dbox_type(struct pkg_info *info, enum dynamicbox_dbox_type type)
 {
        info->dbox.type = type;
 }
@@ -1044,12 +1044,12 @@ HAPI void package_set_network(struct pkg_info *info, int network)
        info->network = network;
 }
 
-HAPI const enum gbar_type const package_gbar_type(const struct pkg_info *info)
+HAPI const enum dynamicbox_gbar_type const package_gbar_type(const struct pkg_info *info)
 {
        return info ? info->gbar.type : GBAR_TYPE_NONE;
 }
 
-HAPI void package_set_gbar_type(struct pkg_info *info, enum gbar_type type)
+HAPI void package_set_gbar_type(struct pkg_info *info, enum dynamicbox_gbar_type type)
 {
        info->gbar.type = type;
 }
index 7075c6f..eab2e8f 100644 (file)
@@ -33,6 +33,7 @@
 #include <dlog.h>
 #include <packet.h>
 #include <dynamicbox_errno.h>
+#include <dynamicbox_service.h>
 
 #include "slave_life.h"
 #include "slave_rpc.h"
index 7614b2d..1c8e9e6 100644 (file)
@@ -29,6 +29,7 @@
 #include <packet.h>
 #include <com-core_packet.h>
 #include <dynamicbox_errno.h>
+#include <dynamicbox_service.h>
 #include <dynamicbox_cmd_list.h>
 
 #include "debug.h"