not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kwin / kwinbindings.cpp
blobecf296f87d8a70fd0620b0e18a27a6545c6fb830
1 /********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
5 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
6 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *********************************************************************/
22 // This file is #included from within:
23 // Workspace::initShortcuts()
24 // {
26 // Some shortcuts have Tarzan-speech like names, they need extra
27 // normal human descriptions with DEF2() the others can use DEF()
28 #ifndef NOSLOTS
29 # define DEF2( name, descr, key, fnSlot ) \
30 a = actionCollection->addAction( name ); \
31 a->setText( i18n(descr) ); \
32 qobject_cast<KAction*>( a )->setGlobalShortcut(KShortcut(key)); \
33 connect(a, SIGNAL(triggered(bool)), SLOT(fnSlot))
34 # define DEF( name, key, fnSlot ) \
35 a = actionCollection->addAction( name ); \
36 a->setText( i18n(name) ); \
37 qobject_cast<KAction*>( a )->setGlobalShortcut(KShortcut(key)); \
38 connect(a, SIGNAL(triggered(bool)), SLOT(fnSlot))
39 #else
40 # define DEF2( name, descr, key, fnSlot ) \
41 a = actionCollection->addAction( name ); \
42 a->setText( i18n(descr) ); \
43 qobject_cast<KAction*>( a )->setGlobalShortcut(KShortcut(key));
44 # define DEF( name, key, fnSlot ) \
45 a = actionCollection->addAction( name ); \
46 a->setText( i18n(name) ); \
47 qobject_cast<KAction*>( a )->setGlobalShortcut(KShortcut(key));
48 #endif
50 a = actionCollection->addAction( "Program:kwin" );
51 a->setText( i18n("System") );
53 a = actionCollection->addAction( "Group:Navigation" );
54 a->setText( i18n("Navigation") );
55 DEF( I18N_NOOP("Walk Through Windows"), Qt::ALT+Qt::Key_Tab, slotWalkThroughWindows() );
56 DEF( I18N_NOOP("Walk Through Windows (Reverse)"), Qt::ALT+Qt::SHIFT+Qt::Key_Backtab, slotWalkBackThroughWindows() );
57 DEF( I18N_NOOP("Walk Through Desktops"), 0, slotWalkThroughDesktops() );
58 DEF( I18N_NOOP("Walk Through Desktops (Reverse)"), 0, slotWalkBackThroughDesktops() );
59 DEF( I18N_NOOP("Walk Through Desktop List"), 0, slotWalkThroughDesktopList() );
60 DEF( I18N_NOOP("Walk Through Desktop List (Reverse)"), 0, slotWalkBackThroughDesktopList() );
62 a = actionCollection->addAction( "Group:Windows" );
63 a->setText( i18n("Windows") );
64 DEF( I18N_NOOP("Window Operations Menu"),
65 Qt::ALT+Qt::Key_F3, slotWindowOperations() );
66 DEF2( "Window Close", I18N_NOOP("Close Window"),
67 Qt::ALT+Qt::Key_F4, slotWindowClose() );
68 DEF2( "Window Maximize", I18N_NOOP("Maximize Window"),
69 0, slotWindowMaximize() );
70 DEF2( "Window Maximize Vertical", I18N_NOOP("Maximize Window Vertically"),
71 0, slotWindowMaximizeVertical() );
72 DEF2( "Window Maximize Horizontal", I18N_NOOP("Maximize Window Horizontally"),
73 0, slotWindowMaximizeHorizontal() );
74 DEF2( "Window Minimize", I18N_NOOP("Minimize Window"),
75 0, slotWindowMinimize() );
76 DEF2( "Window Shade", I18N_NOOP("Shade Window"),
77 0, slotWindowShade() );
78 DEF2( "Window Move", I18N_NOOP("Move Window"),
79 0, slotWindowMove() );
80 DEF2( "Window Resize", I18N_NOOP("Resize Window"),
81 0, slotWindowResize() );
82 DEF2( "Window Raise", I18N_NOOP("Raise Window"),
83 0, slotWindowRaise() );
84 DEF2( "Window Lower", I18N_NOOP("Lower Window"),
85 0, slotWindowLower() );
86 DEF( I18N_NOOP("Toggle Window Raise/Lower"),
87 0, slotWindowRaiseOrLower() );
88 DEF2( "Window Fullscreen", I18N_NOOP("Make Window Fullscreen"),
89 0, slotWindowFullScreen() );
90 DEF2( "Window No Border", I18N_NOOP("Hide Window Border"),
91 0, slotWindowNoBorder() );
92 DEF2( "Window Above Other Windows", I18N_NOOP("Keep Window Above Others"),
93 0, slotWindowAbove() );
94 DEF2( "Window Below Other Windows", I18N_NOOP("Keep Window Below Others"),
95 0, slotWindowBelow() );
96 DEF( I18N_NOOP("Activate Window Demanding Attention"),
97 Qt::CTRL+Qt::ALT+Qt::Key_A, slotActivateAttentionWindow());
98 DEF( I18N_NOOP("Setup Window Shortcut"),
99 0, slotSetupWindowShortcut());
100 DEF2( "Window Pack Right", I18N_NOOP("Pack Window to the Right"),
101 0, slotWindowPackRight() );
102 DEF2( "Window Pack Left", I18N_NOOP("Pack Window to the Left"),
103 0, slotWindowPackLeft() );
104 DEF2( "Window Pack Up", I18N_NOOP("Pack Window Up"),
105 0, slotWindowPackUp() );
106 DEF2( "Window Pack Down", I18N_NOOP("Pack Window Down"),
107 0, slotWindowPackDown() );
108 DEF2( "Window Grow Horizontal", I18N_NOOP("Pack Grow Window Horizontally"),
109 0, slotWindowGrowHorizontal() );
110 DEF2( "Window Grow Vertical", I18N_NOOP("Pack Grow Window Vertically"),
111 0, slotWindowGrowVertical() );
112 DEF2( "Window Shrink Horizontal", I18N_NOOP("Pack Shrink Window Horizontally"),
113 0, slotWindowShrinkHorizontal() );
114 DEF2( "Window Shrink Vertical", I18N_NOOP("Pack Shrink Window Vertically"),
115 0, slotWindowShrinkVertical() );
117 a = actionCollection->addAction( "Group:Window Desktop" );
118 a->setText( i18n("Window & Desktop") );
119 DEF2( "Window On All Desktops", I18N_NOOP("Keep Window on All Desktops"),
120 0, slotWindowOnAllDesktops() );
121 DEF( I18N_NOOP("Window to Desktop 1"), 0, slotWindowToDesktop1() );
122 DEF( I18N_NOOP("Window to Desktop 2"), 0, slotWindowToDesktop2() );
123 DEF( I18N_NOOP("Window to Desktop 3"), 0, slotWindowToDesktop3() );
124 DEF( I18N_NOOP("Window to Desktop 4"), 0, slotWindowToDesktop4() );
125 DEF( I18N_NOOP("Window to Desktop 5"), 0, slotWindowToDesktop5() );
126 DEF( I18N_NOOP("Window to Desktop 6"), 0, slotWindowToDesktop6() );
127 DEF( I18N_NOOP("Window to Desktop 7"), 0, slotWindowToDesktop7() );
128 DEF( I18N_NOOP("Window to Desktop 8"), 0, slotWindowToDesktop8() );
129 DEF( I18N_NOOP("Window to Desktop 9"), 0, slotWindowToDesktop9() );
130 DEF( I18N_NOOP("Window to Desktop 10"), 0, slotWindowToDesktop10() );
131 DEF( I18N_NOOP("Window to Desktop 11"), 0, slotWindowToDesktop11() );
132 DEF( I18N_NOOP("Window to Desktop 12"), 0, slotWindowToDesktop12() );
133 DEF( I18N_NOOP("Window to Desktop 13"), 0, slotWindowToDesktop13() );
134 DEF( I18N_NOOP("Window to Desktop 14"), 0, slotWindowToDesktop14() );
135 DEF( I18N_NOOP("Window to Desktop 15"), 0, slotWindowToDesktop15() );
136 DEF( I18N_NOOP("Window to Desktop 16"), 0, slotWindowToDesktop16() );
137 DEF( I18N_NOOP("Window to Desktop 17"), 0, slotWindowToDesktop17() );
138 DEF( I18N_NOOP("Window to Desktop 18"), 0, slotWindowToDesktop18() );
139 DEF( I18N_NOOP("Window to Desktop 19"), 0, slotWindowToDesktop19() );
140 DEF( I18N_NOOP("Window to Desktop 20"), 0, slotWindowToDesktop20() );
141 DEF( I18N_NOOP("Window to Next Desktop"), 0, slotWindowToNextDesktop() );
142 DEF( I18N_NOOP("Window to Previous Desktop"), 0, slotWindowToPreviousDesktop() );
143 DEF( I18N_NOOP("Window One Desktop to the Right"), 0, slotWindowToDesktopRight() );
144 DEF( I18N_NOOP("Window One Desktop to the Left"), 0, slotWindowToDesktopLeft() );
145 DEF( I18N_NOOP("Window One Desktop Up"), 0, slotWindowToDesktopUp() );
146 DEF( I18N_NOOP("Window One Desktop Down"), 0, slotWindowToDesktopDown() );
147 DEF( I18N_NOOP("Window to Screen 0"), 0, slotWindowToScreen0() );
148 DEF( I18N_NOOP("Window to Screen 1"), 0, slotWindowToScreen1() );
149 DEF( I18N_NOOP("Window to Screen 2"), 0, slotWindowToScreen2() );
150 DEF( I18N_NOOP("Window to Screen 3"), 0, slotWindowToScreen3() );
151 DEF( I18N_NOOP("Window to Screen 4"), 0, slotWindowToScreen4() );
152 DEF( I18N_NOOP("Window to Screen 5"), 0, slotWindowToScreen5() );
153 DEF( I18N_NOOP("Window to Screen 6"), 0, slotWindowToScreen6() );
154 DEF( I18N_NOOP("Window to Screen 7"), 0, slotWindowToScreen7() );
155 DEF( I18N_NOOP("Window to Next Screen"), 0, slotWindowToNextScreen() );
157 a = actionCollection->addAction( "Group:Desktop Switching" );
158 a->setText( i18n("Desktop Switching") );
159 DEF( I18N_NOOP("Switch to Desktop 1"), Qt::CTRL+Qt::Key_F1, slotSwitchToDesktop1() );
160 DEF( I18N_NOOP("Switch to Desktop 2"), Qt::CTRL+Qt::Key_F2, slotSwitchToDesktop2() );
161 DEF( I18N_NOOP("Switch to Desktop 3"), Qt::CTRL+Qt::Key_F3, slotSwitchToDesktop3() );
162 DEF( I18N_NOOP("Switch to Desktop 4"), Qt::CTRL+Qt::Key_F4, slotSwitchToDesktop4() );
163 DEF( I18N_NOOP("Switch to Desktop 5"), 0, slotSwitchToDesktop5() );
164 DEF( I18N_NOOP("Switch to Desktop 6"), 0, slotSwitchToDesktop6() );
165 DEF( I18N_NOOP("Switch to Desktop 7"), 0, slotSwitchToDesktop7() );
166 DEF( I18N_NOOP("Switch to Desktop 8"), 0, slotSwitchToDesktop8() );
167 DEF( I18N_NOOP("Switch to Desktop 9"), 0, slotSwitchToDesktop9() );
168 DEF( I18N_NOOP("Switch to Desktop 10"), 0, slotSwitchToDesktop10() );
169 DEF( I18N_NOOP("Switch to Desktop 11"), 0, slotSwitchToDesktop11() );
170 DEF( I18N_NOOP("Switch to Desktop 12"), 0, slotSwitchToDesktop12() );
171 DEF( I18N_NOOP("Switch to Desktop 13"), 0, slotSwitchToDesktop13() );
172 DEF( I18N_NOOP("Switch to Desktop 14"), 0, slotSwitchToDesktop14() );
173 DEF( I18N_NOOP("Switch to Desktop 15"), 0, slotSwitchToDesktop15() );
174 DEF( I18N_NOOP("Switch to Desktop 16"), 0, slotSwitchToDesktop16() );
175 DEF( I18N_NOOP("Switch to Desktop 17"), 0, slotSwitchToDesktop17() );
176 DEF( I18N_NOOP("Switch to Desktop 18"), 0, slotSwitchToDesktop18() );
177 DEF( I18N_NOOP("Switch to Desktop 19"), 0, slotSwitchToDesktop19() );
178 DEF( I18N_NOOP("Switch to Desktop 20"), 0, slotSwitchToDesktop20() );
179 DEF( I18N_NOOP("Switch to Next Desktop"), 0, slotSwitchDesktopNext() );
180 DEF( I18N_NOOP("Switch to Previous Desktop"), 0, slotSwitchDesktopPrevious() );
181 DEF( I18N_NOOP("Switch One Desktop to the Right"), 0, slotSwitchDesktopRight() );
182 DEF( I18N_NOOP("Switch One Desktop to the Left"), 0, slotSwitchDesktopLeft() );
183 DEF( I18N_NOOP("Switch One Desktop Up"), 0, slotSwitchDesktopUp() );
184 DEF( I18N_NOOP("Switch One Desktop Down"), 0, slotSwitchDesktopDown() );
185 DEF( I18N_NOOP("Switch to Screen 0"), 0, slotSwitchToScreen0() );
186 DEF( I18N_NOOP("Switch to Screen 1"), 0, slotSwitchToScreen1() );
187 DEF( I18N_NOOP("Switch to Screen 2"), 0, slotSwitchToScreen2() );
188 DEF( I18N_NOOP("Switch to Screen 3"), 0, slotSwitchToScreen3() );
189 DEF( I18N_NOOP("Switch to Screen 4"), 0, slotSwitchToScreen4() );
190 DEF( I18N_NOOP("Switch to Screen 5"), 0, slotSwitchToScreen5() );
191 DEF( I18N_NOOP("Switch to Screen 6"), 0, slotSwitchToScreen6() );
192 DEF( I18N_NOOP("Switch to Screen 7"), 0, slotSwitchToScreen7() );
193 DEF( I18N_NOOP("Switch to Next Screen"), 0, slotSwitchToNextScreen() );
195 a = actionCollection->addAction( "Group:Miscellaneous" );
196 a->setText( i18n("Miscellaneous") );
197 DEF( I18N_NOOP("Mouse Emulation"), Qt::ALT+Qt::Key_F12, slotMouseEmulation() );
198 DEF( I18N_NOOP("Kill Window"), Qt::CTRL+Qt::ALT+Qt::Key_Escape, slotKillWindow() );
199 DEF( I18N_NOOP("Window Screenshot to Clipboard"), Qt::ALT+Qt::Key_Print, slotGrabWindow() );
200 DEF( I18N_NOOP("Desktop Screenshot to Clipboard"), Qt::CTRL+Qt::Key_Print, slotGrabDesktop() );
201 DEF( I18N_NOOP("Block Global Shortcuts"), 0, slotDisableGlobalShortcuts());
202 DEF( I18N_NOOP("Suspend Compositing"), Qt::SHIFT+Qt::ALT+Qt::Key_F12, slotToggleCompositing());
204 #undef DEF
205 #undef DEF2
207 // }