mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Remove a bunch of unused variables and incorrect comments.
"ok with me" okan@.
This commit is contained in:
parent
fead0d511f
commit
cd46788d85
9
calmwm.c
9
calmwm.c
@ -149,7 +149,7 @@ void
|
|||||||
x_setupscreen(struct screen_ctx *sc, u_int which)
|
x_setupscreen(struct screen_ctx *sc, u_int which)
|
||||||
{
|
{
|
||||||
XColor tmp;
|
XColor tmp;
|
||||||
XGCValues gv, gv1/* , gv2 */;
|
XGCValues gv;
|
||||||
Window *wins, w0, w1;
|
Window *wins, w0, w1;
|
||||||
u_int nwins, i = 0;
|
u_int nwins, i = 0;
|
||||||
XWindowAttributes winattr;
|
XWindowAttributes winattr;
|
||||||
@ -209,13 +209,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
|
|||||||
GCForeground|GCBackground|GCFunction|
|
GCForeground|GCBackground|GCFunction|
|
||||||
GCLineWidth|GCSubwindowMode, &gv);
|
GCLineWidth|GCSubwindowMode, &gv);
|
||||||
|
|
||||||
gv1.function = GXinvert;
|
|
||||||
gv1.subwindow_mode = IncludeInferiors;
|
|
||||||
gv1.line_width = 1;
|
|
||||||
|
|
||||||
sc->invgc = XCreateGC(X_Dpy, sc->rootwin,
|
|
||||||
GCFunction|GCSubwindowMode|GCLineWidth, &gv1);
|
|
||||||
|
|
||||||
font_init(sc);
|
font_init(sc);
|
||||||
DefaultFont = font_getx(sc, DefaultFontName);
|
DefaultFont = font_getx(sc, DefaultFontName);
|
||||||
|
|
||||||
|
26
calmwm.h
26
calmwm.h
@ -31,7 +31,7 @@
|
|||||||
#define MAX(x, y) ((x) > (y) ? (x) : (y))
|
#define MAX(x, y) ((x) > (y) ? (x) : (y))
|
||||||
|
|
||||||
enum conftype {
|
enum conftype {
|
||||||
CONF_BWIDTH, CONF_IGNORE, CONF_NOTIFIER,
|
CONF_BWIDTH, CONF_IGNORE,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ChildMask (SubstructureRedirectMask|SubstructureNotifyMask)
|
#define ChildMask (SubstructureRedirectMask|SubstructureNotifyMask)
|
||||||
@ -68,12 +68,11 @@ struct screen_ctx {
|
|||||||
Window groupwin;
|
Window groupwin;
|
||||||
Window infowin;
|
Window infowin;
|
||||||
Colormap colormap;
|
Colormap colormap;
|
||||||
GC invcg;
|
|
||||||
XColor bgcolor, fgcolor, fccolor, redcolor, cyancolor,
|
XColor bgcolor, fgcolor, fccolor, redcolor, cyancolor,
|
||||||
whitecolor, blackcolor;
|
whitecolor, blackcolor;
|
||||||
char *display;
|
char *display;
|
||||||
unsigned long blackpixl, whitepixl, redpixl, bluepixl, cyanpixl;
|
unsigned long blackpixl, whitepixl, redpixl, bluepixl, cyanpixl;
|
||||||
GC gc, invgc, hlgc;
|
GC gc, hlgc;
|
||||||
|
|
||||||
Pixmap gray, blue, red;
|
Pixmap gray, blue, red;
|
||||||
|
|
||||||
@ -83,8 +82,6 @@ struct screen_ctx {
|
|||||||
int xmax;
|
int xmax;
|
||||||
int ymax;
|
int ymax;
|
||||||
|
|
||||||
FILE *notifier;
|
|
||||||
|
|
||||||
struct cycle_entry_q mruq;
|
struct cycle_entry_q mruq;
|
||||||
|
|
||||||
struct client_ctx* cycle_client;
|
struct client_ctx* cycle_client;
|
||||||
@ -203,22 +200,6 @@ struct xevent {
|
|||||||
|
|
||||||
TAILQ_HEAD(xevent_q, xevent);
|
TAILQ_HEAD(xevent_q, xevent);
|
||||||
|
|
||||||
/* Keybindings */
|
|
||||||
enum kbtype {
|
|
||||||
KB_DELETE, KB_NEWTERM0, KB_NEWTERM1, KB_HIDE,
|
|
||||||
KB_LOWER, KB_RAISE, KB_SEARCH, KB_CYCLE, KB_LABEL,
|
|
||||||
KB_GROUPSELECT, KB_VERTMAXIMIZE, KB_MAXIMIZE,
|
|
||||||
|
|
||||||
/* Group numbers need to be in order. */
|
|
||||||
KB_GROUP_1, KB_GROUP_2, KB_GROUP_3, KB_GROUP_4, KB_GROUP_5,
|
|
||||||
KB_GROUP_6, KB_GROUP_7, KB_GROUP_8, KB_GROUP_9, KB_NOGROUP,
|
|
||||||
KB_NEXTGROUP, KB_PREVGROUP,
|
|
||||||
|
|
||||||
KB_MOVE_WEST, KB_MOVE_EAST, KB_MOVE_NORTH, KB_MOVE_SOUTH,
|
|
||||||
|
|
||||||
KB__LAST
|
|
||||||
};
|
|
||||||
|
|
||||||
#define CWM_BIGMOVE 0x1000
|
#define CWM_BIGMOVE 0x1000
|
||||||
enum directions {
|
enum directions {
|
||||||
CWM_UP=0, CWM_DOWN, CWM_LEFT, CWM_RIGHT,
|
CWM_UP=0, CWM_DOWN, CWM_LEFT, CWM_RIGHT,
|
||||||
@ -229,7 +210,6 @@ enum directions {
|
|||||||
#define CWM_EXEC_WM 0x2
|
#define CWM_EXEC_WM 0x2
|
||||||
|
|
||||||
#define KBFLAG_NEEDCLIENT 0x01
|
#define KBFLAG_NEEDCLIENT 0x01
|
||||||
#define KBFLAG_FINDCLIENT 0x02
|
|
||||||
|
|
||||||
#define KBTOGROUP(X) ((X) - 1)
|
#define KBTOGROUP(X) ((X) - 1)
|
||||||
|
|
||||||
@ -463,14 +443,12 @@ void kbfunc_lock(struct client_ctx *cc, void *arg);
|
|||||||
void search_init(struct screen_ctx *);
|
void search_init(struct screen_ctx *);
|
||||||
struct menu *search_start(struct menu_q *menuq,
|
struct menu *search_start(struct menu_q *menuq,
|
||||||
void (*match)(struct menu_q *, struct menu_q *, char *),
|
void (*match)(struct menu_q *, struct menu_q *, char *),
|
||||||
void (*rank)(struct menu_q *, char *),
|
|
||||||
void (*print)(struct menu *mi, int),
|
void (*print)(struct menu *mi, int),
|
||||||
char *, int);
|
char *, int);
|
||||||
void search_match_client(struct menu_q *, struct menu_q *, char *);
|
void search_match_client(struct menu_q *, struct menu_q *, char *);
|
||||||
void search_print_client(struct menu *mi, int list);
|
void search_print_client(struct menu *mi, int list);
|
||||||
void search_match_text(struct menu_q *, struct menu_q *, char *);
|
void search_match_text(struct menu_q *, struct menu_q *, char *);
|
||||||
void search_match_exec(struct menu_q *, struct menu_q *, char *);
|
void search_match_exec(struct menu_q *, struct menu_q *, char *);
|
||||||
void search_rank_text(struct menu_q *, char *);
|
|
||||||
|
|
||||||
void group_init(void);
|
void group_init(void);
|
||||||
void group_select(int);
|
void group_select(int);
|
||||||
|
10
kbfunc.c
10
kbfunc.c
@ -178,8 +178,8 @@ kbfunc_client_search(struct client_ctx *scratch, void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((mi = search_start(&menuq,
|
if ((mi = search_start(&menuq,
|
||||||
search_match_client, NULL,
|
search_match_client, search_print_client,
|
||||||
search_print_client, "window", 0)) != NULL) {
|
"window", 0)) != NULL) {
|
||||||
cc = (struct client_ctx *)mi->ctx;
|
cc = (struct client_ctx *)mi->ctx;
|
||||||
if (cc->flags & CLIENT_HIDDEN)
|
if (cc->flags & CLIENT_HIDDEN)
|
||||||
client_unhide(cc);
|
client_unhide(cc);
|
||||||
@ -213,7 +213,7 @@ kbfunc_menu_search(struct client_ctx *scratch, void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((mi = search_start(&menuq,
|
if ((mi = search_start(&menuq,
|
||||||
search_match_text, NULL, NULL, "application", 0)) != NULL)
|
search_match_text, NULL, "application", 0)) != NULL)
|
||||||
u_spawn(((struct cmd *)mi->ctx)->image);
|
u_spawn(((struct cmd *)mi->ctx)->image);
|
||||||
|
|
||||||
while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
|
while ((mi = TAILQ_FIRST(&menuq)) != NULL) {
|
||||||
@ -344,7 +344,7 @@ kbfunc_exec(struct client_ctx *scratch, void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((mi = search_start(&menuq,
|
if ((mi = search_start(&menuq,
|
||||||
search_match_exec, NULL, NULL, label, 1)) != NULL) {
|
search_match_exec, NULL, label, 1)) != NULL) {
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case CWM_EXEC_PROGRAM:
|
case CWM_EXEC_PROGRAM:
|
||||||
u_spawn(mi->text);
|
u_spawn(mi->text);
|
||||||
@ -419,7 +419,7 @@ kbfunc_ssh(struct client_ctx *scratch, void *arg)
|
|||||||
|
|
||||||
|
|
||||||
if ((mi = search_start(&menuq,
|
if ((mi = search_start(&menuq,
|
||||||
search_match_exec, NULL, NULL, "ssh", 1)) != NULL) {
|
search_match_exec, NULL, "ssh", 1)) != NULL) {
|
||||||
conf_cmd_refresh(&Conf);
|
conf_cmd_refresh(&Conf);
|
||||||
l = snprintf(cmd, sizeof(cmd), "%s -e ssh %s", Conf.termpath,
|
l = snprintf(cmd, sizeof(cmd), "%s -e ssh %s", Conf.termpath,
|
||||||
mi->text);
|
mi->text);
|
||||||
|
16
search.c
16
search.c
@ -31,11 +31,6 @@ search_init(struct screen_ctx *sc)
|
|||||||
1, 1, 1, sc->blackpixl, sc->whitepixl);
|
1, 1, 1, sc->blackpixl, sc->whitepixl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* ranking. each rank type is assigned a weight. multiply this by
|
|
||||||
* the rank given. add them up. simple linear combination.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Input: list of items,
|
* Input: list of items,
|
||||||
* Output: choose one
|
* Output: choose one
|
||||||
@ -45,7 +40,6 @@ search_init(struct screen_ctx *sc)
|
|||||||
struct menu *
|
struct menu *
|
||||||
search_start(struct menu_q *menuq,
|
search_start(struct menu_q *menuq,
|
||||||
void (*match)(struct menu_q *, struct menu_q *, char *),
|
void (*match)(struct menu_q *, struct menu_q *, char *),
|
||||||
void (*rank)(struct menu_q *resultq, char *search),
|
|
||||||
void (*print)(struct menu *mi, int print),
|
void (*print)(struct menu *mi, int print),
|
||||||
char *prompt, int dummy)
|
char *prompt, int dummy)
|
||||||
{
|
{
|
||||||
@ -109,10 +103,6 @@ search_start(struct menu_q *menuq,
|
|||||||
|
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
/*
|
|
||||||
* XXX - C-s & C-r for next and prev.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (input_keycodetrans(e.xkey.keycode, e.xkey.state,
|
if (input_keycodetrans(e.xkey.keycode, e.xkey.state,
|
||||||
&ctl, &chr, 1) < 0)
|
&ctl, &chr, 1) < 0)
|
||||||
continue;
|
continue;
|
||||||
@ -180,8 +170,6 @@ search_start(struct menu_q *menuq,
|
|||||||
if (mutated && strlen(searchstr) > 0) {
|
if (mutated && strlen(searchstr) > 0) {
|
||||||
(*match)(menuq, &resultq, searchstr);
|
(*match)(menuq, &resultq, searchstr);
|
||||||
beobnoxious = TAILQ_EMPTY(&resultq);
|
beobnoxious = TAILQ_EMPTY(&resultq);
|
||||||
if (!beobnoxious && rank != NULL)
|
|
||||||
(*rank)(&resultq, searchstr);
|
|
||||||
} else if (mutated)
|
} else if (mutated)
|
||||||
TAILQ_INIT(&resultq);
|
TAILQ_INIT(&resultq);
|
||||||
|
|
||||||
@ -194,12 +182,10 @@ search_start(struct menu_q *menuq,
|
|||||||
case Expose:
|
case Expose:
|
||||||
if (list) {
|
if (list) {
|
||||||
if (TAILQ_EMPTY(&resultq) && list) {
|
if (TAILQ_EMPTY(&resultq) && list) {
|
||||||
/* Copy them over and rank them. */
|
/* Copy them all over. */
|
||||||
TAILQ_FOREACH(mi, menuq, entry)
|
TAILQ_FOREACH(mi, menuq, entry)
|
||||||
TAILQ_INSERT_TAIL(&resultq, mi,
|
TAILQ_INSERT_TAIL(&resultq, mi,
|
||||||
resultentry);
|
resultentry);
|
||||||
if (rank != NULL)
|
|
||||||
(*rank)(&resultq, searchstr);
|
|
||||||
|
|
||||||
listing = 1;
|
listing = 1;
|
||||||
} else if (mutated)
|
} else if (mutated)
|
||||||
|
@ -400,7 +400,7 @@ xev_handle_keypress(struct xevent *xev, XEvent *ee)
|
|||||||
if (kb == NULL)
|
if (kb == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if ((kb->flags & (KBFLAG_NEEDCLIENT|KBFLAG_FINDCLIENT)) &&
|
if ((kb->flags & (KBFLAG_NEEDCLIENT)) &&
|
||||||
(cc = client_find(e->window)) == NULL &&
|
(cc = client_find(e->window)) == NULL &&
|
||||||
(cc = client_current()) == NULL)
|
(cc = client_current()) == NULL)
|
||||||
if (kb->flags & KBFLAG_NEEDCLIENT)
|
if (kb->flags & KBFLAG_NEEDCLIENT)
|
||||||
|
Loading…
Reference in New Issue
Block a user