Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,37 +51,6 @@ static const char *symbol_1 = "<";
static const char *symbol_2 = ">";
#endif // SYMBOLS_PATCH

#if ALPHA_PATCH
static const unsigned int baralpha = 0xd0;
static const unsigned int borderalpha = OPAQUE;
static const unsigned int alphas[][3] = {
/* fg bg border */
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
#if BORDER_PATCH
[SchemeBorder] = { OPAQUE, OPAQUE, OPAQUE },
#endif // BORDER_PATCH
#if MORECOLOR_PATCH
[SchemeMid] = { OPAQUE, baralpha, borderalpha },
#endif // MORECOLOR_PATCH
#if HIGHLIGHT_PATCH || FUZZYHIGHLIGHT_PATCH
[SchemeSelHighlight] = { OPAQUE, baralpha, borderalpha },
[SchemeNormHighlight] = { OPAQUE, baralpha, borderalpha },
#endif // HIGHLIGHT_PATCH | FUZZYHIGHLIGHT_PATCH
#if HIGHPRIORITY_PATCH
[SchemeHp] = { OPAQUE, baralpha, borderalpha },
#endif // HIGHPRIORITY_PATCH
#if EMOJI_HIGHLIGHT_PATCH
[SchemeHover] = { OPAQUE, baralpha, borderalpha },
[SchemeGreen] = { OPAQUE, baralpha, borderalpha },
[SchemeRed] = { OPAQUE, baralpha, borderalpha },
[SchemeYellow] = { OPAQUE, baralpha, borderalpha },
[SchemeBlue] = { OPAQUE, baralpha, borderalpha },
[SchemePurple] = { OPAQUE, baralpha, borderalpha },
#endif // EMOJI_HIGHLIGHT_PATCH
};
#endif // ALPHA_PATCH

static
#if !XRESOURCES_PATCH
const
Expand Down
9 changes: 0 additions & 9 deletions dmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
#endif // PANGO_PATCH
#if ALPHA_PATCH
#define OPAQUE 0xffU
#define OPACITY "_NET_WM_WINDOW_OPACITY"
#endif // ALPHA_PATCH

Expand Down Expand Up @@ -1529,18 +1528,10 @@ setup(void)
/* init appearance */
#if XRESOURCES_PATCH
for (j = 0; j < SchemeLast; j++)
#if ALPHA_PATCH
scheme[j] = drw_scm_create(drw, (const char**)colors[j], alphas[j], 2);
#else
scheme[j] = drw_scm_create(drw, (const char**)colors[j], 2);
#endif // ALPHA_PATCH
#else
for (j = 0; j < SchemeLast; j++)
#if ALPHA_PATCH
scheme[j] = drw_scm_create(drw, colors[j], alphas[j], 2);
#else
scheme[j] = drw_scm_create(drw, colors[j], 2);
#endif // ALPHA_PATCH
#endif // XRESOURCES_PATCH

clip = XInternAtom(dpy, "CLIPBOARD", False);
Expand Down
24 changes: 10 additions & 14 deletions drw.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,19 +284,23 @@ drw_fontset_free(Fnt *font)
#endif // PANGO_PATCH

void
#if ALPHA_PATCH
drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha)
#else
drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
#endif // ALPHA_PATCH
{
if (!drw || !dest || !clrname)
return;

#if ALPHA_PATCH
char color[8];
strncpy(color, clrname, 7);
color[7] = 0;
if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
clrname, dest))
die("error, cannot allocate color '%s'", clrname);
color, dest))
die("error, cannot allocate color '%s'", color);


unsigned short alpha = 0xff;
if (clrname[7])
alpha = (unsigned short) strtol(clrname + 7, NULL, 16);

dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24);
#else
Expand All @@ -310,11 +314,7 @@ drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
/* Wrapper to create color schemes. The caller has to call free(3) on the
* returned color scheme when done using it. */
Clr *
#if ALPHA_PATCH
drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount)
#else
drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
#endif // ALPHA_PATCH
{
size_t i;
Clr *ret;
Expand All @@ -324,11 +324,7 @@ drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
return NULL;

for (i = 0; i < clrcount; i++)
#if ALPHA_PATCH
drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]);
#else
drw_clr_create(drw, &ret[i], clrnames[i]);
#endif // ALPHA_PATCH
return ret;
}

Expand Down
7 changes: 1 addition & 6 deletions drw.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,8 @@ void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned in
#endif // PANGO_PATCH

/* Colorscheme abstraction */
#if ALPHA_PATCH
void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha);
Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount);
#else
void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
#endif // ALPHA_PATCH

/* Cursor abstraction */
Cur *drw_cur_create(Drw *drw, int shape);
Expand All @@ -100,4 +95,4 @@ void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)

#if SCROLL_PATCH
#include "patch/scroll.h"
#endif
#endif