about summary refs log tree commit diff stats
path: root/draw.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-08-24 09:25:10 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-08-24 09:25:10 +0200
commit2e834e941f695481894123e0665416f96333653b (patch)
tree07e0c2bd3c118c513a172443bda276d861df5131 /draw.c
parent77e5f3167c97863ef8e27b6e57fd35ee0c73c8ff (diff)
downloaddwm-2e834e941f695481894123e0665416f96333653b.tar.gz
changing tag indicator through underline
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c42
1 files changed, 16 insertions, 26 deletions
diff --git a/draw.c b/draw.c
index cbf6502..4ebda12 100644
--- a/draw.c
+++ b/draw.c
@@ -22,9 +22,17 @@ textnw(const char *text, unsigned int len)
 }
 
 static void
-drawborder()
+drawtext(const char *text, Bool invert, Bool underline)
 {
+	int x, y, w, h;
+	static char buf[256];
+	unsigned int len, olen;
+	XGCValues gcv;
 	XPoint points[5];
+	XRectangle r = { dc.x, dc.y, dc.w, dc.h };
+
+	XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg);
+	XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
 	points[0].x = dc.x;
 	points[0].y = dc.y;
 	points[1].x = dc.w - 1;
@@ -35,24 +43,8 @@ drawborder()
 	points[3].y = 0;
 	points[4].x = 0;
 	points[4].y = -(dc.h - 1);
-	XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious);
-}
-
-static void
-drawtext(const char *text, Bool invert, Bool highlight)
-{
-	int x, y, w, h;
-	static char buf[256];
-	unsigned int len, olen;
-	DC tmp;
-	XGCValues gcv;
-	XRectangle r = { dc.x, dc.y, dc.w, dc.h };
-
-	XSetForeground(dpy, dc.gc, invert ? dc.fg : dc.bg);
-	XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
-	XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
 	XSetForeground(dpy, dc.gc, dc.border);
-	drawborder();
+	XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious);
 
 	if(!text)
 		return;
@@ -93,14 +85,12 @@ drawtext(const char *text, Bool invert, Bool highlight)
 		XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv);
 		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
 	}
-	if(highlight) {
-		tmp = dc;
-		dc.x += 2;
-		dc.y += 2;
-		dc.w -= 4;
-		dc.h -= 4;
-		drawborder();
-		dc = tmp;
+	if(underline) {
+		points[0].x = dc.x + (h / 2) - 1;
+		points[0].y = dc.y + dc.h - 3;
+		points[1].x = dc.w - h + 2;
+		points[1].y = 0;
+		XDrawLines(dpy, dc.drawable, dc.gc, points, 2, CoordModePrevious);
 	}
 }
 
ceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*	traversal.c function declarations
*/
#ifndef TRAVERSAL_H
#define TRAVERSAL_H

#ifndef HTUTILS_H
#include <HTUtils.h>		/* BOOL, ARGS */
#endif

#ifdef __cplusplus
extern "C" {
#endif
    extern BOOLEAN lookup_link(char *target);
    extern void add_to_table(char *target);
    extern void add_to_traverse_list(char *fname, char *prev_link_name);
    extern void dump_traversal_history(void);
    extern void add_to_reject_list(char *target);
    extern BOOLEAN lookup_reject(char *target);

#ifdef __cplusplus
}
#endif
#endif				/* TRAVERSAL_H */