Enlightenment CVS committal

Author  : handyande
Project : misc
Module  : engage

Dir     : misc/engage/src


Modified Files:
        config.c 


Log Message:
finally, got colours into ecore_config
listeners not working, cannot seem to get a hook into the drawing...
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/config.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- config.c    26 Jul 2004 20:52:28 -0000      1.33
+++ config.c    27 Jul 2004 21:28:05 -0000      1.34
@@ -13,6 +13,13 @@
 void            od_config_menu_hide(void);
 #endif
 
+typedef enum od_config_colors {
+  TT_TXT,
+  TT_SHD,
+  BG_FORE,
+  BG_BACK
+} od_config_colors;
+
 OD_Options      options;
 
 /* listeners */
@@ -43,6 +50,38 @@
   }
 }
 
+unsigned
+od_argb_to_colour(char *argb)
+{
+  unsigned        tmp;
+
+  tmp=strtoul((char *)argb+1, NULL, 16);
+  return tmp;
+}
+
+colour_listener(const char *key, const Ecore_Config_Type type, const int tag, 
+                void *data)
+{
+  unsigned        colour;
+
+  colour = od_argb_to_colour(ecore_config_argbstr_get(key));
+
+  switch (tag) {
+    case TT_TXT:
+      options.tt_txt_color = colour;
+      break;
+    case TT_SHD:
+      options.tt_shd_color = colour;
+      break;
+    case BG_FORE:
+      options.bg_fore = colour;
+      break;
+    case BG_BACK:
+      options.bg_back = colour;
+      break;
+  }
+}
+
 int
 od_config_init(void)
 {
@@ -88,10 +127,11 @@
                             "zoom-time",
                             "Time taken (in seconds) for icons to zoom");
 
-  options.tt_txt_color = 0x00000000;
-  options.tt_shd_color = 0x7f000000;
-  options.bg_fore = 0x7f000000;
-  options.bg_back = 0x7fffffff;
+  ecore_config_argb_create("engage.options.tt_txt_color", "#00000000", 'c', 
"text-color", "Text color");
+  ecore_config_argb_create("engage.options.tt_shd_color", "#7f000000", 'C', 
"shadow-color", "Text shadow color");
+  ecore_config_argb_create("engage.options.bg_fore", "#7f000000", 'b', 
"bg-main-color", "Background main color");
+  ecore_config_argb_create("engage.options.bg_back", "#7fffffff", 'B', 
"bg-outline-color", "Background outline color");
+
   ecore_config_string_create("engage.options.tt_fa", "Vera", 'f', "font",
                              "The font to use for application titles etc.");
   ecore_config_int_create("engage.options.tt_fs", 8, 'F', "font-size",
@@ -124,6 +164,23 @@
   options.dock_zoom_duration =
     ecore_config_float_get("engage.options.zoom_duration");
 
+  options.tt_txt_color = 
+    od_argb_to_colour(ecore_config_argbstr_get("engage.options.tt_txt_color"));
+  ecore_config_listen("colour", "engage.options.tt_txt_color",
+                      colour_listener, TT_TXT, NULL);
+  options.tt_shd_color =
+    od_argb_to_colour(ecore_config_argbstr_get("engage.options.tt_shd_color"));
+  ecore_config_listen("colour", "engage.options.tt_shd_color", 
+                      colour_listener, TT_SHD, NULL);
+  options.bg_fore =
+    od_argb_to_colour(ecore_config_argbstr_get("engage.options.bg_fore"));
+  ecore_config_listen("colour", "engage.options.bg_fore", 
+                      colour_listener, BG_FORE, NULL);
+  options.bg_back = 
+    od_argb_to_colour(ecore_config_argbstr_get("engage.options.bg_back"));
+  ecore_config_listen("colour", "engage.options.bg_back", 
+                      colour_listener, BG_BACK, NULL);
+
   options.tt_fa = ecore_config_string_get("engage.options.tt_fa");
   options.tt_fs = ecore_config_int_get("engage.options.tt_fs");
   options.icon_appear_duration =




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to