Makefile cleanup and other general cleanup.

This commit is contained in:
Kris Maglione 2009-09-17 09:27:11 -04:00
parent 355136a1ca
commit 4af4c3825f
11 changed files with 34 additions and 27 deletions

View File

@ -140,7 +140,7 @@ def clickmenu(choices, args):
class Notice(Button):
def __init__(self):
super(Notice, self).__init__(*noticebar)
super(Notice, self).__init__(*noticebar, colors=wmii['normcolors'])
self.timer = None
def tick(self):

View File

@ -23,7 +23,7 @@ FILTER = sed "s|CONFPREFIX|$(ETC)|g; \
s|AWKPATH|$(AWKPATH)|g"
LDFLAGS += -lfmt -lutf
CFLAGS += $(INCX11) -DVERSION=\"$(VERSION)\"
CFLAGS += $(INCX11)
include $(ROOT)/mk/many.mk
include $(ROOT)/mk/dir.mk

View File

@ -16,7 +16,7 @@ PACKAGES += $(X11PACKAGES) xext xrandr xrender xinerama
LIB = $(LIBIXP)
LDFLAGS += -lm -lregexp9 -lbio -lfmt -lutf
CFLAGS += -DVERSION=\"$(VERSION)\" -DIXP_NEEDAPI=86
CFLAGS += -DIXP_NEEDAPI=86
OBJ = main \
caret \
history \

View File

@ -21,6 +21,7 @@ void debug(int, const char*, ...);
Item* filter_list(Item*, char*);
void init_screens(int);
void update_filter(bool);
void update_input(void);
/* menu.c */
void menu_draw(void);

View File

@ -14,7 +14,7 @@
#include "fns.h"
#define link _link
static const char version[] = "wimenu-"VERSION", ©2009 Kris Maglione\n";
static const char version[] = "wimenu-"VERSION", "COPYRIGHT"\n";
static Biobuf* cmplbuf;
static Biobuf* inbuf;
static bool alwaysprint;
@ -140,6 +140,15 @@ filter_list(Item *i, char *filter) {
return exact.next;
}
void
update_input(void) {
if(alwaysprint) {
write(1, input.string, input.pos - input.string);
write(1, "", 1);
write(1, input.pos, input.end - input.pos + 1);
}
}
void
update_filter(bool print) {
char *filter;
@ -150,11 +159,8 @@ update_filter(bool print) {
matchidx = nil;
matchfirst = matchstart = filter_list(items, filter);
if(alwaysprint && print) {
write(1, input.string, input.pos - input.string);
write(1, "", 1);
write(1, input.pos, input.end - input.pos + 1);
}
if(print)
update_input();
}
/*
@ -264,6 +270,9 @@ main(int argc, char *argv[]) {
case 's':
screen = strtol(EARGF(usage()), nil, 10);
break;
case 'v':
print("%s", version);
return 0;
default:
usage();
}ARGEND;

View File

@ -95,6 +95,7 @@ next:
case BACKWARD:
case FORWARD:
caret_move(op, motion);
update_input();
break;
case CMPL_NEXT:
selectitem(matchidx ? matchidx->next : matchfirst);
@ -298,19 +299,14 @@ kdown_event(Window *w, XKeyEvent *e) {
menu_cmd(BACKWARD, amount);
break;
case LCOMPLETE:
amount = CMPL_NEXT;
if(have(LNEXT))
amount = CMPL_NEXT;
else if(have(LPREV))
amount = CMPL_PREV;
else if(have(LNEXTPAGE))
amount = CMPL_NEXT_PAGE;
else if(have(LPREVPAGE))
amount = CMPL_PREV_PAGE;
else if(have(LFIRST))
amount = CMPL_FIRST;
else if(have(LLAST))
amount = CMPL_LAST;
amount = (
have(LNEXT) ? CMPL_NEXT :
have(LPREV) ? CMPL_PREV :
have(LNEXTPAGE) ? CMPL_NEXT_PAGE :
have(LPREVPAGE) ? CMPL_PREV_PAGE :
have(LFIRST) ? CMPL_FIRST :
have(LLAST) ? CMPL_LAST :
CMPL_NEXT);
menu_cmd(amount, 0);
break;
case LFORWARD:

View File

@ -12,8 +12,7 @@ PACKAGES += $(X11PACKAGES) xext xrandr xrender xinerama
LIB = $(LIBIXP)
LDFLAGS += -lm $(LIBICONV) -lregexp9 -lbio -lfmt -lutf
CFLAGS += $(INCICONV) -DVERSION=\"$(VERSION)\" \
-DIXP_NEEDAPI=97
CFLAGS += $(INCICONV) -DIXP_NEEDAPI=97
OBJ = area \
bar \
client \

View File

@ -16,7 +16,7 @@
#include "fns.h"
static const char
version[] = "wmii-"VERSION", ©2009 Kris Maglione\n";
version[] = "wmii-"VERSION", "COPYRIGHT"\n";
static char* address;
static char* ns_path;

View File

@ -384,7 +384,7 @@ main(int argc, char *argv[]) {
ARGBEGIN{
case 'v':
print("%s-" VERSION ", ©2009 Kris Maglione\n", argv0);
print("%s-" VERSION ", " COPYRIGHT "\n", argv0);
exit(0);
case 'a':
address = EARGF(usage());

View File

@ -4,4 +4,6 @@ VERSION = $(VERS)
VERSION := $(shell echo $(VERS))
VERSION != echo $(VERS)
CONFVERSION = -hg
COPYRIGHT = ©2009 Kris Maglione
CFLAGS += '-DVERSION=\"$(VERSION)\"' '-DCOPYRIGHT=\"$(COPYRIGHT)\"'

View File

@ -9,7 +9,7 @@ xtmp=/tmp/cc.$$.$USER.out
echo CC $($bin/cleanname ${BASE}$outfile)
[ -n "$noisycc" ] && echo $CC -o $outfile $CFLAGS $@
$CC -o $outfile $CFLAGS $@ >$xtmp 2>&1
eval '$CC -o $outfile '"$CFLAGS"' $@ >$xtmp 2>&1'
status=$?
[ $? -eq 0 ] || echo $CC -o $outfile $CFLAGS $@ >&2