autogenerate widget list

This commit is contained in:
Julien Danjou 2008-01-16 08:06:59 +01:00
parent d793526137
commit 5def70a8f0
4 changed files with 30 additions and 13 deletions

3
.gitignore vendored
View File

@ -18,3 +18,6 @@ awesome.doxygen
awesome-client.1
awesome.1
awesomerc.1
awesomerc
uicbgen.h
widgetgen.h

View File

@ -68,6 +68,13 @@ uicbgen.h: $(awesome_SOURCES)
@echo "generating uicbgen.h from headers file"
@$(top_srcdir)/uicbgen.sh > $(top_srcdir)/uicbgen.h
CLEANFILES += widgetgen.h
BUILT_SOURCES += widgetgen.h
EXTRA_DIST += widgetgen.sh
widgetgen.h: widget.h
@echo "generating widgetgen.h from widget.h"
@$(top_srcdir)/widgetgen.sh > $(top_srcdir)/widgetgen.h
if USING_GCC
# If you are using gcc, and want to deactivate this default set of
# compile flags, run make with AWESOME_CFLAGS="".

View File

@ -27,19 +27,7 @@
extern AwesomeConf globalconf;
const name_func_link_t WidgetList[] =
{
{"taglist", taglist_new},
{"layoutinfo", layoutinfo_new},
{"focustitle", focustitle_new},
{"textbox", textbox_new},
{"iconbox", iconbox_new},
{"netwmicon", netwmicon_new},
{"progressbar", progressbar_new},
{"graph", graph_new},
{"tasklist", tasklist_new},
{NULL, NULL}
};
#include "widgetgen.h"
void
widget_calculate_alignments(Widget *widget)

19
widgetgen.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
echo "/* This file is autogenerated by" $(basename $0) "*/"
echo
echo "const name_func_link_t WidgetList[] ="
echo "{"
for file in widget.h
do
echo " /* $file */"
grep '^WidgetConstructor ' widget.h | cut -d' ' -f2 | cut -d\; -f1 | while read widget
do
shortname=$(echo $widget | cut -d_ -f1)
echo " {\"$shortname\", $widget},"
grep -q "^$shortname" awesomerc.1.txt || \
echo " WARNING: $uicb NOT documented" >&2
done
done
echo " {NULL, NULL}"
echo "};"