kwin Library API Documentation

client.h

00001 /*****************************************************************
00002  KWin - the KDE window manager
00003  This file is part of the KDE project.
00004 
00005 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
00006 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
00007 
00008 You can Freely distribute this program under the GNU General Public
00009 License. See the file "COPYING" for the exact licensing terms.
00010 ******************************************************************/
00011 
00012 #ifndef KWIN_CLIENT_H
00013 #define KWIN_CLIENT_H
00014 
00015 #include <qframe.h>
00016 #include <qvbox.h>
00017 #include <qpixmap.h>
00018 #include <netwm.h>
00019 #include <kdebug.h>
00020 #include <assert.h>
00021 #include <kshortcut.h>
00022 #include <X11/X.h>
00023 #include <X11/Xlib.h>
00024 #include <X11/Xutil.h>
00025 #include <fixx11h.h>
00026 
00027 #include "utils.h"
00028 #include "options.h"
00029 #include "workspace.h"
00030 #include "kdecoration.h"
00031 #include "rules.h"
00032 
00033 class QTimer;
00034 class KProcess;
00035 class KStartupInfoData;
00036 
00037 namespace KWinInternal
00038 {
00039 
00040 class Workspace;
00041 class Client;
00042 class WinInfo;
00043 class SessionInfo;
00044 class Bridge;
00045 
00046 class Client : public QObject, public KDecorationDefines
00047     {
00048     Q_OBJECT
00049     public:
00050         Client( Workspace *ws );
00051         Window window() const;
00052         Window frameId() const;
00053         Window wrapperId() const;
00054         Window decorationId() const;
00055 
00056         Workspace* workspace() const;
00057         const Client* transientFor() const;
00058         Client* transientFor();
00059         bool isTransient() const;
00060         bool groupTransient() const;
00061         bool wasOriginallyGroupTransient() const;
00062         ClientList mainClients() const; // call once before loop , is not indirect
00063         bool hasTransient( const Client* c, bool indirect ) const;
00064         const ClientList& transients() const; // is not indirect
00065         void checkTransient( Window w );
00066         Client* findModal();
00067         const Group* group() const;
00068         Group* group();
00069         void checkGroup( Group* gr = NULL, bool force = false );
00070     // prefer isXXX() instead
00071         NET::WindowType windowType( bool direct = false, int supported_types = SUPPORTED_WINDOW_TYPES_MASK ) const;
00072         const WindowRules* rules() const;
00073 
00074         QRect geometry() const;
00075         QSize size() const;
00076         QSize minSize() const;
00077         QSize maxSize() const;
00078         QPoint pos() const;
00079         QRect rect() const;
00080         int x() const;
00081         int y() const;
00082         int width() const;
00083         int height() const;
00084         QPoint clientPos() const; // inside of geometry()
00085         QSize clientSize() const;
00086 
00087         bool windowEvent( XEvent* e );
00088         virtual bool eventFilter( QObject* o, QEvent* e );
00089 
00090         bool manage( Window w, bool isMapped );
00091 
00092         void releaseWindow( bool on_shutdown = false );
00093 
00094         enum Sizemode // how to resize the window in order to obey constains (mainly aspect ratios)
00095             {
00096             SizemodeAny,
00097             SizemodeFixedW, // try not to affect width
00098             SizemodeFixedH, // try not to affect height
00099             SizemodeMax, // try not to make it larger in either direction
00100             SizemodeShaded // shaded - height == 0
00101             };
00102         QSize adjustedSize( const QSize&, Sizemode mode = SizemodeAny ) const;
00103 
00104         QPixmap icon() const;
00105         QPixmap miniIcon() const;
00106 
00107         bool isActive() const;
00108         void setActive( bool, bool updateOpacity = true );
00109 
00110         int desktop() const;
00111         void setDesktop( int );
00112         bool isOnDesktop( int d ) const;
00113         bool isOnCurrentDesktop() const;
00114         bool isOnAllDesktops() const;
00115         void setOnAllDesktops( bool set );
00116 
00117     // !isMinimized() && not hidden, i.e. normally visible on some virtual desktop
00118         bool isShown( bool shaded_is_shown ) const;
00119 
00120         bool isShade() const; // true only for ShadeNormal
00121         ShadeMode shadeMode() const; // prefer isShade()
00122         void setShade( ShadeMode mode );
00123         bool isShadeable() const;
00124 
00125         bool isMinimized() const;
00126         bool isMaximizable() const;
00127         QRect geometryRestore() const;
00128         MaximizeMode maximizeMode() const;
00129         bool isMinimizable() const;
00130         void setMaximize( bool vertically, bool horizontally );
00131 
00132         void setFullScreen( bool set, bool user );
00133         bool isFullScreen() const;
00134         bool isFullScreenable( bool fullscreen_hack = false ) const;
00135         bool userCanSetFullScreen() const;
00136         QRect geometryFSRestore() const { return geom_fs_restore; } // only for session saving
00137         int fullScreenMode() const { return fullscreen_mode; } // only for session saving
00138 
00139         bool isUserNoBorder() const;
00140         void setUserNoBorder( bool set );
00141         bool userCanSetNoBorder() const;
00142         bool noBorder() const;
00143 
00144         bool skipTaskbar( bool from_outside = false ) const;
00145         void setSkipTaskbar( bool set, bool from_outside );
00146 
00147         bool skipPager() const;
00148         void setSkipPager( bool );
00149 
00150         bool keepAbove() const;
00151         void setKeepAbove( bool );
00152         bool keepBelow() const;
00153         void setKeepBelow( bool );
00154         Layer layer() const;
00155         Layer belongsToLayer() const;
00156         void invalidateLayer();
00157 
00158         void setModal( bool modal );
00159         bool isModal() const;
00160 
00161     // auxiliary functions, depend on the windowType
00162         bool wantsTabFocus() const;
00163         bool wantsInput() const;
00164         bool hasNETSupport() const;
00165         bool isMovable() const;
00166         bool isDesktop() const;
00167         bool isDock() const;
00168         bool isToolbar() const;
00169         bool isTopMenu() const;
00170         bool isMenu() const;
00171         bool isNormalWindow() const; // normal as in 'NET::Normal or NET::Unknown non-transient'
00172         bool isDialog() const;
00173         bool isSplash() const;
00174         bool isUtility() const;
00175         bool isOverride() const; // not override redirect, but NET::Override
00176     // returns true for "special" windows and false for windows which are "normal"
00177     // (normal=window which has a border, can be moved by the user, can be closed, etc.)
00178     // true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
00179     // false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
00180         bool isSpecialWindow() const;
00181 
00182         bool isResizable() const;
00183         bool isCloseable() const; // may be closed by the user (may have a close button)
00184 
00185         void takeActivity( int flags, bool handled, allowed_t ); // takes ActivityFlags as arg (in utils.h)
00186         void takeFocus( allowed_t );
00187         void demandAttention( bool set = true );
00188 
00189         void setMask( const QRegion& r, int mode = X::Unsorted );
00190         QRegion mask() const;
00191 
00192         void updateDecoration( bool check_workspace_pos, bool force = false );
00193         void checkBorderSizes();
00194 
00195     // shape extensions
00196         bool shape() const;
00197         void updateShape();
00198 
00199         void setGeometry( int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet );
00200         void setGeometry( const QRect& r, ForceGeometry_t force = NormalGeometrySet );
00201         void move( int x, int y, ForceGeometry_t force = NormalGeometrySet );
00202         void move( const QPoint & p, ForceGeometry_t force = NormalGeometrySet );
00203         // plainResize() simply resizes
00204         void plainResize( int w, int h, ForceGeometry_t force = NormalGeometrySet );
00205         void plainResize( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
00206         void keepInArea( QRect area, bool partial = false );
00207 
00208         void growHorizontal();
00209         void shrinkHorizontal();
00210         void growVertical();
00211         void shrinkVertical();
00212 
00213         bool providesContextHelp() const;
00214         KShortcut shortcut() const;
00215         void setShortcut( const QString& cut );
00216 
00217         bool performMouseCommand( Options::MouseCommand, QPoint globalPos, bool handled = false );
00218 
00219         QCString windowRole() const;
00220         QCString sessionId();
00221         QCString resourceName() const;
00222         QCString resourceClass() const;
00223         QCString wmCommand();
00224         QCString wmClientMachine( bool use_localhost ) const;
00225         Window   wmClientLeader() const;
00226         pid_t pid() const;
00227 
00228         QRect adjustedClientArea( const QRect& desktop, const QRect& area ) const;
00229 
00230         Colormap colormap() const;
00231 
00232     // hides a client - basically like minimize, but without effects, it's simply hidden
00233         void hideClient( bool hide );
00234     // updates visibility depending on whether it's on the current desktop
00235         void virtualDesktopChange();
00236 
00237         QString caption( bool full = true ) const;
00238         void updateCaption();
00239 
00240         void keyPressEvent( uint key_code ); // FRAME ??
00241         void updateMouseGrab();
00242         Window moveResizeGrabWindow() const;
00243 
00244         const QPoint calculateGravitation( bool invert, int gravity = 0 ) const; // FRAME public?
00245 
00246         void NETMoveResize( int x_root, int y_root, NET::Direction direction );
00247         void NETMoveResizeWindow( int flags, int x, int y, int width, int height );
00248         void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp, bool send_event = false );
00249         
00250         void gotPing( Time timestamp );
00251 
00252         static QCString staticWindowRole(WId);
00253         static QCString staticSessionId(WId);
00254         static QCString staticWmCommand(WId);
00255         static QCString staticWmClientMachine(WId);
00256         static Window   staticWmClientLeader(WId);
00257 
00258         void checkWorkspacePosition();
00259         void updateUserTime( Time time = CurrentTime );
00260         Time userTime() const;
00261         bool hasUserTimeSupport() const;
00262         bool ignoreFocusStealing() const;
00263 
00264     // does 'delete c;'
00265         static void deleteClient( Client* c, allowed_t );
00266 
00267         static bool resourceMatch( const Client* c1, const Client* c2 );
00268         static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
00269         static void readIcons( Window win, QPixmap* icon, QPixmap* miniicon );
00270 
00271         void minimize( bool avoid_animation = false );
00272         void unminimize( bool avoid_animation = false );
00273         void closeWindow();
00274         void killWindow();
00275         void maximize( MaximizeMode );
00276         void toggleShade();
00277         void showContextHelp();
00278         void cancelAutoRaise();
00279         void destroyClient();
00280         void checkActiveModal();
00281         void setOpacity(bool translucent, uint opacity = 0);
00282         void setShadowSize(uint shadowSize);
00283         void updateOpacity();
00284         void updateShadowSize();
00285         bool hasCustomOpacity(){return custom_opacity;}
00286         void setCustomOpacityFlag(bool custom = true);
00287         bool getWindowOpacity();
00288         int opacityPercentage();
00289         void checkAndSetInitialRuledOpacity();
00290         uint ruleOpacityInactive();
00291         uint ruleOpacityActive();
00292         unsigned int opacity();
00293         bool isBMP();
00294         void setBMP(bool b);
00295         bool touches(const Client* c);
00296         void setShapable(bool b);
00297 
00298     private slots:
00299         void autoRaise();
00300         void shadeHover();
00301         void shortcutActivated();
00302 
00303     private:
00304         friend class Bridge; // FRAME
00305         virtual void processMousePressEvent( QMouseEvent* e );
00306 
00307     private: // TODO cleanup the order of things in the .h file
00308     // use Workspace::createClient()
00309         virtual ~Client(); // use destroyClient() or releaseWindow()
00310 
00311         Position mousePosition( const QPoint& ) const;
00312         void setCursor( Position m );
00313         void setCursor( const QCursor& c );
00314 
00315         void  animateMinimizeOrUnminimize( bool minimize );
00316         QPixmap animationPixmap( int w );
00317     // transparent stuff
00318         void drawbound( const QRect& geom );
00319         void clearbound();
00320         void doDrawbound( const QRect& geom, bool clear );
00321 
00322     // handlers for X11 events
00323         bool mapRequestEvent( XMapRequestEvent* e );
00324         void unmapNotifyEvent( XUnmapEvent*e );
00325         void destroyNotifyEvent( XDestroyWindowEvent*e );
00326         void configureRequestEvent( XConfigureRequestEvent* e );
00327         void propertyNotifyEvent( XPropertyEvent* e );
00328         void clientMessageEvent( XClientMessageEvent* e );
00329         void enterNotifyEvent( XCrossingEvent* e );
00330         void leaveNotifyEvent( XCrossingEvent* e );
00331         void visibilityNotifyEvent( XVisibilityEvent* e );
00332         void focusInEvent( XFocusInEvent* e );
00333         void focusOutEvent( XFocusOutEvent* e );
00334 
00335         bool buttonPressEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
00336         bool buttonReleaseEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
00337         bool motionNotifyEvent( Window w, int state, int x, int y, int x_root, int y_root );
00338 
00339         void processDecorationButtonPress( int button, int state, int x, int y, int x_root, int y_root );
00340 
00341     private slots:
00342         void pingTimeout();
00343         void processKillerExited();
00344 
00345     private:
00346     // ICCCM 4.1.3.1, 4.1.4 , NETWM 2.5.1
00347         void setMappingState( int s );
00348         int mappingState() const;
00349         bool isIconicState() const;
00350         bool isNormalState() const;
00351         bool isManaged() const; // returns false if this client is not yet managed
00352         void updateAllowedActions( bool force = false );
00353         QSize sizeForClientSize( const QSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
00354         void changeMaximize( bool horizontal, bool vertical, bool adjust );
00355         void checkMaximizeGeometry();
00356         bool checkFullScreenHack( const QRect& geom ) const;
00357         void updateFullScreenHack( const QRect& geom );
00358         void getWmNormalHints();
00359         void getMotifHints();
00360         void getIcons();
00361         void getWmClientLeader();
00362         void getWmClientMachine();
00363         void fetchName();
00364         void fetchIconicName();
00365         QString readName() const;
00366         void setCaption( const QString& s, bool force = false );
00367         bool hasTransientInternal( const Client* c, bool indirect, ConstClientList& set ) const;
00368         void setupWindowRules( bool ignore_temporary );
00369         void updateWindowRules();
00370         void finishWindowRules();
00371         void setShortcutInternal( const KShortcut& cut );
00372 
00373         void updateWorkareaDiffs();
00374         void checkDirection( int new_diff, int old_diff, QRect& rect, const QRect& area );
00375         static int computeWorkareaDiff( int left, int right, int a_left, int a_right );
00376         void configureRequest( int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool );
00377         // resizeWithChecks() resizes according to gravity, and checks workarea position
00378         void resizeWithChecks( int w, int h, ForceGeometry_t force = NormalGeometrySet );
00379         void resizeWithChecks( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
00380         NETExtendedStrut strut() const;
00381         bool hasStrut() const;
00382         int checkShadeGeometry( int w, int h );
00383 
00384         bool startMoveResize();
00385         void finishMoveResize( bool cancel );
00386         void leaveMoveResize();
00387         void checkUnrestrictedMoveResize();
00388         void handleMoveResize( int x, int y, int x_root, int y_root );
00389         void positionGeometryTip();
00390         void grabButton( int mod );
00391         void ungrabButton( int mod );
00392         void resetMaximize();
00393         void resizeDecoration( const QSize& s );
00394         void setXTitleHeightProperty(int titleHeight);
00395 
00396         void pingWindow();
00397         void killProcess( bool ask, Time timestamp = CurrentTime );
00398         void updateUrgency();
00399         static void sendClientMessage( Window w, Atom a, Atom protocol,
00400             long data1 = 0, long data2 = 0, long data3 = 0 );
00401 
00402         void embedClient( Window w, const XWindowAttributes &attr );    
00403         void detectNoBorder();
00404         void destroyDecoration();
00405         void updateFrameStrut();
00406 
00407         void rawShow(); // just shows it
00408         void rawHide(); // just hides it
00409 
00410         Time readUserTimeMapTimestamp( const KStartupInfoId* asn_id, const KStartupInfoData* asn_data,
00411             bool session ) const;
00412         Time readUserCreationTime() const;
00413         static bool sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool active_hack );
00414         void startupIdChanged();
00415 
00416         Window client;
00417         Window wrapper;
00418         Window frame;
00419         KDecoration* decoration;
00420         Workspace* wspace;
00421         Bridge* bridge;
00422         int desk;
00423         bool buttonDown;
00424         bool moveResizeMode;
00425         bool move_faked_activity;
00426         Window move_resize_grab_window;
00427         bool unrestrictedMoveResize;
00428         bool isMove() const 
00429             {
00430             return moveResizeMode && mode == PositionCenter;
00431             }
00432         bool isResize() const 
00433             {
00434             return moveResizeMode && mode != PositionCenter;
00435             }
00436 
00437         Position mode;
00438         QPoint moveOffset;
00439         QPoint invertedMoveOffset;
00440         QRect moveResizeGeom;
00441         QRect initialMoveResizeGeom;
00442         XSizeHints  xSizeHint;
00443         void sendSyntheticConfigureNotify();
00444         int mapping_state;
00445         void readTransient();
00446         Window verifyTransientFor( Window transient_for, bool set );
00447         void addTransient( Client* cl );
00448         void removeTransient( Client* cl );
00449         void removeFromMainClients();
00450         void cleanGrouping();
00451         void checkGroupTransients();
00452         void setTransient( Window new_transient_for_id );
00453         Client* transient_for;
00454         Window transient_for_id;
00455         Window original_transient_for_id;
00456         ClientList transients_list; // SELI make this ordered in stacking order?
00457         ShadeMode shade_mode;
00458         uint active :1;
00459         uint keep_above : 1; // NET::KeepAbove (was stays_on_top)
00460         uint is_shape :1;
00461         uint skip_taskbar :1;
00462         uint original_skip_taskbar :1; // unaffected by KWin
00463         uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
00464         uint Ptakefocus :1;// does the window understand the TakeFocus protocol?
00465         uint Ptakeactivity : 1; // does it support _NET_WM_TAKE_ACTIVITY
00466         uint Pcontexthelp : 1; // does the window understand the ContextHelp protocol?
00467         uint Pping : 1; // does it support _NET_WM_PING?
00468         uint input :1; // does the window want input in its wm_hints
00469         uint skip_pager : 1;
00470         uint motif_noborder : 1;
00471         uint motif_may_resize : 1;
00472         uint motif_may_move :1;
00473         uint motif_may_close : 1;
00474         uint keep_below : 1; // NET::KeepBelow
00475         uint minimized : 1;
00476         uint hidden : 1; // forcibly hidden by calling hide()
00477         uint modal : 1; // NET::Modal
00478         uint noborder : 1;
00479         uint user_noborder : 1;
00480         uint not_obscured : 1;
00481         uint urgency : 1; // XWMHints, UrgencyHint
00482         uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client
00483         WindowRules client_rules;
00484         void getWMHints();
00485         void readIcons();
00486         void getWindowProtocols();
00487         QPixmap icon_pix;
00488         QPixmap miniicon_pix;
00489         QCursor cursor;
00490     // FullScreenHack - non-NETWM fullscreen (noborder,size of desktop)
00491     // DON'T reorder - saved to config files !!!
00492         enum FullScreenMode { FullScreenNone, FullScreenNormal, FullScreenHack };
00493         FullScreenMode fullscreen_mode;
00494         MaximizeMode max_mode;
00495         QRect geom_restore;
00496         QRect geom_fs_restore;
00497         int workarea_diff_x, workarea_diff_y;
00498         WinInfo* info;
00499         QTimer* autoRaiseTimer;
00500         QTimer* shadeHoverTimer;
00501         Colormap cmap;
00502         QCString resource_name;
00503         QCString resource_class;
00504         QCString client_machine;
00505         QString cap_normal, cap_iconic, cap_suffix;
00506         WId wmClientLeaderWin;
00507         QCString window_role;
00508         Group* in_group;
00509         Window window_group;
00510         Layer in_layer;
00511         QTimer* ping_timer;
00512         KProcess* process_killer;
00513         Time ping_timestamp;
00514         Time user_time;
00515         unsigned long allowed_actions;
00516         QRect frame_geometry;
00517         QSize client_size;
00518         int block_geometry; // >0 - new geometry is remembered, but not actually set
00519         bool shade_geometry_change;
00520         int border_left, border_right, border_top, border_bottom;
00521         QRegion _mask;
00522         static bool check_active_modal; // see Client::checkActiveModal()
00523         KShortcut _shortcut;
00524         friend struct FetchNameInternalPredicate;
00525         friend struct CheckIgnoreFocusStealingProcedure;
00526         friend struct ResetupRulesProcedure;
00527         void show() { assert( false ); } // SELI remove after Client is no longer QWidget
00528         void hide() { assert( false ); }
00529         uint opacity_;
00530         uint savedOpacity_;
00531         bool custom_opacity;
00532         uint rule_opacity_active; //translucency rules
00533         uint rule_opacity_inactive; //dto.
00534         //int shadeOriginalHeight;
00535         bool isBMP_;
00536         
00537     };
00538 
00539 // NET WM Protocol handler class
00540 class WinInfo : public NETWinInfo
00541     {
00542     private:
00543         typedef KWinInternal::Client Client; // because of NET::Client
00544     public:
00545         WinInfo( Client* c, Display * display, Window window,
00546                 Window rwin, const unsigned long pr[], int pr_size );
00547         virtual void changeDesktop(int desktop);
00548         virtual void changeState( unsigned long state, unsigned long mask );
00549     private:
00550         Client * m_client;
00551     };
00552 
00553 inline Window Client::window() const
00554     {
00555     return client;
00556     }
00557 
00558 inline Window Client::frameId() const
00559     {
00560     return frame;
00561     }
00562 
00563 inline Window Client::wrapperId() const
00564     {
00565     return wrapper;
00566     }
00567 
00568 inline Window Client::decorationId() const
00569     {
00570     return decoration != NULL ? decoration->widget()->winId() : None;
00571     }
00572 
00573 inline Workspace* Client::workspace() const
00574     {
00575     return wspace;
00576     }
00577 
00578 inline const Client* Client::transientFor() const
00579     {
00580     return transient_for;
00581     }
00582 
00583 inline Client* Client::transientFor()
00584     {
00585     return transient_for;
00586     }
00587 
00588 inline bool Client::groupTransient() const
00589     {
00590     return transient_for_id == workspace()->rootWin();
00591     }
00592 
00593 // needed because verifyTransientFor() may set transient_for_id to root window,
00594 // if the original value has a problem (window doesn't exist, etc.)
00595 inline bool Client::wasOriginallyGroupTransient() const
00596     {
00597     return original_transient_for_id == workspace()->rootWin();
00598     }
00599 
00600 inline bool Client::isTransient() const
00601     {
00602     return transient_for_id != None;
00603     }
00604 
00605 inline const ClientList& Client::transients() const
00606     {
00607     return transients_list;
00608     }
00609 
00610 inline const Group* Client::group() const
00611     {
00612     return in_group;
00613     }
00614 
00615 inline Group* Client::group()
00616     {
00617     return in_group;
00618     }
00619 
00620 inline int Client::mappingState() const
00621     {
00622     return mapping_state;
00623     }
00624 
00625 inline QCString Client::resourceName() const
00626     {
00627     return resource_name; // it is always lowercase
00628     }
00629 
00630 inline QCString Client::resourceClass() const
00631     {
00632     return resource_class; // it is always lowercase
00633     }
00634 
00635 inline
00636 bool Client::isMinimized() const
00637     {
00638     return minimized;
00639     }
00640 
00641 inline bool Client::isActive() const
00642     {
00643     return active;
00644     }
00645 
00652 inline int Client::desktop() const
00653     {
00654     return desk;
00655     }
00656 
00657 inline bool Client::isOnAllDesktops() const
00658     {
00659     return desk == NET::OnAllDesktops;
00660     }
00665 inline bool Client::isOnDesktop( int d ) const
00666     {
00667     return desk == d || /*desk == 0 ||*/ isOnAllDesktops();
00668     }
00669 
00670 inline
00671 bool Client::isShown( bool shaded_is_shown ) const
00672     {
00673     return !isMinimized() && ( !isShade() || shaded_is_shown ) && !hidden;
00674     }
00675 
00676 inline
00677 bool Client::isShade() const
00678     {
00679     return shade_mode == ShadeNormal;
00680     }
00681 
00682 inline
00683 ShadeMode Client::shadeMode() const
00684     {
00685     return shade_mode;
00686     }
00687 
00688 inline QPixmap Client::icon() const
00689     {
00690     return icon_pix;
00691     }
00692 
00693 inline QPixmap Client::miniIcon() const
00694     {
00695     return miniicon_pix;
00696     }
00697 
00698 inline QRect Client::geometryRestore() const
00699     {
00700     return geom_restore;
00701     }
00702 
00703 inline Client::MaximizeMode Client::maximizeMode() const
00704     {
00705     return max_mode;
00706     }
00707 
00708 inline bool Client::skipTaskbar( bool from_outside ) const
00709     {
00710     return from_outside ? original_skip_taskbar : skip_taskbar;
00711     }
00712 
00713 inline bool Client::skipPager() const
00714     {
00715     return skip_pager;
00716     }
00717 
00718 inline bool Client::keepAbove() const
00719     {
00720     return keep_above;
00721     }
00722 
00723 inline bool Client::keepBelow() const
00724     {
00725     return keep_below;
00726     }
00727 
00728 inline bool Client::shape() const
00729     {
00730     return is_shape;
00731     }
00732 
00733 
00734 inline bool Client::isFullScreen() const
00735     {
00736     return fullscreen_mode != FullScreenNone;
00737     }
00738 
00739 inline bool Client::isModal() const
00740     {
00741     return modal;
00742     }
00743 
00744 inline bool Client::hasNETSupport() const
00745     {
00746     return info->hasNETSupport();
00747     }
00748 
00749 inline Colormap Client::colormap() const
00750     {
00751     return cmap;
00752     }
00753 
00754 inline pid_t Client::pid() const
00755     {
00756     return info->pid();
00757     }
00758 
00759 inline void Client::invalidateLayer()
00760     {
00761     in_layer = UnknownLayer;
00762     }
00763 
00764 inline bool Client::isIconicState() const
00765     {
00766     return mapping_state == IconicState;
00767     }
00768 
00769 inline bool Client::isNormalState() const
00770     {
00771     return mapping_state == NormalState;
00772     }
00773 
00774 inline bool Client::isManaged() const
00775     {
00776     return mapping_state != WithdrawnState;
00777     }
00778 
00779 inline QCString Client::windowRole() const
00780     {
00781     return window_role;
00782     }
00783 
00784 inline QRect Client::geometry() const
00785     {
00786     return frame_geometry;
00787     }
00788 
00789 inline QSize Client::size() const
00790     {
00791     return frame_geometry.size();
00792     }
00793 
00794 inline QPoint Client::pos() const
00795     {
00796     return frame_geometry.topLeft();
00797     }
00798 
00799 inline int Client::x() const
00800     {
00801     return frame_geometry.x();
00802     }
00803 
00804 inline int Client::y() const
00805     {
00806     return frame_geometry.y();
00807     }
00808 
00809 inline int Client::width() const
00810     {
00811     return frame_geometry.width();
00812     }
00813 
00814 inline int Client::height() const
00815     {
00816     return frame_geometry.height();
00817     }
00818 
00819 inline QRect Client::rect() const
00820     {
00821     return QRect( 0, 0, width(), height());
00822     }
00823 
00824 inline QPoint Client::clientPos() const
00825     {
00826     return QPoint( border_left, border_top );
00827     }
00828 
00829 inline QSize Client::clientSize() const
00830     {
00831     return client_size;
00832     }
00833 
00834 inline void Client::setGeometry( const QRect& r, ForceGeometry_t force )
00835     {
00836     setGeometry( r.x(), r.y(), r.width(), r.height(), force );
00837     }
00838 
00839 inline void Client::move( const QPoint & p, ForceGeometry_t force )
00840     {
00841     move( p.x(), p.y(), force );
00842     }
00843 
00844 inline void Client::plainResize( const QSize& s, ForceGeometry_t force )
00845     {
00846     plainResize( s.width(), s.height(), force );
00847     }
00848 
00849 inline void Client::resizeWithChecks( const QSize& s, ForceGeometry_t force )
00850     {
00851     resizeWithChecks( s.width(), s.height(), force );
00852     }
00853 
00854 inline bool Client::hasUserTimeSupport() const
00855     {
00856     return info->userTime() != -1U;
00857     }
00858     
00859 inline bool Client::ignoreFocusStealing() const
00860     {
00861     return ignore_focus_stealing;
00862     }
00863 
00864 inline const WindowRules* Client::rules() const
00865     {
00866     return &client_rules;
00867     }
00868 
00869 KWIN_PROCEDURE( CheckIgnoreFocusStealingProcedure, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing( cl ));
00870 
00871 inline Window Client::moveResizeGrabWindow() const
00872     {
00873     return move_resize_grab_window;
00874     }
00875 
00876 inline KShortcut Client::shortcut() const
00877     {
00878     return _shortcut;
00879     }
00880 
00881 inline bool Client::isBMP()
00882     {
00883     return isBMP_;
00884     }
00885 
00886 inline void Client::setBMP(bool b)
00887     {
00888     isBMP_ = b;
00889     }
00890     
00891 #ifdef NDEBUG
00892 inline
00893 kndbgstream& operator<<( kndbgstream& stream, const Client* ) { return stream; }
00894 inline
00895 kndbgstream& operator<<( kndbgstream& stream, const ClientList& ) { return stream; }
00896 inline
00897 kndbgstream& operator<<( kndbgstream& stream, const ConstClientList& ) { return stream; }
00898 #else
00899 kdbgstream& operator<<( kdbgstream& stream, const Client* );
00900 kdbgstream& operator<<( kdbgstream& stream, const ClientList& );
00901 kdbgstream& operator<<( kdbgstream& stream, const ConstClientList& );
00902 #endif
00903 
00904 KWIN_COMPARE_PREDICATE( WindowMatchPredicate, Window, cl->window() == value );
00905 KWIN_COMPARE_PREDICATE( FrameIdMatchPredicate, Window, cl->frameId() == value );
00906 KWIN_COMPARE_PREDICATE( WrapperIdMatchPredicate, Window, cl->wrapperId() == value );
00907 
00908 } // namespace
00909 
00910 #endif
KDE Logo
This file is part of the documentation for kwin Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Sep 30 18:40:41 2005 by doxygen 1.4.3 written by Dimitri van Heesch, © 1997-2003