Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: Ewl.h Makefile.am ewl_colorpicker.c ewl_colorpicker.h ewl_spectrum.c ewl_spectrum.h Added Files: ewl_histogram.c ewl_histogram.h Log Message: Add initial implementation of a histogram widget. Outline DND drop support for the color picker. Add dirty flag to spectrum to reduce redraws. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/Ewl.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- Ewl.h 22 Aug 2006 21:41:45 -0000 1.9 +++ Ewl.h 11 Sep 2006 20:51:41 -0000 1.10 @@ -310,6 +310,7 @@ #include <ewl_spacer.h> #include <ewl_spinner.h> #include <ewl_image.h> +#include <ewl_histogram.h> #include <ewl_spectrum.h> #include <ewl_menu_item.h> #include <ewl_menu_base.h> =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/Makefile.am,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- Makefile.am 22 Aug 2006 21:41:45 -0000 1.32 +++ Makefile.am 11 Sep 2006 20:51:41 -0000 1.33 @@ -44,6 +44,7 @@ ewl_filedialog.h \ ewl_freebox.h \ ewl_grid.h \ + ewl_histogram.h \ ewl_icon.h \ ewl_icon_theme.h \ ewl_iconbox.h \ @@ -119,6 +120,7 @@ ewl_filedialog.c \ ewl_freebox.c \ ewl_grid.c \ + ewl_histogram.c \ ewl_icon.c \ ewl_icon_theme.c \ ewl_iconbox.c \ =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_colorpicker.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- ewl_colorpicker.c 14 Aug 2006 14:56:56 -0000 1.27 +++ ewl_colorpicker.c 11 Sep 2006 20:51:41 -0000 1.28 @@ -95,6 +95,7 @@ {"b", EWL_COLOR_MODE_RGB_BLUE, 255}, {NULL, EWL_COLOR_MODE_RGB_RED, 0} }; + const char *types[] = { "application/x-color", NULL }; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("cp", cp, FALSE); @@ -105,6 +106,10 @@ ewl_box_orientation_set(EWL_BOX(cp), EWL_ORIENTATION_HORIZONTAL); ewl_widget_appearance_set(EWL_WIDGET(cp), EWL_COLORPICKER_TYPE); ewl_widget_inherit(EWL_WIDGET(cp), EWL_COLORPICKER_TYPE); + ewl_dnd_accepted_types_set(EWL_WIDGET(cp), types); + + ewl_callback_append(EWL_WIDGET(cp), EWL_CALLBACK_DND_DATA, + ewl_colorpicker_cb_dnd_data, NULL); r = g = b = 0; @@ -722,6 +727,30 @@ cp = data; ewl_colorpicker_current_rgb_set(cp, cp->previous.r, cp->previous.g, cp->previous.b); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @internal + * @param w: UNUSED + * @param ev: UNUSED + * @param data: The colorpicker + * @return Returns no value + * @brief Callback for when a user clicks on the previous colour + */ +void +ewl_colorpicker_cb_dnd_data(Ewl_Widget *w __UNUSED__, void *ev, + void *data __UNUSED__) +{ + Ewl_Event_Dnd_Data *event = ev; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("ev", ev); + DCHECK_PARAM_PTR("data", data); + DCHECK_TYPE("w", w, EWL_WIDGET_TYPE); + + printf("Data %d bytes\n", event->len); DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_colorpicker.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- ewl_colorpicker.h 11 Aug 2006 07:50:23 -0000 1.19 +++ ewl_colorpicker.h 11 Sep 2006 20:51:41 -0000 1.20 @@ -100,6 +100,7 @@ void ewl_colorpicker_cb_radio_change(Ewl_Widget *w, void *ev, void *data); void ewl_colorpicker_cb_previous_clicked(Ewl_Widget *w, void *ev, void *data); +void ewl_colorpicker_cb_dnd_data(Ewl_Widget *w, void *ev, void *data); /** * @} =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_spectrum.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- ewl_spectrum.c 26 May 2006 19:58:00 -0000 1.25 +++ ewl_spectrum.c 11 Sep 2006 20:51:41 -0000 1.26 @@ -164,6 +164,7 @@ DCHECK_TYPE("sp", sp, EWL_SPECTRUM_TYPE); sp->mode = mode; + sp->dirty = 1; ewl_widget_configure(EWL_WIDGET(sp)); DLEAVE_FUNCTION(DLEVEL_STABLE); @@ -209,6 +210,7 @@ if (sp->rgb.b > 255) sp->rgb.b = 255; ewl_spectrum_hsv_from_rgb(sp); + sp->dirty = 1; ewl_widget_configure(EWL_WIDGET(sp)); DLEAVE_FUNCTION(DLEVEL_STABLE); @@ -266,6 +268,7 @@ if (sp->hsv.v < 0.0) sp->hsv.v = 0.0; ewl_spectrum_rgb_from_hsv(sp); + sp->dirty = 1; ewl_widget_configure(EWL_WIDGET(sp)); DLEAVE_FUNCTION(DLEVEL_STABLE); @@ -599,6 +602,9 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("sp", sp); DCHECK_TYPE("sp", sp, EWL_SPECTRUM_TYPE); + + if (!sp->dirty) + DRETURN(DLEVEL_STABLE); img = EWL_IMAGE(sp->canvas)->image; evas_object_image_size_set(img, CURRENT_W(sp), CURRENT_H(sp)); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_spectrum.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ewl_spectrum.h 15 Mar 2006 04:03:48 -0000 1.13 +++ ewl_spectrum.h 11 Sep 2006 20:51:41 -0000 1.14 @@ -48,6 +48,7 @@ Ewl_Color_Mode mode; /**< The mode of the spectrum */ Ewl_Spectrum_Type type; /**< The type of the spectrum */ + unsigned int dirty:1; /**< The flag to queue redraw */ }; Ewl_Widget *ewl_spectrum_new(void); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs