non-trivial menu drawing rewrite, moving to Xft and solving various

font/color drawing issues; from Alexander Polakov
This commit is contained in:
okan
2012-12-17 02:28:45 +00:00
parent a3aaad2c18
commit 6900cd3612
9 changed files with 133 additions and 65 deletions

View File

@@ -84,14 +84,19 @@ union arg {
int i;
};
enum menucolor {
CWM_COLOR_MENU_FG,
CWM_COLOR_MENU_BG,
CWM_COLOR_MENU_FONT,
CWM_COLOR_MENU_FONT_SEL,
CWM_COLOR_MENU_MAX
};
enum cwmcolor {
CWM_COLOR_BORDER_ACTIVE,
CWM_COLOR_BORDER_INACTIVE,
CWM_COLOR_BORDER_GROUP,
CWM_COLOR_BORDER_UNGROUP,
CWM_COLOR_FG_MENU,
CWM_COLOR_BG_MENU,
CWM_COLOR_FONT,
CWM_COLOR_MAX
};
@@ -208,13 +213,12 @@ struct screen_ctx {
Window rootwin;
Window menuwin;
struct color color[CWM_COLOR_MAX];
GC gc;
int cycling;
struct geom view; /* viewable area */
struct geom work; /* workable area, gap-applied */
struct gap gap;
struct cycle_entry_q mruq;
XftColor xftcolor;
XftColor xftcolor[CWM_COLOR_MENU_MAX];
XftDraw *xftdraw;
XftFont *font;
int xinerama_no;
@@ -289,6 +293,7 @@ struct conf {
int snapdist;
struct gap gap;
struct color color[CWM_COLOR_MAX];
char *menucolor[CWM_COLOR_MENU_MAX];
char termpath[MAXPATHLEN];
char lockpath[MAXPATHLEN];
#define CONF_FONT "sans-serif:pixelsize=14:bold"
@@ -445,10 +450,10 @@ void conf_ungrab(struct conf *, struct keybinding *);
int font_ascent(struct screen_ctx *);
int font_descent(struct screen_ctx *);
void font_draw(struct screen_ctx *, const char *, int,
Drawable, int, int);
Drawable, int, int, int);
u_int font_height(struct screen_ctx *);
void font_init(struct screen_ctx *, const char *,
const char *);
const char **);
int font_width(struct screen_ctx *, const char *, int);
void xev_loop(void);
@@ -486,6 +491,7 @@ void xu_ewmh_net_desktop_names(struct screen_ctx *, char *, int);
void xu_ewmh_net_wm_desktop(struct client_ctx *);
void xu_xorcolor(XRenderColor, XRenderColor, XRenderColor *);
void u_exec(char *);
void u_spawn(char *);