Changeset View
Changeset View
Standalone View
Standalone View
tabbox/tabbox.h
Show All 29 Lines | |||||
30 | #include "tabbox/tabboxhandler.h" | 30 | #include "tabbox/tabboxhandler.h" | ||
31 | 31 | | |||
32 | class KConfigGroup; | 32 | class KConfigGroup; | ||
33 | class QAction; | 33 | class QAction; | ||
34 | class QMouseEvent; | 34 | class QMouseEvent; | ||
35 | class QKeyEvent; | 35 | class QKeyEvent; | ||
36 | class QWheelEvent; | 36 | class QWheelEvent; | ||
37 | 37 | | |||
38 | struct xcb_button_press_event_t; | | |||
39 | struct xcb_motion_notify_event_t; | | |||
40 | | ||||
41 | namespace KWin | 38 | namespace KWin | ||
42 | { | 39 | { | ||
43 | 40 | | |||
44 | class Workspace; | 41 | class Workspace; | ||
45 | class AbstractClient; | 42 | class AbstractClient; | ||
46 | class Client; | 43 | class Client; | ||
44 | class X11EventFilter; | ||||
47 | namespace TabBox | 45 | namespace TabBox | ||
48 | { | 46 | { | ||
49 | class DesktopChainManager; | 47 | class DesktopChainManager; | ||
50 | class TabBoxConfig; | 48 | class TabBoxConfig; | ||
51 | class TabBox; | 49 | class TabBox; | ||
52 | class TabBoxHandlerImpl : public TabBoxHandler | 50 | class TabBoxHandlerImpl : public TabBoxHandler | ||
53 | { | 51 | { | ||
54 | public: | 52 | public: | ||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 118 | public: | |||
159 | effect. | 157 | effect. | ||
160 | 158 | | |||
161 | \sa reference(), unreference() | 159 | \sa reference(), unreference() | ||
162 | */ | 160 | */ | ||
163 | bool isDisplayed() const { | 161 | bool isDisplayed() const { | ||
164 | return m_displayRefcount > 0; | 162 | return m_displayRefcount > 0; | ||
165 | }; | 163 | }; | ||
166 | 164 | | |||
167 | bool handleMouseEvent(xcb_button_press_event_t *e); | 165 | /** | ||
168 | bool handleMouseEvent(xcb_motion_notify_event_t *e); | 166 | * @returns @c true if TabBox is shown, @c false if replaced by Effect | ||
167 | **/ | ||||
168 | bool isShown() const { | ||||
169 | return m_isShown; | ||||
170 | } | ||||
171 | | ||||
169 | bool handleMouseEvent(QMouseEvent *event); | 172 | bool handleMouseEvent(QMouseEvent *event); | ||
170 | bool handleWheelEvent(QWheelEvent *event); | 173 | bool handleWheelEvent(QWheelEvent *event); | ||
171 | void grabbedKeyEvent(QKeyEvent* event); | 174 | void grabbedKeyEvent(QKeyEvent* event); | ||
172 | 175 | | |||
173 | bool isGrabbed() const { | 176 | bool isGrabbed() const { | ||
174 | return m_tabGrab || m_desktopGrab; | 177 | return m_tabGrab || m_desktopGrab; | ||
175 | }; | 178 | }; | ||
176 | 179 | | |||
177 | void initShortcuts(); | 180 | void initShortcuts(); | ||
178 | 181 | | |||
179 | AbstractClient* nextClientStatic(AbstractClient*) const; | 182 | AbstractClient* nextClientStatic(AbstractClient*) const; | ||
180 | AbstractClient* previousClientStatic(AbstractClient*) const; | 183 | AbstractClient* previousClientStatic(AbstractClient*) const; | ||
181 | int nextDesktopStatic(int iDesktop) const; | 184 | int nextDesktopStatic(int iDesktop) const; | ||
182 | int previousDesktopStatic(int iDesktop) const; | 185 | int previousDesktopStatic(int iDesktop) const; | ||
183 | void keyPress(int key); | 186 | void keyPress(int key); | ||
184 | void keyRelease(const xcb_key_release_event_t *ev); | | |||
185 | void modifiersReleased(); | 187 | void modifiersReleased(); | ||
186 | 188 | | |||
187 | bool forcedGlobalMouseGrab() const { | 189 | bool forcedGlobalMouseGrab() const { | ||
188 | return m_forcedGlobalMouseGrab; | 190 | return m_forcedGlobalMouseGrab; | ||
189 | } | 191 | } | ||
190 | 192 | | |||
191 | bool noModifierGrab() const { | 193 | bool noModifierGrab() const { | ||
192 | return m_noModifierGrab; | 194 | return m_noModifierGrab; | ||
193 | } | 195 | } | ||
196 | void setCurrentIndex(QModelIndex index, bool notifyEffects = true); | ||||
194 | 197 | | |||
195 | static TabBox *self(); | 198 | static TabBox *self(); | ||
196 | static TabBox *create(QObject *parent); | 199 | static TabBox *create(QObject *parent); | ||
197 | 200 | | |||
198 | public Q_SLOTS: | 201 | public Q_SLOTS: | ||
199 | void show(); | 202 | void show(); | ||
200 | void close(bool abort = false); | 203 | void close(bool abort = false); | ||
201 | void accept(bool closeTabBox = true); | 204 | void accept(bool closeTabBox = true); | ||
Show All 17 Lines | |||||
219 | Q_SIGNALS: | 222 | Q_SIGNALS: | ||
220 | void tabBoxAdded(int); | 223 | void tabBoxAdded(int); | ||
221 | void tabBoxClosed(); | 224 | void tabBoxClosed(); | ||
222 | void tabBoxUpdated(); | 225 | void tabBoxUpdated(); | ||
223 | void tabBoxKeyEvent(QKeyEvent*); | 226 | void tabBoxKeyEvent(QKeyEvent*); | ||
224 | 227 | | |||
225 | private: | 228 | private: | ||
226 | explicit TabBox(QObject *parent); | 229 | explicit TabBox(QObject *parent); | ||
227 | void setCurrentIndex(QModelIndex index, bool notifyEffects = true); | | |||
228 | void loadConfig(const KConfigGroup& config, TabBoxConfig& tabBoxConfig); | 230 | void loadConfig(const KConfigGroup& config, TabBoxConfig& tabBoxConfig); | ||
229 | 231 | | |||
230 | bool startKDEWalkThroughWindows(TabBoxMode mode); // TabBoxWindowsMode | TabBoxWindowsAlternativeMode | 232 | bool startKDEWalkThroughWindows(TabBoxMode mode); // TabBoxWindowsMode | TabBoxWindowsAlternativeMode | ||
231 | bool startWalkThroughDesktops(TabBoxMode mode); // TabBoxDesktopMode | TabBoxDesktopListMode | 233 | bool startWalkThroughDesktops(TabBoxMode mode); // TabBoxDesktopMode | TabBoxDesktopListMode | ||
232 | bool startWalkThroughDesktops(); | 234 | bool startWalkThroughDesktops(); | ||
233 | bool startWalkThroughDesktopList(); | 235 | bool startWalkThroughDesktopList(); | ||
234 | void navigatingThroughWindows(bool forward, const QKeySequence &shortcut, TabBoxMode mode); // TabBoxWindowsMode | TabBoxWindowsAlternativeMode | 236 | void navigatingThroughWindows(bool forward, const QKeySequence &shortcut, TabBoxMode mode); // TabBoxWindowsMode | TabBoxWindowsAlternativeMode | ||
235 | void KDEWalkThroughWindows(bool forward); | 237 | void KDEWalkThroughWindows(bool forward); | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 257 | private: | |||
280 | QKeySequence m_cutWalkThroughWindowsAlternative, m_cutWalkThroughWindowsAlternativeReverse; | 282 | QKeySequence m_cutWalkThroughWindowsAlternative, m_cutWalkThroughWindowsAlternativeReverse; | ||
281 | QKeySequence m_cutWalkThroughCurrentAppWindows, m_cutWalkThroughCurrentAppWindowsReverse; | 283 | QKeySequence m_cutWalkThroughCurrentAppWindows, m_cutWalkThroughCurrentAppWindowsReverse; | ||
282 | QKeySequence m_cutWalkThroughCurrentAppWindowsAlternative, m_cutWalkThroughCurrentAppWindowsAlternativeReverse; | 284 | QKeySequence m_cutWalkThroughCurrentAppWindowsAlternative, m_cutWalkThroughCurrentAppWindowsAlternativeReverse; | ||
283 | bool m_forcedGlobalMouseGrab; | 285 | bool m_forcedGlobalMouseGrab; | ||
284 | bool m_ready; // indicates whether the config is completely loaded | 286 | bool m_ready; // indicates whether the config is completely loaded | ||
285 | QList<ElectricBorder> m_borderActivate, m_borderAlternativeActivate; | 287 | QList<ElectricBorder> m_borderActivate, m_borderAlternativeActivate; | ||
286 | QHash<ElectricBorder, QAction *> m_touchActivate; | 288 | QHash<ElectricBorder, QAction *> m_touchActivate; | ||
287 | QHash<ElectricBorder, QAction *> m_touchAlternativeActivate; | 289 | QHash<ElectricBorder, QAction *> m_touchAlternativeActivate; | ||
290 | QScopedPointer<X11EventFilter> m_x11EventFilter; | ||||
288 | 291 | | |||
289 | static TabBox *s_self; | 292 | static TabBox *s_self; | ||
290 | }; | 293 | }; | ||
291 | 294 | | |||
292 | inline | 295 | inline | ||
293 | TabBox *TabBox::self() | 296 | TabBox *TabBox::self() | ||
294 | { | 297 | { | ||
295 | return s_self; | 298 | return s_self; | ||
296 | } | 299 | } | ||
297 | 300 | | |||
298 | } // namespace TabBox | 301 | } // namespace TabBox | ||
299 | } // namespace | 302 | } // namespace | ||
300 | #endif | 303 | #endif |