From: Ian Jackson Date: Wed, 6 Jun 2012 00:25:42 +0000 (+0100) Subject: use meaningful colour names in pix_... X-Git-Tag: debian/4.1.31~22 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=commitdiff_plain;h=4a3f20ad305c69535145628f8f75736cc7bef10d;hp=fa75bccc01b0152bfdd9d64c00f43e41416767de use meaningful colour names in pix_... --- diff --git a/cprogs/xacpi-simple.c b/cprogs/xacpi-simple.c index bf0cf78..cbbe292 100644 --- a/cprogs/xacpi-simple.c +++ b/cprogs/xacpi-simple.c @@ -576,7 +576,7 @@ typedef struct { unsigned long lastfg; } Gcstate; -#define C(c,u) static unsigned long pix_##c; +#define C(c,u) static unsigned long pix_##u; #define GC(g) static Gcstate gc_##g; COLOURS #undef C @@ -622,23 +622,23 @@ static void show(void) { int i, leftmost_lit, leftmost_nondeg, beyond, first_beyond; if (!charging_mask) - return show_solid(pix_darkgreen); + return show_solid(pix_absent); if (charging_mask & (1u << CHGST_ERROR)) - return show_solid(pix_yellow); + return show_solid(pix_error); - setbackground(pix_dimgrey); + setbackground(pix_degraded); XClearWindow(disp,win); setforeground(&gc_remain, !(charging_mask & CHGMASK_CHG_DIS) ? (~charging_mask & (1u << CHGST_CHARGED) ? - pix_lightgrey : pix_cyan) : - !(~charging_mask & CHGMASK_CHG_DIS) ? pix_grey : + pix_notcharging : pix_charged) : + !(~charging_mask & CHGMASK_CHG_DIS) ? pix_confusing : charging_mask & (1u<lastfg= gcv.foreground= pix_white; + gc_r->lastfg= gcv.foreground= pix_equilibrium; gc_r->gc= XCreateGC(disp,win, GCFunction|GCLineWidth|GCForeground, &gcv); } @@ -724,15 +724,15 @@ static void initgraphics(int argc, char **argv) { pos_x,pos_y,width,height,0,0,0); cmap= DefaultColormap(disp,screen); -#define C(c,u) colour(&pix_##c, #u "Color"); +#define C(c,u) colour(&pix_##u, #u "Color"); #define GC(g) initgc(&gc_##g); COLOURS #undef C #undef GC - r= XSetWindowBackground(disp,win,pix_dimgrey); + r= XSetWindowBackground(disp,win,pix_degraded); if (!r) fail("init set background"); - lastbackground= pix_dimgrey; + lastbackground= pix_degraded; normal_hints->flags= PWinGravity; normal_hints->win_gravity= gravity; diff --git a/debian/changelog b/debian/changelog index 6445653..2b070bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ chiark-utils (4.1.31~~iwj) unstable; urgency=low rather than trying to use "alarm" value from /sys/class/power_supply (which is not very predictable or reliable). - Option -debug produces some debugging output. + - In the code, rename pix_... variables to be named after the meaning + rather than the default colour. * Fix the build-depends to refer to nettle-dev not libnettle-dev. * Add ${misc:Depends} to Depends: lines. Causes no change to the .debs.