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