From 909fd6e2c4369020707782e20656069fbb3030d1 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 20 May 2014 23:34:25 +1000 Subject: Found a way to deal with the PACKAGE_* stuff outside of Elm. It's undocumented. --- src/libraries/winFang.c | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) (limited to 'src/libraries/winFang.c') diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c index bfd9327..9319a18 100644 --- a/src/libraries/winFang.c +++ b/src/libraries/winFang.c @@ -1,41 +1,7 @@ +#include "LumbrJack.h" #include "winFang.h" -void HamrTime(void *elm_main, char *domain) -{ - char *env, cwd[PATH_MAX], temp[PATH_MAX * 2]; - - elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR); - elm_app_compile_data_dir_set(PACKAGE_DATA_DIR); - elm_app_compile_lib_dir_set(PACKAGE_LIB_DIR); - elm_app_compile_locale_set(PACKAGE_LOCALE_DIR); - // Do this after the above calls, but before changing the working directory, or screwing with argv[0]. - // It tries to set up the package paths depending on where the executable is, so things are relocatable. - // First argument is the elm_main() function that Elementary starts us from. - // Second argument should be a lower case string used as the "domain", which is different from the log domain. - // It's used lower case as part of the data directory path. - // So, if prefix is /usr/local, then the system data dir is /usr/local/share, - // and this apps data dir is /usr/local/share/"domain". - // It's used upper case as part of environment variables to override directory paths at run time. - // So "DOMAIN"_PREFIX, "DOMAIN"_BIN_DIR, "DOMAIN"_LIB_DIR, "DOMAIN"_DATA_DIR, and "DOMAIN"_LOCALE_DIR - // Third argument is the name of a file it can check for to make sure it found the correct path. - // This file is looked for in the data dir. - elm_app_info_set(elm_main, domain, "checkme.txt"); - // Once this is all setup, the code can do - - // elm_app_prefix_dir_get(); // or bin, lib, data, locale. - - getcwd(cwd, PATH_MAX); - env = getenv("LUA_CPATH"); - if (!env) env = ""; - sprintf(temp, "%s;%s/lib?.so;%s/?.so;%s/?.so", env, elm_app_lib_dir_get(), elm_app_lib_dir_get(), cwd); - setenv("LUA_CPATH", temp, 1); - - env = getenv("LUA_PATH"); - if (!env) env = ""; - sprintf(temp, "%s;%s/?.lua;%s/?.lua", env, elm_app_lib_dir_get(), cwd); - setenv("LUA_PATH", temp, 1); -} - static void _checkWindowBounds(winFang *win, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { Evas_Object *test; @@ -244,7 +210,7 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch x = 0; y = 0; } - snprintf(buf, sizeof(buf), "%s/winFang.edj", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/winFang.edj", prefix_data_get()); result->layout = eo_add(ELM_OBJ_LAYOUT_CLASS, obj, evas_obj_size_set(w, h), evas_obj_position_set(x, y), @@ -275,7 +241,7 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch eo_unref(obj); // Create corner handles. - snprintf(buf, sizeof(buf), "%s/pt.png", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/pt.png", prefix_data_get()); for (i = 0; i < 4; i++) { int cx = result->x, cy = result->y; -- cgit v1.1