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/extantz/Evas_3D_demo.c | 8 ++++---- src/extantz/ephysics_demo.c | 4 ++-- src/extantz/extantz.c | 27 +++++++++------------------ src/extantz/extantz.h | 1 + src/extantz/woMan.c | 6 +++--- 5 files changed, 19 insertions(+), 27 deletions(-) (limited to 'src/extantz') diff --git a/src/extantz/Evas_3D_demo.c b/src/extantz/Evas_3D_demo.c index 3dda9ef..6cb673b 100644 --- a/src/extantz/Evas_3D_demo.c +++ b/src/extantz/Evas_3D_demo.c @@ -286,7 +286,7 @@ static void _cube_setup(globals *ourGlobals, Scene_Data *scene) evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA, EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels1[0]) ); - snprintf(buf, sizeof(buf), "%s/normal_lego.png", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/normal_lego.png", prefix_data_get()); scene->texture_normal = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, evas_3d_texture_file_set(buf, NULL) ); @@ -354,7 +354,7 @@ static void _sonic_setup(globals *ourGlobals, Scene_Data *scene) char buf[PATH_MAX]; // Setup an MD2 mesh. - snprintf(buf, sizeof(buf), "%s/sonic.png", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/sonic.png", prefix_data_get()); scene->texture2 = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, evas_3d_texture_file_set(buf, NULL), evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, EVAS_3D_TEXTURE_FILTER_NEAREST), @@ -375,7 +375,7 @@ static void _sonic_setup(globals *ourGlobals, Scene_Data *scene) evas_3d_material_shininess_set(50.0) ); - snprintf(buf, sizeof(buf), "%s/sonic.md2", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/sonic.md2", prefix_data_get()); scene->mesh2 = eo_add(EVAS_3D_MESH_CLASS, ourGlobals->evas, evas_3d_mesh_file_set(EVAS_3D_MESH_FILE_TYPE_MD2, buf, NULL), evas_3d_mesh_frame_material_set(0, scene->material2), @@ -397,7 +397,7 @@ static void _earth_setup(globals *ourGlobals, Scene_Data *scene) char buf[PATH_MAX]; // Setup earth material. - snprintf(buf, sizeof(buf), "%s/EarthDiffuse.png", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/EarthDiffuse.png", prefix_data_get()); scene->texture_diffuse = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, evas_3d_texture_file_set(buf, NULL), evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR) diff --git a/src/extantz/ephysics_demo.c b/src/extantz/ephysics_demo.c index a0bf4d0..89dda99 100644 --- a/src/extantz/ephysics_demo.c +++ b/src/extantz/ephysics_demo.c @@ -32,7 +32,7 @@ EPhysics_World *ephysicsAdd(globals *ourGlobals) ephysics_body_restitution_set(boundary, 1); ephysics_body_friction_set(boundary, 0); - sprintf(buf, "%s/%s.edj", elm_app_data_dir_get(), EPHYSICS_TEST_THEME); + sprintf(buf, "%s/%s.edj", prefix_data_get(), EPHYSICS_TEST_THEME); box1 = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win, elm_obj_image_file_set(buf, "blue-cube"), evas_obj_size_set(70, 70), @@ -49,7 +49,7 @@ EPhysics_World *ephysicsAdd(globals *ourGlobals) ephysics_body_sleeping_threshold_set(box_body1, 0.1, 0.1); eo_unref(box1); - sprintf(buf, "%s/%s.edj", elm_app_data_dir_get(), EPHYSICS_TEST_THEME); + sprintf(buf, "%s/%s.edj", prefix_data_get(), EPHYSICS_TEST_THEME); box2 = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win, elm_obj_image_file_set(buf, "purple-cube"), evas_obj_size_set(70, 70), diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index fa38251..a27118b 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c @@ -2,14 +2,13 @@ #include "extantz.h" #include "SledjHamr.h" -#include "LumbrJack.h" static void _onWorldClick(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void *einfo); static void on_pixels(void *data, Evas_Object *obj); -static int logDom; // Our logging domain. +int logDom = -1; // Our logging domain. globals ourGlobals; static Eina_Strbuf *serverStream; @@ -120,7 +119,7 @@ static Eina_Bool _del(void *data, int type, Ecore_Con_Event_Server_Del *ev) PW("Failed to connect to a world server, starting our own."); // TODO - Should use Ecore_Exe for this sort of thing. - sprintf(buf, "%s/love &", elm_app_bin_dir_get()); + sprintf(buf, "%s/love &", prefix_bin_get()); system(buf); count = 0; } @@ -555,6 +554,8 @@ EAPI_MAIN int elm_main(int argc, char **argv) char buf[PATH_MAX * 2]; // Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't. + logDom = HamrTime(argv[0], elm_main, logDom); + /* Set the locale according to the system pref. * If you don't do so the file selector will order the files list in * a case sensitive manner @@ -564,13 +565,6 @@ EAPI_MAIN int elm_main(int argc, char **argv) elm_need_ethumb(); elm_need_efreet(); - HamrTime(elm_main, "extantz"); - fprintf(stdout, "prefix was set to: %s\n", elm_app_prefix_dir_get()); - fprintf(stdout, "data directory is: %s\n", elm_app_data_dir_get()); - fprintf(stdout, "library directory is: %s\n", elm_app_lib_dir_get()); - fprintf(stdout, "locale directory is: %s\n", elm_app_locale_dir_get()); - - logDom = loggingStartup("extantz", logDom); ourGlobals.running = 1; @@ -643,7 +637,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) // Override the background image #if 1 - snprintf(buf, sizeof(buf), "%s/sky_03.jpg", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get()); ourGlobals.mainWindow->bg = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals.mainWindow->win, evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), elm_obj_image_fill_outside_set(EINA_TRUE), @@ -652,7 +646,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) ); elm_win_resize_object_add(ourGlobals.mainWindow->win, ourGlobals.mainWindow->bg); #else - snprintf(buf, sizeof(buf), "%s/sky_03.jpg", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get()); eo_do(ourGlobals.mainWindow->bg, elm_obj_image_file_set(buf, NULL), evas_obj_color_set(255, 255, 255, 255) @@ -673,7 +667,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) woMan_add(&ourGlobals); ourGlobals.purkle = GuiLuaLoad("purkle", ourGlobals.mainWindow, ourGlobals.world); ourGlobals.LSLGuiMess = GuiLuaLoad("LSLGuiMess", ourGlobals.mainWindow, ourGlobals.world); - ourGlobals.files = filesAdd(&ourGlobals, (char *) elm_app_data_dir_get(), EINA_TRUE, EINA_FALSE); + ourGlobals.files = filesAdd(&ourGlobals, (char *) prefix_data_get(), EINA_TRUE, EINA_FALSE); // Try to connect to the love server we started before. serverStream = eina_strbuf_new(); @@ -701,11 +695,8 @@ EAPI_MAIN int elm_main(int argc, char **argv) winFangDel(ourGlobals.mainWindow); } - if (logDom >= 0) - { - eina_log_domain_unregister(logDom); - logDom = -1; - } + pantsOff(logDom); + logDom = -1; elm_shutdown(); diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h index a41f4e0..ca62bdc 100644 --- a/src/extantz/extantz.h +++ b/src/extantz/extantz.h @@ -6,6 +6,7 @@ #define DO_GEARS 0 +#include "LumbrJack.h" #include "winFang.h" #include "GuiLua.h" #include "scenri.h" diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c index ef10631..09e7e2d 100644 --- a/src/extantz/woMan.c +++ b/src/extantz/woMan.c @@ -35,8 +35,8 @@ static Elm_Genlist_Item_Class *grid_gic = NULL; static Elm_Genlist_Item_Class *account_gic = NULL; static Elm_Genlist_Item_Class *viewer_gic = NULL; -//static const char *img1 = PACKAGE_DATA_DIR "plant_01.jpg"; -//static const char *img2 = PACKAGE_DATA_DIR "sky_01.jpg"; +//static const char *img1 = "plant_01.jpg"; +//static const char *img2 = "sky_01.jpg"; static const char *img3 = "rock_01.jpg"; @@ -264,7 +264,7 @@ winFang *woMan_add(globals *ourGlobals) evas_object_size_hint_align_set(nf, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(nf); - sprintf(buf, "%s/%s", elm_app_data_dir_get(), img3); + sprintf(buf, "%s/%s", prefix_data_get(), img3); tab = viewerList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Viewers", _promote, tab_it); // TODO - This strdup leaks, but this is just temporary test code anyway, it will go away. tab = _content_image_new(me->win, strdup(buf)); tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Landmarks", _promote, tab_it); -- cgit v1.1