Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_init.c e_init.h e_order.c e_startup.c 


Log Message:
Convert startup code to e_order.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_init.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- e_init.c    28 Dec 2006 13:43:30 -0000      1.42
+++ e_init.c    24 Mar 2007 22:53:16 -0000      1.43
@@ -199,12 +199,10 @@
 }
 
 EAPI void
-e_init_icons_app_add(E_App *app)
+e_init_icons_desktop_add(Efreet_Desktop *desktop)
 {
    Evas_Object *o;
-
-   E_OBJECT_CHECK(app);
-   E_OBJECT_TYPE_CHECK(app, E_APP_TYPE);
+   char buf[128];
 
    if (!_e_init_evas) return;
    
@@ -231,17 +229,21 @@
        evas_object_show(o);
      }
    
-   o = e_app_icon_add(app, _e_init_evas);
-   evas_object_resize(o, _e_init_icon_size, _e_init_icon_size);
-   e_box_pack_end(_e_init_icon_box, o);
-   e_box_pack_options_set(o, 
-                         0, 0, 
-                         0, 0, 
-                         0.5, 0.5,
-                         _e_init_icon_size, _e_init_icon_size,
-                         _e_init_icon_size, _e_init_icon_size);
-   evas_object_show(o);
-   _e_init_icon_list = evas_list_append(_e_init_icon_list, o);
+   snprintf(buf, sizeof(buf), "%dx%d", _e_init_icon_size, _e_init_icon_size);
+   o = e_util_desktop_icon_add(desktop, buf, _e_init_evas);
+   if (o)
+     {
+       evas_object_resize(o, _e_init_icon_size, _e_init_icon_size);
+       e_box_pack_end(_e_init_icon_box, o);
+       e_box_pack_options_set(o, 
+                              0, 0, 
+                              0, 0, 
+                              0.5, 0.5,
+                              _e_init_icon_size, _e_init_icon_size,
+                              _e_init_icon_size, _e_init_icon_size);
+       evas_object_show(o);
+       _e_init_icon_list = evas_list_append(_e_init_icon_list, o);
+     }
 }
 
 static void
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_init.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_init.h    22 Jun 2005 14:09:17 -0000      1.6
+++ e_init.h    24 Mar 2007 22:53:16 -0000      1.7
@@ -16,7 +16,7 @@
 EAPI Ecore_X_Window e_init_window_get(void);
 EAPI void           e_init_done(void);
     
-EAPI void           e_init_icons_app_add(E_App *app);
+EAPI void           e_init_icons_desktop_add(Efreet_Desktop *desktop);
 
 #endif
 #endif
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_order.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_order.c   24 Mar 2007 22:02:33 -0000      1.2
+++ e_order.c   24 Mar 2007 22:53:16 -0000      1.3
@@ -43,7 +43,7 @@
                    {
                       Efreet_Desktop *desktop;
                       desktop = efreet_util_desktop_by_file_id_get(buf);
-                      if (desktop) evas_list_append(eo->desktops, desktop);
+                      if (desktop) eo->desktops = 
evas_list_append(eo->desktops, desktop);
                    }
               }
          }
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_startup.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_startup.c 24 Mar 2007 17:42:12 -0000      1.10
+++ e_startup.c 24 Mar 2007 22:53:16 -0000      1.11
@@ -3,18 +3,18 @@
  */
 #include "e.h"
 
+/* TODO:
+ * - Need some kind of "wait for exit" system, maybe register with
+ *   e_config? startup and restart apps could also be in e_config
+ */
+
 /* local subsystem functions */
 static void _e_startup(void);
-static int  _e_startup_timeout_cb(void *data);
-static int  _e_startup_next_cb(void *data);
-static void _e_startup_app_exit_cb(void *data, E_App *a, E_App_Change ch);
+static void _e_startup_next_cb(void *data);
 
 /* local subsystem globals */
-static E_App       *startup_apps = NULL;
-static int          start_app_pos = -1;
-static Ecore_Timer *next_timer = NULL;
-static Ecore_Timer *timeout_timer = NULL;
-static E_App       *waiting_app = NULL;
+static E_Order        *startup_apps = NULL;
+static int             start_app_pos = -1;
 
 /* externally accessible functions */
 EAPI void
@@ -25,16 +25,15 @@
    
    homedir = e_user_homedir_get();
    if (mode == E_STARTUP_START)
-     snprintf(buf, sizeof(buf), "%s/.e/e/applications/startup", homedir);
+     snprintf(buf, sizeof(buf), "%s/.e/e/applications/startup/.order", 
homedir);
    else if (mode == E_STARTUP_RESTART)
-     snprintf(buf, sizeof(buf), "%s/.e/e/applications/restart", homedir);
-   startup_apps = e_app_new(buf, 1);
+     snprintf(buf, sizeof(buf), "%s/.e/e/applications/restart/.order", 
homedir);
+   startup_apps = e_order_new(buf);
    if (!startup_apps)
      {
 //     e_init_hide();
        return;
      }
-   e_app_change_callback_add(_e_startup_app_exit_cb, NULL);
    start_app_pos = 0;
    _e_startup();
 }
@@ -43,7 +42,7 @@
 static void
 _e_startup(void)
 {
-   E_App *a;
+   Efreet_Desktop *desktop;
    char buf[4096];
    
    if (!startup_apps)
@@ -51,66 +50,25 @@
        e_init_done();
        return;
      }
-   a = evas_list_nth(startup_apps->subapps, start_app_pos);
+   desktop = evas_list_nth(startup_apps->desktops, start_app_pos);
    start_app_pos++;
-   if (!a)
+   if (!desktop)
      {
-       e_object_unref(E_OBJECT(startup_apps));
+       e_object_del(E_OBJECT(startup_apps));
        startup_apps = NULL;
        start_app_pos = -1;
-       waiting_app = NULL;
-       e_app_change_callback_del(_e_startup_app_exit_cb, NULL);
        e_init_done();
        return;
      }
-   e_app_exec(NULL, a, NULL, NULL, NULL);
-   snprintf(buf, sizeof(buf), _("Starting %s"), a->name);
+   e_exec(NULL, desktop, NULL, NULL, NULL);
+   snprintf(buf, sizeof(buf), _("Starting %s"), desktop->name);
    e_init_status_set(buf);   
-   e_init_icons_app_add(a);
-   if (a->wait_exit)
-     {
-       timeout_timer = ecore_timer_add(10.0, _e_startup_timeout_cb, NULL);
-       waiting_app = a;
-     }
-   else
-     {
-       timeout_timer = ecore_timer_add(0.0, _e_startup_next_cb, NULL);
-       waiting_app = NULL;
-     }
-}
-
-static int
-_e_startup_timeout_cb(void *data)
-{
-   timeout_timer = NULL;
-   waiting_app = NULL;
-   /* FIXME: error dialog or log etc..... */
-   _e_startup();
-   return 0;
+   e_init_icons_desktop_add(desktop);
+   ecore_job_add(_e_startup_next_cb, NULL);
 }
 
-static int
+static void
 _e_startup_next_cb(void *data)
 {
-   next_timer = NULL;
    _e_startup();
-   return 0;
-}
-
-static void
-_e_startup_app_exit_cb(void *data, E_App *a, E_App_Change ch)
-{
-   if (ch == E_APP_EXIT)
-     {
-       if (a == waiting_app)
-         {
-            waiting_app = NULL;
-            if (timeout_timer)
-              {
-                 ecore_timer_del(timeout_timer);
-                 timeout_timer = NULL;
-              }
-            _e_startup();
-         }
-     }
 }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to