From 1e89515d97be3b3a9c5f95e44d5a420e307786d3 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 24 Oct 2008 20:38:29 +0200 Subject: [PATCH] mouse: move declaration from structs to mouse header Signed-off-by: Julien Danjou --- client.h | 1 + mouse.h | 20 ++++++++++++++++++++ structs.h | 21 +-------------------- widget.h | 2 +- window.c | 1 + 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/client.h b/client.h index cb18b1fd..d259f046 100644 --- a/client.h +++ b/client.h @@ -25,6 +25,7 @@ #include #include "structs.h" +#include "mouse.h" #include "stack.h" static void diff --git a/mouse.h b/mouse.h index 0954e778..45f3b1c0 100644 --- a/mouse.h +++ b/mouse.h @@ -24,6 +24,26 @@ #include "structs.h" +/** Mouse buttons bindings */ +struct button_t +{ + /** Ref count */ + int refcount; + /** Key modifiers */ + unsigned long mod; + /** Mouse button number */ + unsigned int button; + /** Lua function to execute on press. */ + luaA_ref press; + /** Lua function to execute on release. */ + luaA_ref release; +}; + +void button_delete(button_t **); + +DO_RCNT(button_t, button, button_delete) +ARRAY_FUNCS(button_t *, button, button_unref) + int luaA_client_mouse_resize(lua_State *); int luaA_client_mouse_move(lua_State *); diff --git a/structs.h b/structs.h index a7e0b823..c489c924 100644 --- a/structs.h +++ b/structs.h @@ -71,6 +71,7 @@ typedef void (widget_destructor_t)(widget_t *); typedef struct awesome_t awesome_t; ARRAY_TYPE(widget_node_t, widget_node) +ARRAY_TYPE(button_t *, button) /** Wibox type */ typedef struct @@ -101,26 +102,6 @@ typedef struct } wibox_t; ARRAY_TYPE(wibox_t *, wibox) -/** Mouse buttons bindings */ -struct button_t -{ - /** Ref count */ - int refcount; - /** Key modifiers */ - unsigned long mod; - /** Mouse button number */ - unsigned int button; - /** Lua function to execute on press. */ - luaA_ref press; - /** Lua function to execute on release. */ - luaA_ref release; -}; - -void button_delete(button_t **button); - -DO_RCNT(button_t, button, button_delete) -DO_ARRAY(button_t *, button, button_unref) - /** Widget */ struct widget_t { diff --git a/widget.h b/widget.h index 78430c2d..746b7587 100644 --- a/widget.h +++ b/widget.h @@ -22,7 +22,7 @@ #ifndef AWESOME_WIDGET_H #define AWESOME_WIDGET_H -#include "structs.h" +#include "mouse.h" #define WIDGET_CACHE_EMBEDDED (1<<3) diff --git a/window.c b/window.c index f091e618..0e055982 100644 --- a/window.c +++ b/window.c @@ -23,6 +23,7 @@ #include #include "window.h" +#include "mouse.h" #include "common/atoms.h" extern awesome_t globalconf; -- 2.11.4.GIT