efl ecore - init vpath on ecore init so we have a base object working
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 4 Apr 2016 08:12:38 +0000 (17:12 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 5 Apr 2016 07:22:59 +0000 (16:22 +0900)
this inits a new vpath object and adds it at priority 0 to the vpath
manager so you can use the vpath manager to create vpath file objects
and look things up.

@feature

src/lib/ecore/Ecore.h
src/lib/ecore/ecore.c

index e843038..477335a 100644 (file)
 #define _ECORE_H
 
 #include <Efl_Config.h>
+#include <Efl.h>
 
 #ifdef _MSC_VER
 # include <Evil.h>
index 247612b..d7eead3 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "Ecore.h"
 #include "ecore_private.h"
+#include "Efl.h"
 
 #if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO)
 #include <malloc.h>
@@ -116,6 +117,8 @@ static Ecore_Memory_State _ecore_memory_state = ECORE_MEMORY_STATE_NORMAL;
 static Ecore_Timer *_systemd_watchdog = NULL;
 #endif
 
+static Efl_Vpath *vpath = NULL;
+
 Eina_Lock _ecore_main_loop_lock;
 int _ecore_main_lock_count;
 
@@ -243,6 +246,10 @@ ecore_init(void)
    if (_ecore_fps_debug) _ecore_fps_debug_init();
    if (!ecore_mempool_init()) goto shutdown_mempool;
    _ecore_main_loop_init();
+
+   vpath = eo_add(EFL_VPATH_CORE_CLASS, NULL);
+   if (vpath) efl_vpath_manager_register(EFL_VPATH_MANAGER_CLASS, 0, vpath);
+
    _ecore_signal_init();
 #ifndef HAVE_EXOTIC
    _ecore_exe_init();
@@ -394,6 +401,13 @@ ecore_shutdown(void)
      _ecore_event_shutdown();
      _ecore_main_shutdown();
      _ecore_signal_shutdown();
+
+   if (vpath)
+     {
+        eo_del(vpath);
+        vpath = NULL;
+     }
+
      _ecore_main_loop_shutdown();
 
 #if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_INFO)