From 4bf6d2df6203092f59019a15c4001ef6e54e712f Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 26 Jun 2008 23:32:33 +0200 Subject: [PATCH] widgets: add documentation support Signed-off-by: Julien Danjou --- build-utils/fake-lua-src.lua | 2 +- widgets/graph.c | 15 ++++++++++++++- widgets/progressbar.c | 9 +++++++++ widgets/taglist.c | 7 +++++++ widgets/tasklist.c | 8 ++++++++ widgets/textbox.c | 8 ++++++++ 6 files changed, 47 insertions(+), 2 deletions(-) diff --git a/build-utils/fake-lua-src.lua b/build-utils/fake-lua-src.lua index fe9a8de93..bb494b670 100755 --- a/build-utils/fake-lua-src.lua +++ b/build-utils/fake-lua-src.lua @@ -61,7 +61,7 @@ end capture = false for i, line in ipairs(ilines) do if not libname then - _, _, libname, libtype = line:find("const struct luaL_reg awesome_(%a+)_(%a+)%[%] =") + _, _, libname, libtype = line:find("const struct luaL_reg awesome_(%a+)_(%a+)%[%] ") -- Special case if not libname then _, _, libname, libtype = line:find("const struct luaL_reg (awesome)_(lib)%[%] =") end else diff --git a/widgets/graph.c b/widgets/graph.c index 7102a441a..bac49de2e 100644 --- a/widgets/graph.c +++ b/widgets/graph.c @@ -285,7 +285,12 @@ graph_draw(draw_context_t *ctx, return w->area.width; } -/** Set various graph general properties. +/** Set various graph general properties: + * width, the widget width; + * height, the widget height; + * bg, the bacground color; + * bordercolor, the border color; + * grow, left or right where to add plot data. * \param L The Lua VM state. * \return The number of elements pushed on stack. * \luastack @@ -556,4 +561,12 @@ graph_new(alignment_t align) return w; } +/* This is used for building documentation. */ +static const struct luaL_reg awesome_graph_meta[] __attribute__ ((unused)) = +{ + { "properties_set", luaA_graph_properties_set }, + { "plot_properties_set", luaA_graph_plot_properties_set }, + { "plot_data_add", luaA_graph_plot_data_add }, +}; + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/widgets/progressbar.c b/widgets/progressbar.c index 83b8e87a3..a57134720 100644 --- a/widgets/progressbar.c +++ b/widgets/progressbar.c @@ -606,4 +606,13 @@ progressbar_new(alignment_t align) return w; } + +/* This is used for building documentation. */ +static const struct luaL_reg awesome_progressbar_meta[] __attribute__ ((unused)) = +{ + { "properties_set", luaA_progressbar_properties_set }, + { "bar_properties_set", luaA_progressbar_bar_properties_set }, + { "bar_data_add", luaA_progressbar_bar_data_add }, +}; + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/widgets/taglist.c b/widgets/taglist.c index 84937e820..c64528fc4 100644 --- a/widgets/taglist.c +++ b/widgets/taglist.c @@ -417,4 +417,11 @@ taglist_new(alignment_t align) return w; } +/* This is used for building documentation. */ +static const struct luaL_reg awesome_taglist_meta[] __attribute__ ((unused)) = +{ + { "text_set", luaA_taglist_text_set }, + { "showempty_set", luaA_taglist_showempty_set } +}; + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/widgets/tasklist.c b/widgets/tasklist.c index 129a4243b..e2142d586 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -436,4 +436,12 @@ tasklist_new(alignment_t align __attribute__ ((unused))) return w; } +/* This is used for building documentation. */ +static const struct luaL_reg awesome_tasklist_meta[] __attribute__ ((unused)) = +{ + { "text_set", luaA_tasklist_text_set }, + { "showicons_set", luaA_tasklist_showicons_set }, + { "show_set", luaA_tasklist_show_set } +}; + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/widgets/textbox.c b/widgets/textbox.c index b6739d845..370ab19d3 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -180,4 +180,12 @@ textbox_new(alignment_t align) return w; } + +/* This is used for building documentation. */ +static const struct luaL_reg awesome_textbox_meta[] __attribute__ ((unused)) = +{ + { "text_set", luaA_textbox_text_set }, + { "width_set", luaA_textbox_width_set } +}; + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80