From: Hyungdeuk Kim Date: Wed, 5 Dec 2012 10:48:26 +0000 (+0900) Subject: add manual indicator mode/fix prevent issues X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b50b4f166c1693aec7c42969a7e05e52db07b3c;p=platform%2Fcore%2Fappfw%2Fui-gadget-1.git add manual indicator mode/fix prevent issues --- diff --git a/include/SLP_UI_Gadget_PG.h b/include/SLP_UI_Gadget_PG.h index d57183d..be7ed75 100755 --- a/include/SLP_UI_Gadget_PG.h +++ b/include/SLP_UI_Gadget_PG.h @@ -187,6 +187,8 @@ UG_OPT_INDICATOR_PORTRAIT_ONLY UG_OPT_INDICATOR_LANDSCAPE_ONLY // Disable indicator UG_OPT_INDICATOR_DISABLE +// current indicator status will be held +UG_OPT_INDICATOR_MANUAL @endcode \note struct ug_data is a user defined private data structure describing base layout, own UI gadget handler, and whatever you need: diff --git a/include/ui-gadget.h b/include/ui-gadget.h index 88e82fe..bad4fff 100755 --- a/include/ui-gadget.h +++ b/include/ui-gadget.h @@ -109,9 +109,6 @@ enum ug_key_event { UG_KEY_EVENT_MAX }; -#define UG_OPT_INDICATOR_MASK (0x03) -#define UG_OPT_INDICATOR(opt) (opt & UG_OPT_INDICATOR_MASK) - /** * UI gadget option * - Indicator option: [1, 0] bits @@ -129,6 +126,9 @@ enum ug_option { UG_OPT_INDICATOR_DISABLE = 0x03, /**< Indicator option: Disable with both portrait and landscape view window */ + UG_OPT_INDICATOR_MANUAL = 0x04, + /**< Indicator option: + Indicator will be handled manually */ UG_OPT_MAX }; diff --git a/packaging/ui-gadget-1.spec b/packaging/ui-gadget-1.spec index f31d3e1..d546714 100755 --- a/packaging/ui-gadget-1.spec +++ b/packaging/ui-gadget-1.spec @@ -1,7 +1,7 @@ Name: ui-gadget-1 Summary: UI Gadget Library -Version: 0.1.2 +Version: 0.1.3 Release: 1 Group: TO_BE/FILLED_IN License: TO BE FILLED IN diff --git a/src/manager.c b/src/manager.c index 265b07d..5c581c8 100755 --- a/src/manager.c +++ b/src/manager.c @@ -265,7 +265,7 @@ static int ugman_indicator_update(enum ug_option opt, enum ug_event event) return -1; } - switch (UG_OPT_INDICATOR(opt)) { + switch (opt) { case UG_OPT_INDICATOR_ENABLE: if (event == UG_EVENT_NONE) enable = 1; @@ -283,6 +283,8 @@ static int ugman_indicator_update(enum ug_option opt, enum ug_event event) case UG_OPT_INDICATOR_DISABLE: enable = 0; break; + case UG_OPT_INDICATOR_MANUAL: + return 0; default: _ERR("ugman_indicator_update failed: Invalid opt\n"); return -1; @@ -299,7 +301,7 @@ static int ugman_ug_getopt(ui_gadget_h ug) return -1; /* Indicator Option */ if (ug->mode == UG_MODE_FULLVIEW) - ugman_indicator_update(UG_OPT_INDICATOR(ug->opt), UG_EVENT_NONE); + ugman_indicator_update(ug->opt, UG_EVENT_NONE); return 0; } @@ -703,7 +705,7 @@ int ugman_send_event(enum ug_event event) g_idle_add(ugman_send_event_pre, (void *)event); if (is_rotation && ug_man.fv_top) - ugman_indicator_update(UG_OPT_INDICATOR(ug_man.fv_top->opt), event); + ugman_indicator_update(ug_man.fv_top->opt, event); return 0; } diff --git a/src/module.c b/src/module.c index 89989f7..3b75a41 100644 --- a/src/module.c +++ b/src/module.c @@ -51,7 +51,6 @@ struct ug_module *ug_module_load(const char *name) struct ug_module *module; char ug_file[PATH_MAX]; - char *pkg_name = NULL; uid_t uid; int (*module_init) (struct ug_module_ops *ops); @@ -63,10 +62,14 @@ struct ug_module *ug_module_load(const char *name) return NULL; } +#if 0 + char *pkg_name = NULL; pkg_name = getenv("PKG_NAME"); uid = geteuid(); +#endif do { +#if 0 if (pkg_name) { snprintf(ug_file, PATH_MAX, "/usr/apps/%s/lib/libug-%s.so", pkg_name, name); if (file_exist(ug_file)) @@ -75,6 +78,7 @@ struct ug_module *ug_module_load(const char *name) if (file_exist(ug_file)) break; } +#endif snprintf(ug_file, PATH_MAX, "/usr/ug/lib/libug-%s.so", name); if (file_exist(ug_file)) break; diff --git a/src/ug.c b/src/ug.c index 2aaba2d..68c5374 100755 --- a/src/ug.c +++ b/src/ug.c @@ -65,6 +65,7 @@ int ug_free(ui_gadget_h ug) if (ug->service) service_destroy(ug->service); free(ug); + ug = NULL; return 0; }