widget: remove common_new()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-12 14:41:26 +01:00
parent e7abdd5cc0
commit f556c04868
7 changed files with 2 additions and 15 deletions

View File

@ -261,15 +261,6 @@ widget_render(widget_node_array_t *widgets, draw_context_t *ctx, xcb_gcontext_t
} }
} }
/** Common function for creating a widget.
* \param widget The allocated widget.
*/
void
widget_common_new(widget_t *widget)
{
widget->align_supported = AlignLeft | AlignRight;
}
/** Invalidate widgets which should be refresh depending on their types. /** Invalidate widgets which should be refresh depending on their types.
* \param screen Virtual screen number. * \param screen Virtual screen number.
* \param type Widget type to invalidate. * \param type Widget type to invalidate.
@ -354,6 +345,8 @@ luaA_widget_new(lua_State *L)
w->type = wc; w->type = wc;
w->align_supported |= AlignLeft | AlignRight;
/* Set visible by default. */ /* Set visible by default. */
w->isvisible = true; w->isvisible = true;

View File

@ -37,7 +37,6 @@ void widget_delete(widget_t **);
DO_RCNT(widget_t, widget, widget_delete) DO_RCNT(widget_t, widget, widget_delete)
int widget_calculate_offset(int, int, int, int); int widget_calculate_offset(int, int, int, int);
void widget_common_new(widget_t *);
void widget_render(widget_node_array_t *, draw_context_t *, xcb_gcontext_t, xcb_drawable_t, int, orientation_t, int, int, wibox_t *); void widget_render(widget_node_array_t *, draw_context_t *, xcb_gcontext_t, xcb_drawable_t, int, orientation_t, int, int, wibox_t *);
int luaA_widget_userdata_new(lua_State *, widget_t *); int luaA_widget_userdata_new(lua_State *, widget_t *);

View File

@ -588,7 +588,6 @@ graph_new(alignment_t align)
graph_data_t *d; graph_data_t *d;
w = p_new(widget_t, 1); w = p_new(widget_t, 1);
widget_common_new(w);
w->draw = graph_draw; w->draw = graph_draw;
w->index = luaA_graph_index; w->index = luaA_graph_index;

View File

@ -218,7 +218,6 @@ imagebox_new(alignment_t align)
{ {
widget_t *w = p_new(widget_t, 1); widget_t *w = p_new(widget_t, 1);
imagebox_data_t *d; imagebox_data_t *d;
widget_common_new(w);
w->align = align; w->align = align;
w->draw = imagebox_draw; w->draw = imagebox_draw;
w->index = luaA_imagebox_index; w->index = luaA_imagebox_index;

View File

@ -646,7 +646,6 @@ progressbar_new(alignment_t align)
progressbar_data_t *d; progressbar_data_t *d;
w = p_new(widget_t, 1); w = p_new(widget_t, 1);
widget_common_new(w);
w->align = align; w->align = align;
w->draw = progressbar_draw; w->draw = progressbar_draw;
w->index = luaA_progressbar_index; w->index = luaA_progressbar_index;

View File

@ -80,7 +80,6 @@ systray_new(alignment_t align)
widget_t *w; widget_t *w;
w = p_new(widget_t, 1); w = p_new(widget_t, 1);
widget_common_new(w);
w->align = align; w->align = align;
w->draw = systray_draw; w->draw = systray_draw;
w->geometry = systray_geometry; w->geometry = systray_geometry;

View File

@ -241,7 +241,6 @@ textbox_new(alignment_t align)
textbox_data_t *d; textbox_data_t *d;
w = p_new(widget_t, 1); w = p_new(widget_t, 1);
widget_common_new(w);
w->align = align; w->align = align;
w->align_supported |= AlignFlex; w->align_supported |= AlignFlex;
w->draw = textbox_draw; w->draw = textbox_draw;