enlightenment_start_SOURCES = \
e_start_main.c
-enlightenment_start_LDFLAGS =
+enlightenment_start_LDFLAGS = @dlopen_libs@
enlightenment_thumb_SOURCES = \
e_thumb_main.c \
static void _e_fwin_parent(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_fwin_file_open(E_Fwin *fwin, const char *file, const char *mime);
static void _e_fwin_file_open_app(E_Fwin *fwin, E_App *a, const char *file);
+static void _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files);
/* local subsystem globals */
static Evas_List *fwins = NULL;
}
static void
+_e_fwin_cb_ilist_change(void *data, Evas_Object *obj)
+{
+}
+
+static void
_e_fwin_file_open(E_Fwin *fwin, const char *file, const char *mime)
{
Evas_List *apps, *l;
/* FIXME: register app a as handling mime type if app doesnt */
/* say it can already in a separate info blob so in future */
/* e will list it as an option */
- for (l = apps; l; l = l->next)
- {
- a = l->data;
- }
}
evas_list_free(apps);
}
}
e_zone_exec(fwin->win->border->zone, buf);
}
+
+static void
+_e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files)
+{
+ E_Dialog *dia;
+ Evas_Coord mw, mh;
+ Evas_Object *o, *ocon, *of, *oi;
+ Evas *evas;
+ Evas_List *l, *ll;
+ Evas_List *apps;
+ E_App *a;
+
+ dia = e_dialog_new(fwin->win->border->zone->container,
+ "E", "_fwin_open_apps");
+ e_dialog_title_set(dia, _("Open with..."));
+ e_dialog_border_icon_set(dia, "enlightenment/applications");
+ e_dialog_button_add(dia, _("Open"), "enlightenment/open", NULL, NULL);
+ e_dialog_button_add(dia, _("Close"), "enlightenment/close", NULL, NULL);
+
+ evas = e_win_evas_get(dia->win);
+
+ o = e_widget_list_add(evas, 1, 1);
+ ocon = o;
+
+ of = e_widget_framelist_add(evas, _("Specific Applications"), 0);
+ /* FIXME: dialog needs data attched to store what u select */
+ o = e_widget_ilist_add(evas, 24, 24, NULL);
+// apps = e_app_mime_list(e_fm_mime_filename_get(file));
+ apps = NULL;
+ if (apps)
+ {
+ for (l = apps; l; l = l->next)
+ {
+ a = l->data;
+ oi = e_app_icon_add(evas, a);
+ e_widget_ilist_append(o, oi, a->name,
+ _e_fwin_cb_ilist_change, NULL,
+ ecore_file_get_file(a->path));
+ }
+ evas_list_free(apps);
+ }
+ e_widget_ilist_go(o);
+ e_widget_min_size_set(o, 160, 240);
+ e_widget_framelist_object_append(of, o);
+ e_widget_list_object_append(ocon, of, 1, 1, 0.5);
+
+ of = e_widget_framelist_add(evas, _("All Applications"), 0);
+ /* FIXME: fm2 view etc. etc. */
+ o = e_widget_ilist_add(evas, 24, 24, NULL);
+ e_widget_ilist_go(o);
+ e_widget_min_size_set(o, 160, 240);
+ e_widget_framelist_object_append(of, o);
+ e_widget_list_object_append(ocon, of, 1, 1, 0.5);
+
+ /* FIXME: add rest of widgets */
+
+ e_widget_min_size_get(ocon, &mw, &mh);
+ e_dialog_content_set(dia, ocon, mw, mh);
+
+ e_dialog_show(dia);
+}
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <dlfcn.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/utsname.h>
int
main(int argc, char **argv)
{
- int i;
+ int i, do_precache = 1;
char buf[16384], **args, *p;
prefix_determine(argv[0]);
else snprintf(buf, sizeof(buf), "%s/lib", _prefix_path);
env_set("LD_LIBRARY_PATH", buf);
- snprintf(buf, sizeof(buf), "%s/lib/enlightenment/preload/e_precache.so", _prefix_path);
- env_set("LD_PRELOAD", buf);
-
- precache();
+ for (i = 1; i < argc; i++)
+ {
+ if (!strcmp(argv[i], "-no-precache")) do_precache = 0;
+ }
+ while (do_precache)
+ {
+ void *lib, *func;
+
+ /* sanity checks - if precache might fail - check here first */
+ lib = dlopen("libevas.so", RTLD_GLOBAL | RTLD_LAZY);
+ if (!lib) dlopen("libevas.so.1", RTLD_GLOBAL | RTLD_LAZY);
+ if (!lib) break;
+ func = dlsym(lib, "evas_init");
+ if (!func) break;
+ lib = dlopen("libecore_file.so", RTLD_GLOBAL | RTLD_LAZY);
+ if (!lib) dlopen("libecore_file.so.1", RTLD_GLOBAL | RTLD_LAZY);
+ if (!lib) break;
+ func = dlsym(lib, "ecore_file_init");
+ if (!func) break;
+ lib = dlopen("libeet.so", RTLD_GLOBAL | RTLD_LAZY);
+ if (!lib) dlopen("libeet.so.0", RTLD_GLOBAL | RTLD_LAZY);
+ if (!lib) break;
+ func = dlsym(lib, "eet_init");
+ if (!func) break;
+ /* precache SHOULD work */
+ snprintf(buf, sizeof(buf), "%s/lib/enlightenment/preload/e_precache.so", _prefix_path);
+ env_set("LD_PRELOAD", buf);
+ precache();
+ break;
+ }
args = alloca((argc + 1) * sizeof(char *));
args[0] = "enlightenment";
static void
log_open(void)
{
- char buf[4096], *home;
+ char buf[4096] = "DUMMY", *home;
if (log_fd != -1) return;
#ifdef HAVE_UNSETENV
static void
log_close(void)
{
- close(log_fd);
+ if (log_fd >= 0)
+ {
+ close(log_fd);
+ log_fd = -1;
+ }
do_log = 0;
}
write(log_fd, "\n", 1);
}
+static void *
+lib_func(const char *lib1, const char *lib2, const char *fname, const char *libname, void **lib)
+{
+ void *func;
+
+ if (!*lib) *lib = dlopen(lib1, RTLD_GLOBAL | RTLD_LAZY);
+ if (!*lib) *lib = dlopen(lib2, RTLD_GLOBAL | RTLD_LAZY);
+ func = dlsym(*lib, fname);
+ if (!func)
+ {
+ printf("ABORT: Can't find %s() in %s or %s (%s = %p)\n",
+ fname, lib1, lib2, libname, *lib);
+ abort();
+ }
+ log_open();
+ return func;
+}
/* intercepts */
void
{
static void (*func) (Evas_Object *obj, const char *file, const char *key) = NULL;
if (!func)
- {
- if (!lib_evas)
- lib_evas = dlopen("libevas.so", RTLD_GLOBAL | RTLD_LAZY);
- func = dlsym(lib_evas, "evas_object_image_file_set");
- log_open();
- }
+ func = lib_func("libevas.so", "libevas.so.1",
+ "evas_object_image_file_set", "lib_evas", &lib_evas);
if (do_log) log_write("o", file);
(*func) (obj, file, key);
}
{
static time_t (*func) (const char *file) = NULL;
if (!func)
- {
- if (!lib_ecore_file)
- lib_ecore_file = dlopen("libecore_file.so", RTLD_GLOBAL | RTLD_LAZY);
- func = dlsym(lib_ecore_file, "ecore_file_mod_time");
- log_open();
- }
+ func = lib_func("libecore_file.so", "libecore_file.so.1",
+ "ecore_file_mod_time", "lib_ecore_file", &lib_ecore_file);
if (do_log) log_write("s", file);
return (*func) (file);
}
{
static int (*func) (const char *file) = NULL;
if (!func)
- {
- if (!lib_ecore_file)
- lib_ecore_file = dlopen("libecore_file.so", RTLD_GLOBAL | RTLD_LAZY);
- func = dlsym(lib_ecore_file, "ecore_file_size");
- log_open();
- }
+ func = lib_func("libecore_file.so", "libecore_file.so.1",
+ "ecore_file_size", "lib_ecore_file", &lib_ecore_file);
if (do_log) log_write("s", file);
return (*func) (file);
}
{
static int (*func) (const char *file) = NULL;
if (!func)
- {
- if (!lib_ecore_file)
- lib_ecore_file = dlopen("libecore_file.so", RTLD_GLOBAL | RTLD_LAZY);
- func = dlsym(lib_ecore_file, "ecore_file_exists");
- log_open();
- }
+ func = lib_func("libecore_file.so", "libecore_file.so.1",
+ "ecore_file_exists", "lib_ecore_file", &lib_ecore_file);
if (do_log) log_write("s", file);
return (*func) (file);
}
{
static int (*func) (const char *file) = NULL;
if (!func)
- {
- if (!lib_ecore_file)
- lib_ecore_file = dlopen("libecore_file.so", RTLD_GLOBAL | RTLD_LAZY);
- func = dlsym(lib_ecore_file, "ecore_file_is_dir");
- log_open();
- }
+ func = lib_func("libecore_file.so", "libecore_file.so.1",
+ "ecore_file_is_dir", "lib_ecore_file", &lib_ecore_file);
if (do_log) log_write("s", file);
return (*func) (file);
}
{
static int (*func) (const char *file) = NULL;
if (!func)
- {
- if (!lib_ecore_file)
- lib_ecore_file = dlopen("libecore_file.so", RTLD_GLOBAL | RTLD_LAZY);
- func = dlsym(lib_ecore_file, "ecore_file_can_read");
- log_open();
- }
+ func = lib_func("libecore_file.so", "libecore_file.so.1",
+ "ecore_file_can_read", "lib_ecore_file", &lib_ecore_file);
if (do_log) log_write("s", file);
return (*func) (file);
}
{
static int (*func) (const char *file) = NULL;
if (!func)
- {
- if (!lib_ecore_file)
- lib_ecore_file = dlopen("libecore_file.so", RTLD_GLOBAL | RTLD_LAZY);
- func = dlsym(lib_ecore_file, "ecore_file_can_write");
- log_open();
- }
+ func = lib_func("libecore_file.so", "libecore_file.so.1",
+ "ecore_file_can_write", "lib_ecore_file", &lib_ecore_file);
if (do_log) log_write("s", file);
return (*func) (file);
}
{
static int (*func) (const char *file) = NULL;
if (!func)
- {
- if (!lib_ecore_file)
- lib_ecore_file = dlopen("libecore_file.so", RTLD_GLOBAL | RTLD_LAZY);
- func = dlsym(lib_ecore_file, "ecore_file_can_exec");
- log_open();
- }
+ func = lib_func("libecore_file.so", "libecore_file.so.1",
+ "ecore_file_can_exec", "lib_ecore_file", &lib_ecore_file);
if (do_log) log_write("s", file);
return (*func) (file);
}
{
static Ecore_List * (*func) (const char *file) = NULL;
if (!func)
- {
- if (!lib_ecore_file)
- lib_ecore_file = dlopen("libecore_file.so", RTLD_GLOBAL | RTLD_LAZY);
- func = dlsym(lib_ecore_file, "ecore_file_ls");
- log_open();
- }
+ func = lib_func("libecore_file.so", "libecore_file.so.1",
+ "ecore_file_ls", "lib_ecore_file", &lib_ecore_file);
if (do_log) log_write("d", file);
return (*func) (file);
}
{
static Eet_File * (*func) (const char *file, Eet_File_Mode mode) = NULL;
if (!func)
- {
- if (!lib_eet)
- lib_eet = dlopen("libeet.so", RTLD_GLOBAL | RTLD_LAZY);
- func = dlsym(lib_eet, "eet_open");
- log_open();
- }
+ func = lib_func("libeet.so", "libeet.so.0",
+ "eet_open", "lib_eet", &lib_eet);
if (do_log) log_write("o", file);
return (*func) (file, mode);
}