Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_colordialog.c ewl_colordialog.h Log Message: Standardize the color structure passed around. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_colordialog.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_colordialog.c 14 Jun 2005 21:17:07 -0000 1.1 +++ ewl_colordialog.c 17 Jun 2005 16:49:07 -0000 1.2 @@ -35,6 +35,7 @@ Ewl_Widget *hbox; Ewl_Widget *button; Ewl_Widget *label; + Ewl_ColorDialog_Color col; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("cd", cd, FALSE); @@ -161,7 +162,6 @@ ewl_widget_show(vbox); - struct { int r, g, b; } col; col.r = r; col.g = g; col.b = b; ewl_colordialog_color_valuechanged_cb(EWL_WIDGET(cd), &col, cd); @@ -178,7 +178,7 @@ void ewl_colordialog_redvalue_changed(Ewl_Widget *w, void *ev_data, void *user_data) { Ewl_ColorDialog *cd = EWL_COLORDIALOG(user_data); - struct { int r, g, b; } col; + Ewl_ColorDialog_Color col; float h, s, v; col.r = strtol(ev_data, NULL, 10); col.g = cd->selected.g; @@ -198,7 +198,7 @@ void ewl_colordialog_greenvalue_changed(Ewl_Widget *w, void *ev_data, void *user_data) { Ewl_ColorDialog *cd = EWL_COLORDIALOG(user_data); - struct { int r, g, b; } col; + Ewl_ColorDialog_Color col; float h, s, v; col.r = cd->selected.r; col.g = strtol(ev_data, NULL, 10); @@ -218,7 +218,7 @@ void ewl_colordialog_bluevalue_changed(Ewl_Widget *w, void *ev_data, void *user_data) { Ewl_ColorDialog *cd = EWL_COLORDIALOG(user_data); - struct { int r, g, b; } col; + Ewl_ColorDialog_Color col; float h, s, v; col.r = cd->selected.r; col.g = cd->selected.g; @@ -238,7 +238,7 @@ void ewl_colordialog_huevalue_changed(Ewl_Widget *w, void *ev_data, void *user_data) { Ewl_ColorDialog *cd = EWL_COLORDIALOG(user_data); - struct { int r, g, b; } col; + Ewl_ColorDialog_Color col; float h, s, v; ewl_spectrum_rgb_to_hsv(cd->selected.r, cd->selected.g, cd->selected.b, &h, &s, &v); h = strtod(ev_data, NULL); @@ -255,7 +255,7 @@ void ewl_colordialog_saturationvalue_changed(Ewl_Widget *w, void *ev_data, void *user_data) { Ewl_ColorDialog *cd = EWL_COLORDIALOG(user_data); - struct { int r, g, b; } col; + Ewl_ColorDialog_Color col; float h, s, v; ewl_spectrum_rgb_to_hsv(cd->selected.r, cd->selected.g, cd->selected.b, &h, &s, &v); s = strtod(ev_data, NULL); @@ -272,7 +272,7 @@ void ewl_colordialog_valuevalue_changed(Ewl_Widget *w, void *ev_data, void *user_data) { Ewl_ColorDialog *cd = EWL_COLORDIALOG(user_data); - struct { int r, g, b; } col; + Ewl_ColorDialog_Color col; float h, s, v; ewl_spectrum_rgb_to_hsv(cd->selected.r, cd->selected.g, cd->selected.b, &h, &s, &v); v = strtod(ev_data, NULL); @@ -289,7 +289,7 @@ void ewl_colordialog_color_valuechanged_cb(Ewl_Widget *w, void *ev_data, void *user_data) { Ewl_ColorDialog *cd = EWL_COLORDIALOG(user_data); - struct _ewl_colordialog_color *col = ev_data; + Ewl_ColorDialog_Color *col = ev_data; cd->selected.r = col->r; cd->selected.g = col->g; cd->selected.b = col->b; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_colordialog.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_colordialog.h 14 Jun 2005 21:17:07 -0000 1.1 +++ ewl_colordialog.h 17 Jun 2005 16:49:07 -0000 1.2 @@ -8,6 +8,13 @@ * @{ */ +typedef struct Ewl_ColorDialog_Color Ewl_ColorDialog_Color; + +struct Ewl_ColorDialog_Color +{ + int r, g, b, a; +}; + typedef struct Ewl_ColorDialog Ewl_ColorDialog; /** @@ -19,7 +26,7 @@ struct Ewl_ColorDialog { Ewl_Box box; - Ewl_Widget *preview; + Ewl_Widget *preview; Ewl_Widget *picker; Ewl_Widget *red_entry; Ewl_Widget *green_entry; @@ -27,10 +34,7 @@ Ewl_Widget *hue_entry; Ewl_Widget *saturation_entry; Ewl_Widget *value_entry; - struct _ewl_colordialog_color - { - int r, g, b; - } selected; + Ewl_ColorDialog_Color selected; }; Ewl_Widget *ewl_colordialog_new(int r, int g, int b); ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs