diff options
-rw-r--r-- | src/Window.hh | 86 |
1 files changed, 79 insertions, 7 deletions
diff --git a/src/Window.hh b/src/Window.hh index a7acabf..cecb33b 100644 --- a/src/Window.hh +++ b/src/Window.hh | |||
@@ -183,33 +183,92 @@ public: | |||
183 | bool removeClient(WinClient &client); | 183 | bool removeClient(WinClient &client); |
184 | /// set new current client and raise it | 184 | /// set new current client and raise it |
185 | bool setCurrentClient(WinClient &client, bool setinput = true); | 185 | bool setCurrentClient(WinClient &client, bool setinput = true); |
186 | /** | ||
187 | * Sets the label associated with the client to focused | ||
188 | * @param client the client associated with the label | ||
189 | * @param value the focus state | ||
190 | */ | ||
186 | void setLabelButtonFocus(WinClient &client, bool value = true); | 191 | void setLabelButtonFocus(WinClient &client, bool value = true); |
192 | /** | ||
193 | * Sets the attention state ("flashing") | ||
194 | * @see AttentionNoticeHandler | ||
195 | * @param value the new state value | ||
196 | */ | ||
187 | void setAttentionState(bool value); | 197 | void setAttentionState(bool value); |
198 | /** | ||
199 | * Gets the attention state | ||
200 | * @return current attiontion state | ||
201 | */ | ||
188 | bool getAttentionState() { return m_attention_state; } | 202 | bool getAttentionState() { return m_attention_state; } |
203 | /** | ||
204 | * Searches for a client | ||
205 | * @param win the client X window | ||
206 | * @return pointer to client matching the window or NULL | ||
207 | */ | ||
189 | WinClient *findClient(Window win); | 208 | WinClient *findClient(Window win); |
209 | /// select next client | ||
190 | void nextClient(); | 210 | void nextClient(); |
211 | /// select previous client | ||
191 | void prevClient(); | 212 | void prevClient(); |
213 | /// move the current client to the left | ||
192 | void moveClientLeft(); | 214 | void moveClientLeft(); |
215 | /// move the current client to the right | ||
193 | void moveClientRight(); | 216 | void moveClientRight(); |
217 | /** | ||
218 | * Move a client to the right of dest. | ||
219 | * @param win the client to move | ||
220 | * @param dest the left-of-client | ||
221 | */ | ||
194 | void moveClientRightOf(WinClient &win, WinClient &dest); | 222 | void moveClientRightOf(WinClient &win, WinClient &dest); |
223 | /** | ||
224 | * Move a client to the right of dest. | ||
225 | * @param win the client to move | ||
226 | * @param dest the left-of-client | ||
227 | */ | ||
195 | void moveClientLeftOf(WinClient &win, WinClient &dest); | 228 | void moveClientLeftOf(WinClient &win, WinClient &dest); |
229 | /** | ||
230 | * Move client to place specified by pixel position | ||
231 | * @param win the client to move | ||
232 | * @param x position | ||
233 | * @param y position | ||
234 | */ | ||
196 | void moveClientTo(WinClient &win, int x, int y); | 235 | void moveClientTo(WinClient &win, int x, int y); |
236 | /** | ||
237 | * Calculates insertition position in the list by | ||
238 | * using pixel position x and y. | ||
239 | * @param x position | ||
240 | * @param y position | ||
241 | * @return iterator position for insertion | ||
242 | */ | ||
197 | ClientList::iterator getClientInsertPosition(int x, int y); | 243 | ClientList::iterator getClientInsertPosition(int x, int y); |
198 | 244 | /** | |
245 | * Take focus. | ||
246 | * @see Focusable | ||
247 | * @return true if it took focus. | ||
248 | */ | ||
199 | bool focus(); | 249 | bool focus(); |
250 | |||
251 | /// Raises the window and takes focus (if possible). | ||
200 | void raiseAndFocus() { raise(); focus(); } | 252 | void raiseAndFocus() { raise(); focus(); } |
253 | /// sets the internal focus flag | ||
201 | void setFocusFlag(bool flag); | 254 | void setFocusFlag(bool flag); |
202 | // map this window | 255 | /// make this window visible |
203 | void show(); | 256 | void show(); |
204 | // unmap this window | 257 | /// hide window |
205 | void hide(bool interrupt_moving = true); | 258 | void hide(bool interrupt_moving = true); |
259 | /// iconify window | ||
206 | void iconify(); | 260 | void iconify(); |
261 | /** | ||
262 | * Deiconify window | ||
263 | * @param reassoc reassociate the window to the current workspace | ||
264 | * @param do_raise raise the window when its been deiconfied | ||
265 | */ | ||
207 | void deiconify(bool reassoc = true, bool do_raise = true); | 266 | void deiconify(bool reassoc = true, bool do_raise = true); |
208 | 267 | ||
209 | // ------------------ | 268 | // ------------------ |
210 | // Per window transparency addons | 269 | // Per window transparency addons |
211 | unsigned char getFocusedAlpha() const { return frame().getAlpha(true); } | 270 | unsigned char getFocusedAlpha() const { return frame().getAlpha(true); } |
212 | unsigned char getUnfocusedAlpha() const { return frame().getAlpha(false); } | 271 | unsigned char getUnfocusedAlpha() const { return frame().getAlpha(false); } |
213 | void setFocusedAlpha(unsigned char alpha) { frame().setAlpha(true, alpha); } | 272 | void setFocusedAlpha(unsigned char alpha) { frame().setAlpha(true, alpha); } |
214 | void setUnfocusedAlpha(unsigned char alpha) { frame().setAlpha(false, alpha); } | 273 | void setUnfocusedAlpha(unsigned char alpha) { frame().setAlpha(false, alpha); } |
215 | void updateAlpha(bool focused, unsigned char alpha) { frame().setAlpha(focused, alpha); } | 274 | void updateAlpha(bool focused, unsigned char alpha) { frame().setAlpha(focused, alpha); } |
@@ -249,8 +308,11 @@ public: | |||
249 | void tempRaise(); | 308 | void tempRaise(); |
250 | void raiseLayer(); | 309 | void raiseLayer(); |
251 | void lowerLayer(); | 310 | void lowerLayer(); |
311 | /// moves the window to a new layer | ||
252 | void moveToLayer(int layernum, bool force = false); | 312 | void moveToLayer(int layernum, bool force = false); |
313 | /// sets the window focus hidden state | ||
253 | void setFocusHidden(bool value); | 314 | void setFocusHidden(bool value); |
315 | /// sets the window icon hidden state | ||
254 | void setIconHidden(bool value); | 316 | void setIconHidden(bool value); |
255 | void reconfigure(); | 317 | void reconfigure(); |
256 | 318 | ||
@@ -266,11 +328,21 @@ public: | |||
266 | void moveResize(int x, int y, unsigned int width, unsigned int height, bool send_event = false); | 328 | void moveResize(int x, int y, unsigned int width, unsigned int height, bool send_event = false); |
267 | /// move to pos x,y and resize client window to size width, height | 329 | /// move to pos x,y and resize client window to size width, height |
268 | void moveResizeForClient(int x, int y, unsigned int width, unsigned int height, int gravity = ForgetGravity, unsigned int client_bw = 0); | 330 | void moveResizeForClient(int x, int y, unsigned int width, unsigned int height, int gravity = ForgetGravity, unsigned int client_bw = 0); |
331 | /** | ||
332 | * Determines maximum size using all clients that this window can have. | ||
333 | * @param width will be filled in with maximum width | ||
334 | * @param height will be filled in with maximum height | ||
335 | */ | ||
269 | void maxSize(unsigned int &width, unsigned int &height); | 336 | void maxSize(unsigned int &width, unsigned int &height); |
270 | void setWorkspace(int n); | 337 | void setWorkspace(int n); |
271 | void changeBlackboxHints(const BlackboxHints &bh); | 338 | void changeBlackboxHints(const BlackboxHints &bh); |
272 | void updateFunctions(); | 339 | void updateFunctions(); |
273 | void restoreAttributes(); | 340 | void restoreAttributes(); |
341 | /** | ||
342 | * Show window meny at at given position | ||
343 | * @param mx position | ||
344 | * @param my position | ||
345 | */ | ||
274 | void showMenu(int mx, int my); | 346 | void showMenu(int mx, int my); |
275 | // popup menu on last button press position | 347 | // popup menu on last button press position |
276 | void popupMenu(); | 348 | void popupMenu(); |
@@ -553,14 +625,14 @@ private: | |||
553 | unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state | 625 | unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state |
554 | int m_last_button_x, ///< last known x position of the mouse button | 626 | int m_last_button_x, ///< last known x position of the mouse button |
555 | m_last_button_y; ///< last known y position of the mouse button | 627 | m_last_button_y; ///< last known y position of the mouse button |
556 | FbWinFrame m_frame; | 628 | FbWinFrame m_frame; ///< the actuall window frame |
557 | 629 | ||
558 | int m_layernum; | 630 | int m_layernum; |
559 | int m_old_layernum; | 631 | int m_old_layernum; |
560 | 632 | ||
561 | FbTk::FbWindow &m_parent; ///< window on which we draw move/resize rectangle (the "root window") | 633 | FbTk::FbWindow &m_parent; ///< window on which we draw move/resize rectangle (the "root window") |
562 | 634 | ||
563 | ResizeDirection m_resize_corner; | 635 | ResizeDirection m_resize_corner; //< the current resize corner used while resizing |
564 | 636 | ||
565 | static int s_num_grabs; ///< number of XGrabPointer's | 637 | static int s_num_grabs; ///< number of XGrabPointer's |
566 | }; | 638 | }; |