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