summary refs log tree commit diff
path: root/calmwm.h
diff options
context:
space:
mode:
authorokan <okan>2014-01-29 21:13:52 +0000
committerokan <okan>2014-01-29 21:13:52 +0000
commitdb0b2fde5cb55a8867d9781dd0acb7c0ef92bcd2 (patch)
treeb55ac41540cdec24b37c5d3c334aff4bbb31a9ce /calmwm.h
parent4438970b649d8c6b0d662576bc37fc577b8de1b6 (diff)
downloadcwm-db0b2fde5cb55a8867d9781dd0acb7c0ef92bcd2.tar.gz
cwm-db0b2fde5cb55a8867d9781dd0acb7c0ef92bcd2.tar.xz
cwm-db0b2fde5cb55a8867d9781dd0acb7c0ef92bcd2.zip
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.
Diffstat (limited to 'calmwm.h')
-rw-r--r--calmwm.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/calmwm.h b/calmwm.h
index 389c269..14ffcf2 100644
--- a/calmwm.h
+++ b/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