add manual indicator mode/fix prevent issues
authorHyungdeuk Kim <hd3.kim@samsung.com>
Wed, 5 Dec 2012 10:48:26 +0000 (19:48 +0900)
committerHyungdeuk Kim <hd3.kim@samsung.com>
Wed, 5 Dec 2012 10:48:26 +0000 (19:48 +0900)
include/SLP_UI_Gadget_PG.h
include/ui-gadget.h
packaging/ui-gadget-1.spec
src/manager.c
src/module.c
src/ug.c

index d57183d7299e67490bb30da1f8a161c6170cc399..be7ed75c2e6d61ebd8336cad6eeafc86585ed734 100755 (executable)
@@ -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 <b>struct ug_data</b> is a user defined private data structure describing base layout, own UI gadget handler, and whatever you need:
index 88e82fe71172e5c96a2c89c6f5a8ab3e936932a8..bad4fff6930b643038c661906039b9c2d61108b5 100755 (executable)
@@ -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
 };
 
index f31d3e1617ef3ad76aa8641756b7a1b84baf8393..d54671459385a59299b20c929968583fcfad9e9a 100755 (executable)
@@ -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
index 265b07d0de1d765ee2e118961fac04d02523f442..5c581c8446374aa4f0c7776f12815c19ee617ad0 100755 (executable)
@@ -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;
 }
index 89989f7fad6e35fd34fbaa5d3237010a91c875d5..3b75a41f7be0858eb854fe23f574f40f8af2c135 100644 (file)
@@ -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;
index 2aaba2da0527002f4802d3afc9f5cbab6ab51f98..68c53744dff9d2d11fbaccbeb3ce82e3871fa894 100755 (executable)
--- 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;
 }