Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_text_context.c 


Log Message:
- pass the color set instead of each individual component

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text_context.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_text_context.c  25 Apr 2007 15:12:02 -0000      1.1
+++ ewl_text_context.c  17 Jul 2007 21:56:47 -0000      1.2
@@ -20,7 +20,7 @@
 static unsigned int ewl_text_context_hash_key(const void *ctx);
 static int ewl_text_context_hash_cmp(const void *ctx1, const void *ctx2);
 
-static char *ewl_text_context_color_string_get(int r, int g, int b, int a);
+static char *ewl_text_context_color_string_get(Ewl_Color_Set *colour);
 
 /**
  * @internal
@@ -310,20 +310,14 @@
 
                        fmt[pos].key = "underline_color";
                        fmt[pos].val = ewl_text_context_color_string_get(
-                                       ctx->style_colors.underline.r,
-                                       ctx->style_colors.underline.g,
-                                       ctx->style_colors.underline.b,
-                                       ctx->style_colors.underline.a);
+                                                       
&(ctx->style_colors.underline));
                        fmt[pos++].free = TRUE;
 
                        if (ctx->styles & EWL_TEXT_STYLE_DOUBLE_UNDERLINE)
                        {
                                fmt[pos].key = "underline2_color";
                                fmt[pos].val = 
ewl_text_context_color_string_get(
-                                               
ctx->style_colors.double_underline.r,
-                                               
ctx->style_colors.double_underline.g,
-                                               
ctx->style_colors.double_underline.b,
-                                               
ctx->style_colors.double_underline.a);
+                                                       
&(ctx->style_colors.double_underline));
                                fmt[pos++].free = TRUE;
                        }
                }
@@ -339,10 +333,7 @@
 
                        fmt[pos].key = "strikethrough_color";
                        fmt[pos].val = ewl_text_context_color_string_get(
-                                       ctx->style_colors.strikethrough.r,
-                                       ctx->style_colors.strikethrough.g,
-                                       ctx->style_colors.strikethrough.b,
-                                       ctx->style_colors.strikethrough.a);
+                                               
&(ctx->style_colors.strikethrough));
                        fmt[pos++].free = TRUE;
                }
                else t = "off";
@@ -359,10 +350,7 @@
                {
                        fmt[pos].key = "shadow_color";
                        fmt[pos].val = ewl_text_context_color_string_get(
-                                       ctx->style_colors.shadow.r,
-                                       ctx->style_colors.shadow.g,
-                                       ctx->style_colors.shadow.b,
-                                       ctx->style_colors.shadow.a);
+                                               &(ctx->style_colors.shadow));
                        fmt[pos++].free = TRUE;
 
                        if (ctx->styles & EWL_TEXT_STYLE_GLOW)
@@ -371,10 +359,7 @@
 
                                fmt[pos].key = "glow_color";
                                fmt[pos].val = 
ewl_text_context_color_string_get(
-                                               ctx->style_colors.glow.r,
-                                               ctx->style_colors.glow.g,
-                                               ctx->style_colors.glow.b,
-                                               ctx->style_colors.glow.a);
+                                                       
&(ctx->style_colors.glow));
                                fmt[pos++].free = TRUE;
                        }
                        else if (ctx->styles & EWL_TEXT_STYLE_OUTLINE)
@@ -387,10 +372,7 @@
 
                                fmt[pos].key = "outline_color";
                                fmt[pos].val = 
ewl_text_context_color_string_get(
-                                               ctx->style_colors.outline.r,
-                                               ctx->style_colors.outline.g,
-                                               ctx->style_colors.outline.b,
-                                               ctx->style_colors.outline.a);
+                                                       
&(ctx->style_colors.outline));
                                fmt[pos++].free = TRUE;
                        }
                        else if (ctx->styles & EWL_TEXT_STYLE_SHADOW)
@@ -472,15 +454,11 @@
        fmt[pos++].free = TRUE;
 
        fmt[pos].key = "backing_color";
-       fmt[pos].val = ewl_text_context_color_string_get(
-                       ctx->style_colors.bg.r, ctx->style_colors.bg.g,
-                       ctx->style_colors.bg.b, ctx->style_colors.bg.a);
+       fmt[pos].val = 
ewl_text_context_color_string_get(&(ctx->style_colors.bg));
        fmt[pos++].free = TRUE;
 
        fmt[pos].key = "color";
-       fmt[pos].val = ewl_text_context_color_string_get(
-                       ctx->color.r, ctx->color.g,
-                       ctx->color.b, ctx->color.a);
+       fmt[pos].val = ewl_text_context_color_string_get(&(ctx->color));
        fmt[pos++].free = TRUE;
 
        /* create the formatting string */
@@ -775,13 +753,13 @@
 }
 
 static char *
-ewl_text_context_color_string_get(int r, int g, int b, int a)
+ewl_text_context_color_string_get(Ewl_Color_Set *colour)
 {
        char buf[10];
 
        DENTER_FUNCTION(DLEVEL_STABLE);
 
-       snprintf(buf, sizeof(buf), "#%02x%02x%02x%02x", r, g, b, a);
+       snprintf(buf, sizeof(buf), "#%02x%02x%02x%02x", colour->r, colour->g, 
colour->b, colour->a);
 
        DRETURN_PTR(strdup(buf), DLEVEL_STABLE);
 }



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to