examples - use putenv, not setenv for porting reasons

putenv is more portable than setenv, so usethat instead. this nukes
warnings on windows as evil is meant to go private and you thus have no
setenv anymore.
This commit is contained in:
Carsten Haitzler 2019-07-28 11:17:51 +01:00
parent 5fd272d038
commit 188874e289
19 changed files with 31 additions and 20 deletions

View File

@ -77,9 +77,20 @@ _on_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o, void
static void static void
_on_mouse_down_text(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) _on_mouse_down_text(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
{ {
static char *env_lang_str = NULL;
char *s;
lang_idx = (lang_idx + 1) % (sizeof (lang)/ sizeof (lang[0])); lang_idx = (lang_idx + 1) % (sizeof (lang)/ sizeof (lang[0]));
fprintf(stderr, "Setting lang to '%s'\n", lang[lang_idx]); fprintf(stderr, "Setting lang to '%s'\n", lang[lang_idx]);
setenv("LANGUAGE", lang[lang_idx], 1); s = malloc(10 + strlen(lang[lang_idx]));
if (s)
{
strcpy(s, "LANGUAGE=");
strcpy(s + 9, lang[lang_idx]);
putenv(s);
if (env_lang_str) free(env_lang_str);
env_lang_str = s;
}
edje_language_set(lang[lang_idx]); edje_language_set(lang[lang_idx]);
} }
int int
@ -122,7 +133,7 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
evas_object_move(edje_obj, 0, 20); evas_object_move(edje_obj, 0, 20);
evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40);
evas_object_show(edje_obj); evas_object_show(edje_obj);
setenv("LANGUAGE", "en_IN", 1); putenv("LANGUAGE=en_IN");
edje_object_language_set(edje_obj, "en_IN"); edje_object_language_set(edje_obj, "en_IN");
edje_object_text_change_cb_set(edje_obj, _on_text_change, NULL); edje_object_text_change_cb_set(edje_obj, _on_text_change, NULL);
edje_object_part_text_set(edje_obj, "part_two", "<b>Click here"); edje_object_part_text_set(edje_obj, "part_two", "<b>Click here");

View File

@ -266,7 +266,7 @@ main(void)
if (!ecore_evas_init()) return 0; if (!ecore_evas_init()) return 0;
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
ecore_evas = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); ecore_evas = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
if (!ecore_evas) return 0; if (!ecore_evas) return 0;

View File

@ -218,7 +218,7 @@ int
main(void) main(void)
{ {
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
Scene_Data data; Scene_Data data;

View File

@ -213,7 +213,7 @@ int
main(void) main(void)
{ {
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
Scene_Data data; Scene_Data data;

View File

@ -98,7 +98,7 @@ int
main(void) main(void)
{ {
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
if (!ecore_evas_init()) return 0; if (!ecore_evas_init()) return 0;

View File

@ -190,7 +190,7 @@ int
main(void) main(void)
{ {
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
Scene_Data data; Scene_Data data;
Ecore_Animator *anim; Ecore_Animator *anim;

View File

@ -405,7 +405,7 @@ main(void)
if (!ecore_evas_init()) return 0; if (!ecore_evas_init()) return 0;
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
ecore_evas = ecore_evas_new("opengl_x11", 0, 0, WIDTH, HEIGHT, NULL); ecore_evas = ecore_evas_new("opengl_x11", 0, 0, WIDTH, HEIGHT, NULL);
if (!ecore_evas) return 0; if (!ecore_evas) return 0;

View File

@ -412,7 +412,7 @@ main(void)
Scene_Data data; Scene_Data data;
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
if (!ecore_evas_init()) return 0; if (!ecore_evas_init()) return 0;

View File

@ -75,7 +75,7 @@ int
main(void) main(void)
{ {
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
if (!ecore_evas_init()) return 0; if (!ecore_evas_init()) return 0;

View File

@ -165,7 +165,7 @@ main(void)
Eina_File *obj_file, *ply_file, *eet_file, *md2_file; Eina_File *obj_file, *ply_file, *eet_file, *md2_file;
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
if (!ecore_evas_init()) return 0; if (!ecore_evas_init()) return 0;

View File

@ -143,7 +143,7 @@ main(void)
char buffer[PATH_MAX], full_file_path[PATH_MAX + 4]; char buffer[PATH_MAX], full_file_path[PATH_MAX + 4];
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
if (!ecore_evas_init()) return 0; if (!ecore_evas_init()) return 0;

View File

@ -217,7 +217,7 @@ int
main(void) main(void)
{ {
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
Scene_Data data; Scene_Data data;

View File

@ -101,7 +101,7 @@ int
main(void) main(void)
{ {
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
if (!ecore_evas_init()) return 0; if (!ecore_evas_init()) return 0;

View File

@ -114,7 +114,7 @@ main(void)
} }
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
if (!ecore_evas_init()) return 0; if (!ecore_evas_init()) return 0;

View File

@ -201,7 +201,7 @@ int
main(void) main(void)
{ {
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
Scene_Data data; Scene_Data data;

View File

@ -626,7 +626,7 @@ main(void)
Eina_List *nodes1 = NULL, *nodes2 = NULL; Eina_List *nodes1 = NULL, *nodes2 = NULL;
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
if (!ecore_evas_init()) return 0; if (!ecore_evas_init()) return 0;
ecore_evas = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL); ecore_evas = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);

View File

@ -235,7 +235,7 @@ int
main(void) main(void)
{ {
// Unless Evas 3D supports Software renderer, we force use of the gl backend. // Unless Evas 3D supports Software renderer, we force use of the gl backend.
setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); putenv("ECORE_EVAS_ENGINE=opengl_x11");
Scene_Data data; Scene_Data data;

View File

@ -104,7 +104,7 @@ main(void)
if (!ecore_evas_init()) if (!ecore_evas_init())
return -1; return -1;
//setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); //putenv("ECORE_EVAS_ENGINE=opengl_x11");
ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
if (!ee) return -1; if (!ee) return -1;

View File

@ -59,7 +59,7 @@ int
main(void) main(void)
{ {
//Cairo backend is not supported. //Cairo backend is not supported.
setenv("ECTOR_BACKEND", "default", 1); putenv("ECTOR_BACKEND=default");
if (!ecore_evas_init()) if (!ecore_evas_init())
return EXIT_FAILURE; return EXIT_FAILURE;