struct {
struct {
unsigned char r, g, b, a;
- } normal, underline, underline2, outline, shadow, glow, glow2, backing,
+ } normal, underline, underline2, underline_dash, outline, shadow, glow, glow2, backing,
strikethrough;
} color;
struct {
int tabstops;
int linesize;
int linegap;
+ int underline_dash_width;
+ int underline_dash_gap;
double linerelsize;
double linerelgap;
double linefill;
Eina_Bool wrap_mixed : 1;
Eina_Bool underline : 1;
Eina_Bool underline2 : 1;
+ Eina_Bool underline_dash : 1;
Eina_Bool strikethrough : 1;
Eina_Bool backing : 1;
Eina_Bool password : 1;
static const char *colorstr = NULL;
static const char *underline_colorstr = NULL;
static const char *underline2_colorstr = NULL;
+static const char *underline_dash_colorstr = NULL;
static const char *outline_colorstr = NULL;
static const char *shadow_colorstr = NULL;
static const char *glow_colorstr = NULL;
static const char *linefillstr = NULL;
static const char *ellipsisstr = NULL;
static const char *passwordstr = NULL;
+static const char *underline_dash_widthstr = NULL;
+static const char *underline_dash_gapstr = NULL;
/**
* @internal
colorstr = eina_stringshare_add("color");
underline_colorstr = eina_stringshare_add("underline_color");
underline2_colorstr = eina_stringshare_add("underline2_color");
+ underline_dash_colorstr = eina_stringshare_add("underline_dash_color");
outline_colorstr = eina_stringshare_add("outline_color");
shadow_colorstr = eina_stringshare_add("shadow_color");
glow_colorstr = eina_stringshare_add("glow_color");
linefillstr = eina_stringshare_add("linefill");
ellipsisstr = eina_stringshare_add("ellipsis");
passwordstr = eina_stringshare_add("password");
+ underline_dash_widthstr = eina_stringshare_add("underline_dash_width");
+ underline_dash_gapstr = eina_stringshare_add("underline_dash_gap");
}
format_refcount++;
}
eina_stringshare_del(colorstr);
eina_stringshare_del(underline_colorstr);
eina_stringshare_del(underline2_colorstr);
+ eina_stringshare_del(underline_dash_colorstr);
eina_stringshare_del(outline_colorstr);
eina_stringshare_del(shadow_colorstr);
eina_stringshare_del(glow_colorstr);
eina_stringshare_del(linefillstr);
eina_stringshare_del(ellipsisstr);
eina_stringshare_del(passwordstr);
+ eina_stringshare_del(underline_dash_widthstr);
+ eina_stringshare_del(underline_dash_gapstr);
}
/**
_format_color_parse(tmp_param,
&(fmt->color.underline2.r), &(fmt->color.underline2.g),
&(fmt->color.underline2.b), &(fmt->color.underline2.a));
+ else if (cmd == underline_dash_colorstr)
+ _format_color_parse(tmp_param,
+ &(fmt->color.underline_dash.r), &(fmt->color.underline_dash.g),
+ &(fmt->color.underline_dash.b), &(fmt->color.underline_dash.a));
else if (cmd == outline_colorstr)
_format_color_parse(tmp_param,
&(fmt->color.outline.r), &(fmt->color.outline.g),
fmt->underline = 1;
fmt->underline2 = 1;
}
+ else if (!strcmp(tmp_param, "dashed"))
+ fmt->underline_dash = 1;
}
else if (cmd == strikethroughstr)
{
else if (!strcmp(tmp_param, "on"))
fmt->password = 1;
}
+ else if (cmd == underline_dash_widthstr)
+ {
+ fmt->underline_dash_width = atoi(tmp_param);
+ if (fmt->underline_dash_width <= 0) fmt->underline_dash_width = 1;
+ }
+ else if (cmd == underline_dash_gapstr)
+ {
+ fmt->underline_dash_gap = atoi(tmp_param);
+ if (fmt->underline_dash_gap <= 0) fmt->underline_dash_gap = 1;
+ }
}
/**
fmt->linesize = 0;
fmt->linerelsize = 0.0;
fmt->linegap = 0;
+ fmt->underline_dash_width = 6;
+ fmt->underline_dash_gap = 2;
fmt->linerelgap = 0.0;
fmt->password = 1;
}
if (fmt->underline2)
c->have_underline2 = 1;
- else if (fmt->underline)
+ else if (fmt->underline || fmt->underline_dash)
c->have_underline = 1;
*_fmt = fmt;
}
} \
while (0)
+#define DRAW_FORMAT_DASHED(oname, oy, oh, or, og, ob, oa, dw, dp) \
+ do \
+ { \
+ if (itr->format->oname) \
+ { \
+ int i, dx = 0, dn, dr; \
+ or = itr->format->color.oname.r; \
+ og = itr->format->color.oname.g; \
+ ob = itr->format->color.oname.b; \
+ oa = itr->format->color.oname.a; \
+ if (!EINA_INLIST_GET(itr)->next) \
+ { \
+ dn = itr->w / (dw + dp); \
+ dr = itr->w % (dw + dp); \
+ } \
+ else \
+ { \
+ dn = itr->adv / (dw + dp); \
+ dr = itr->adv % (dw + dp); \
+ } \
+ if (dr > dw) dr = dw; \
+ for (i = dn; i > 0 ; i--) \
+ { \
+ DRAW_RECT(itr->x + dx, oy, dw, oh, or, og, ob, oa); \
+ dx += dw + dp; \
+ } \
+ DRAW_RECT(itr->x + dx, oy, dr, oh, or, og, ob, oa); \
+ } \
+ } \
+ while (0)
+
#define DRAW_FORMAT(oname, oy, oh, or, og, ob, oa) \
do \
{ \
/* UNDERLINE */
DRAW_FORMAT(underline, ln->baseline + 1, 1, r2, g2, b2, a2);
+ /* UNDERLINE DASHED */
+ DRAW_FORMAT_DASHED(underline_dash, ln->baseline + 1, 1, r2, g2, b2, a2,
+ ti->parent.format->underline_dash_width, ti->parent.format->underline_dash_gap);
+
/* UNDERLINE2 */
DRAW_FORMAT(underline2, ln->baseline + 3, 1, r3, g3, b3, a3);
}