Enlightenment CVS committal
Author : devilhorns
Project : e_modules
Module : flame
Dir : e_modules/flame
Modified Files:
e_mod_main.h e_mod_main.c e_mod_config.c
Log Message:
Add a White Palette.
Fix r,g,b values when switching between Basic and Advanced Config Modes.
===================================================================
RCS file: /cvs/e/e_modules/flame/e_mod_main.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_mod_main.h 1 Apr 2006 19:35:59 -0000 1.10
+++ e_mod_main.h 6 Apr 2006 21:03:08 -0000 1.11
@@ -17,6 +17,7 @@
PLASMA_PALETTE,
MATRIX_PALETTE,
ICE_PALETTE,
+ WHITE_PALETTE,
CUSTOM_PALETTE
};
===================================================================
RCS file: /cvs/e/e_modules/flame/e_mod_main.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- e_mod_main.c 5 Apr 2006 17:48:49 -0000 1.19
+++ e_mod_main.c 6 Apr 2006 21:03:08 -0000 1.20
@@ -28,6 +28,7 @@
static void _flame_palette_plasma_set(Flame_Face *ff);
static void _flame_palette_matrix_set(Flame_Face *ff);
static void _flame_palette_ice_set(Flame_Face *ff);
+static void _flame_palette_white_set(Flame_Face *ff);
static void _flame_palette_custom_set(Flame_Face *ff);
static void _flame_zero_set(Flame_Face *ff);
static void _flame_base_random_set(Flame_Face *ff);
@@ -249,6 +250,9 @@
case ICE_PALETTE:
_flame_palette_ice_set(f->face);
break;
+ case WHITE_PALETTE:
+ _flame_palette_white_set(f->face);
+ break;
case CUSTOM_PALETTE:
_flame_palette_custom_set(f->face);
break;
@@ -517,6 +521,34 @@
r = (i - 160) * 3;
g = (i - 40) * 3;
b = i * 3;
+
+ if (r < 0)
+ r = 0;
+ if (r > 255)
+ r = 255;
+ if (g < 0)
+ g = 0;
+ if (g > 255)
+ g = 255;
+ if (b < 0)
+ b = 0;
+ if (b > 255)
+ b = 255;
+ a = (int)((r * 0.299) + (g * 0.587) + (b * 0.114));
+ ff->palette[i] = ((((unsigned char)a) << 24) | (((unsigned char)r) <<
16) | (((unsigned char)g) << 8) | ((unsigned char)b));
+ }
+}
+
+static void
+_flame_palette_white_set(Flame_Face *ff)
+{
+ int i, r, g, b, a;
+
+ for (i = 0; i < 300; i++)
+ {
+ r = 0;
+ g = 0;
+ b = 0;
if (r < 0)
r = 0;
===================================================================
RCS file: /cvs/e/e_modules/flame/e_mod_config.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- e_mod_config.c 5 Apr 2006 17:48:49 -0000 1.22
+++ e_mod_config.c 6 Apr 2006 21:03:08 -0000 1.23
@@ -45,9 +45,6 @@
f = cfd->data;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
-
- _fill_data(f, cfdata);
-
return cfdata;
}
@@ -76,6 +73,8 @@
Evas_Object *o, *of, *ob;
E_Radio_Group *rg;
+ _fill_data(cfd->data, cfdata);
+
o = e_widget_list_add(evas, 0, 0);
of = e_widget_framelist_add(evas, D_("Flame Color"), 0);
rg = e_widget_radio_group_new(&(cfdata->palette));
@@ -89,6 +88,8 @@
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, D_("Ice"), ICE_PALETTE, rg);
e_widget_framelist_object_append(of, ob);
+ ob = e_widget_radio_add(evas, D_("White"), WHITE_PALETTE, rg);
+ e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, D_("Custom"), CUSTOM_PALETTE, rg);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
@@ -131,7 +132,12 @@
f->conf->g = 40;
f->conf->b = 0;
break;
- case 6:
+ case 6:
+ f->conf->palette_type = WHITE_PALETTE;
+ f->conf->r = 0;
+ f->conf->g = 0;
+ f->conf->b = 0;
+ case 7:
f->conf->palette_type = CUSTOM_PALETTE; //Custom
break;
default:
@@ -149,6 +155,8 @@
{
Evas_Object *o, *of, *ob;
+ _fill_data(cfd->data, cfdata);
+
o = e_widget_list_add(evas, 0, 0);
of = e_widget_framelist_add(evas, D_("Flame Color"), 0);
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs