From 416f88f84f40260d54a60654eeb00b409dc4694c Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 17 Apr 2009 16:15:19 +0200 Subject: [PATCH] widget: move definition into widget.h Signed-off-by: Julien Danjou --- structs.h | 33 --------------------------------- widget.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/structs.h b/structs.h index c03f95651..c1ee62e11 100644 --- a/structs.h +++ b/structs.h @@ -74,8 +74,6 @@ typedef struct client_t client_t; typedef struct client_node client_node_t; typedef struct tag tag_t; typedef struct tag_client_node_t tag_client_node_t; -typedef widget_t *(widget_constructor_t)(widget_t *); -typedef void (widget_destructor_t)(widget_t *); typedef struct awesome_t awesome_t; ARRAY_TYPE(widget_node_t, widget_node) @@ -122,37 +120,6 @@ typedef struct } wibox_t; ARRAY_TYPE(wibox_t *, wibox) -/** Widget */ -struct widget_t -{ - /** Lua references */ - luaA_ref_array_t refs; - /** Widget type is constructor */ - widget_constructor_t *type; - /** Widget destructor */ - widget_destructor_t *destructor; - /** Geometry function */ - area_t (*geometry)(widget_t *, screen_t *, int, int); - /** Draw function */ - void (*draw)(widget_t *, draw_context_t *, area_t, wibox_t *); - /** Index function */ - int (*index)(lua_State *, awesome_token_t); - /** Newindex function */ - int (*newindex)(lua_State *, awesome_token_t); - /** Mouse over event handler */ - luaA_ref mouse_enter, mouse_leave; - /** Alignement */ - alignment_t align; - /** Supported alignment */ - alignment_t align_supported; - /** Misc private data */ - void *data; - /** Button bindings */ - button_array_t buttons; - /** True if the widget is visible */ - bool isvisible; -}; - /* Strut */ typedef struct { diff --git a/widget.h b/widget.h index 555e9b724..2bda01fb2 100644 --- a/widget.h +++ b/widget.h @@ -24,6 +24,40 @@ #include "mouse.h" +typedef widget_t *(widget_constructor_t)(widget_t *); +typedef void (widget_destructor_t)(widget_t *); + +/** Widget */ +struct widget_t +{ + /** Lua references */ + luaA_ref_array_t refs; + /** Widget type is constructor */ + widget_constructor_t *type; + /** Widget destructor */ + widget_destructor_t *destructor; + /** Geometry function */ + area_t (*geometry)(widget_t *, screen_t *, int, int); + /** Draw function */ + void (*draw)(widget_t *, draw_context_t *, area_t, wibox_t *); + /** Index function */ + int (*index)(lua_State *, awesome_token_t); + /** Newindex function */ + int (*newindex)(lua_State *, awesome_token_t); + /** Mouse over event handler */ + luaA_ref mouse_enter, mouse_leave; + /** Alignement */ + alignment_t align; + /** Supported alignment */ + alignment_t align_supported; + /** Misc private data */ + void *data; + /** Button bindings */ + button_array_t buttons; + /** True if the widget is visible */ + bool isvisible; +}; + LUA_OBJECT_FUNCS(widget_t, widget, "widget"); struct widget_node_t