コード例 #1
0
ファイル: theme.c プロジェクト: Limsik/e17
void
theme_init(const char *theme)
{
   Evas_Object *o;
   char buf[4096];

   if (!theme) theme = "default";
   o = edje_object_add(evas);
   if ((theme) &&
       (theme[0] != '/') &&
       (!!strncmp(theme, "./", 2)) &&
	(!!strncmp(theme, "../", 3)))
     snprintf(buf, sizeof(buf), "%s/%s.edj", eina_prefix_data_get(pfx), theme);
   else
     snprintf(buf, sizeof(buf), "%s", theme);
   o = exquisite_object_add (evas, buf);
   evas_object_move(o, 0, 0);
   evas_object_resize(o, scr_w, scr_h);
   evas_object_show(o);
   o_bg = o;
}
コード例 #2
0
ファイル: main.c プロジェクト: RomainNaour/efl
static int
elua_register_require(lua_State *L)
{
   const char *corepath = lua_touserdata(L, lua_upvalueindex(1));
   const char *modpath  = lua_touserdata(L, lua_upvalueindex(2));
   const char *appspath = lua_touserdata(L, lua_upvalueindex(3));
   Eina_List  *largs    = lua_touserdata(L, lua_upvalueindex(4)), *l = NULL;
   Eina_Bool   noenv    = lua_toboolean (L, lua_upvalueindex(5));
   Arg_Data   *data     = NULL;
   char corepathbuf[PATH_MAX], modpathbuf[PATH_MAX], appspathbuf[PATH_MAX];
   int n = 3;
   lua_pushvalue(L, 1);
   elua_require_ref = luaL_ref(L, LUA_REGISTRYINDEX);
   lua_pushvalue(L, 2);
   elua_appload_ref = luaL_ref(L, LUA_REGISTRYINDEX);
   if (getenv("EFL_RUN_IN_TREE"))
     {
        corepath = PACKAGE_SRC_DIR "/src/scripts/elua/core";
        modpath  = PACKAGE_SRC_DIR "/src/scripts/elua/modules";
        appspath = PACKAGE_SRC_DIR "/src/scripts/elua/apps";
     }
   else
     {
        if (!corepath)
          {
             if (noenv || !(corepath = getenv("ELUA_CORE_DIR")) || !corepath[0])
               {
                  corepath = corepathbuf;
                  snprintf(corepathbuf, sizeof(corepathbuf), "%s/core",
                           eina_prefix_data_get(elua_prefix));
               }
          }
        if (!modpath)
          {
             if (noenv || !(modpath = getenv("ELUA_MODULES_DIR")) || !modpath[0])
               {
                  modpath = modpathbuf;
                  snprintf(modpathbuf, sizeof(modpathbuf), "%s/modules",
                           eina_prefix_data_get(elua_prefix));
               }
          }
        if (!appspath)
          {
             if (noenv || !(appspath = getenv("ELUA_APPS_DIR")) || !appspath[0])
               {
                  appspath = appspathbuf;
                  snprintf(appspathbuf, sizeof(appspathbuf), "%s/apps",
                           eina_prefix_data_get(elua_prefix));
               }
          }
     }
   lua_pushfstring(L, "%s/?.lua;", corepath);
   EINA_LIST_FOREACH(largs, l, data)
     {
        if (data->type != ARG_LIBDIR) continue;
        lua_pushfstring(L, "%s/?.lua;", data->value);
        ++n;
     }
   lua_pushfstring(L, "%s/?.eo.lua;", modpath);
   lua_pushfstring(L, "%s/?.lua;", modpath);
   lua_pushvalue(L, 3);
   lua_concat(L, n + 1);
   lua_pushfstring(L, "%s/?.lua;", appspath);
   lua_pushvalue(L, 4);
   lua_concat(L, 2);
   return 2;
}