Enlightenment CVS committal
Author : handyande
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/examples
Modified Files:
config_basic_example.c
Log Message:
Morten Nilsen's latest patches for ecore_config argb etc
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/examples/config_basic_example.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- config_basic_example.c 6 Jan 2006 21:56:05 -0000 1.4
+++ config_basic_example.c 8 Jan 2006 14:57:13 -0000 1.5
@@ -14,15 +14,17 @@
long int_val;
float flt_val;
+int r_val;
+int g_val;
+int b_val;
char *str_val;
-char *rgb_val;
char *thm_val;
void set_defaults (void) {
ecore_config_int_default(INT_VAL_KEY, 0);
ecore_config_float_default(FLT_VAL_KEY, 0.0);
ecore_config_string_default(STR_VAL_KEY, "test1");
- ecore_config_argb_default(RGB_VAL_KEY, "#FF000000");
+ ecore_config_argb_default(RGB_VAL_KEY, 255, 0, 0, 0);
ecore_config_theme_default(THM_VAL_KEY, "default");
}
@@ -35,7 +37,7 @@
int_val = ecore_config_int_get(INT_VAL_KEY);
flt_val = ecore_config_float_get(FLT_VAL_KEY);
str_val = ecore_config_string_get(STR_VAL_KEY);
- rgb_val = ecore_config_argbstr_get(RGB_VAL_KEY);
+ ecore_config_argb_get(RGB_VAL_KEY, NULL, &r_val, &g_val, &b_val);
thm_val = ecore_config_theme_get(THM_VAL_KEY);
}
@@ -47,15 +49,11 @@
} else {
str_val[4] += 1;
}
- if('9' == rgb_val[3]) {
- rgb_val[3] = '0';
- rgb_val[5] = '0';
- rgb_val[7] = '0';
- } else {
- rgb_val[3] += 1;
- rgb_val[5] += 1;
- rgb_val[7] += 1;
- }
+
+ r_val = (r_val + 1) % 256;
+ g_val = (g_val + 1) % 256;
+ b_val = (b_val + 1) % 256;
+
if(!strcmp(thm_val, "default")) {
if(thm_val) free(thm_val);
thm_val = strdup("winter");
@@ -69,7 +67,7 @@
ecore_config_int_set(INT_VAL_KEY, int_val);
ecore_config_float_set(FLT_VAL_KEY, flt_val);
ecore_config_string_set(STR_VAL_KEY, str_val);
- ecore_config_argb_set(RGB_VAL_KEY, rgb_val);
+ ecore_config_argb_set(RGB_VAL_KEY, 255, r_val, g_val, b_val);
ecore_config_theme_set(THM_VAL_KEY, thm_val);
ecore_config_save();
}
@@ -78,7 +76,7 @@
printf(" Int Value: %li\n", int_val);
printf(" Float Value: %f\n", flt_val);
printf(" String Value: %s\n", str_val);
- printf(" RGB Value: %s\n", rgb_val);
+ printf(" RGB Value: %i %i %i\n", r_val, g_val, b_val);
printf(" Theme Value: %s\n", thm_val);
}
@@ -92,7 +90,6 @@
dump_settings();
save_settings();
if(str_val) free(str_val);
- if(rgb_val) free(rgb_val);
if(thm_val) free(thm_val);
ecore_config_shutdown();
return 0;
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs