Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: Ewl.h.in Makefile.am ewl_colordialog.c ewl_colordialog.h ewl_colorpicker.h ewl_widget.c ewl_widget.h Removed Files: ewl_coloredrect.c ewl_coloredrect.h Log Message: - add ewl_widget_color_set/get to set the colour of the widget - get rid of the ewl_coloredrect, use a widget with the set colour instead =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/Ewl.h.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- Ewl.h.in 15 Jun 2005 20:17:43 -0000 1.7 +++ Ewl.h.in 20 Jun 2005 20:35:02 -0000 1.8 @@ -317,7 +317,6 @@ #include <ewl_spinner.h> #include <ewl_image.h> #include <ewl_spectrum.h> -#include <ewl_coloredrect.h> #include <ewl_menu_base.h> #include <ewl_imenu.h> #include <ewl_menu.h> =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- Makefile.am 15 Jun 2005 20:17:43 -0000 1.4 +++ Makefile.am 20 Jun 2005 20:35:02 -0000 1.5 @@ -20,8 +20,7 @@ ewl_cell.h \ ewl_check.h \ ewl_checkbutton.h \ - ewl_colordialog.h \ - ewl_coloredrect.h \ + ewl_colordialog.h \ ewl_colorpicker.h \ ewl_combo.h \ ewl_config.h \ @@ -84,8 +83,7 @@ ewl_cell.c \ ewl_check.c \ ewl_checkbutton.c \ - ewl_colordialog.c \ - ewl_coloredrect.c \ + ewl_colordialog.c \ ewl_colorpicker.c \ ewl_combo.c \ ewl_config.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_colordialog.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_colordialog.c 20 Jun 2005 04:18:16 -0000 1.7 +++ ewl_colordialog.c 20 Jun 2005 20:35:03 -0000 1.8 @@ -75,11 +75,13 @@ ewl_object_minimum_size_set(EWL_OBJECT(vbox), 60, 100); ewl_container_child_append(EWL_CONTAINER(cd), vbox); - cd->preview = ewl_coloredrect_new(r, g, b, 255); + cd->preview = NEW(Ewl_Widget, 1); + ewl_widget_init(cd->preview, "coloured_rect"); ewl_object_fill_policy_set(EWL_OBJECT(cd->preview), EWL_FLAG_FILL_ALL); ewl_object_alignment_set(EWL_OBJECT(cd->preview), EWL_FLAG_ALIGN_CENTER); ewl_container_child_append(EWL_CONTAINER(vbox), cd->preview); + ewl_widget_color_set(cd->preview, r, g, b, 255); ewl_widget_show(cd->preview); hbox = ewl_box_new(EWL_ORIENTATION_HORIZONTAL); @@ -405,8 +407,7 @@ ewl_entry_text_set(EWL_ENTRY(cd->value_entry), valuetext); // Update the preview - ewl_coloredrect_color_set(EWL_COLOREDRECT(cd->preview), col->r, - col->g, col->b, 255); + ewl_widget_color_set(cd->preview, col->r, col->g, col->b, 255); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_colordialog.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_colordialog.h 20 Jun 2005 04:18:16 -0000 1.3 +++ ewl_colordialog.h 20 Jun 2005 20:35:03 -0000 1.4 @@ -20,13 +20,13 @@ { Ewl_Box box; Ewl_Widget *preview; - Ewl_Widget *picker; - Ewl_Widget *red_entry; - Ewl_Widget *green_entry; - Ewl_Widget *blue_entry; - Ewl_Widget *hue_entry; - Ewl_Widget *saturation_entry; - Ewl_Widget *value_entry; + Ewl_Widget *picker; + Ewl_Widget *red_entry; + Ewl_Widget *green_entry; + Ewl_Widget *blue_entry; + Ewl_Widget *hue_entry; + Ewl_Widget *saturation_entry; + Ewl_Widget *value_entry; Ewl_Color_Set selected; }; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_colorpicker.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_colorpicker.h 20 Jun 2005 04:18:16 -0000 1.7 +++ ewl_colorpicker.h 20 Jun 2005 20:35:03 -0000 1.8 @@ -8,13 +8,6 @@ * @{ */ -typedef struct Ewl_Color_Set Ewl_Color_Set; - -struct Ewl_Color_Set -{ - int r, g, b, a; -}; - typedef struct Ewl_ColorPicker Ewl_ColorPicker; /** =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_widget.c 20 May 2005 05:02:59 -0000 1.6 +++ ewl_widget.c 20 Jun 2005 20:35:03 -0000 1.7 @@ -104,6 +104,8 @@ ewl_widget_inherit(w, "widget"); ewl_widget_appearance_set(w, appearance); + ewl_widget_color_set(w, 255, 255, 255, 255); + DRETURN_INT(TRUE, DLEVEL_STABLE); } @@ -980,6 +982,55 @@ DRETURN_PTR(last_key, DLEVEL_STABLE); } +/** + * @param w: The widget to set the color of + * @param r: The red value + * @param g: The green value + * @param b: The blue value + * @param a: The alpha value + * @return Returns no value + * @brief sets the colour of the widget + */ +void +ewl_widget_color_set(Ewl_Widget *w, int r, int g, int b, int a) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + w->color.r = r; + w->color.g = g; + w->color.b = b; + w->color.a = a; + + if (REALIZED(w)) + evas_object_color_set(w->fx_clip_box, r, g, b, a); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param w: The widget to get the colour from + * @param r: Where to put the red value + * @param g: Where to put the green value + * @param b: Where to put the blue value + * @parma a: Where to put the alpha value + * @return Returns no value + * @brief Gets the colour settings of the widget + */ +void +ewl_widget_color_get(Ewl_Widget *w, int *r, int *g, int *b, int *a) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + + if (r) *r = w->color.r; + if (g) *g = w->color.g; + if (b) *b = w->color.b; + if (a) *a = w->color.a; + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + /* * Perform the series of operations common to every widget when * they are destroyed. This should ALWAYS be the the last callback @@ -1129,6 +1180,9 @@ if (sum > ewl_embed_max_layer_get(emb)) ewl_embed_max_layer_set(emb, sum); evas_object_layer_set(w->fx_clip_box, sum); + + evas_object_color_set(w->fx_clip_box, w->color.r, w->color.g, + w->color.b, w->color.a); } pc = EWL_CONTAINER(w->parent); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_widget.h 13 May 2005 03:26:13 -0000 1.5 +++ ewl_widget.h 20 Jun 2005 20:35:03 -0000 1.6 @@ -25,6 +25,13 @@ unsigned int mask; }; +typedef struct Ewl_Color_Set Ewl_Color_Set; + +struct Ewl_Color_Set +{ + int r, g, b, a; +}; + /** * The class that all widgets should inherit. Provides reference to a parent * widget/container, callbacks, and appearance information. @@ -58,6 +65,8 @@ char *inheritance; /**< Key to lookup inhertiance of widget */ int layer; /**< Current layer of widget on canvas */ + Ewl_Color_Set color; + Ecore_Hash *theme; /**< Overriding theme settings of this widget */ Ecore_Hash *data; /**< Arbitrary data attached to this widget */ }; @@ -199,6 +208,11 @@ Ewl_Widget *ewl_widget_focused_get(void); void ewl_widget_tab_order_push(Ewl_Widget *w); +void ewl_widget_color_set(Ewl_Widget *w, int r, int g, + int b, int a); +void ewl_widget_color_get(Ewl_Widget *w, int *r, int *g, + int *b, int *a); + /** * @def LAYER(w) * Used to retrieve the layer of a widget. ------------------------------------------------------- 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