Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        Makefile.am e_fwin.c e_start_main.c 


Log Message:


paranoid checks and disabling of precache if it might not be able to be done.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/Makefile.am,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -3 -r1.161 -r1.162
--- Makefile.am 17 Oct 2006 12:29:00 -0000      1.161
+++ Makefile.am 23 Oct 2006 13:49:06 -0000      1.162
@@ -352,7 +352,7 @@
 enlightenment_start_SOURCES = \
 e_start_main.c
 
-enlightenment_start_LDFLAGS = 
+enlightenment_start_LDFLAGS = @dlopen_libs@
 
 enlightenment_thumb_SOURCES = \
 e_thumb_main.c \
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fwin.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e_fwin.c    22 Oct 2006 02:14:08 -0000      1.5
+++ e_fwin.c    23 Oct 2006 13:49:06 -0000      1.6
@@ -19,6 +19,7 @@
 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;
@@ -250,6 +251,11 @@
 }
 
 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;
@@ -288,10 +294,6 @@
             /* 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);
      }
@@ -354,4 +356,65 @@
        snprintf(buf, sizeof(buf), "%s %s", a->exe, file);
      }
    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);
 }
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_start_main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_start_main.c      22 Oct 2006 10:03:58 -0000      1.6
+++ e_start_main.c      23 Oct 2006 13:49:06 -0000      1.7
@@ -3,6 +3,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <dlfcn.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/utsname.h>
@@ -321,7 +322,7 @@
 int
 main(int argc, char **argv)
 {
-   int i;
+   int i, do_precache = 1;
    char buf[16384], **args, *p;
 
    prefix_determine(argv[0]);
@@ -338,10 +339,36 @@
    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";



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to