summaryrefslogtreecommitdiffstats
path: root/include/input_state.h
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-08-22 21:03:45 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-08-22 21:03:45 -0700
commit42d5d9a17779710e83f4ebb2d7e8c893ad91dfe6 (patch)
treea323f619fa2a2254fd642dd5f285019510b28632 /include/input_state.h
parentfloating/tiling move + floating resize cleaned and fixed (diff)
downloadsway-42d5d9a17779710e83f4ebb2d7e8c893ad91dfe6.tar.gz
sway-42d5d9a17779710e83f4ebb2d7e8c893ad91dfe6.tar.zst
sway-42d5d9a17779710e83f4ebb2d7e8c893ad91dfe6.zip
mouse tile resize mode done
Diffstat (limited to 'include/input_state.h')
-rw-r--r--include/input_state.h46
1 files changed, 13 insertions, 33 deletions
diff --git a/include/input_state.h b/include/input_state.h
index 3a246e0c..747a3563 100644
--- a/include/input_state.h
+++ b/include/input_state.h
@@ -37,52 +37,34 @@ enum pointer_mode {
37 M_RESIZING = 1 << 3, 37 M_RESIZING = 1 << 3,
38}; 38};
39 39
40struct pointer_button_state {
41 bool held;
42 // state at the point it was pressed
43 int x, y;
44 swayc_t *view;
45};
46
40extern struct pointer_state { 47extern struct pointer_state {
41 // mouse clicks 48 // mouse clicks
42 bool l_held : 1; 49 struct pointer_button_state left;
43 bool r_held : 1; 50 struct pointer_button_state right;
44 51 struct pointer_button_state scroll;
45 // scroll wheel
46 bool s_held : 1;
47 bool s_up : 1;
48 bool s_down :1;
49 52
50 // pointer position 53 // pointer position
51 struct mouse_origin{ 54 struct mouse_origin{
52 int x, y; 55 int x, y;
53 } origin; 56 } origin;
57
58 // change in pointer position
54 struct { 59 struct {
55 int x, y; 60 int x, y;
56 } delta; 61 } delta;
57 62
58 // view pointer is over 63 // view pointer is currently over
59 swayc_t *view; 64 swayc_t *view;
60 65
61 // Pointer mode 66 // Pointer mode
62 int mode; 67 int mode;
63
64 // OLD
65 struct pointer_floating {
66 bool drag;
67 bool resize;
68 } floating;
69 struct pointer_tiling {
70 bool resize;
71 swayc_t *init_view;
72 struct wlc_origin lock_pos;
73 } tiling;
74 struct pointer_lock {
75 // Lock movement for certain edges
76 bool left;
77 bool right;
78 bool top;
79 bool bottom;
80 // Lock movement in certain directions
81 bool temp_left;
82 bool temp_right;
83 bool temp_up;
84 bool temp_down;
85 } lock;
86} pointer_state; 68} pointer_state;
87 69
88// on button release unset mode depending on the button. 70// on button release unset mode depending on the button.
@@ -95,8 +77,6 @@ void pointer_mode_update(void);
95// Reset mode on any keypress; 77// Reset mode on any keypress;
96void pointer_mode_reset(void); 78void pointer_mode_reset(void);
97 79
98void start_floating(swayc_t *view);
99void reset_floating(swayc_t *view);
100void input_init(void); 80void input_init(void);
101 81
102#endif 82#endif