From f97feb3ccf6b2eed9c7dcc0960b4872dbdaa1521 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 29 Jan 2014 21:13:52 +0000 Subject: Merge keybinding and mousebinding queues into using the same merged struct, binding; they were essentially the same accept for what was 'pressed', keysym or button. --- calmwm.h | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'calmwm.h') diff --git a/calmwm.h b/calmwm.h index 930fc12..11c4a02 100644 --- a/calmwm.h +++ b/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.249 2014/01/29 18:34:22 okan Exp $ + * $OpenBSD: calmwm.h,v 1.250 2014/01/29 21:13:52 okan Exp $ */ #ifndef _CALMWM_H_ @@ -94,6 +94,11 @@ union arg { int i; }; +union press { + KeySym keysym; + unsigned int button; +}; + enum cursor_font { CF_DEFAULT, CF_MOVE, @@ -247,26 +252,17 @@ struct screen_ctx { }; TAILQ_HEAD(screen_ctx_q, screen_ctx); -struct keybinding { - TAILQ_ENTRY(keybinding) entry; +struct binding { + TAILQ_ENTRY(binding) entry; void (*callback)(struct client_ctx *, union arg *); union arg argument; unsigned int modmask; - KeySym keysym; + union press press; int flags; int argtype; }; -TAILQ_HEAD(keybinding_q, keybinding); - -struct mousebinding { - TAILQ_ENTRY(mousebinding) entry; - void (*callback)(struct client_ctx *, union arg *); - union arg argument; - unsigned int modmask; - unsigned int button; - int flags; -}; -TAILQ_HEAD(mousebinding_q, mousebinding); +TAILQ_HEAD(keybinding_q, binding); +TAILQ_HEAD(mousebinding_q, binding); struct cmd { TAILQ_ENTRY(cmd) entry; @@ -290,10 +286,10 @@ TAILQ_HEAD(menu_q, menu); struct conf { struct keybinding_q keybindingq; + struct mousebinding_q mousebindingq; struct autogroupwin_q autogroupq; struct winmatch_q ignoreq; struct cmd_q cmdq; - struct mousebinding_q mousebindingq; #define CONF_STICKY_GROUPS 0x0001 int flags; #define CONF_BWIDTH 1 -- cgit v1.2.3-2-gb3c3