Enlightenment CVS committal

Author  : ningerso
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_colorpicker.c 


Log Message:
Handle DND color swatches from the gimp. This may crash with colors from other
applications until ecore_x can provide bit format info.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_colorpicker.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- ewl_colorpicker.c   11 Sep 2006 20:51:41 -0000      1.28
+++ ewl_colorpicker.c   29 Sep 2006 04:33:12 -0000      1.29
@@ -740,17 +740,33 @@
  * @brief Callback for when a user clicks on the previous colour
  */
 void
-ewl_colorpicker_cb_dnd_data(Ewl_Widget *w __UNUSED__, void *ev,
+ewl_colorpicker_cb_dnd_data(Ewl_Widget *w, void *ev,
                                void *data __UNUSED__)
 {
+       int i;
+       int curcolors[4];
+       unsigned short *colors;
+       Ewl_Colorpicker *cp = EWL_COLORPICKER(w);
        Ewl_Event_Dnd_Data *event = ev;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
        DCHECK_PARAM_PTR("ev", ev);
-       DCHECK_PARAM_PTR("data", data);
        DCHECK_TYPE("w", w, EWL_WIDGET_TYPE);
 
        printf("Data %d bytes\n", event->len);
+       colors = event->data;
+       printf("Color: %d %d %d %d\n", colors[0], colors[1], colors[2], 
colors[3]);
+       ewl_colorpicker_current_rgb_get(cp, &curcolors[0], &curcolors[1],
+                       &curcolors[2]);
+       curcolors[3] = ewl_colorpicker_alpha_get(cp);
+
+       for (i = 0; i < event->len && i < 4; i++)
+               curcolors[i] = colors[i] >> 8;
+
+       ewl_colorpicker_current_rgb_set(cp, curcolors[0], curcolors[1],
+                       curcolors[2]);
+       ewl_colorpicker_alpha_set(cp, curcolors[3]);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to