Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_configure.c e_configure.h 


Log Message:
* data/themes/default_configure.edc
  - Rename edc parts to widgets/configure/*
  
* src/bin/e_configure.c:
  - turn E_Configure into a real object
  
* src/bin/e_configure.h:
  - turn E_Configure into a real object, add missing #else
  
  

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_configure.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_configure.c       20 Sep 2005 09:45:08 -0000      1.4
+++ e_configure.c       20 Sep 2005 13:12:25 -0000      1.5
@@ -1,56 +1,50 @@
 #include "e.h"
 
-static void _e_configure_gui_show(E_Configure *app);
 static void _e_configure_gui_hide(E_Win *win);
 static void _e_configure_apps_load(E_Configure *app);
 static void _e_configure_apps_unload(E_Configure *app);
-
+static void _e_configure_free(E_Configure *app);
 static void _e_configure_apps_click(void *data, Evas_Object *obj, const char 
*emission, const char *source);
+static void _e_configure_cb_resize(E_Win *win);
+    
 
 E_Configure *
 e_configure_show(E_Container *con)
 {
    E_Configure *app;
-
-   app = calloc(1, sizeof(E_Configure));
+   E_Manager *man;
+   Evas_Coord w, h, ew, eh;   
+   
+   if (!con)
+   {
+      man = e_manager_current_get();
+      if (!man) return NULL;
+      con = e_container_current_get(man);
+      if (!con) con = e_container_number_get(man, 0);
+      if (!con) return NULL;
+   }
+   app = E_OBJECT_ALLOC(E_Configure, E_CONFIGURE_TYPE, _e_configure_free);
+   if (!app) return NULL;
+   app->win = e_win_new(con);   
+   if (!app->win)
+   {
+      free(app);
+      return NULL;
+   }
+            
    app->con = con;
-   _e_configure_gui_show(app);
-   return app;
-}
-
-static void
-_e_configure_cb_resize(E_Win *win)
-{
-   Evas_Coord w, h;
-   E_Configure *app;
-
-   if (win)
-     {
-       ecore_evas_geometry_get(win->ecore_evas, NULL, NULL, &w, &h);
-
-       app = (E_Configure *) ecore_evas_data_get(win->ecore_evas, "App");
-       evas_object_resize(app->edje, w, h);
-     }
-}
-
-static void
-_e_configure_gui_show(E_Configure *app)
-{
-   Evas_Coord w, h, ew, eh;
-       
-   app->win = e_win_new(app->con);
+   
    e_win_delete_callback_set(app->win, _e_configure_gui_hide);
-
    e_win_title_set(app->win, "Enlightenment Configuration");
    e_win_name_class_set(app->win, "EConfigure", "EConfigure");
    app->evas = e_win_evas_get(app->win);
-   ecore_evas_data_set(app->win->ecore_evas, "App", app);
-               
-   e_win_resize_callback_set(app->win, _e_configure_cb_resize);
-
+   ecore_evas_data_set(app->win->ecore_evas, "App", app);              
+   e_win_resize_callback_set(app->win, _e_configure_cb_resize);   
+   e_win_centered_set(app->win, 1);
+      
    app->edje = edje_object_add(app->evas);
 
-   e_theme_edje_object_set(app->edje, "base/theme/configure", 
"configure/main");
+   e_theme_edje_object_set(app->edje, "base/theme/configure", 
"widgets/configure/main");
 
    app->box = e_box_add(app->evas);
        
@@ -82,9 +76,29 @@
    
    evas_object_show(app->edje);
                
-   e_win_show(app->win);
+   e_win_show(app->win);   
+   
+   
+   return app;
+}
+
+static void
+_e_configure_cb_resize(E_Win *win)
+{
+   Evas_Coord w, h;
+   E_Configure *app;
+
+   if (win)
+     {
+       ecore_evas_geometry_get(win->ecore_evas, NULL, NULL, &w, &h);
+
+       app = (E_Configure *) ecore_evas_data_get(win->ecore_evas, "App");
+       evas_object_resize(app->edje, w, h);
+     }
 }
 
+
+
 static void
 _e_configure_gui_hide(E_Win *win)
 {
@@ -119,7 +133,7 @@
        app->app_ref = evas_list_append(app->app_ref, a);
        
        o = edje_object_add(app->evas);
-       e_theme_edje_object_set(o, "base/theme/configure", "configure/icon");
+       e_theme_edje_object_set(o, "base/theme/configure", 
"widgets/configure/icon");
        icon = edje_object_add(app->evas);
        edje_object_file_set(icon, a->path, "icon");
                             
@@ -144,7 +158,6 @@
                               999, 999 //172, 72 /* max */
                               );
 
-//     evas_object_resize(o, 172, 72);
        evas_object_show(o);
        app->icons = evas_list_append(app->icons, o);
        edje_object_signal_callback_add(o, "clicked", "",
@@ -190,3 +203,11 @@
        if (exe) ecore_exe_free(exe);
      }
 }
+
+static void
+_e_configure_free(E_Configure *app)
+{
+   _e_configure_apps_unload(app);
+   e_object_del(E_OBJECT(app->win));
+   free(app);
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_configure.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_configure.h       20 Sep 2005 08:34:23 -0000      1.2
+++ e_configure.h       20 Sep 2005 13:12:25 -0000      1.3
@@ -2,11 +2,16 @@
 
 typedef struct _E_Configure E_Configure;
 
+#else
 #ifndef E_CONFIGURE_H
 #define E_CONFIGURE_H
 
+#define E_CONFIGURE_TYPE 0xE0b01014
+
 struct _E_Configure
 {
+   E_Object             e_obj_inherit;
+      
    E_Container *con;
    E_Win       *win;
    Evas        *evas;




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to