Enlightenment CVS committal

Author  : devilhorns
Project : e_modules
Module  : flame

Dir     : e_modules/flame


Modified Files:
        e-module-flame.edj e_mod_config.c e_mod_config.h e_mod_main.c 
        e_mod_main.h 


Log Message:
Flame module gets updated for recent api breakage.
First module to use it's own icon as config panel item.

===================================================================
RCS file: /cvs/e/e_modules/flame/e-module-flame.edj,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
Binary files /tmp/cvsg1PdN7 and /tmp/cvsKbxWgX differ
===================================================================
RCS file: /cvs/e/e_modules/flame/e_mod_config.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- e_mod_config.c      30 Mar 2007 20:21:43 -0000      1.32
+++ e_mod_config.c      31 Oct 2007 13:31:05 -0000      1.33
@@ -23,12 +23,15 @@
                                 E_Config_Dialog_Data * cfdata);
 static void _fill_data (Flame * f, E_Config_Dialog_Data * cfdata);
 
-void
-_config_flame_module (E_Container * con, Flame * fl)
+EAPI E_Config_Dialog *
+e_int_config_flame_module(E_Container *con, const char *params __UNUSED__) 
 {
-  E_Config_Dialog *cfd;
-  E_Config_Dialog_View *v;
-  char buf[4096];
+   E_Config_Dialog *cfd;
+   E_Config_Dialog_View *v;
+   Flame *fl;
+   char buf[4096];
+
+   fl = flame_module->data;
 
   v = E_NEW (E_Config_Dialog_View, 1);
 
@@ -44,6 +47,7 @@
   cfd = e_config_dialog_new (con, D_ ("Flame Configuration"), "Flame", 
                             "_e_modules_flame_config_dialog", buf, 0, v, fl);
   fl->config_dialog = cfd;
+   return cfd;
 }
 
 static void *
===================================================================
RCS file: /cvs/e/e_modules/flame/e_mod_config.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e_mod_config.h      30 Jan 2006 19:17:21 -0000      1.5
+++ e_mod_config.h      31 Oct 2007 13:31:05 -0000      1.6
@@ -3,6 +3,8 @@
 #ifndef E_MOD_CONFIG_H
 #define E_MOD_CONFIG_H
 #include "e_mod_main.h"
-void _config_flame_module(E_Container *con, Flame *fl);
+
+EAPI E_Config_Dialog *e_int_config_flame_module(E_Container *con, const char 
*params __UNUSED__);
+
 #endif
 #endif
===================================================================
RCS file: /cvs/e/e_modules/flame/e_mod_main.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- e_mod_main.c        30 Mar 2007 20:21:43 -0000      1.31
+++ e_mod_main.c        31 Oct 2007 13:31:05 -0000      1.32
@@ -44,17 +44,37 @@
   "Flame"
 };
 
+EAPI E_Module *flame_module = NULL;
+
 EAPI void *
 e_modapi_init (E_Module * m)
 {
   Flame *f;
+   Efreet_Desktop *desk;
+   char buf[4096];
 
   /* Set up module's message catalogue */
   bindtextdomain (PACKAGE, LOCALEDIR);
   bind_textdomain_codeset (PACKAGE, "UTF-8");
+   
+   snprintf(buf, sizeof(buf), "%s/module.desktop", e_module_dir_get(m));
+   desk = efreet_desktop_get(buf);
+   if ((desk) && (desk->orig_path) && (desk->icon))
+     {
+       snprintf(buf, sizeof(buf), "%s/%s.edj", 
ecore_file_dir_get(desk->orig_path), desk->icon);
+       efreet_desktop_free(desk);
+     }
+   else
+     buf[0] = '\0';
+
+   e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, 
+                                    "enlightenment/appearance");
+   e_configure_registry_item_add("appearance/flame", 150, _("Flame"), NULL, 
+                                buf, e_int_config_flame_module);
 
   f = _flame_init (m);
   f->module = m;
+   flame_module = m;
   return f;
 }
 
@@ -63,6 +83,9 @@
 {
   Flame *f;
 
+   e_configure_registry_item_del("appearance/flame");
+   e_configure_registry_category_del("appearance");
+
   f = m->data;
   if (f)
     {
@@ -84,29 +107,6 @@
   f = m->data;
   if (f)
     e_config_domain_save ("module.flame", f->conf_edd, f->conf);
-  return 1;
-}
-
-EAPI int
-e_modapi_about (E_Module * m)
-{
-  e_module_dialog_show (m, D_ ("Enlightenment Flame Module"),
-                       D_ ("A simple module to display flames."));
-  return 1;
-}
-
-EAPI int
-e_modapi_config (E_Module * m)
-{
-  Flame *f;
-  E_Container *con;
-
-  f = m->data;
-  if (!f)
-    return 0;
-  con = e_container_current_get (e_manager_current_get ());
-  if (f->face->con == con)
-    _config_flame_module (con, f);
   return 1;
 }
 
===================================================================
RCS file: /cvs/e/e_modules/flame/e_mod_main.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- e_mod_main.h        3 Jul 2006 07:37:32 -0000       1.13
+++ e_mod_main.h        31 Oct 2007 13:31:06 -0000      1.14
@@ -66,13 +66,13 @@
    Ecore_Event_Handler *ev_handler_container_resize;
 };
 
+extern E_Module *flame_module;
+
 EAPI extern E_Module_Api e_modapi;
 
 EAPI void *e_modapi_init(E_Module *m);
 EAPI int e_modapi_shutdown(E_Module *m);
 EAPI int e_modapi_save(E_Module *m);
-EAPI int e_modapi_about(E_Module *m);
-EAPI int e_modapi_config(E_Module *m);
 
 void _flame_cb_config_updated(void *data);
 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to