diff options
Diffstat (limited to '')
-rw-r--r-- | src/libraries/winFang.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c index 5662970..dc5188a 100644 --- a/src/libraries/winFang.c +++ b/src/libraries/winFang.c | |||
@@ -1,7 +1,40 @@ | |||
1 | #include "winFang.h" | 1 | #include "winFang.h" |
2 | 2 | ||
3 | 3 | ||
4 | 4 | void HamrTime(void *elm_main, char *domain) | |
5 | { | ||
6 | char *env, cwd[PATH_MAX], temp[PATH_MAX * 2]; | ||
7 | |||
8 | elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR); | ||
9 | elm_app_compile_data_dir_set(PACKAGE_DATA_DIR); | ||
10 | elm_app_compile_lib_dir_set(PACKAGE_LIB_DIR); | ||
11 | elm_app_compile_locale_set(PACKAGE_LOCALE_DIR); | ||
12 | // Do this after the above calls, but before changing the working directory, or screwing with argv[0]. | ||
13 | // It tries to set up the package paths depending on where the executable is, so things are relocatable. | ||
14 | // First argument is the elm_main() function that Elementary starts us from. | ||
15 | // Second argument should be a lower case string used as the "domain", which is different from the log domain. | ||
16 | // It's used lower case as part of the data directory path. | ||
17 | // So, if prefix is /usr/local, then the system data dir is /usr/local/share, | ||
18 | // and this apps data dir is /usr/local/share/"domain". | ||
19 | // It's used upper case as part of environment variables to override directory paths at run time. | ||
20 | // So "DOMAIN"_PREFIX, "DOMAIN"_BIN_DIR, "DOMAIN"_LIB_DIR, "DOMAIN"_DATA_DIR, and "DOMAIN"_LOCALE_DIR | ||
21 | // Third argument is the name of a file it can check for to make sure it found the correct path. | ||
22 | // This file is looked for in the data dir. | ||
23 | elm_app_info_set(elm_main, domain, "checkme.txt"); | ||
24 | // Once this is all setup, the code can do - | ||
25 | // elm_app_prefix_dir_get(); // or bin, lib, data, locale. | ||
26 | |||
27 | getcwd(cwd, PATH_MAX); | ||
28 | env = getenv("LUA_CPATH"); | ||
29 | if (!env) env = ""; | ||
30 | sprintf(temp, "%s;%s/lib?.so;%s/?.so;%s/?.so", env, elm_app_lib_dir_get(), elm_app_lib_dir_get(), cwd); | ||
31 | setenv("LUA_CPATH", temp, 1); | ||
32 | |||
33 | env = getenv("LUA_PATH"); | ||
34 | if (!env) env = ""; | ||
35 | sprintf(temp, "%s;%s/?.lua;%s/?.lua", env, elm_app_lib_dir_get(), cwd); | ||
36 | setenv("LUA_PATH", temp, 1); | ||
37 | } | ||
5 | 38 | ||
6 | static void _checkWindowBounds(winFang *win, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) | 39 | static void _checkWindowBounds(winFang *win, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) |
7 | { | 40 | { |