diff options
Diffstat (limited to '')
-rw-r--r-- | src/libraries/winFang.c | 40 |
1 files changed, 3 insertions, 37 deletions
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 @@ | |||
1 | #include "LumbrJack.h" | ||
1 | #include "winFang.h" | 2 | #include "winFang.h" |
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 | } | ||
38 | |||
39 | static void _checkWindowBounds(winFang *win, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) | 5 | static void _checkWindowBounds(winFang *win, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) |
40 | { | 6 | { |
41 | Evas_Object *test; | 7 | Evas_Object *test; |
@@ -244,7 +210,7 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
244 | x = 0; y = 0; | 210 | x = 0; y = 0; |
245 | } | 211 | } |
246 | 212 | ||
247 | snprintf(buf, sizeof(buf), "%s/winFang.edj", elm_app_data_dir_get()); | 213 | snprintf(buf, sizeof(buf), "%s/winFang.edj", prefix_data_get()); |
248 | result->layout = eo_add(ELM_OBJ_LAYOUT_CLASS, obj, | 214 | result->layout = eo_add(ELM_OBJ_LAYOUT_CLASS, obj, |
249 | evas_obj_size_set(w, h), | 215 | evas_obj_size_set(w, h), |
250 | evas_obj_position_set(x, y), | 216 | 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 | |||
275 | eo_unref(obj); | 241 | eo_unref(obj); |
276 | 242 | ||
277 | // Create corner handles. | 243 | // Create corner handles. |
278 | snprintf(buf, sizeof(buf), "%s/pt.png", elm_app_data_dir_get()); | 244 | snprintf(buf, sizeof(buf), "%s/pt.png", prefix_data_get()); |
279 | for (i = 0; i < 4; i++) | 245 | for (i = 0; i < 4; i++) |
280 | { | 246 | { |
281 | int cx = result->x, cy = result->y; | 247 | int cx = result->x, cy = result->y; |