allow ecore to not load system modules.
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Thu, 14 Nov 2013 15:27:19 +0000 (13:27 -0200)
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Thu, 14 Nov 2013 15:27:19 +0000 (13:27 -0200)
this won't go to changelog/news as it's mainly internal, I can't see
people wanting to use it except rare cases as edje tools.

src/bin/edje/edje_cc.c
src/bin/edje/edje_codegen.c
src/bin/edje/edje_convert_main.c
src/bin/edje/edje_decc.c
src/bin/edje/edje_external_inspector.c
src/bin/edje/edje_inspector.c
src/bin/edje/edje_pick.c
src/lib/ecore/Ecore_Common.h
src/lib/ecore/ecore.c

index 1ce5168..d714355 100644 (file)
@@ -116,6 +116,8 @@ main(int argc, char **argv)
 
    setlocale(LC_NUMERIC, "C");
 
+   ecore_app_no_system_modules();
+
    if (!eina_init())
      return -1;
 
index d03f450..f2ddc7f 100644 (file)
@@ -1098,6 +1098,8 @@ main(int argc, char *argv[])
 
    setlocale(LC_NUMERIC, "C");
 
+   ecore_app_no_system_modules();
+
    eina_init();
    ecore_init();
    ecore_evas_init();
index e17d412..97a96d8 100644 (file)
@@ -113,6 +113,8 @@ main(int argc, char **argv)
 
    setlocale(LC_NUMERIC, "C");
 
+   ecore_app_no_system_modules();
+
    if (!eina_init())
      return -1;
 
index 2065d90..1cbaf29 100644 (file)
@@ -142,6 +142,9 @@ main(int argc, char **argv)
    int i;
 
    setlocale(LC_NUMERIC, "C");
+
+   ecore_app_no_system_modules();
+
    if (!eina_init())
      exit(-1);
    _edje_cc_log_dom = eina_log_domain_register
index 6bd9a35..6b1a521 100644 (file)
@@ -602,6 +602,8 @@ main(int argc, char **argv)
 
    setlocale(LC_NUMERIC, "C");
 
+   ecore_app_no_system_modules();
+
    ecore_init();
    eina_init();
    edje_init();
index 01cf104..81fe427 100644 (file)
@@ -1536,6 +1536,8 @@ main(int argc, char **argv)
 
    setlocale(LC_NUMERIC, "C");
 
+   ecore_app_no_system_modules();
+
    ecore_init();
    ecore_evas_init();
    eina_init();
index 4635dfe..c057d3a 100644 (file)
@@ -1207,6 +1207,8 @@ main(int argc, char **argv)
    void *n;
    int k, bytes;
 
+   ecore_app_no_system_modules();
+
    eina_init();
    eet_init();
    ecore_init();
index 5536d22..bf6d1de 100644 (file)
@@ -1741,6 +1741,22 @@ EAPI void ecore_app_args_get(int *argc, char ***argv);
 EAPI void ecore_app_restart(void);
 
 /**
+ * @brief Do not load system modules for this application.
+ *
+ * Ecore will now load platform-specific system modules such as
+ * power-management, time and locate monitors.
+ *
+ * Whenever this function is called @b before ecore_init(), ecore
+ * won't load such modules.
+ *
+ * This may be useful to some command-line utilities, hardly will be
+ * useful for end-user applications.
+ *
+ * @since 1.8
+ */
+EAPI void ecore_app_no_system_modules(void);
+
+/**
  * @}
  */
 
index 1e7a1b7..d9c194c 100644 (file)
@@ -52,6 +52,8 @@ static FILE *_ecore_memory_statistic_file = NULL;
 #endif
 #endif
 
+static Eina_Bool _no_system_modules = EINA_FALSE;
+
 Eo *_ecore_parent = NULL;
 
 static const char *_ecore_magic_string_get(Ecore_Magic m);
@@ -194,6 +196,12 @@ ecore_system_modules_unload(void)
      }
 }
 
+EAPI void
+ecore_app_no_system_modules(void)
+{
+   _no_system_modules = EINA_TRUE;
+}
+
 /**
  * @addtogroup Ecore_Init_Group
  *
@@ -320,7 +328,8 @@ ecore_init(void)
      }
 #endif
 
-   ecore_system_modules_load();
+   if (!_no_system_modules)
+     ecore_system_modules_load();
 
    eina_log_timing(_ecore_log_dom,
                   EINA_LOG_STATE_STOP,