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 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, 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 public slots: // FRAME these probably don't need to be slots anymore 00272 void minimize(); 00273 void unminimize(); 00274 void closeWindow(); 00275 void killWindow(); 00276 void maximize( MaximizeMode ); 00277 void toggleOnAllDesktops(); 00278 void toggleShade(); 00279 void showContextHelp(); 00280 void autoRaise(); 00281 void cancelAutoRaise(); 00282 void shadeHover(); 00283 void destroyClient(); 00284 00285 private: 00286 friend class Bridge; // FRAME 00287 virtual void processMousePressEvent( QMouseEvent* e ); 00288 00289 private: // TODO cleanup the order of things in the .h file 00290 // use Workspace::createClient() 00291 virtual ~Client(); // use destroyClient() or releaseWindow() 00292 00293 Position mousePosition( const QPoint& ) const; 00294 void setCursor( Position m ); 00295 void setCursor( const QCursor& c ); 00296 00297 void animateMinimizeOrUnminimize( bool minimize ); 00298 QPixmap animationPixmap( int w ); 00299 // transparent stuff 00300 void drawbound( const QRect& geom ); 00301 void clearbound(); 00302 void doDrawbound( const QRect& geom, bool clear ); 00303 00304 // handlers for X11 events 00305 bool mapRequestEvent( XMapRequestEvent* e ); 00306 void unmapNotifyEvent( XUnmapEvent*e ); 00307 void destroyNotifyEvent( XDestroyWindowEvent*e ); 00308 void configureRequestEvent( XConfigureRequestEvent* e ); 00309 void propertyNotifyEvent( XPropertyEvent* e ); 00310 void clientMessageEvent( XClientMessageEvent* e ); 00311 void enterNotifyEvent( XCrossingEvent* e ); 00312 void leaveNotifyEvent( XCrossingEvent* e ); 00313 void visibilityNotifyEvent( XVisibilityEvent* e ); 00314 void focusInEvent( XFocusInEvent* e ); 00315 void focusOutEvent( XFocusOutEvent* e ); 00316 00317 bool buttonPressEvent( Window w, int button, int state, int x, int y, int x_root, int y_root ); 00318 bool buttonReleaseEvent( Window w, int button, int state, int x, int y, int x_root, int y_root ); 00319 bool motionNotifyEvent( Window w, int state, int x, int y, int x_root, int y_root ); 00320 00321 void processDecorationButtonPress( int button, int state, int x, int y, int x_root, int y_root ); 00322 00323 private slots: 00324 void pingTimeout(); 00325 void processKillerExited(); 00326 00327 private: 00328 // ICCCM 4.1.3.1, 4.1.4 , NETWM 2.5.1 00329 void setMappingState( int s ); 00330 int mappingState() const; 00331 bool isIconicState() const; 00332 bool isNormalState() const; 00333 bool isManaged() const; // returns false if this client is not yet managed 00334 void updateAllowedActions( bool force = false ); 00335 QSize sizeForClientSize( const QSize&, Sizemode mode = SizemodeAny ) const; 00336 void changeMaximize( bool horizontal, bool vertical, bool adjust ); 00337 void getWmNormalHints(); 00338 void getIcons(); 00339 void getWmClientLeader(); 00340 void fetchName(); 00341 void fetchIconicName(); 00342 bool hasTransientInternal( const Client* c, bool indirect, ConstClientList& set ) const; 00343 00344 void updateWorkareaDiffs(); 00345 void checkDirection( int new_diff, int old_diff, QRect& rect, const QRect& area ); 00346 static int computeWorkareaDiff( int left, int right, int a_left, int a_right ); 00347 void configureRequest( int value_mask, int rx, int ry, int rw, int rh, int gravity = 0 ); 00348 // resizeWithChecks() resizes according to gravity, and checks workarea position 00349 void resizeWithChecks( int w, int h, ForceGeometry_t force = NormalGeometrySet ); 00350 void resizeWithChecks( const QSize& s, ForceGeometry_t force = NormalGeometrySet ); 00351 00352 bool startMoveResize(); 00353 void finishMoveResize( bool cancel ); 00354 void leaveMoveResize(); 00355 void checkUnrestrictedMoveResize(); 00356 void handleMoveResize( int x, int y, int x_root, int y_root ); 00357 void positionGeometryTip(); 00358 void updateMouseGrab(); 00359 void grabButton( int mod ); 00360 void ungrabButton( int mod ); 00361 void resetMaximize(); 00362 void resizeDecoration( const QSize& s ); 00363 00364 void pingWindow(); 00365 void killProcess( bool ask, Time timestamp = CurrentTime ); 00366 void updateUrgency(); 00367 00368 void embedClient( Window w, const XWindowAttributes &attr ); 00369 void detectNoBorder(); 00370 void destroyDecoration(); 00371 void updateFrameStrut(); 00372 00373 void rawShow(); // just shows it 00374 void rawHide(); // just hides it 00375 00376 Time readUserTimeMapTimestamp( const KStartupInfoData* asn_data, 00377 const SessionInfo* session ) const; 00378 Time readUserCreationTime() const; 00379 static bool sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool active_hack ); 00380 void startupIdChanged(); 00381 00382 Window client; 00383 Window wrapper; 00384 Window frame; 00385 KDecoration* decoration; 00386 Workspace* wspace; 00387 Bridge* bridge; 00388 int desk; 00389 bool buttonDown; 00390 bool moveResizeMode; 00391 bool move_faked_activity; 00392 Window move_resize_grab_window; 00393 bool unrestrictedMoveResize; 00394 bool isMove() const 00395 { 00396 return moveResizeMode && mode == PositionCenter; 00397 } 00398 bool isResize() const 00399 { 00400 return moveResizeMode && mode != PositionCenter; 00401 } 00402 00403 Position mode; 00404 QPoint moveOffset; 00405 QPoint invertedMoveOffset; 00406 QRect moveResizeGeom; 00407 QRect initialMoveResizeGeom; 00408 XSizeHints xSizeHint; 00409 void sendSyntheticConfigureNotify(); 00410 int mapping_state; 00411 void readTransient(); 00412 Window verifyTransientFor( Window transient_for, bool set ); 00413 void addTransient( Client* cl ); 00414 void removeTransient( Client* cl ); 00415 void removeFromMainClients(); 00416 void cleanGrouping(); 00417 void checkGroupTransients(); 00418 void setTransient( Window new_transient_for_id ); 00419 Client* transient_for; 00420 Window transient_for_id; 00421 Window original_transient_for_id; 00422 ClientList transients_list; // SELI make this ordered in stacking order? 00423 ShadeMode shade_mode; 00424 uint active :1; 00425 uint keep_above : 1; // NET::KeepAbove (was stays_on_top) 00426 uint is_shape :1; 00427 uint skip_taskbar :1; 00428 uint original_skip_taskbar :1; // unaffected by KWin 00429 uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol? 00430 uint Ptakefocus :1;// does the window understand the TakeFocus protocol? 00431 uint Pcontexthelp : 1; // does the window understand the ContextHelp protocol? 00432 uint Pping : 1; // does it support _NET_WM_PING? 00433 uint input :1; // does the window want input in its wm_hints 00434 uint store_settings : 1; 00435 uint skip_pager : 1; 00436 uint motif_may_resize : 1; 00437 uint motif_may_move :1; 00438 uint motif_may_close : 1; 00439 uint keep_below : 1; // NET::KeepBelow 00440 uint minimized : 1; 00441 uint hidden : 1; // forcibly hidden by calling hide() 00442 uint modal : 1; // NET::Modal 00443 uint noborder : 1; 00444 uint user_noborder : 1; 00445 uint not_obscured : 1; 00446 uint urgency : 1; // XWMHints, UrgencyHint 00447 uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client 00448 void getWMHints(); 00449 void readIcons(); 00450 void getWindowProtocols(); 00451 QPixmap icon_pix; 00452 QPixmap miniicon_pix; 00453 QCursor cursor; 00454 // FullScreenHack - non-NETWM fullscreen (noborder,size of desktop) 00455 // DON'T reorder - saved to config files !!! 00456 enum FullScreenMode { FullScreenNone, FullScreenNormal, FullScreenHack }; 00457 FullScreenMode fullscreen_mode; 00458 MaximizeMode max_mode; 00459 QRect geom_restore; 00460 QRect geom_fs_restore; 00461 int workarea_diff_x, workarea_diff_y; 00462 WinInfo* info; 00463 QTimer* autoRaiseTimer; 00464 QTimer* shadeHoverTimer; 00465 Colormap cmap; 00466 QCString resource_name; 00467 QCString resource_class; 00468 QString cap_normal, cap_iconic, cap_suffix; 00469 WId wmClientLeaderWin; 00470 QCString window_role; 00471 void checkGroup(); 00472 Group* in_group; 00473 Window window_group; 00474 Layer in_layer; 00475 QTimer* ping_timer; 00476 KProcess* process_killer; 00477 Time ping_timestamp; 00478 Time user_time; 00479 unsigned long allowed_actions; 00480 QRect frame_geometry; 00481 QSize client_size; 00482 int block_geometry; // >0 - new geometry is remembered, but not actually set 00483 bool shade_geometry_change; 00484 int border_left, border_right, border_top, border_bottom; 00485 QRegion _mask; 00486 friend struct FetchNameInternalPredicate; 00487 friend struct CheckIgnoreFocusStealingProcedure; 00488 void show() { assert( false ); } // SELI remove after Client is no longer QWidget 00489 void hide() { assert( false ); } 00490 }; 00491 00492 // NET WM Protocol handler class 00493 class WinInfo : public NETWinInfo 00494 { 00495 private: 00496 typedef KWinInternal::Client Client; // because of NET::Client 00497 public: 00498 WinInfo( Client* c, Display * display, Window window, 00499 Window rwin, const unsigned long pr[], int pr_size ); 00500 virtual void changeDesktop(int desktop); 00501 virtual void changeState( unsigned long state, unsigned long mask ); 00502 private: 00503 Client * m_client; 00504 }; 00505 00506 inline Window Client::window() const 00507 { 00508 return client; 00509 } 00510 00511 inline Window Client::frameId() const 00512 { 00513 return frame; 00514 } 00515 00516 inline Window Client::wrapperId() const 00517 { 00518 return wrapper; 00519 } 00520 00521 inline Window Client::decorationId() const 00522 { 00523 return decoration != NULL ? decoration->widget()->winId() : None; 00524 } 00525 00526 inline Workspace* Client::workspace() const 00527 { 00528 return wspace; 00529 } 00530 00531 inline const Client* Client::transientFor() const 00532 { 00533 return transient_for; 00534 } 00535 00536 inline Client* Client::transientFor() 00537 { 00538 return transient_for; 00539 } 00540 00541 inline bool Client::groupTransient() const 00542 { 00543 return transient_for_id == workspace()->rootWin(); 00544 } 00545 00546 // needed because verifyTransientFor() may set transient_for_id to root window, 00547 // if the original value has a problem (window doesn't exist, etc.) 00548 inline bool Client::wasOriginallyGroupTransient() const 00549 { 00550 return original_transient_for_id == workspace()->rootWin(); 00551 } 00552 00553 inline bool Client::isTransient() const 00554 { 00555 return transient_for_id != None; 00556 } 00557 00558 inline const ClientList& Client::transients() const 00559 { 00560 return transients_list; 00561 } 00562 00563 inline const Group* Client::group() const 00564 { 00565 return in_group; 00566 } 00567 00568 inline Group* Client::group() 00569 { 00570 return in_group; 00571 } 00572 00573 inline int Client::mappingState() const 00574 { 00575 return mapping_state; 00576 } 00577 00578 inline QCString Client::resourceName() const 00579 { 00580 return resource_name; // it is always lowercase 00581 } 00582 00583 inline QCString Client::resourceClass() const 00584 { 00585 return resource_class; // it is always lowercase 00586 } 00587 00588 inline 00589 bool Client::isMinimized() const 00590 { 00591 return minimized; 00592 } 00593 00594 inline bool Client::isActive() const 00595 { 00596 return active; 00597 } 00598 00605 inline int Client::desktop() const 00606 { 00607 return desk; 00608 } 00609 00610 inline bool Client::isOnAllDesktops() const 00611 { 00612 return desk == NET::OnAllDesktops; 00613 } 00618 inline bool Client::isOnDesktop( int d ) const 00619 { 00620 return desk == d || /*desk == 0 ||*/ isOnAllDesktops(); 00621 } 00622 00623 inline 00624 bool Client::isShown( bool shaded_is_shown ) const 00625 { 00626 return !isMinimized() && ( !isShade() || shaded_is_shown ) && !hidden; 00627 } 00628 00629 inline 00630 bool Client::isShade() const 00631 { 00632 return shade_mode == ShadeNormal; 00633 } 00634 00635 inline 00636 Client::ShadeMode Client::shadeMode() const 00637 { 00638 return shade_mode; 00639 } 00640 00641 inline QPixmap Client::icon() const 00642 { 00643 return icon_pix; 00644 } 00645 00646 inline QPixmap Client::miniIcon() const 00647 { 00648 return miniicon_pix; 00649 } 00650 00651 inline QRect Client::geometryRestore() const 00652 { 00653 return geom_restore; 00654 } 00655 00656 inline Client::MaximizeMode Client::maximizeMode() const 00657 { 00658 return max_mode; 00659 } 00660 00661 inline bool Client::skipTaskbar( bool from_outside ) const 00662 { 00663 return from_outside ? original_skip_taskbar : skip_taskbar; 00664 } 00665 00666 inline bool Client::skipPager() const 00667 { 00668 return skip_pager; 00669 } 00670 00671 inline bool Client::keepAbove() const 00672 { 00673 return keep_above; 00674 } 00675 00676 inline bool Client::keepBelow() const 00677 { 00678 return keep_below; 00679 } 00680 00681 inline bool Client::storeSettings() const 00682 { 00683 return store_settings; 00684 } 00685 00686 inline void Client::setStoreSettings( bool b ) 00687 { 00688 store_settings = b; 00689 } 00690 00691 00692 inline bool Client::shape() const 00693 { 00694 return is_shape; 00695 } 00696 00697 00698 inline bool Client::isFullScreen() const 00699 { 00700 return fullscreen_mode != FullScreenNone; 00701 } 00702 00703 inline bool Client::isModal() const 00704 { 00705 return modal; 00706 } 00707 00708 inline bool Client::hasNETSupport() const 00709 { 00710 return info->hasNETSupport(); 00711 } 00712 00713 inline Colormap Client::colormap() const 00714 { 00715 return cmap; 00716 } 00717 00718 inline pid_t Client::pid() const 00719 { 00720 return info->pid(); 00721 } 00722 00723 inline void Client::invalidateLayer() 00724 { 00725 in_layer = UnknownLayer; 00726 } 00727 00728 inline bool Client::isIconicState() const 00729 { 00730 return mapping_state == IconicState; 00731 } 00732 00733 inline bool Client::isNormalState() const 00734 { 00735 return mapping_state == NormalState; 00736 } 00737 00738 inline bool Client::isManaged() const 00739 { 00740 return mapping_state != WithdrawnState; 00741 } 00742 00743 inline QCString Client::windowRole() const 00744 { 00745 return window_role; 00746 } 00747 00748 inline QRect Client::geometry() const 00749 { 00750 return frame_geometry; 00751 } 00752 00753 inline QSize Client::size() const 00754 { 00755 return frame_geometry.size(); 00756 } 00757 00758 inline QSize Client::minSize() const 00759 { 00760 return QSize( xSizeHint.min_width, xSizeHint.min_height ); 00761 } 00762 00763 inline QPoint Client::pos() const 00764 { 00765 return frame_geometry.topLeft(); 00766 } 00767 00768 inline int Client::x() const 00769 { 00770 return frame_geometry.x(); 00771 } 00772 00773 inline int Client::y() const 00774 { 00775 return frame_geometry.y(); 00776 } 00777 00778 inline int Client::width() const 00779 { 00780 return frame_geometry.width(); 00781 } 00782 00783 inline int Client::height() const 00784 { 00785 return frame_geometry.height(); 00786 } 00787 00788 inline QRect Client::rect() const 00789 { 00790 return QRect( 0, 0, width(), height()); 00791 } 00792 00793 inline QPoint Client::clientPos() const 00794 { 00795 return QPoint( border_left, border_top ); 00796 } 00797 00798 inline QSize Client::clientSize() const 00799 { 00800 return client_size; 00801 } 00802 00803 inline void Client::setGeometry( const QRect& r, ForceGeometry_t force ) 00804 { 00805 setGeometry( r.x(), r.y(), r.width(), r.height(), force ); 00806 } 00807 00808 inline void Client::move( const QPoint & p, ForceGeometry_t force ) 00809 { 00810 move( p.x(), p.y(), force ); 00811 } 00812 00813 inline void Client::plainResize( const QSize& s, ForceGeometry_t force ) 00814 { 00815 plainResize( s.width(), s.height(), force ); 00816 } 00817 00818 inline void Client::resizeWithChecks( const QSize& s, ForceGeometry_t force ) 00819 { 00820 resizeWithChecks( s.width(), s.height(), force ); 00821 } 00822 00823 inline bool Client::hasUserTimeSupport() const 00824 { 00825 return info->userTime() != -1U; 00826 } 00827 00828 inline bool Client::ignoreFocusStealing() const 00829 { 00830 return ignore_focus_stealing; 00831 } 00832 00833 KWIN_PROCEDURE( CheckIgnoreFocusStealingProcedure, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing( cl )); 00834 00835 inline Window Client::moveResizeGrabWindow() const 00836 { 00837 return move_resize_grab_window; 00838 } 00839 00840 #ifdef NDEBUG 00841 kndbgstream& operator<<( kndbgstream& stream, const Client* ); 00842 kndbgstream& operator<<( kndbgstream& stream, const ClientList& ); 00843 kndbgstream& operator<<( kndbgstream& stream, const ConstClientList& ); 00844 #else 00845 kdbgstream& operator<<( kdbgstream& stream, const Client* ); 00846 kdbgstream& operator<<( kdbgstream& stream, const ClientList& ); 00847 kdbgstream& operator<<( kdbgstream& stream, const ConstClientList& ); 00848 #endif 00849 00850 KWIN_COMPARE_PREDICATE( WindowMatchPredicate, Window, cl->window() == value ); 00851 KWIN_COMPARE_PREDICATE( FrameIdMatchPredicate, Window, cl->frameId() == value ); 00852 KWIN_COMPARE_PREDICATE( WrapperIdMatchPredicate, Window, cl->wrapperId() == value ); 00853 00854 } // namespace 00855 00856 #endif
KDE Logo
This file is part of the documentation for kwin Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Dec 16 19:08:40 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003