_elm_win_rescale();
}
+void
+_set_elm_module()
+{
+ char *buf = NULL;
+
+ buf = getenv("ELM_THEME");
+ if (buf != NULL && ((!strcmp(buf, "beat") || !strcmp(buf, "kessler"))))
+ setenv("ELM_MODULES","ctxpopup_copypasteUI>entry/api",1);
+}
+
/**
* @defgroup General General
*/
{
_elm_init_count++;
if (_elm_init_count != 1) return;
+ _set_elm_module();
elm_quicklaunch_init(argc, argv);
elm_quicklaunch_sub_init(argc, argv);
}
if (_elm_need_e_dbus)
{
_elm_need_e_dbus = 0;
- e_hal_shutdown();
+ e_hal_shutdown();
e_dbus_shutdown();
}
#endif
_elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
if (!_elm_log_dom)
{
- EINA_LOG_ERR("could not register elementary log domain.");
- _elm_log_dom = EINA_LOG_DOMAIN_GLOBAL;
+ EINA_LOG_ERR("could not register elementary log domain.");
+ _elm_log_dom = EINA_LOG_DOMAIN_GLOBAL;
}
eet_init();
if (!_elm_data_dir)
{
- s = getenv("ELM_DATA_DIR");
- _elm_data_dir = eina_stringshare_add(s);
+ s = getenv("ELM_DATA_DIR");
+ _elm_data_dir = eina_stringshare_add(s);
}
if (!_elm_data_dir)
{
- s = getenv("ELM_PREFIX");
- if (s)
- {
- snprintf(buf, sizeof(buf), "%s/share/elementary", s);
- _elm_data_dir = eina_stringshare_add(buf);
- }
+ s = getenv("ELM_PREFIX");
+ if (s)
+ {
+ snprintf(buf, sizeof(buf), "%s/share/elementary", s);
+ _elm_data_dir = eina_stringshare_add(buf);
+ }
}
if (!_elm_lib_dir)
{
- s = getenv("ELM_LIB_DIR");
- _elm_lib_dir = eina_stringshare_add(s);
+ s = getenv("ELM_LIB_DIR");
+ _elm_lib_dir = eina_stringshare_add(s);
}
if (!_elm_lib_dir)
{
- s = getenv("ELM_PREFIX");
- if (s)
- {
- snprintf(buf, sizeof(buf), "%s/lib", s);
- _elm_lib_dir = eina_stringshare_add(buf);
- }
+ s = getenv("ELM_PREFIX");
+ if (s)
+ {
+ snprintf(buf, sizeof(buf), "%s/lib", s);
+ _elm_lib_dir = eina_stringshare_add(buf);
+ }
}
#ifdef HAVE_DLADDR
if ((!_elm_data_dir) || (!_elm_lib_dir))
{
- Dl_info elementary_dl;
- // libelementary.so/../../share/elementary/
- if (dladdr(elm_init, &elementary_dl))
- {
- char *dir, *dir2;
-
- dir = ecore_file_dir_get(elementary_dl.dli_fname);
- if (dir)
- {
+ Dl_info elementary_dl;
+ // libelementary.so/../../share/elementary/
+ if (dladdr(elm_init, &elementary_dl))
+ {
+ char *dir, *dir2;
+
+ dir = ecore_file_dir_get(elementary_dl.dli_fname);
+ if (dir)
+ {
if (!_elm_lib_dir)
{
if (ecore_file_is_dir(dir))
free(dir2);
}
}
- free(dir);
- }
- }
+ free(dir);
+ }
+ }
}
#endif
if (!_elm_data_dir)
(_elm_config->engine == ELM_SOFTWARE_16_WINCE))
{
#ifdef HAVE_ELEMENTARY_X
- ecore_x_disconnect();
+ ecore_x_disconnect();
#endif
- evas_cserve_disconnect();
+ evas_cserve_disconnect();
}
}
if ((_elm_log_dom > -1) && (_elm_log_dom != EINA_LOG_DOMAIN_GLOBAL))
{
- eina_log_domain_unregister(_elm_log_dom);
- _elm_log_dom = -1;
+ eina_log_domain_unregister(_elm_log_dom);
+ _elm_log_dom = -1;
}
eina_shutdown();
(_elm_config->engine == ELM_OPENGL_X11))
{
#ifdef HAVE_ELEMENTARY_X
- ecore_x_sync();
+ ecore_x_sync();
#endif
}
ecore_main_loop_iterate();
char *exe = elm_quicklaunch_exe_path_get(argv[0]);
if (!exe)
{
- ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
- return EINA_FALSE;
+ ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
+ return EINA_FALSE;
}
else
{
- char *exe2, *p;
- char *exename;
-
- exe2 = malloc(strlen(exe) + 1 + 10);
- strcpy(exe2, exe);
- p = strrchr(exe2, '/');
- if (p) p++;
- else p = exe2;
- exename = alloca(strlen(p) + 1);
- strcpy(exename, p);
- *p = 0;
- strcat(p, "../lib/");
- strcat(p, exename);
- strcat(p, ".so");
- if (access(exe2, R_OK | X_OK) == 0)
- {
- free(exe);
- exe = exe2;
- }
- else
- free(exe2);
+ char *exe2, *p;
+ char *exename;
+
+ exe2 = malloc(strlen(exe) + 1 + 10);
+ strcpy(exe2, exe);
+ p = strrchr(exe2, '/');
+ if (p) p++;
+ else p = exe2;
+ exename = alloca(strlen(p) + 1);
+ strcpy(exename, p);
+ *p = 0;
+ strcat(p, "../lib/");
+ strcat(p, exename);
+ strcat(p, ".so");
+ if (access(exe2, R_OK | X_OK) == 0)
+ {
+ free(exe);
+ exe = exe2;
+ }
+ else
+ free(exe2);
}
qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
if (!qr_handle)
{
fprintf(stderr, "dlerr: %s\n", dlerror());
- WRN("dlopen('%s') failed: %s", exe, dlerror());
- free(exe);
- return EINA_FALSE;
+ WRN("dlopen('%s') failed: %s", exe, dlerror());
+ free(exe);
+ return EINA_FALSE;
}
INF("dlopen('%s') = %p", exe, qr_handle);
free(exe);
INF("dlsym(%p, 'elm_main') = %p", qr_handle, qr_main);
if (!qr_main)
{
- WRN("not quicklauncher capable: no elm_main in '%s'", exe);
- dlclose(qr_handle);
- qr_handle = NULL;
- return EINA_FALSE;
+ WRN("not quicklauncher capable: no elm_main in '%s'", exe);
+ dlclose(qr_handle);
+ qr_handle = NULL;
+ return EINA_FALSE;
}
return EINA_TRUE;
#else
// need to accept current environment from elementary_run
if (!qr_main)
{
- int i;
- char **args;
-
- child = fork();
- if (child > 0) return EINA_TRUE;
- else if (child < 0)
- {
- perror("could not fork");
- return EINA_FALSE;
- }
- setsid();
- if (chdir(cwd) != 0)
- perror("could not chdir");
- args = alloca((argc + 1) * sizeof(char *));
- for (i = 0; i < argc; i++) args[i] = argv[i];
- args[argc] = NULL;
- WRN("%s not quicklaunch capable, fallback...", argv[0]);
- execvp(argv[0], args);
- ERR("failed to execute '%s': %s", argv[0], strerror(errno));
- exit(-1);
+ int i;
+ char **args;
+
+ child = fork();
+ if (child > 0) return EINA_TRUE;
+ else if (child < 0)
+ {
+ perror("could not fork");
+ return EINA_FALSE;
+ }
+ setsid();
+ if (chdir(cwd) != 0)
+ perror("could not chdir");
+ args = alloca((argc + 1) * sizeof(char *));
+ for (i = 0; i < argc; i++) args[i] = argv[i];
+ args[argc] = NULL;
+ WRN("%s not quicklaunch capable, fallback...", argv[0]);
+ execvp(argv[0], args);
+ ERR("failed to execute '%s': %s", argv[0], strerror(errno));
+ exit(-1);
}
child = fork();
if (child > 0) return EINA_TRUE;
else if (child < 0)
{
- perror("could not fork");
- return EINA_FALSE;
+ perror("could not fork");
+ return EINA_FALSE;
}
if (postfork_func) postfork_func(postfork_data);
save_env();
if (argv)
{
- char *lastarg, *p;
+ char *lastarg, *p;
- ecore_app_args_get(&real_argc, &real_argv);
- lastarg = real_argv[real_argc - 1] + strlen(real_argv[real_argc - 1]);
- for (p = real_argv[0]; p < lastarg; p++) *p = 0;
- strcpy(real_argv[0], argv[0]);
+ ecore_app_args_get(&real_argc, &real_argv);
+ lastarg = real_argv[real_argc - 1] + strlen(real_argv[real_argc - 1]);
+ for (p = real_argv[0]; p < lastarg; p++) *p = 0;
+ strcpy(real_argv[0], argv[0]);
}
ecore_app_args_set(argc, (const char **)argv);
ret = qr_main(argc, argv);
#ifdef HAVE_FORK
if (qr_handle)
{
- dlclose(qr_handle);
- qr_handle = NULL;
- qr_main = NULL;
+ dlclose(qr_handle);
+ qr_handle = NULL;
+ qr_main = NULL;
}
#endif
}
if ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/')) return strdup(exe);
if (!path)
{
- const char *p, *pp;
- char *buf2;
- path = getenv("PATH");
- buf2 = alloca(strlen(path) + 1);
- p = path;
- pp = p;
- for (;;)
- {
- if ((*p == ':') || (*p == 0))
- {
- int len;
-
- len = p - pp;
- strncpy(buf2, pp, len);
- buf2[len] = 0;
- pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
- if (*p == 0) break;
- p++;
- pp = p;
- }
- else
- {
- if (*p == 0) break;
- p++;
- }
- }
+ const char *p, *pp;
+ char *buf2;
+ path = getenv("PATH");
+ buf2 = alloca(strlen(path) + 1);
+ p = path;
+ pp = p;
+ for (;;)
+ {
+ if ((*p == ':') || (*p == 0))
+ {
+ int len;
+
+ len = p - pp;
+ strncpy(buf2, pp, len);
+ buf2[len] = 0;
+ pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
+ if (*p == 0) break;
+ p++;
+ pp = p;
+ }
+ else
+ {
+ if (*p == 0) break;
+ p++;
+ }
+ }
}
EINA_LIST_FOREACH(pathlist, l, pathitr)
{
- snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
- if (access(buf, R_OK | X_OK) == 0) return strdup(buf);
+ snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
+ if (access(buf, R_OK | X_OK) == 0) return strdup(buf);
}
return NULL;
}