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
00078 QRect geometry() const;
00079 QSize size() const;
00080 QSize minSize() const;
00081 QSize maxSize() const;
00082 QPoint pos() const;
00083 QRect rect() const;
00084 int x() const;
00085 int y() const;
00086 int width() const;
00087 int height() const;
00088 QPoint clientPos() const;
00089 QSize clientSize() const;
00090
00091 bool windowEvent( XEvent* e );
00092 virtual bool eventFilter( QObject* o, QEvent* e );
00093
00094 bool manage( Window w, bool isMapped );
00095
00096 void releaseWindow( bool on_shutdown = false );
00097
00098 enum Sizemode
00099 {
00100 SizemodeAny,
00101 SizemodeFixedW,
00102 SizemodeFixedH,
00103 SizemodeMax
00104 };
00105 QSize adjustedSize( const QSize&, Sizemode mode = SizemodeAny ) const;
00106 QSize adjustedSize() const;
00107
00108 QPixmap icon() const;
00109 QPixmap miniIcon() const;
00110
00111 bool isActive() const;
00112 void setActive( bool, bool updateOpacity = true );
00113
00114 int desktop() const;
00115 void setDesktop( int );
00116 bool isOnDesktop( int d ) const;
00117 bool isOnCurrentDesktop() const;
00118 bool isOnAllDesktops() const;
00119 void setOnAllDesktops( bool set );
00120
00121 bool isOnScreen( int screen ) const;
00122 int screen() const;
00123
00124
00125 bool isShown( bool shaded_is_shown ) const;
00126
00127 bool isShade() const;
00128 ShadeMode shadeMode() const;
00129 void setShade( ShadeMode mode );
00130 bool isShadeable() const;
00131
00132 bool isMinimized() const;
00133 bool isMaximizable() const;
00134 QRect geometryRestore() const;
00135 MaximizeMode maximizeModeRestore() const;
00136 MaximizeMode maximizeMode() const;
00137 bool isMinimizable() const;
00138 void setMaximize( bool vertically, bool horizontally );
00139
00140 void setFullScreen( bool set, bool user );
00141 bool isFullScreen() const;
00142 bool isFullScreenable( bool fullscreen_hack = false ) const;
00143 bool userCanSetFullScreen() const;
00144 QRect geometryFSRestore() const { return geom_fs_restore; }
00145 int fullScreenMode() const { return fullscreen_mode; }
00146
00147 bool isUserNoBorder() const;
00148 void setUserNoBorder( bool set );
00149 bool userCanSetNoBorder() const;
00150 bool noBorder() const;
00151
00152 bool skipTaskbar( bool from_outside = false ) const;
00153 void setSkipTaskbar( bool set, bool from_outside );
00154
00155 bool skipPager() const;
00156 void setSkipPager( bool );
00157
00158 bool keepAbove() const;
00159 void setKeepAbove( bool );
00160 bool keepBelow() const;
00161 void setKeepBelow( bool );
00162 Layer layer() const;
00163 Layer belongsToLayer() const;
00164 void invalidateLayer();
00165
00166 void setModal( bool modal );
00167 bool isModal() const;
00168
00169
00170 bool wantsTabFocus() const;
00171 bool wantsInput() const;
00172 bool hasNETSupport() const;
00173 bool isMovable() const;
00174 bool isDesktop() const;
00175 bool isDock() const;
00176 bool isToolbar() const;
00177 bool isTopMenu() const;
00178 bool isMenu() const;
00179 bool isNormalWindow() const;
00180 bool isDialog() const;
00181 bool isSplash() const;
00182 bool isUtility() const;
00183
00184
00185
00186
00187 bool isSpecialWindow() const;
00188
00189 bool isResizable() const;
00190 bool isCloseable() const;
00191
00192 void takeActivity( int flags, bool handled, allowed_t );
00193 void takeFocus( allowed_t );
00194 void demandAttention( bool set = true );
00195
00196 void setMask( const QRegion& r, int mode = X::Unsorted );
00197 QRegion mask() const;
00198
00199 void updateDecoration( bool check_workspace_pos, bool force = false );
00200 void checkBorderSizes();
00201
00202
00203 bool shape() const;
00204 void updateShape();
00205
00206 void setGeometry( int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet );
00207 void setGeometry( const QRect& r, ForceGeometry_t force = NormalGeometrySet );
00208 void move( int x, int y, ForceGeometry_t force = NormalGeometrySet );
00209 void move( const QPoint & p, ForceGeometry_t force = NormalGeometrySet );
00210
00211 void plainResize( int w, int h, ForceGeometry_t force = NormalGeometrySet );
00212 void plainResize( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
00213
00214 void resizeWithChecks( int w, int h, ForceGeometry_t force = NormalGeometrySet );
00215 void resizeWithChecks( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
00216 void keepInArea( QRect area, bool partial = false );
00217
00218 void growHorizontal();
00219 void shrinkHorizontal();
00220 void growVertical();
00221 void shrinkVertical();
00222
00223 bool providesContextHelp() const;
00224 KShortcut shortcut() const;
00225 void setShortcut( const QString& cut );
00226
00227 bool performMouseCommand( Options::MouseCommand, QPoint globalPos, bool handled = false );
00228
00229 QCString windowRole() const;
00230 QCString sessionId();
00231 QCString resourceName() const;
00232 QCString resourceClass() const;
00233 QCString wmCommand();
00234 QCString wmClientMachine( bool use_localhost ) const;
00235 Window wmClientLeader() const;
00236 pid_t pid() const;
00237
00238 QRect adjustedClientArea( const QRect& desktop, const QRect& area ) const;
00239
00240 Colormap colormap() const;
00241
00242
00243 void updateVisibility();
00244
00245 void hideClient( bool hide );
00246
00247 QString caption( bool full = true ) const;
00248 void updateCaption();
00249
00250 void keyPressEvent( uint key_code );
00251 void updateMouseGrab();
00252 Window moveResizeGrabWindow() const;
00253
00254 const QPoint calculateGravitation( bool invert, int gravity = 0 ) const;
00255
00256 void NETMoveResize( int x_root, int y_root, NET::Direction direction );
00257 void NETMoveResizeWindow( int flags, int x, int y, int width, int height );
00258 void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp, bool send_event = false );
00259
00260 void gotPing( Time timestamp );
00261
00262 static QCString staticWindowRole(WId);
00263 static QCString staticSessionId(WId);
00264 static QCString staticWmCommand(WId);
00265 static QCString staticWmClientMachine(WId);
00266 static Window staticWmClientLeader(WId);
00267
00268 void checkWorkspacePosition();
00269 void updateUserTime( Time time = CurrentTime );
00270 Time userTime() const;
00271 bool hasUserTimeSupport() const;
00272 bool ignoreFocusStealing() const;
00273
00274
00275 static void deleteClient( Client* c, allowed_t );
00276
00277 static bool resourceMatch( const Client* c1, const Client* c2 );
00278 static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
00279 static void readIcons( Window win, QPixmap* icon, QPixmap* miniicon );
00280
00281 void minimize( bool avoid_animation = false );
00282 void unminimize( bool avoid_animation = false );
00283 void closeWindow();
00284 void killWindow();
00285 void maximize( MaximizeMode );
00286 void toggleShade();
00287 void showContextHelp();
00288 void cancelShadeHover();
00289 void cancelAutoRaise();
00290 void destroyClient();
00291 void checkActiveModal();
00292 void setOpacity(bool translucent, uint opacity = 0);
00293 void setShadowSize(uint shadowSize);
00294 void updateOpacity();
00295 void updateShadowSize();
00296 bool hasCustomOpacity(){return custom_opacity;}
00297 void setCustomOpacityFlag(bool custom = true);
00298 bool getWindowOpacity();
00299 int opacityPercentage();
00300 void checkAndSetInitialRuledOpacity();
00301 uint ruleOpacityInactive();
00302 uint ruleOpacityActive();
00303 unsigned int opacity();
00304 bool isBMP();
00305 void setBMP(bool b);
00306 bool touches(const Client* c);
00307 void setShapable(bool b);
00308 bool hasStrut() const;
00309
00310 private slots:
00311 void autoRaise();
00312 void shadeHover();
00313 void shortcutActivated();
00314
00315 private:
00316 friend class Bridge;
00317 virtual void processMousePressEvent( QMouseEvent* e );
00318
00319 private:
00320
00321 virtual ~Client();
00322
00323 Position mousePosition( const QPoint& ) const;
00324 void setCursor( Position m );
00325 void setCursor( const QCursor& c );
00326
00327 void animateMinimizeOrUnminimize( bool minimize );
00328 QPixmap animationPixmap( int w );
00329
00330 void drawbound( const QRect& geom );
00331 void clearbound();
00332 void doDrawbound( const QRect& geom, bool clear );
00333
00334
00335 bool mapRequestEvent( XMapRequestEvent* e );
00336 void unmapNotifyEvent( XUnmapEvent*e );
00337 void destroyNotifyEvent( XDestroyWindowEvent*e );
00338 void configureRequestEvent( XConfigureRequestEvent* e );
00339 void propertyNotifyEvent( XPropertyEvent* e );
00340 void clientMessageEvent( XClientMessageEvent* e );
00341 void enterNotifyEvent( XCrossingEvent* e );
00342 void leaveNotifyEvent( XCrossingEvent* e );
00343 void focusInEvent( XFocusInEvent* e );
00344 void focusOutEvent( XFocusOutEvent* e );
00345
00346 bool buttonPressEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
00347 bool buttonReleaseEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
00348 bool motionNotifyEvent( Window w, int state, int x, int y, int x_root, int y_root );
00349
00350 void processDecorationButtonPress( int button, int state, int x, int y, int x_root, int y_root );
00351
00352 private slots:
00353 void pingTimeout();
00354 void processKillerExited();
00355 void demandAttentionKNotify();
00356
00357 private:
00358
00359 void setMappingState( int s );
00360 int mappingState() const;
00361 bool isIconicState() const;
00362 bool isNormalState() const;
00363 bool isManaged() const;
00364 void updateAllowedActions( bool force = false );
00365 QSize sizeForClientSize( const QSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
00366 void changeMaximize( bool horizontal, bool vertical, bool adjust );
00367 void checkMaximizeGeometry();
00368 int checkFullScreenHack( const QRect& geom ) const;
00369 void updateFullScreenHack( const QRect& geom );
00370 void getWmNormalHints();
00371 void getMotifHints();
00372 void getIcons();
00373 void getWmClientLeader();
00374 void getWmClientMachine();
00375 void fetchName();
00376 void fetchIconicName();
00377 QString readName() const;
00378 void setCaption( const QString& s, bool force = false );
00379 bool hasTransientInternal( const Client* c, bool indirect, ConstClientList& set ) const;
00380 void updateWindowRules();
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