Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_spectrum.c 


Log Message:
- add doxygen
- move callback after public api

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_spectrum.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewl_spectrum.c      27 Sep 2005 05:38:32 -0000      1.8
+++ ewl_spectrum.c      27 Sep 2005 05:44:36 -0000      1.9
@@ -267,66 +267,16 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
-/*
- * Callback for drawing the spectrum to the image data.
+/**
+ * @param hue: The hue to convert
+ * @param Saturation: The saturation to convert
+ * @param value: The value to convert
+ * @param _r: Where to store the red value
+ * @param _g: Where to store the green value
+ * @param _b: Where to store the red value
+ * @return Returns no value.
  */
 void
-ewl_spectrum_configure_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
-                         void *user_data __UNUSED__)
-{
-       Evas_Object    *o;
-       int             pw, ph;
-       int             i, j;
-       int            *data = NULL;
-       Ewl_Spectrum   *sp;
-
-       DENTER_FUNCTION(DLEVEL_STABLE);
-       DCHECK_PARAM_PTR("w", w);
-
-       if (!REALIZED(w))
-       {
-               DRETURN(DLEVEL_STABLE);
-       }
-
-       sp = EWL_SPECTRUM(w);
-       if (!sp->redraw)
-       {
-               DRETURN(DLEVEL_STABLE);
-       }
-
-       o = EWL_IMAGE(sp)->image;
-       if (!o)
-       {
-               DRETURN(DLEVEL_STABLE);
-       }
-
-       /* set/get the spectrum size and image data */
-       evas_object_image_size_set(o, CURRENT_W(sp), CURRENT_H(sp));
-       evas_object_image_size_get(o, &pw, &ph);
-       data = evas_object_image_data_get(o, 1);
-       if (!data)
-       {
-               DRETURN(DLEVEL_STABLE);
-       }
-
-       /* draw the spectrum */
-       for (j = 0; j < ph; j++) 
-       {
-               for (i = 0; i < pw; i++) 
-               {
-                       int r, g, b, a;
-                       ewl_spectrum_color_coord_map(sp, i, j, &r, &g, &b, &a);
-                       data[(j * pw) + i] = (a << 24) | (r << 16) | (g << 8) | 
b;
-               }
-       }
-
-       evas_object_image_data_set(o, data);
-       evas_object_image_data_update_add(o, 0, 0, pw, ph);
-
-       DLEAVE_FUNCTION(DLEVEL_STABLE);
-}
-
-void
 ewl_spectrum_hsv_to_rgb(float hue, float saturation, float value,
                        int *_r, int *_g, int *_b)
 {
@@ -392,6 +342,15 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
+/**
+ * @param r: The red value to convert
+ * @param g: The green value to convert
+ * @param b: The blue value to convert
+ * @param h: Where to store the hue
+ * @param s: Where to store the saturation
+ * @param v: Where to store the value
+ * @return Returns no value
+ */
 void
 ewl_spectrum_rgb_to_hsv(int r, int g, int b,
                        float *h, float *s, float *v)
@@ -428,6 +387,65 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
+/*
+ * Callback for drawing the spectrum to the image data.
+ */
+void
+ewl_spectrum_configure_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
+                         void *user_data __UNUSED__)
+{
+       Evas_Object    *o;
+       int             pw, ph;
+       int             i, j;
+       int            *data = NULL;
+       Ewl_Spectrum   *sp;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+
+       if (!REALIZED(w))
+       {
+               DRETURN(DLEVEL_STABLE);
+       }
+
+       sp = EWL_SPECTRUM(w);
+       if (!sp->redraw)
+       {
+               DRETURN(DLEVEL_STABLE);
+       }
+
+       o = EWL_IMAGE(sp)->image;
+       if (!o)
+       {
+               DRETURN(DLEVEL_STABLE);
+       }
+
+       /* set/get the spectrum size and image data */
+       evas_object_image_size_set(o, CURRENT_W(sp), CURRENT_H(sp));
+       evas_object_image_size_get(o, &pw, &ph);
+       data = evas_object_image_data_get(o, 1);
+       if (!data)
+       {
+               DRETURN(DLEVEL_STABLE);
+       }
+
+       /* draw the spectrum */
+       for (j = 0; j < ph; j++) 
+       {
+               for (i = 0; i < pw; i++) 
+               {
+                       int r, g, b, a;
+                       ewl_spectrum_color_coord_map(sp, i, j, &r, &g, &b, &a);
+                       data[(j * pw) + i] = (a << 24) | (r << 16) | (g << 8) | 
b;
+               }
+       }
+
+       evas_object_image_data_set(o, data);
+       evas_object_image_data_update_add(o, 0, 0, pw, ph);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
 static void
 ewl_spectrum_color_coord_map2d(Ewl_Spectrum *sp, int x, int y, 
                                int *r, int *g, int *b, int *a)




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to