aboutsummaryrefslogtreecommitdiff
path: root/src/CurrentWindowCmd.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-07-28 15:06:36 (GMT)
committerrathnor <rathnor>2003-07-28 15:06:36 (GMT)
commitd353b688dec41daddeec9696586a4519f58cce45 (patch)
tree322a29e0e31cb15a7725047c10144c4ab3d5e130 /src/CurrentWindowCmd.cc
parentf9bb208da8e8926281c91f3e386ec1de48f700a2 (diff)
downloadfluxbox-d353b688dec41daddeec9696586a4519f58cce45.zip
fluxbox-d353b688dec41daddeec9696586a4519f58cce45.tar.bz2
update many things to use WinClient instead of FluxboxWindow
Diffstat (limited to 'src/CurrentWindowCmd.cc')
-rw-r--r--src/CurrentWindowCmd.cc36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc
index f4d4af7..b8913bb 100644
--- a/src/CurrentWindowCmd.cc
+++ b/src/CurrentWindowCmd.cc
@@ -20,58 +20,68 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: CurrentWindowCmd.cc,v 1.2 2003/07/26 13:44:00 rathnor Exp $ 23// $Id: CurrentWindowCmd.cc,v 1.3 2003/07/28 15:06:33 rathnor Exp $
24 24
25#include "CurrentWindowCmd.hh" 25#include "CurrentWindowCmd.hh"
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28#include "Window.hh" 28#include "Window.hh"
29#include "Screen.hh" 29#include "Screen.hh"
30#include "WinClient.hh"
30 31
31CurrentWindowCmd::CurrentWindowCmd(Action act):m_action(act) { } 32CurrentWindowCmd::CurrentWindowCmd(Action act):m_action(act) { }
32 33
33void CurrentWindowCmd::execute() { 34void CurrentWindowCmd::execute() {
34 Fluxbox *fb = Fluxbox::instance(); 35 WinClient *client = Fluxbox::instance()->getFocusedWindow();
35 if (fb->getFocusedWindow() != 0) 36 if (client && client->fbwindow())
36 (*fb->getFocusedWindow().*m_action)(); 37 (client->fbwindow()->*m_action)();
37} 38}
38 39
39 40
40void KillWindowCmd::real_execute() { 41void KillWindowCmd::real_execute() {
41 XKillClient(FbTk::App::instance()->display(), window().clientWindow()); 42 winclient().sendClose(true);
42} 43}
43 44
44void SendToWorkspaceCmd::real_execute() { 45void SendToWorkspaceCmd::real_execute() {
45 if (m_workspace_num >= 0 && m_workspace_num < window().screen().getNumberOfWorkspaces()) 46 if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces())
46 window().screen().sendToWorkspace(m_workspace_num, &window()); 47 fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow());
47} 48}
48 49
49void WindowHelperCmd::execute() { 50void WindowHelperCmd::execute() {
50 if (Fluxbox::instance()->getFocusedWindow()) 51 WinClient *client = Fluxbox::instance()->getFocusedWindow();
52 if (client && client->fbwindow()) // guarantee that fbwindow() exists too
51 real_execute(); 53 real_execute();
52} 54}
53 55
54FluxboxWindow &WindowHelperCmd::window() { 56WinClient &WindowHelperCmd::winclient() {
57 // will exist from execute above
55 return *Fluxbox::instance()->getFocusedWindow(); 58 return *Fluxbox::instance()->getFocusedWindow();
56} 59}
57 60
61FluxboxWindow &WindowHelperCmd::fbwindow() {
62 // will exist from execute above
63 return *Fluxbox::instance()->getFocusedWindow()->fbwindow();
64}
65
58MoveLeftCmd::MoveLeftCmd(int step_size):MoveHelper(step_size) { } 66MoveLeftCmd::MoveLeftCmd(int step_size):MoveHelper(step_size) { }
59void MoveLeftCmd::real_execute() { 67void MoveLeftCmd::real_execute() {
60 window().move(window().x() - stepSize(), window().y()); 68 fbwindow().move(fbwindow().x() - stepSize(),
69 fbwindow().y());
61} 70}
62 71
63MoveRightCmd::MoveRightCmd(int step_size):MoveHelper(step_size) { } 72MoveRightCmd::MoveRightCmd(int step_size):MoveHelper(step_size) { }
64void MoveRightCmd::real_execute() { 73void MoveRightCmd::real_execute() {
65 window().move(window().x() + stepSize(), window().y()); 74 fbwindow().move(fbwindow().x() + stepSize(),
75 fbwindow().y());
66} 76}
67 77
68MoveDownCmd::MoveDownCmd(int step_size):MoveHelper(step_size) { } 78MoveDownCmd::MoveDownCmd(int step_size):MoveHelper(step_size) { }
69void MoveDownCmd::real_execute() { 79void MoveDownCmd::real_execute() {
70 window().move(window().x(), window().y() + stepSize()); 80 fbwindow().move(fbwindow().x(), fbwindow().y() + stepSize());
71} 81}
72 82
73MoveUpCmd::MoveUpCmd(int step_size):MoveHelper(step_size) { } 83MoveUpCmd::MoveUpCmd(int step_size):MoveHelper(step_size) { }
74void MoveUpCmd::real_execute() { 84void MoveUpCmd::real_execute() {
75 window().move(window().x(), window().y() - stepSize()); 85 fbwindow().move(fbwindow().x(), fbwindow().y() - stepSize());
76} 86}
77 87