diff options
author | taiyu <taiyu.len@gmail.com> | 2015-08-22 21:03:45 -0700 |
---|---|---|
committer | taiyu <taiyu.len@gmail.com> | 2015-08-22 21:03:45 -0700 |
commit | 42d5d9a17779710e83f4ebb2d7e8c893ad91dfe6 (patch) | |
tree | a323f619fa2a2254fd642dd5f285019510b28632 /include | |
parent | floating/tiling move + floating resize cleaned and fixed (diff) | |
download | sway-42d5d9a17779710e83f4ebb2d7e8c893ad91dfe6.tar.gz sway-42d5d9a17779710e83f4ebb2d7e8c893ad91dfe6.tar.zst sway-42d5d9a17779710e83f4ebb2d7e8c893ad91dfe6.zip |
mouse tile resize mode done
Diffstat (limited to 'include')
-rw-r--r-- | include/input_state.h | 46 | ||||
-rw-r--r-- | include/resize.h | 2 |
2 files changed, 14 insertions, 34 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 | ||
40 | struct pointer_button_state { | ||
41 | bool held; | ||
42 | // state at the point it was pressed | ||
43 | int x, y; | ||
44 | swayc_t *view; | ||
45 | }; | ||
46 | |||
40 | extern struct pointer_state { | 47 | extern 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; |
96 | void pointer_mode_reset(void); | 78 | void pointer_mode_reset(void); |
97 | 79 | ||
98 | void start_floating(swayc_t *view); | ||
99 | void reset_floating(swayc_t *view); | ||
100 | void input_init(void); | 80 | void input_init(void); |
101 | 81 | ||
102 | #endif | 82 | #endif |
diff --git a/include/resize.h b/include/resize.h index 4ace1815..04209983 100644 --- a/include/resize.h +++ b/include/resize.h | |||
@@ -1,8 +1,8 @@ | |||
1 | #ifndef _SWAY_RESIZE_H | 1 | #ifndef _SWAY_RESIZE_H |
2 | #define _SWAY_RESIZE_H | 2 | #define _SWAY_RESIZE_H |
3 | #include <stdbool.h> | ||
3 | 4 | ||
4 | bool mouse_resize_tiled(struct wlc_origin prev_pos); | 5 | bool mouse_resize_tiled(struct wlc_origin prev_pos); |
5 | bool resize_floating(struct wlc_origin prev_pos); | ||
6 | bool resize_tiled(int amount, bool use_width); | 6 | bool resize_tiled(int amount, bool use_width); |
7 | 7 | ||
8 | #endif | 8 | #endif |