00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef KWIN_WORKSPACE_H
00013 #define KWIN_WORKSPACE_H
00014
00015 #include <qtimer.h>
00016 #include <kshortcut.h>
00017 #include <qcursor.h>
00018 #include <netwm.h>
00019 #include <kxmessages.h>
00020
00021 #include "KWinInterface.h"
00022 #include "utils.h"
00023 #include "kdecoration.h"
00024 #include "sm.h"
00025
00026 #include <X11/Xlib.h>
00027
00028 class QPopupMenu;
00029 class KConfig;
00030 class KGlobalAccel;
00031 class KShortcutDialog;
00032 class KStartupInfo;
00033 class KStartupInfoId;
00034 class KStartupInfoData;
00035 class QSlider;
00036 class QPushButton;
00037 class KProcess;
00038
00039 namespace KWinInternal
00040 {
00041
00042 class Client;
00043 class TabBox;
00044 class PopupInfo;
00045 class RootInfo;
00046 class PluginMgr;
00047 class Placement;
00048 class Rules;
00049 class WindowRules;
00050
00051 class SystemTrayWindow
00052 {
00053 public:
00054 SystemTrayWindow()
00055 : win(0),winFor(0)
00056 {}
00057 SystemTrayWindow( WId w )
00058 : win(w),winFor(0)
00059 {}
00060 SystemTrayWindow( WId w, WId wf )
00061 : win(w),winFor(wf)
00062 {}
00063
00064 bool operator==( const SystemTrayWindow& other )
00065 { return win == other.win; }
00066 WId win;
00067 WId winFor;
00068 };
00069
00070 typedef QValueList<SystemTrayWindow> SystemTrayWindowList;
00071
00072 class Workspace : public QObject, public KWinInterface, public KDecorationDefines
00073 {
00074 Q_OBJECT
00075 public:
00076 Workspace( bool restore = FALSE );
00077 virtual ~Workspace();
00078
00079 static Workspace * self() { return _self; }
00080
00081 bool workspaceEvent( XEvent * );
00082
00083 KDecoration* createDecoration( KDecorationBridge* bridge );
00084
00085 bool hasClient( const Client * );
00086
00087 template< typename T > Client* findClient( T predicate );
00088 template< typename T1, typename T2 > void forEachClient( T1 procedure, T2 predicate );
00089 template< typename T > void forEachClient( T procedure );
00090
00091 QRect clientArea( clientAreaOption, const QPoint& p, int desktop ) const;
00092 QRect clientArea( clientAreaOption, const Client* c ) const;
00093
00097 void killWindowId( Window window);
00098
00099 void killWindow() { slotKillWindow(); }
00100
00101 WId rootWin() const;
00102
00103 bool initializing() const;
00104
00109 Client* activeClient() const;
00110
00111
00112
00113 Client* mostRecentlyActivatedClient() const;
00114
00115 void activateClient( Client*, bool force = FALSE );
00116 void requestFocus( Client* c, bool force = FALSE );
00117 void takeActivity( Client* c, int flags, bool handled );
00118 void handleTakeActivity( Client* c, Time timestamp, int flags );
00119 bool allowClientActivation( const Client* c, Time time = -1U, bool focus_in = false );
00120 void restoreFocus();
00121 void gotFocusIn( const Client* );
00122 void setShouldGetFocus( Client* );
00123 bool fakeRequestedActivity( Client* c );
00124 void unfakeActivity( Client* c );
00125 bool activateNextClient( Client* c );
00126 bool focusChangeEnabled() { return block_focus == 0; }
00127
00128 void updateColormap();
00129
00133 void setClientIsMoving( Client *c );
00134
00135 void place( Client *c, QRect& area );
00136 void placeSmart( Client* c, const QRect& area );
00137
00138 QPoint adjustClientPosition( Client* c, QPoint pos );
00139 QRect adjustClientSize( Client* c, QRect moveResizeGeom, int mode );
00140 void raiseClient( Client* c );
00141 void lowerClient( Client* c );
00142 void raiseClientRequest( Client* c, NET::RequestSource src, Time timestamp );
00143 void lowerClientRequest( Client* c, NET::RequestSource src, Time timestamp );
00144 void restackClientUnderActive( Client* );
00145 void updateClientLayer( Client* c );
00146 void raiseOrLowerClient( Client * );
00147 void reconfigure();
00148
00149 void clientHidden( Client* );
00150 void clientAttentionChanged( Client* c, bool set );
00151
00152 void clientMoved(const QPoint &pos, Time time);
00153
00157 int currentDesktop() const;
00161 int numberOfDesktops() const;
00162 void setNumberOfDesktops( int n );
00163
00164 QWidget* desktopWidget();
00165
00166
00167 Client* nextFocusChainClient(Client*) const;
00168 Client* previousFocusChainClient(Client*) const;
00169 Client* nextStaticClient(Client*) const;
00170 Client* previousStaticClient(Client*) const;
00171 int nextDesktopFocusChain( int iDesktop ) const;
00172 int previousDesktopFocusChain( int iDesktop ) const;
00173 void closeTabBox();
00174
00179 const ClientList& stackingOrder() const;
00180
00181 ClientList ensureStackingOrder( const ClientList& clients ) const;
00182
00183 Client* topClientOnDesktop( int desktop, bool unconstrained = false ) const;
00184 Client* findDesktop( bool topmost, int desktop ) const;
00185 void sendClientToDesktop( Client* c, int desktop, bool dont_activate );
00186 void windowToPreviousDesktop( Client* c );
00187 void windowToNextDesktop( Client* c );
00188
00189
00190 void showWindowMenuAt( unsigned long id, int x, int y );
00191
00196 void showWindowMenu( const QRect &pos, Client* cl );
00200 void showWindowMenu( int x, int y, Client* cl );
00201 void showWindowMenu( QPoint pos, Client* cl );
00202
00203 void updateMinimizedOfTransients( Client* );
00204 void updateOnAllDesktopsOfTransients( Client* );
00205 void checkTransients( Window w );
00206
00207 void performWindowOperation( Client* c, WindowOperation op );
00208
00209 void storeSession( KConfig* config, SMSavePhase phase );
00210
00211 SessionInfo* takeSessionInfo( Client* );
00212 WindowRules findWindowRules( const Client*, bool );
00213 void rulesUpdated();
00214 void discardUsedWindowRules( Client* c, bool withdraw );
00215
00216
00217 void cascadeDesktop();
00218 void unclutterDesktop();
00219 void doNotManage(QString);
00220 bool setCurrentDesktop( int new_desktop );
00221 void nextDesktop();
00222 void previousDesktop();
00223 void circulateDesktopApplications();
00224
00225 QString desktopName( int desk ) const;
00226 void setDesktopLayout(int o, int x, int y);
00227 void setShowingDesktop( bool showing );
00228 void resetShowingDesktop( bool keep_hidden );
00229 bool showingDesktop() const;
00230
00231 bool isNotManaged( const QString& title );
00232
00233 void sendPingToWindow( Window w, Time timestamp );
00234 void sendTakeActivity( Client* c, Time timestamp, long flags );
00235
00236 void stopKompmgr();
00237 bool kompmgrIsRunning();
00238 void setOpacity(unsigned long winId, unsigned int opacityPercent);
00239 void setShadowSize(unsigned long winId, unsigned int shadowSizePercent);
00240 void setUnshadowed(unsigned long winId);
00241
00242
00243 void removeClient( Client*, allowed_t );
00244 void setActiveClient( Client*, allowed_t );
00245 Group* findGroup( Window leader ) const;
00246 void addGroup( Group* group, allowed_t );
00247 void removeGroup( Group* group, allowed_t );
00248 Group* findClientLeaderGroup( const Client* c ) const;
00249
00250 bool checkStartupNotification( Window w, KStartupInfoId& id, KStartupInfoData& data );
00251
00252 void focusToNull();
00253
00254 bool forcedGlobalMouseGrab() const;
00255 void clientShortcutUpdated( Client* c );
00256 bool shortcutAvailable( const KShortcut& cut, Client* ignore = NULL ) const;
00257 bool globalShortcutsDisabled() const;
00258 void disableGlobalShortcuts( bool disable );
00259 void disableGlobalShortcutsForClient( bool disable );
00260
00261 void sessionSaveStarted();
00262 void sessionSaveDone();
00263 void setWasUserInteraction();
00264 bool wasUserInteraction() const;
00265 bool sessionSaving() const;
00266
00267 bool managingTopMenus() const;
00268 int topMenuHeight() const;
00269 void updateCurrentTopMenu();
00270
00271 int packPositionLeft( const Client* cl, int oldx, bool left_edge ) const;
00272 int packPositionRight( const Client* cl, int oldx, bool right_edge ) const;
00273 int packPositionUp( const Client* cl, int oldy, bool top_edge ) const;
00274 int packPositionDown( const Client* cl, int oldy, bool bottom_edge ) const;
00275
00276 static QStringList configModules(bool controlCenter);
00277
00278 void cancelDelayFocus();
00279 void requestDelayFocus( Client* );
00280
00281 void toggleTopDockShadows(bool on);
00282
00283 public slots:
00284 void refresh();
00285
00286 void slotSwitchDesktopNext();
00287 void slotSwitchDesktopPrevious();
00288 void slotSwitchDesktopRight();
00289 void slotSwitchDesktopLeft();
00290 void slotSwitchDesktopUp();
00291 void slotSwitchDesktopDown();
00292
00293 void slotSwitchToDesktop( int );
00294
00295 void slotWindowToDesktop( int );
00296
00297
00298 void slotWindowMaximize();
00299 void slotWindowMaximizeVertical();
00300 void slotWindowMaximizeHorizontal();
00301 void slotWindowMinimize();
00302 void slotWindowShade();
00303 void slotWindowRaise();
00304 void slotWindowLower();
00305 void slotWindowRaiseOrLower();
00306 void slotActivateAttentionWindow();
00307 void slotWindowPackLeft();
00308 void slotWindowPackRight();
00309 void slotWindowPackUp();
00310 void slotWindowPackDown();
00311 void slotWindowGrowHorizontal();
00312 void slotWindowGrowVertical();
00313 void slotWindowShrinkHorizontal();
00314 void slotWindowShrinkVertical();
00315
00316 void slotWalkThroughDesktops();
00317 void slotWalkBackThroughDesktops();
00318 void slotWalkThroughDesktopList();
00319 void slotWalkBackThroughDesktopList();
00320 void slotWalkThroughWindows();
00321 void slotWalkBackThroughWindows();
00322
00323 void slotWindowOperations();
00324 void slotWindowClose();
00325 void slotWindowMove();
00326 void slotWindowResize();
00327 void slotWindowAbove();
00328 void slotWindowBelow();
00329 void slotWindowOnAllDesktops();
00330 void slotWindowFullScreen();
00331 void slotWindowNoBorder();
00332
00333 void slotWindowToNextDesktop();
00334 void slotWindowToPreviousDesktop();
00335 void slotWindowToDesktopRight();
00336 void slotWindowToDesktopLeft();
00337 void slotWindowToDesktopUp();
00338 void slotWindowToDesktopDown();
00339
00340 void slotMouseEmulation();
00341 void slotDisableGlobalShortcuts();
00342
00343 void slotSettingsChanged( int category );
00344
00345 void slotReconfigure();
00346
00347 void slotKillWindow();
00348
00349 void slotGrabWindow();
00350 void slotGrabDesktop();
00351
00352 void slotSetupWindowShortcut();
00353 void setupWindowShortcutDone( bool );
00354
00355 void updateClientArea();
00356
00357
00358 void startKompmgr();
00359
00360 private slots:
00361 void desktopPopupAboutToShow();
00362 void clientPopupAboutToShow();
00363 void slotSendToDesktop( int );
00364 void clientPopupActivated( int );
00365 void configureWM();
00366 void desktopResized();
00367 void slotUpdateToolWindows();
00368 void lostTopMenuSelection();
00369 void lostTopMenuOwner();
00370 void delayFocus();
00371 void gotTemporaryRulesMessage( const QString& );
00372 void cleanupTemporaryRules();
00373 void writeWindowRules();
00374 void kipcMessage( int id, int data );
00375
00376 void setPopupClientOpacity(int v);
00377 void resetClientOpacity();
00378 void setTransButtonText(int value);
00379 void unblockKompmgrRestart();
00380 void restartKompmgr();
00381 void handleKompmgrOutput( KProcess *proc, char *buffer, int buflen);
00382
00383
00384 protected:
00385 bool keyPressMouseEmulation( XKeyEvent& ev );
00386 bool netCheck( XEvent* e );
00387
00388 private:
00389 void init();
00390 void initShortcuts();
00391 void readShortcuts();
00392 void initDesktopPopup();
00393 void setupWindowShortcut( Client* c );
00394
00395 bool startKDEWalkThroughWindows();
00396 bool startWalkThroughDesktops( int mode );
00397 bool startWalkThroughDesktops();
00398 bool startWalkThroughDesktopList();
00399 void KDEWalkThroughWindows( bool forward );
00400 void CDEWalkThroughWindows( bool forward );
00401 void walkThroughDesktops( bool forward );
00402 void KDEOneStepThroughWindows( bool forward );
00403 void oneStepThroughDesktops( bool forward, int mode );
00404 void oneStepThroughDesktops( bool forward );
00405 void oneStepThroughDesktopList( bool forward );
00406 bool establishTabBoxGrab();
00407 void removeTabBoxGrab();
00408 int desktopToRight( int desktop ) const;
00409 int desktopToLeft( int desktop ) const;
00410 int desktopUp( int desktop ) const;
00411 int desktopDown( int desktop ) const;
00412
00413 void updateStackingOrder( bool propagate_new_clients = false );
00414 void propagateClients( bool propagate_new_clients );
00415 ClientList constrainedStackingOrder();
00416 void raiseClientWithinApplication( Client* c );
00417 void lowerClientWithinApplication( Client* c );
00418 bool allowFullClientRaising( const Client* c, Time timestamp );
00419 bool keepTransientAbove( const Client* mainwindow, const Client* transient );
00420 void blockStackingUpdates( bool block );
00421 void addTopMenu( Client* c );
00422 void removeTopMenu( Client* c );
00423 void setupTopMenuHandling();
00424 void updateTopMenuGeometry( Client* c = NULL );
00425 void updateToolWindows( bool also_hide );
00426
00427
00428 Client* createClient( Window w, bool is_mapped );
00429 void addClient( Client* c, allowed_t );
00430
00431 Window findSpecialEventWindow( XEvent* e );
00432
00433 void randomPlacement(Client* c);
00434 void smartPlacement(Client* c);
00435 void cascadePlacement(Client* c, bool re_init = false);
00436
00437 bool addSystemTrayWin( WId w );
00438 bool removeSystemTrayWin( WId w, bool check );
00439 void propagateSystemTrayWins();
00440 SystemTrayWindow findSystemTrayWin( WId w );
00441
00442
00443 void loadDesktopSettings();
00444 void saveDesktopSettings();
00445
00446
00447 WId getMouseEmulationWindow();
00448 enum MouseEmulation { EmuPress, EmuRelease, EmuMove };
00449 unsigned int sendFakedMouseEvent( QPoint pos, WId win, MouseEmulation type, int button, unsigned int state );
00450
00451 void tabBoxKeyPress( const KKeyNative& keyX );
00452 void tabBoxKeyRelease( const XKeyEvent& ev );
00453
00454
00455 void checkElectricBorders( bool force = false );
00456 void createBorderWindows();
00457 void destroyBorderWindows();
00458 bool electricBorder(XEvent * e);
00459 void raiseElectricBorders();
00460
00461
00462
00463 void helperDialog( const QString& message, const Client* c );
00464
00465 void calcDesktopLayout(int &x, int &y) const;
00466
00467 QPopupMenu* clientPopup();
00468 void closeActivePopup();
00469
00470 void updateClientArea( bool force );
00471
00472 SystemTrayWindowList systemTrayWins;
00473
00474 int current_desktop;
00475 int number_of_desktops;
00476 QMemArray<int> desktop_focus_chain;
00477
00478 QWidget* active_popup;
00479 Client* active_popup_client;
00480
00481 QWidget* desktop_widget;
00482
00483 void loadSessionInfo();
00484 void loadWindowRules();
00485 void editWindowRules( Client* c, bool whole_app );
00486
00487 QPtrList<SessionInfo> session;
00488 QValueList<Rules*> rules;
00489 KXMessages temporaryRulesMessages;
00490 QTimer rulesUpdatedTimer;
00491 static const char* windowTypeToTxt( NET::WindowType type );
00492 static NET::WindowType txtToWindowType( const char* txt );
00493 static bool sessionInfoWindowTypeMatch( Client* c, SessionInfo* info );
00494
00495 Client* active_client;
00496 Client* last_active_client;
00497 Client* most_recently_raised;
00498 Client* movingClient;
00499 Client* pending_take_activity;
00500
00501
00502 QTimer* delayFocusTimer;
00503 Client* delayfocus_client;
00504
00505 ClientList clients;
00506 ClientList desktops;
00507
00508 ClientList unconstrained_stacking_order;
00509 ClientList stacking_order;
00510 ClientList focus_chain;
00511 ClientList should_get_focus;
00512 ClientList attention_chain;
00513
00514 bool showing_desktop;
00515 ClientList showing_desktop_clients;
00516 int block_showing_desktop;
00517
00518 GroupList groups;
00519
00520 bool was_user_interaction;
00521 bool session_saving;
00522 int session_active_client;
00523 int session_desktop;
00524
00525 bool control_grab;
00526 bool tab_grab;
00527
00528
00529
00530 KShortcut cutWalkThroughDesktops, cutWalkThroughDesktopsReverse;
00531 KShortcut cutWalkThroughDesktopList, cutWalkThroughDesktopListReverse;
00532 KShortcut cutWalkThroughWindows, cutWalkThroughWindowsReverse;
00533 bool mouse_emulation;
00534 unsigned int mouse_emulation_state;
00535 WId mouse_emulation_window;
00536 int block_focus;
00537
00538 TabBox* tab_box;
00539 PopupInfo* popupinfo;
00540
00541 QPopupMenu *popup;
00542 QPopupMenu *advanced_popup;
00543 QPopupMenu *desk_popup;
00544 int desk_popup_index;
00545
00546 KGlobalAccel *keys;
00547 KGlobalAccel *client_keys;
00548 ShortcutDialog* client_keys_dialog;
00549 Client* client_keys_client;
00550 KGlobalAccel *disable_shortcuts_keys;
00551 bool global_shortcuts_disabled;
00552 bool global_shortcuts_disabled_for_client;
00553
00554 WId root;
00555
00556 PluginMgr *mgr;
00557
00558 RootInfo *rootInfo;
00559 QWidget* supportWindow;
00560
00561
00562 QStringList doNotManageList;
00563
00564
00565 Colormap default_colormap;
00566 Colormap installed_colormap;
00567
00568
00569 QTimer reconfigureTimer;
00570
00571 QTimer updateToolWindowsTimer;
00572
00573 static Workspace *_self;
00574
00575 bool workspaceInit;
00576
00577 KStartupInfo* startup;
00578
00579 bool electric_have_borders;
00580 int electric_current_border;
00581 WId electric_top_border;
00582 WId electric_bottom_border;
00583 WId electric_left_border;
00584 WId electric_right_border;
00585 int electricLeft;
00586 int electricRight;
00587 int electricTop;
00588 int electricBottom;
00589 Time electric_time_first;
00590 Time electric_time_last;
00591 QPoint electric_push_point;
00592
00593 Qt::Orientation layoutOrientation;
00594 int layoutX;
00595 int layoutY;
00596
00597 Placement *initPositioning;
00598
00599 QRect* workarea;
00600 QRect** screenarea;
00601
00602 bool managing_topmenus;
00603 KSelectionOwner* topmenu_selection;
00604 KSelectionWatcher* topmenu_watcher;
00605 ClientList topmenus;
00606 mutable int topmenu_height;
00607 QWidget* topmenu_space;
00608
00609 int set_active_client_recursion;
00610 int block_stacking_updates;
00611 bool blocked_propagating_new_clients;
00612 Window null_focus_window;
00613 bool forced_global_mouse_grab;
00614 friend class StackingUpdatesBlocker;
00615
00616
00617 QSlider *transSlider;
00618 QPushButton *transButton;
00619
00620
00621
00622
00623
00624
00625 signals:
00626 void kompmgrStarted();
00627 void kompmgrStopped();
00628 };
00629
00630
00631 class StackingUpdatesBlocker
00632 {
00633 public:
00634 StackingUpdatesBlocker( Workspace* w )
00635 : ws( w ) { ws->blockStackingUpdates( true ); }
00636 ~StackingUpdatesBlocker()
00637 { ws->blockStackingUpdates( false ); }
00638 private:
00639 Workspace* ws;
00640 };
00641
00642
00643 class RootInfo : public NETRootInfo4
00644 {
00645 private:
00646 typedef KWinInternal::Client Client;
00647 public:
00648 RootInfo( Workspace* ws, Display *dpy, Window w, const char *name, unsigned long pr[], int pr_num, int scr= -1);
00649 protected:
00650 virtual void changeNumberOfDesktops(int n);
00651 virtual void changeCurrentDesktop(int d);
00652
00653 virtual void changeActiveWindow(Window w,NET::RequestSource src, Time timestamp, Window active_window);
00654 virtual void closeWindow(Window w);
00655 virtual void moveResize(Window w, int x_root, int y_root, unsigned long direction);
00656 virtual void moveResizeWindow(Window w, int flags, int x, int y, int width, int height );
00657 virtual void gotPing(Window w, Time timestamp);
00658 virtual void restackWindow(Window w, RequestSource source, Window above, int detail, Time timestamp);
00659 virtual void gotTakeActivity(Window w, Time timestamp, long flags );
00660 virtual void changeShowingDesktop( bool showing );
00661 private:
00662 Workspace* workspace;
00663 };
00664
00665
00666 inline WId Workspace::rootWin() const
00667 {
00668 return root;
00669 }
00670
00671 inline bool Workspace::initializing() const
00672 {
00673 return workspaceInit;
00674 }
00675
00676 inline Client* Workspace::activeClient() const
00677 {
00678 return active_client;
00679 }
00680
00681 inline Client* Workspace::mostRecentlyActivatedClient() const
00682 {
00683 return should_get_focus.count() > 0 ? should_get_focus.last() : active_client;
00684 }
00685
00686 inline int Workspace::currentDesktop() const
00687 {
00688 return current_desktop;
00689 }
00690
00691 inline int Workspace::numberOfDesktops() const
00692 {
00693 return number_of_desktops;
00694 }
00695
00696 inline void Workspace::addGroup( Group* group, allowed_t )
00697 {
00698 groups.append( group );
00699 }
00700
00701 inline void Workspace::removeGroup( Group* group, allowed_t )
00702 {
00703 groups.remove( group );
00704 }
00705
00706 inline const ClientList& Workspace::stackingOrder() const
00707 {
00708
00709 return stacking_order;
00710 }
00711
00712 inline void Workspace::showWindowMenu(QPoint pos, Client* cl)
00713 {
00714 showWindowMenu(QRect(pos, pos), cl);
00715 }
00716
00717 inline void Workspace::showWindowMenu(int x, int y, Client* cl)
00718 {
00719 showWindowMenu(QRect(QPoint(x, y), QPoint(x, y)), cl);
00720 }
00721
00722 inline
00723 void Workspace::setWasUserInteraction()
00724 {
00725 was_user_interaction = true;
00726 }
00727
00728 inline
00729 bool Workspace::wasUserInteraction() const
00730 {
00731 return was_user_interaction;
00732 }
00733
00734 inline
00735 bool Workspace::managingTopMenus() const
00736 {
00737 return managing_topmenus;
00738 }
00739
00740 inline void Workspace::sessionSaveStarted()
00741 {
00742 session_saving = true;
00743 }
00744
00745 inline void Workspace::sessionSaveDone()
00746 {
00747 session_saving = false;
00748 }
00749
00750 inline bool Workspace::sessionSaving() const
00751 {
00752 return session_saving;
00753 }
00754
00755 inline bool Workspace::forcedGlobalMouseGrab() const
00756 {
00757 return forced_global_mouse_grab;
00758 }
00759
00760 inline bool Workspace::showingDesktop() const
00761 {
00762 return showing_desktop;
00763 }
00764
00765 inline bool Workspace::globalShortcutsDisabled() const
00766 {
00767 return global_shortcuts_disabled || global_shortcuts_disabled_for_client;
00768 }
00769
00770 template< typename T >
00771 inline Client* Workspace::findClient( T predicate )
00772 {
00773 if( Client* ret = findClientInList( clients, predicate ))
00774 return ret;
00775 if( Client* ret = findClientInList( desktops, predicate ))
00776 return ret;
00777 return NULL;
00778 }
00779
00780 template< typename T1, typename T2 >
00781 inline void Workspace::forEachClient( T1 procedure, T2 predicate )
00782 {
00783 for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it)
00784 if ( predicate( const_cast< const Client* >( *it)))
00785 procedure( *it );
00786 for ( ClientList::ConstIterator it = desktops.begin(); it != desktops.end(); ++it)
00787 if ( predicate( const_cast< const Client* >( *it)))
00788 procedure( *it );
00789 }
00790
00791 template< typename T >
00792 inline void Workspace::forEachClient( T procedure )
00793 {
00794 return forEachClient( procedure, TruePredicate());
00795 }
00796
00797 KWIN_COMPARE_PREDICATE( ClientMatchPredicate, const Client*, cl == value );
00798 inline bool Workspace::hasClient( const Client* c )
00799 {
00800 return findClient( ClientMatchPredicate( c ));
00801 }
00802
00803 }
00804
00805 #endif