diff options
Diffstat (limited to 'src/Window.hh')
-rw-r--r-- | src/Window.hh | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/Window.hh b/src/Window.hh index d533dfc..9780ef2 100644 --- a/src/Window.hh +++ b/src/Window.hh | |||
@@ -126,19 +126,19 @@ public: | |||
126 | }; | 126 | }; |
127 | 127 | ||
128 | /** | 128 | /** |
129 | * Resize direction while resizing | 129 | * Reference corner for moves and resizes |
130 | */ | 130 | */ |
131 | enum ResizeDirection { | 131 | enum ReferenceCorner { |
132 | NOCORNER = -1, | 132 | ERROR = -1, |
133 | LEFTTOP = 0, | 133 | LEFTTOP = 0, |
134 | TOP = 1, | 134 | TOP = 1, |
135 | RIGHTTOP = 2, | 135 | RIGHTTOP = 2, |
136 | RIGHT = 3, | 136 | RIGHT = 3, |
137 | RIGHTBOTTOM = 4, | 137 | RIGHTBOTTOM = 4, |
138 | BOTTOM = 5, | 138 | BOTTOM = 5, |
139 | LEFTBOTTOM = 6, | 139 | LEFTBOTTOM = 6, |
140 | LEFT = 7, | 140 | LEFT = 7, |
141 | ALLCORNERS = 8 | 141 | CENTER = 8 |
142 | }; | 142 | }; |
143 | 143 | ||
144 | /// holds old blackbox attributes | 144 | /// holds old blackbox attributes |
@@ -371,14 +371,19 @@ public: | |||
371 | * @param y start position | 371 | * @param y start position |
372 | * @param dir the resize direction | 372 | * @param dir the resize direction |
373 | */ | 373 | */ |
374 | void startResizing(int x, int y, ResizeDirection dir); | 374 | void startResizing(int x, int y, ReferenceCorner dir); |
375 | /// determine which edge or corner to resize | 375 | /// determine which edge or corner to resize |
376 | ResizeDirection getResizeDirection(int x, int y, ResizeModel model) const; | 376 | ReferenceCorner getResizeDirection(int x, int y, ResizeModel model) const; |
377 | /// stops the resizing | 377 | /// stops the resizing |
378 | void stopResizing(bool interrupted = false); | 378 | void stopResizing(bool interrupted = false); |
379 | /// starts tabbing | 379 | /// starts tabbing |
380 | void startTabbing(const XButtonEvent &be); | 380 | void startTabbing(const XButtonEvent &be); |
381 | 381 | ||
382 | /// determine the reference corner from a string | ||
383 | static ReferenceCorner getCorner(std::string str); | ||
384 | /// convert to coordinates on the root window | ||
385 | void translateCoords(int &x, int &y, ReferenceCorner dir = LEFTTOP) const; | ||
386 | |||
382 | /** | 387 | /** |
383 | @name accessors | 388 | @name accessors |
384 | */ | 389 | */ |
@@ -624,7 +629,7 @@ private: | |||
624 | 629 | ||
625 | FbTk::FbWindow &m_parent; ///< window on which we draw move/resize rectangle (the "root window") | 630 | FbTk::FbWindow &m_parent; ///< window on which we draw move/resize rectangle (the "root window") |
626 | 631 | ||
627 | ResizeDirection m_resize_corner; //< the current resize corner used while resizing | 632 | ReferenceCorner m_resize_corner; //< the current corner used while resizing |
628 | 633 | ||
629 | static int s_num_grabs; ///< number of XGrabPointer's | 634 | static int s_num_grabs; ///< number of XGrabPointer's |
630 | }; | 635 | }; |