diff --git a/screen.h b/screen.h index 9ab26d82..ebd7a3f2 100644 --- a/screen.h +++ b/screen.h @@ -23,6 +23,7 @@ #define AWESOME_SCREEN_H #include "structs.h" +#include "wibox.h" struct a_screen { diff --git a/structs.h b/structs.h index c1ee62e1..7f410254 100644 --- a/structs.h +++ b/structs.h @@ -59,13 +59,7 @@ typedef enum WINDOW_TYPE_DND } window_type_t; -/** Wibox types */ -typedef enum -{ - WIBOX_TYPE_NORMAL = 0, - WIBOX_TYPE_TITLEBAR -} wibox_type_t; - +typedef struct wibox_t wibox_t; typedef struct a_screen screen_t; typedef struct button_t button_t; typedef struct widget_t widget_t; @@ -81,45 +75,6 @@ ARRAY_TYPE(button_t *, button) ARRAY_TYPE(tag_t *, tag) ARRAY_TYPE(screen_t, screen) -/** Wibox type */ -typedef struct -{ - /** Lua references */ - luaA_ref_array_t refs; - /** Ontop */ - bool ontop; - /** Visible */ - bool isvisible; - /** Position */ - position_t position; - /** Wibox type */ - wibox_type_t type; - /** Window */ - simple_window_t sw; - /** Alignment */ - alignment_t align; - /** Screen */ - screen_t *screen; - /** Widget list */ - widget_node_array_t widgets; - luaA_ref widgets_table; - /** Widget the mouse is over */ - widget_t *mouse_over; - /** Mouse over event handler */ - luaA_ref mouse_enter, mouse_leave; - /** Need update */ - bool need_update; - /** Cursor */ - char *cursor; - /** Background image */ - image_t *bg_image; - /* Banned? used for titlebars */ - bool isbanned; - /** Button bindings */ - button_array_t buttons; -} wibox_t; -ARRAY_TYPE(wibox_t *, wibox) - /* Strut */ typedef struct { diff --git a/wibox.h b/wibox.h index 6dc1b407..50cf3bbc 100644 --- a/wibox.h +++ b/wibox.h @@ -25,6 +25,55 @@ #include "widget.h" #include "swindow.h" +/** Wibox types */ +typedef enum +{ + WIBOX_TYPE_NORMAL = 0, + WIBOX_TYPE_TITLEBAR +} wibox_type_t; + +/** Wibox type */ +struct wibox_t +{ + /** Lua references */ + luaA_ref_array_t refs; + /** Ontop */ + bool ontop; + /** Visible */ + bool isvisible; + /** Position */ + position_t position; + /** Wibox type */ + wibox_type_t type; + /** Window */ + simple_window_t sw; + /** Alignment */ + alignment_t align; + /** Screen */ + screen_t *screen; + /** Widget list */ + widget_node_array_t widgets; + luaA_ref widgets_table; + /** Widget the mouse is over */ + widget_t *mouse_over; + /** Mouse over event handler */ + luaA_ref mouse_enter, mouse_leave; + /** Need update */ + bool need_update; + /** Cursor */ + char *cursor; + /** Background image */ + image_t *bg_image; + /* Banned? used for titlebars */ + bool isbanned; + /** Button bindings */ + button_array_t buttons; +}; + +void wibox_unref_simplified(wibox_t **); + +DO_ARRAY(wibox_t *, wibox, wibox_unref_simplified) + void wibox_refresh(void); void wibox_update_positions(void); @@ -34,8 +83,6 @@ void wibox_position_update(wibox_t *); wibox_t * wibox_getbywin(xcb_window_t); void wibox_detach(wibox_t *); -void wibox_unref_simplified(wibox_t **); - static inline void wibox_moveresize(wibox_t *wibox, area_t geometry) { @@ -55,7 +102,6 @@ wibox_moveresize(wibox_t *wibox, area_t geometry) } LUA_OBJECT_FUNCS(wibox_t, wibox, "wibox") -ARRAY_FUNCS(wibox_t *, wibox, wibox_unref_simplified) #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80