00001
00002
00003
00004
00005
00006
00007
00008
00009
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;
00063 bool hasTransient( const Client* c, bool indirect ) const;
00064 const ClientList& transients() const;
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 void changeClientLeaderGroup( Group* gr );
00071
00072 NET::WindowType windowType( bool direct = false, int supported_types = SUPPORTED_WINDOW_TYPES_MASK ) const;
00073 const WindowRules* rules() const;
00074 void removeRule( Rules* r );
00075 void setupWindowRules( bool ignore_temporary );
00076 void applyWindowRules();
00077 void updateWindowRules();
00078
00079 QRect geometry() const;
00080 QSize size() const;
00081 QSize minSize() const;
00082 QSize maxSize() const;
00083 QPoint pos() const;
00084 QRect rect() const;
00085 int x() const;
00086 int y() const;
00087 int width() const;
00088 int height() const;
00089 QPoint clientPos() const;
00090 QSize clientSize() const;
00091
00092 bool windowEvent( XEvent* e );
00093 virtual bool eventFilter( QObject* o, QEvent* e );
00094
00095 bool manage( Window w, bool isMapped );
00096
00097 void releaseWindow( bool on_shutdown = false );
00098
00099 enum Sizemode
00100 {
00101 SizemodeAny,
00102 SizemodeFixedW,
00103 SizemodeFixedH,
00104 SizemodeMax
00105 };
00106 QSize adjustedSize( const QSize&, Sizemode mode = SizemodeAny ) const;
00107 QSize adjustedSize() const;
00108
00109 QPixmap icon() const;
00110 QPixmap miniIcon() const;
00111
00112 bool isActive() const;
00113 void setActive( bool, bool updateOpacity = true );
00114
00115 int desktop() const;
00116 void setDesktop( int );
00117 bool isOnDesktop( int d ) const;
00118 bool isOnCurrentDesktop() const;
00119 bool isOnAllDesktops() const;
00120 void setOnAllDesktops( bool set );
00121
00122 bool isOnScreen( int screen ) const;
00123 int screen() const;
00124
00125
00126 bool isShown( bool shaded_is_shown ) const;
00127
00128 bool isShade() const;
00129 ShadeMode shadeMode() const;
00130 void setShade( ShadeMode mode );
00131 bool isShadeable() const;
00132
00133 bool isMinimized() const;
00134 bool isMaximizable() const;
00135 QRect geometryRestore() const;
00136 MaximizeMode maximizeModeRestore() const;
00137 MaximizeMode maximizeMode() const;
00138 bool isMinimizable() const;
00139 void setMaximize( bool vertically, bool horizontally );
00140
00141 void setFullScreen( bool set, bool user );
00142 bool isFullScreen() const;
00143 bool isFullScreenable( bool fullscreen_hack = false ) const;
00144 bool userCanSetFullScreen() const;
00145 QRect geometryFSRestore() const { return geom_fs_restore; }
00146 int fullScreenMode() const { return fullscreen_mode; }
00147
00148 bool isUserNoBorder() const;
00149 void setUserNoBorder( bool set );
00150 bool userCanSetNoBorder() const;
00151 bool noBorder() const;
00152
00153 bool skipTaskbar( bool from_outside = false ) const;
00154 void setSkipTaskbar( bool set, bool from_outside );
00155
00156 bool skipPager() const;
00157 void setSkipPager( bool );
00158
00159 bool keepAbove() const;
00160 void setKeepAbove( bool );
00161 bool keepBelow() const;
00162 void setKeepBelow( bool );
00163 Layer layer() const;
00164 Layer belongsToLayer() const;
00165 void invalidateLayer();
00166
00167 void setModal( bool modal );
00168 bool isModal() const;
00169
00170
00171 bool wantsTabFocus() const;
00172 bool wantsInput() const;
00173 bool hasNETSupport() const;
00174 bool isMovable() const;
00175 bool isDesktop() const;
00176 bool isDock() const;
00177 bool isToolbar() const;
00178 bool isTopMenu() const;
00179 bool isMenu() const;
00180 bool isNormalWindow() const;
00181 bool isDialog() const;
00182 bool isSplash() const;
00183 bool isUtility() const;
00184
00185
00186
00187
00188 bool isSpecialWindow() const;
00189
00190 bool isResizable() const;
00191 bool isCloseable() const;
00192
00193 void takeActivity( int flags, bool handled, allowed_t );
00194 void takeFocus( allowed_t );
00195 void demandAttention( bool set = true );
00196
00197 void setMask( const QRegion& r, int mode = X::Unsorted );
00198 QRegion mask() const;
00199
00200 void updateDecoration( bool check_workspace_pos, bool force = false );
00201 void checkBorderSizes();
00202
00203
00204 bool shape() const;
00205 void updateShape();
00206
00207 void setGeometry( int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet );
00208 void setGeometry( const QRect& r, ForceGeometry_t force = NormalGeometrySet );
00209 void move( int x, int y, ForceGeometry_t force = NormalGeometrySet );
00210 void move( const QPoint & p, ForceGeometry_t force = NormalGeometrySet );
00211
00212 void plainResize( int w, int h, ForceGeometry_t force = NormalGeometrySet );
00213 void plainResize( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
00214
00215 void resizeWithChecks( int w, int h, ForceGeometry_t force = NormalGeometrySet );
00216 void resizeWithChecks( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
00217 void keepInArea( QRect area, bool partial = false );
00218
00219 void growHorizontal();
00220 void shrinkHorizontal();
00221 void growVertical();
00222 void shrinkVertical();
00223
00224 bool providesContextHelp() const;
00225 KShortcut shortcut() const;
00226 void setShortcut( const QString& cut );
00227
00228 bool performMouseCommand( Options::MouseCommand, QPoint globalPos, bool handled = false );
00229
00230 QCString windowRole() const;
00231 QCString sessionId();
00232 QCString resourceName() const;
00233 QCString resourceClass() const;
00234 QCString wmCommand();
00235 QCString wmClientMachine( bool use_localhost ) const;
00236 Window wmClientLeader() const;
00237 pid_t pid() const;
00238
00239 QRect adjustedClientArea( const QRect& desktop, const QRect& area ) const;
00240
00241 Colormap colormap() const;
00242
00243
00244 void updateVisibility();
00245
00246 void hideClient( bool hide );
00247
00248 QString caption( bool full = true ) const;
00249 void updateCaption();
00250
00251 void keyPressEvent( uint key_code );
00252 void updateMouseGrab();
00253 Window moveResizeGrabWindow() const;
00254
00255 const QPoint calculateGravitation( bool invert, int gravity = 0 ) const;
00256
00257 void NETMoveResize( int x_root, int y_root, NET::Direction direction );
00258 void NETMoveResizeWindow( int flags, int x, int y, int width, int height );
00259 void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp, bool send_event = false );
00260
00261 void gotPing( Time timestamp );
00262
00263 static QCString staticWindowRole(WId);
00264 static QCString staticSessionId(WId);
00265 static QCString staticWmCommand(WId);
00266 static QCString staticWmClientMachine(WId);
00267 static Window staticWmClientLeader(WId);
00268
00269 void checkWorkspacePosition();
00270 void updateUserTime( Time time = CurrentTime );
00271 Time userTime() const;
00272 bool hasUserTimeSupport() const;
00273 bool ignoreFocusStealing() const;
00274
00275
00276 static void deleteClient( Client* c, allowed_t );
00277
00278 static bool resourceMatch( const Client* c1, const Client* c2 );
00279 static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
00280 static void readIcons( Window win, QPixmap* icon, QPixmap* miniicon );
00281
00282 void minimize( bool avoid_animation = false );
00283 void unminimize( bool avoid_animation = false );
00284 void closeWindow();
00285 void killWindow();
00286 void maximize( MaximizeMode );
00287 void toggleShade();
00288 void showContextHelp();
00289 void cancelShadeHover();
00290 void cancelAutoRaise();
00291 void destroyClient();
00292 void checkActiveModal();
00293 void setOpacity(bool translucent, uint opacity = 0);
00294 void setShadowSize(uint shadowSize);
00295 void updateOpacity();
00296 void updateShadowSize();
00297 bool hasCustomOpacity(){return custom_opacity;}
00298 void setCustomOpacityFlag(bool custom = true);
00299 bool getWindowOpacity();
00300 int opacityPercentage();
00301 void checkAndSetInitialRuledOpacity();
00302 uint ruleOpacityInactive();
00303 uint ruleOpacityActive();
00304 unsigned int opacity();
00305 bool isBMP();
00306 void setBMP(bool b);
00307 bool touches(const Client* c);
00308 void setShapable(bool b);
00309 bool hasStrut() const;
00310
00311 private slots:
00312 void autoRaise();
00313 void shadeHover();
00314 void shortcutActivated();
00315
00316 private:
00317 friend class Bridge;
00318 virtual void processMousePressEvent( QMouseEvent* e );
00319
00320 private:
00321
00322 virtual ~Client();
00323
00324 Position mousePosition( const QPoint& ) const;
00325 void setCursor( Position m );
00326 void setCursor( const QCursor& c );
00327
00328 void animateMinimizeOrUnminimize( bool minimize );
00329 QPixmap animationPixmap( int w );
00330
00331 void drawbound( const QRect& geom );
00332 void clearbound();
00333 void doDrawbound( const QRect& geom, bool clear );
00334
00335
00336 bool mapRequestEvent( XMapRequestEvent* e );
00337 void unmapNotifyEvent( XUnmapEvent*e );
00338 void destroyNotifyEvent( XDestroyWindowEvent*e );
00339 void configureRequestEvent( XConfigureRequestEvent* e );
00340 void propertyNotifyEvent( XPropertyEvent* e );
00341 void clientMessageEvent( XClientMessageEvent* e );
00342 void enterNotifyEvent( XCrossingEvent* e );
00343 void leaveNotifyEvent( XCrossingEvent* e );
00344 void focusInEvent( XFocusInEvent* e );
00345 void focusOutEvent( XFocusOutEvent* e );
00346
00347 bool buttonPressEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
00348 bool buttonReleaseEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
00349 bool motionNotifyEvent( Window w, int state, int x, int y, int x_root, int y_root );
00350
00351 void processDecorationButtonPress( int button, int state, int x, int y, int x_root, int y_root );
00352
00353 private slots:
00354 void pingTimeout();
00355 void processKillerExited();
00356 void demandAttentionKNotify();
00357
00358 private:
00359
00360 void setMappingState( int s );
00361 int mappingState() const;
00362 bool isIconicState() const;
00363 bool isNormalState() const;
00364 bool isManaged() const;
00365 void updateAllowedActions( bool force = false );
00366 QSize sizeForClientSize( const QSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
00367 void changeMaximize( bool horizontal, bool vertical, bool adjust );
00368 void checkMaximizeGeometry();
00369 int checkFullScreenHack( const QRect& geom ) const;
00370 void updateFullScreenHack( const QRect& geom );
00371 void getWmNormalHints();
00372 void getMotifHints();
00373 void getIcons();
00374 void getWmClientLeader();
00375 void getWmClientMachine();
00376 void fetchName();
00377 void fetchIconicName();
00378 QString readName() const;
00379 void setCaption( const QString& s, bool force = false );
00380 bool hasTransientInternal( const Client* c, bool indirect, ConstClientList& set ) const;
00381 void finishWindowRules();
00382 void setShortcutInternal( const KShortcut& cut );
00383
00384 void updateWorkareaDiffs();
00385 void checkDirection( int new_diff, int old_diff, QRect& rect, const QRect& area );
00386 static int computeWorkareaDiff( int left, int right, int a_left, int a_right );
00387 void configureRequest( int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool );
00388 NETExtendedStrut strut() const;
00389 int checkShadeGeometry( int w, int h );
00390 void postponeGeometryUpdates( bool postpone );
00391
00392 bool startMoveResize();
00393 void finishMoveResize( bool cancel );
00394 void leaveMoveResize();
00395 void checkUnrestrictedMoveResize();
00396 void handleMoveResize( int x, int y, int x_root, int y_root );
00397 void positionGeometryTip();
00398 void grabButton( int mod );
00399 void ungrabButton( int mod );
00400 void resetMaximize();
00401 void resizeDecoration( const QSize& s );
00402 void setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth);
00403 void unsetDecoHashProperty();
00404
00405 void pingWindow();
00406 void killProcess( bool ask, Time timestamp = CurrentTime );
00407 void updateUrgency();
00408 static void sendClientMessage( Window w, Atom a, Atom protocol,
00409 long data1 = 0, long data2 = 0, long data3 = 0 );
00410
00411 void embedClient( Window w, const XWindowAttributes &attr );
00412 void detectNoBorder();
00413 void detectShapable();
00414 void destroyDecoration();
00415 void updateFrameExtents();
00416
00417 void rawShow();
00418 void rawHide();
00419
00420 Time readUserTimeMapTimestamp( const KStartupInfoId* asn_id, const KStartupInfoData* asn_data,
00421 bool session ) const;
00422 Time readUserCreationTime() const;
00423 static bool sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool active_hack );
00424 void startupIdChanged();
00425
00426 Window client;
00427 Window wrapper;
00428 Window frame;
00429 KDecoration* decoration;
00430 Workspace* wspace;
00431 Bridge* bridge;
00432 int desk;
00433 bool buttonDown;
00434 bool moveResizeMode;
00435 bool move_faked_activity;
00436 Window move_resize_grab_window;
00437 bool unrestrictedMoveResize;
00438 bool isMove() const
00439 {
00440 return moveResizeMode && mode == PositionCenter;
00441 }
00442 bool isResize() const
00443 {
00444 return moveResizeMode && mode != PositionCenter;
00445 }
00446
00447 Position mode;
00448 QPoint moveOffset;
00449 QPoint invertedMoveOffset;
00450 QRect moveResizeGeom;
00451 QRect initialMoveResizeGeom;
00452 XSizeHints xSizeHint;
00453 void sendSyntheticConfigureNotify();
00454 int mapping_state;
00455 void readTransient();
00456 Window verifyTransientFor( Window transient_for, bool set );
00457 void addTransient( Client* cl );
00458 void removeTransient( Client* cl );
00459 void removeFromMainClients();
00460 void cleanGrouping();
00461 void checkGroupTransients();
00462 void setTransient( Window new_transient_for_id );
00463 Client* transient_for;
00464 Window transient_for_id;
00465 Window original_transient_for_id;
00466 ClientList transients_list;
00467 ShadeMode shade_mode;
00468 uint active :1;
00469 uint deleting : 1;
00470 uint keep_above : 1;
00471 uint is_shape :1;
00472 uint skip_taskbar :1;
00473 uint original_skip_taskbar :1;
00474 uint Pdeletewindow :1;
00475 uint Ptakefocus :1;
00476 uint Ptakeactivity : 1;
00477 uint Pcontexthelp : 1;
00478 uint Pping : 1;
00479 uint input :1;
00480 uint skip_pager : 1;
00481 uint motif_noborder : 1;
00482 uint motif_may_resize : 1;
00483 uint motif_may_move :1;
00484 uint motif_may_close : 1;
00485 uint keep_below : 1;
00486 uint minimized : 1;
00487 uint hidden : 1;
00488 uint modal : 1;
00489 uint noborder : 1;
00490 uint user_noborder : 1;
00491 uint urgency : 1;
00492 uint ignore_focus_stealing : 1;
00493 uint demands_attention : 1;
00494 WindowRules client_rules;
00495 void getWMHints();
00496 void readIcons();
00497 void getWindowProtocols();
00498 QPixmap icon_pix;
00499 QPixmap miniicon_pix;
00500 QCursor cursor;
00501
00502
00503 enum FullScreenMode { FullScreenNone, FullScreenNormal, FullScreenHack };
00504 FullScreenMode fullscreen_mode;
00505 MaximizeMode max_mode;
00506 QRect geom_restore;
00507 QRect geom_fs_restore;
00508 MaximizeMode maxmode_restore;
00509 int workarea_diff_x, workarea_diff_y;
00510 WinInfo* info;
00511 QTimer* autoRaiseTimer;
00512 QTimer* shadeHoverTimer;
00513 Colormap cmap;
00514 QCString resource_name;
00515 QCString resource_class;
00516 QCString client_machine;
00517 QString cap_normal, cap_iconic, cap_suffix;
00518 WId wmClientLeaderWin;
00519 QCString window_role;
00520 Group* in_group;
00521 Window window_group;
00522 Layer in_layer;
00523 QTimer* ping_timer;
00524 KProcess* process_killer;
00525 Time ping_timestamp;
00526 Time user_time;
00527 unsigned long allowed_actions;
00528 QRect frame_geometry;
00529 QSize client_size;
00530 int postpone_geometry_updates;
00531 bool pending_geometry_update;
00532 bool shade_geometry_change;
00533 int border_left, border_right, border_top, border_bottom;
00534 QRegion _mask;
00535 static bool check_active_modal;
00536 KShortcut _shortcut;
00537 friend struct FetchNameInternalPredicate;
00538 friend struct CheckIgnoreFocusStealingProcedure;
00539 friend struct ResetupRulesProcedure;
00540 friend class GeometryUpdatesPostponer;
00541 void show() { assert( false ); }
00542 void hide() { assert( false ); }
00543 uint opacity_;
00544 uint savedOpacity_;
00545 bool custom_opacity;
00546 uint rule_opacity_active;
00547 uint rule_opacity_inactive;
00548
00549 bool isBMP_;
00550 QTimer* demandAttentionKNotifyTimer;
00551
00552 friend bool performTransiencyCheck();
00553 };
00554
00555
00556 class GeometryUpdatesPostponer
00557 {
00558 public:
00559 GeometryUpdatesPostponer( Client* c )
00560 : cl( c ) { cl->postponeGeometryUpdates( true ); }
00561 ~GeometryUpdatesPostponer()
00562 { cl->postponeGeometryUpdates( false ); }
00563 private:
00564 Client* cl;
00565 };
00566
00567
00568
00569 class WinInfo : public NETWinInfo
00570 {
00571 private:
00572 typedef KWinInternal::Client Client;
00573 public:
00574 WinInfo( Client* c, Display * display, Window window,
00575 Window rwin, const unsigned long pr[], int pr_size );
00576 virtual void changeDesktop(int desktop);
00577 virtual void changeState( unsigned long state, unsigned long mask );
00578 private:
00579 Client * m_client;
00580 };
00581
00582 inline Window Client::window() const
00583 {
00584 return client;
00585 }
00586
00587 inline Window Client::frameId() const
00588 {
00589 return frame;
00590 }
00591
00592 inline Window Client::wrapperId() const
00593 {
00594 return wrapper;
00595 }
00596
00597 inline Window Client::decorationId() const
00598 {
00599 return decoration != NULL ? decoration->widget()->winId() : None;
00600 }
00601
00602 inline Workspace* Client::workspace() const
00603 {
00604 return wspace;
00605 }
00606
00607 inline const Client* Client::transientFor() const
00608 {
00609 return transient_for;
00610 }
00611
00612 inline Client* Client::transientFor()
00613 {
00614 return transient_for;
00615 }
00616
00617 inline bool Client::groupTransient() const
00618 {
00619 return transient_for_id == workspace()->rootWin();
00620 }
00621
00622
00623
00624 inline bool Client::wasOriginallyGroupTransient() const
00625 {
00626 return original_transient_for_id == workspace()->rootWin();
00627 }
00628
00629 inline bool Client::isTransient() const
00630 {
00631 return transient_for_id != None;
00632 }
00633
00634 inline const ClientList& Client::transients() const
00635 {
00636 return transients_list;
00637 }
00638
00639 inline const Group* Client::group() const
00640 {
00641 return in_group;
00642 }
00643
00644 inline Group* Client::group()
00645 {
00646 return in_group;
00647 }
00648
00649 inline int Client::mappingState() const
00650 {
00651 return mapping_state;
00652 }
00653
00654 inline QCString Client::resourceName() const
00655 {
00656 return resource_name;
00657 }
00658
00659 inline QCString Client::resourceClass() const
00660 {
00661 return resource_class;
00662 }
00663
00664 inline
00665 bool Client::isMinimized() const
00666 {
00667 return minimized;
00668 }
00669
00670 inline bool Client::isActive() const
00671 {
00672 return active;
00673 }
00674
00681 inline int Client::desktop() const
00682 {
00683 return desk;
00684 }
00685
00686 inline bool Client::isOnAllDesktops() const
00687 {
00688 return desk == NET::OnAllDesktops;
00689 }
00694 inline bool Client::isOnDesktop( int d ) const
00695 {
00696 return desk == d || isOnAllDesktops();
00697 }
00698
00699 inline
00700 bool Client::isShown( bool shaded_is_shown ) const
00701 {
00702 return !isMinimized() && ( !isShade() || shaded_is_shown ) && !hidden;
00703 }
00704
00705 inline
00706 bool Client::isShade() const
00707 {
00708 return shade_mode == ShadeNormal;
00709 }
00710
00711 inline
00712 ShadeMode Client::shadeMode() const
00713 {
00714 return shade_mode;
00715 }
00716
00717 inline QPixmap Client::icon() const
00718 {
00719 return icon_pix;
00720 }
00721
00722 inline QPixmap Client::miniIcon() const
00723 {
00724 return miniicon_pix;
00725 }
00726
00727 inline QRect Client::geometryRestore() const
00728 {
00729 return geom_restore;
00730 }
00731
00732 inline Client::MaximizeMode Client::maximizeModeRestore() const
00733 {
00734 return maxmode_restore;
00735 }
00736
00737 inline Client::MaximizeMode Client::maximizeMode() const
00738 {
00739 return max_mode;
00740 }
00741
00742 inline bool Client::skipTaskbar( bool from_outside ) const
00743 {
00744 return from_outside ? original_skip_taskbar : skip_taskbar;
00745 }
00746
00747 inline bool Client::skipPager() const
00748 {
00749 return skip_pager;
00750 }
00751
00752 inline bool Client::keepAbove() const
00753 {
00754 return keep_above;
00755 }
00756
00757 inline bool Client::keepBelow() const
00758 {
00759 return keep_below;
00760 }
00761
00762 inline bool Client::shape() const
00763 {
00764 return is_shape;
00765 }
00766
00767
00768 inline bool Client::isFullScreen() const
00769 {
00770 return fullscreen_mode != FullScreenNone;
00771 }
00772
00773 inline bool Client::isModal() const
00774 {
00775 return modal;
00776 }
00777
00778 inline bool Client::hasNETSupport() const
00779 {
00780 return info->hasNETSupport();
00781 }
00782
00783 inline Colormap Client::colormap() const
00784 {
00785 return cmap;
00786 }
00787
00788 inline pid_t Client::pid() const
00789 {
00790 return info->pid();
00791 }
00792
00793 inline void Client::invalidateLayer()
00794 {
00795 in_layer = UnknownLayer;
00796 }
00797
00798 inline bool Client::isIconicState() const
00799 {
00800 return mapping_state == IconicState;
00801 }
00802
00803 inline bool Client::isNormalState() const
00804 {
00805 return mapping_state == NormalState;
00806 }
00807
00808 inline bool Client::isManaged() const
00809 {
00810 return mapping_state != WithdrawnState;
00811 }
00812
00813 inline QCString Client::windowRole() const
00814 {
00815 return window_role;
00816 }
00817
00818 inline QRect Client::geometry() const
00819 {
00820 return frame_geometry;
00821 }
00822
00823 inline QSize Client::size() const
00824 {
00825 return frame_geometry.size();
00826 }
00827
00828 inline QPoint Client::pos() const
00829 {
00830 return frame_geometry.topLeft();
00831 }
00832
00833 inline int Client::x() const
00834 {
00835 return frame_geometry.x();
00836 }
00837
00838 inline int Client::y() const
00839 {
00840 return frame_geometry.y();
00841 }
00842
00843 inline int Client::width() const
00844 {
00845 return frame_geometry.width();
00846 }
00847
00848 inline int Client::height() const
00849 {
00850 return frame_geometry.height();
00851 }
00852
00853 inline QRect Client::rect() const
00854 {
00855 return QRect( 0, 0, width(), height());
00856 }
00857
00858 inline QPoint Client::clientPos() const
00859 {
00860 return QPoint( border_left, border_top );
00861 }
00862
00863 inline QSize Client::clientSize() const
00864 {
00865 return client_size;
00866 }
00867
00868 inline void Client::setGeometry( const QRect& r, ForceGeometry_t force )
00869 {
00870 setGeometry( r.x(), r.y(), r.width(), r.height(), force );
00871 }
00872
00873 inline void Client::move( const QPoint & p, ForceGeometry_t force )
00874 {
00875 move( p.x(), p.y(), force );
00876 }
00877
00878 inline void Client::plainResize( const QSize& s, ForceGeometry_t force )
00879 {
00880 plainResize( s.width(), s.height(), force );
00881 }
00882
00883 inline void Client::resizeWithChecks( const QSize& s, ForceGeometry_t force )
00884 {
00885 resizeWithChecks( s.width(), s.height(), force );
00886 }
00887
00888 inline bool Client::hasUserTimeSupport() const
00889 {
00890 return info->userTime() != -1U;
00891 }
00892
00893 inline bool Client::ignoreFocusStealing() const
00894 {
00895 return ignore_focus_stealing;
00896 }
00897
00898 inline const WindowRules* Client::rules() const
00899 {
00900 return &client_rules;
00901 }
00902
00903 KWIN_PROCEDURE( CheckIgnoreFocusStealingProcedure, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing( cl ));
00904
00905 inline Window Client::moveResizeGrabWindow() const
00906 {
00907 return move_resize_grab_window;
00908 }
00909
00910 inline KShortcut Client::shortcut() const
00911 {
00912 return _shortcut;
00913 }
00914
00915 inline bool Client::isBMP()
00916 {
00917 return isBMP_;
00918 }
00919
00920 inline void Client::setBMP(bool b)
00921 {
00922 isBMP_ = b;
00923 }
00924
00925 inline void Client::removeRule( Rules* rule )
00926 {
00927 client_rules.remove( rule );
00928 }
00929
00930 #ifdef NDEBUG
00931 inline
00932 kndbgstream& operator<<( kndbgstream& stream, const Client* ) { return stream; }
00933 inline
00934 kndbgstream& operator<<( kndbgstream& stream, const ClientList& ) { return stream; }
00935 inline
00936 kndbgstream& operator<<( kndbgstream& stream, const ConstClientList& ) { return stream; }
00937 #else
00938 kdbgstream& operator<<( kdbgstream& stream, const Client* );
00939 kdbgstream& operator<<( kdbgstream& stream, const ClientList& );
00940 kdbgstream& operator<<( kdbgstream& stream, const ConstClientList& );
00941 #endif
00942
00943 KWIN_COMPARE_PREDICATE( WindowMatchPredicate, Window, cl->window() == value );
00944 KWIN_COMPARE_PREDICATE( FrameIdMatchPredicate, Window, cl->frameId() == value );
00945 KWIN_COMPARE_PREDICATE( WrapperIdMatchPredicate, Window, cl->wrapperId() == value );
00946
00947 }
00948
00949 #endif