• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • twin
 

twin

  • twin
client.h
1 /*****************************************************************
2  KWin - the KDE window manager
3  This file is part of the KDE project.
4 
5 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
6 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
7 
8 You can Freely distribute this program under the GNU General Public
9 License. See the file "COPYING" for the exact licensing terms.
10 ******************************************************************/
11 
12 #ifndef KWIN_CLIENT_H
13 #define KWIN_CLIENT_H
14 
15 #include <tqframe.h>
16 #include <tqvbox.h>
17 #include <tqpixmap.h>
18 #include <netwm.h>
19 #include <kdebug.h>
20 #include <assert.h>
21 #include <tdeshortcut.h>
22 #include <X11/X.h>
23 #include <X11/Xlib.h>
24 #include <X11/Xutil.h>
25 #include <fixx11h.h>
26 
27 #include "utils.h"
28 #include "options.h"
29 #include "workspace.h"
30 #include "kdecoration.h"
31 #include "rules.h"
32 
33 class TQTimer;
34 class TDEProcess;
35 class TDEStartupInfoData;
36 
37 namespace KWinInternal
38 {
39 
40 class Workspace;
41 class Client;
42 class WinInfo;
43 class SessionInfo;
44 class Bridge;
45 
46 class Client : public TQObject, public KDecorationDefines
47  {
48  Q_OBJECT
49  public:
50  Client( Workspace *ws );
51  Window window() const;
52  Window frameId() const;
53  Window wrapperId() const;
54  Window decorationId() const;
55 
56  Workspace* workspace() const;
57  const Client* transientFor() const;
58  Client* transientFor();
59  bool isTransient() const;
60  bool isModalSystemNotification() const;
61  bool groupTransient() const;
62  bool wasOriginallyGroupTransient() const;
63  ClientList mainClients() const; // call once before loop , is not indirect
64  bool hasTransient( const Client* c, bool indirect ) const;
65  const ClientList& transients() const; // is not indirect
66  void checkTransient( Window w );
67  Client* findModal();
68  const Group* group() const;
69  Group* group();
70  void checkGroup( Group* gr = NULL, bool force = false );
71  void changeClientLeaderGroup( Group* gr );
72  // prefer isXXX() instead
73  NET::WindowType windowType( bool direct = false, int supported_types = SUPPORTED_WINDOW_TYPES_MASK ) const;
74  const WindowRules* rules() const;
75  void removeRule( Rules* r );
76  void setupWindowRules( bool ignore_temporary );
77  void applyWindowRules();
78  void updateWindowRules();
79 
80  TQRect geometry() const;
81  TQSize size() const;
82  TQSize minSize() const;
83  TQSize maxSize() const;
84  TQPoint pos() const;
85  TQRect rect() const;
86  int x() const;
87  int y() const;
88  int width() const;
89  int height() const;
90  TQPoint clientPos() const; // inside of geometry()
91  TQSize clientSize() const;
92 
93  bool windowEvent( XEvent* e );
94  virtual bool eventFilter( TQObject* o, TQEvent* e );
95 
96  bool manage( Window w, bool isMapped );
97 
98  void releaseWindow( bool on_shutdown = false );
99 
100  enum Sizemode // how to resize the window in order to obey constains (mainly aspect ratios)
101  {
102  SizemodeAny,
103  SizemodeFixedW, // try not to affect width
104  SizemodeFixedH, // try not to affect height
105  SizemodeMax // try not to make it larger in either direction
106  };
107  TQSize adjustedSize( const TQSize&, Sizemode mode = SizemodeAny ) const;
108  TQSize adjustedSize() const;
109 
110  TQPixmap icon() const;
111  TQPixmap miniIcon() const;
112 
113  bool isActive() const;
114  void setActive( bool, bool updateOpacity = true );
115 
116  bool isSuspendable() const;
117  bool isResumeable() const;
118 
119  int desktop() const;
120  void setDesktop( int );
121  bool isOnDesktop( int d ) const;
122  bool isOnCurrentDesktop() const;
123  bool isOnAllDesktops() const;
124  void setOnAllDesktops( bool set );
125 
126  bool isOnScreen( int screen ) const; // true if it's at least partially there
127  int screen() const; // the screen where the center is
128 
129  // !isMinimized() && not hidden, i.e. normally visible on some virtual desktop
130  bool isShown( bool shaded_is_shown ) const;
131 
132  bool isShade() const; // true only for ShadeNormal
133  ShadeMode shadeMode() const; // prefer isShade()
134  void setShade( ShadeMode mode );
135  bool isShadeable() const;
136 
137  bool isMinimized() const;
138  bool isMaximizable() const;
139  TQRect geometryRestore() const;
140  MaximizeMode maximizeModeRestore() const;
141  MaximizeMode maximizeMode() const;
142  bool isMinimizable() const;
143  void setMaximize( bool vertically, bool horizontally );
144 
145  void setFullScreen( bool set, bool user );
146  bool isFullScreen() const;
147  bool isFullScreenable( bool fullscreen_hack = false ) const;
148  bool userCanSetFullScreen() const;
149  TQRect geometryFSRestore() const { return geom_fs_restore; } // only for session saving
150  int fullScreenMode() const { return fullscreen_mode; } // only for session saving
151 
152  bool isUserNoBorder() const;
153  void setUserNoBorder( bool set );
154  bool userCanSetNoBorder() const;
155  bool noBorder() const;
156 
157  bool skipTaskbar( bool from_outside = false ) const;
158  void setSkipTaskbar( bool set, bool from_outside );
159 
160  bool skipPager() const;
161  void setSkipPager( bool );
162 
163  bool keepAbove() const;
164  void setKeepAbove( bool );
165  bool keepBelow() const;
166  void setKeepBelow( bool );
167  Layer layer() const;
168  Layer belongsToLayer() const;
169  void invalidateLayer();
170 
171  void setModal( bool modal );
172  bool isModal() const;
173 
174  // auxiliary functions, depend on the windowType
175  bool wantsTabFocus() const;
176  bool wantsInput() const;
177  bool hasNETSupport() const;
178  bool isMovable() const;
179  bool isDesktop() const;
180  bool isDock() const;
181  bool isToolbar() const;
182  bool isTopMenu() const;
183  bool isMenu() const;
184  bool isNormalWindow() const; // normal as in 'NET::Normal or NET::Unknown non-transient'
185  bool isDialog() const;
186  bool isSplash() const;
187  bool isUtility() const;
188  // returns true for "special" windows and false for windows which are "normal"
189  // (normal=window which has a border, can be moved by the user, can be closed, etc.)
190  // true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
191  // false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
192  bool isSpecialWindow() const;
193 
194  bool isResizable() const;
195  bool isCloseable() const; // may be closed by the user (may have a close button)
196 
197  void takeActivity( int flags, bool handled, allowed_t ); // takes ActivityFlags as arg (in utils.h)
198  void takeFocus( allowed_t );
199  void demandAttention( bool set = true );
200 
201  void setMask( const TQRegion& r, int mode = X::Unsorted );
202  TQRegion mask() const;
203 
204  void updateDecoration( bool check_workspace_pos, bool force = false );
205  void checkBorderSizes();
206 
207  // drop shadow
208  bool isShadowed() const;
209  void setShadowed(bool shadowed);
210  Window shadowId() const;
211  // Aieee, a friend function! Unpleasant, yes, but it's needed by
212  // raiseClient() to redraw a window's shadow when it is active prior to
213  // being raised.
214  friend void Workspace::raiseClient(Client *);
215  // Wouldn't you know it, friend functions breed. This one's needed to
216  // enable a DCOP function that causes all shadows obscuring a changed
217  // window to be redrawn.
218  friend void Workspace::updateOverlappingShadows(WId);
219 
220  // shape extensions
221  bool shape() const;
222  void updateShape();
223 
224  void setGeometry( int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet );
225  void setGeometry( const TQRect& r, ForceGeometry_t force = NormalGeometrySet );
226  void move( int x, int y, ForceGeometry_t force = NormalGeometrySet );
227  void move( const TQPoint & p, ForceGeometry_t force = NormalGeometrySet );
228  // plainResize() simply resizes
229  void plainResize( int w, int h, ForceGeometry_t force = NormalGeometrySet );
230  void plainResize( const TQSize& s, ForceGeometry_t force = NormalGeometrySet );
231  // resizeWithChecks() resizes according to gravity, and checks workarea position
232  void resizeWithChecks( int w, int h, ForceGeometry_t force = NormalGeometrySet );
233  void resizeWithChecks( const TQSize& s, ForceGeometry_t force = NormalGeometrySet );
234  void keepInArea( TQRect area, bool partial = false );
235 
236  void growHorizontal();
237  void shrinkHorizontal();
238  void growVertical();
239  void shrinkVertical();
240 
241  bool providesContextHelp() const;
242  TDEShortcut shortcut() const;
243  void setShortcut( const TQString& cut );
244 
245  bool performMouseCommand( Options::MouseCommand, TQPoint globalPos, bool handled = false );
246 
247  TQCString windowRole() const;
248  TQCString sessionId();
249  TQCString resourceName() const;
250  TQCString resourceClass() const;
251  TQCString wmCommand();
252  TQCString wmClientMachine( bool use_localhost ) const;
253  Window wmClientLeader() const;
254  pid_t pid() const;
255 
256  TQRect adjustedClientArea( const TQRect& desktop, const TQRect& area ) const;
257 
258  Colormap colormap() const;
259 
260  // updates visibility depending on being shaded, virtual desktop, etc.
261  void updateVisibility();
262  // hides a client - basically like minimize, but without effects, it's simply hidden
263  void hideClient( bool hide );
264 
265  TQString caption( bool full = true ) const;
266  void updateCaption();
267 
268  void keyPressEvent( uint key_code ); // FRAME ??
269  void updateMouseGrab();
270  Window moveResizeGrabWindow() const;
271 
272  const TQPoint calculateGravitation( bool invert, int gravity = 0 ) const; // FRAME public?
273 
274  void NETMoveResize( int x_root, int y_root, NET::Direction direction );
275  void NETMoveResizeWindow( int flags, int x, int y, int width, int height );
276  void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp, bool send_event = false );
277 
278  void gotPing( Time timestamp );
279 
280  static TQCString staticWindowRole(WId);
281  static TQCString staticSessionId(WId);
282  static TQCString staticWmCommand(WId);
283  static TQCString staticWmClientMachine(WId);
284  static Window staticWmClientLeader(WId);
285 
286  void checkWorkspacePosition();
287  void updateUserTime( Time time = CurrentTime );
288  Time userTime() const;
289  bool hasUserTimeSupport() const;
290  bool ignoreFocusStealing() const;
291 
292  // does 'delete c;'
293  static void deleteClient( Client* c, allowed_t );
294 
295  static bool resourceMatch( const Client* c1, const Client* c2 );
296  static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
297  static void readIcons( Window win, TQPixmap* icon, TQPixmap* miniicon );
298 
299  void minimize( bool avoid_animation = false );
300  void unminimize( bool avoid_animation = false );
301  void closeWindow();
302  void killWindow();
303  void suspendWindow();
304  void resumeWindow();
305  bool queryUserSuspendedResume();
306  void maximize( MaximizeMode );
307  void toggleShade();
308  void showContextHelp();
309  void cancelShadeHover();
310  void cancelAutoRaise();
311  void destroyClient();
312  void checkActiveModal();
313  void setOpacity(bool translucent, uint opacity = 0);
314  void setShadowSize(uint shadowSize);
315  void updateOpacity();
316  void updateShadowSize();
317  bool hasCustomOpacity(){return custom_opacity;}
318  void setCustomOpacityFlag(bool custom = true);
319  bool getWindowOpacity();
320  int opacityPercentage();
321  void checkAndSetInitialRuledOpacity();
322  uint ruleOpacityInactive();
323  uint ruleOpacityActive();
324  unsigned int opacity();
325  bool isBMP();
326  void setBMP(bool b);
327  bool touches(const Client* c);
328  void setShapable(bool b);
329  bool hasStrut() const;
330 
331  private slots:
332  void autoRaise();
333  void shadeHover();
334  void shortcutActivated();
335  void updateOpacityCache();
336 
337 
338  private:
339  friend class Bridge; // FRAME
340  virtual void processMousePressEvent( TQMouseEvent* e );
341 
342  private: // TODO cleanup the order of things in the .h file
343  // use Workspace::createClient()
344  virtual ~Client(); // use destroyClient() or releaseWindow()
345 
346  Position mousePosition( const TQPoint& ) const;
347  void setCursor( Position m );
348  void setCursor( const TQCursor& c );
349 
350  void animateMinimizeOrUnminimize( bool minimize );
351  TQPixmap animationPixmap( int w );
352  // transparent stuff
353  void drawbound( const TQRect& geom );
354  void clearbound();
355  void doDrawbound( const TQRect& geom, bool clear );
356 
357  // handlers for X11 events
358  bool mapRequestEvent( XMapRequestEvent* e );
359  void unmapNotifyEvent( XUnmapEvent*e );
360  void destroyNotifyEvent( XDestroyWindowEvent*e );
361  void configureRequestEvent( XConfigureRequestEvent* e );
362  void propertyNotifyEvent( XPropertyEvent* e );
363  void clientMessageEvent( XClientMessageEvent* e );
364  void enterNotifyEvent( XCrossingEvent* e );
365  void leaveNotifyEvent( XCrossingEvent* e );
366  void focusInEvent( XFocusInEvent* e );
367  void focusOutEvent( XFocusOutEvent* e );
368 
369  bool buttonPressEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
370  bool buttonReleaseEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
371  bool motionNotifyEvent( Window w, int state, int x, int y, int x_root, int y_root );
372 
373  // drop shadows
374  void drawIntersectingShadows();
375  void drawOverlappingShadows(bool waitForMe);
376  TQRegion getExposedRegion(TQRegion occludedRegion, int x, int y,
377  int w, int h, int thickness, int xOffset, int yOffset);
378  void imposeCachedShadow(TQPixmap &pixmap, TQRegion exposed);
379  void imposeRegionShadow(TQPixmap &pixmap, TQRegion occluded,
380  TQRegion exposed, int thickness, double maxOpacity = 0.75);
381 
382  void processDecorationButtonPress( int button, int state, int x, int y, int x_root, int y_root );
383 
384  private slots:
385  void pingTimeout();
386  void processKillerExited();
387  void processResumerExited();
388  void demandAttentionKNotify();
389  void drawShadow();
390  void drawShadowAfter(Client *after);
391  void drawDelayedShadow();
392  void removeShadow();
393 
394  signals:
395  void shadowDrawn();
396 
397 
398  private:
399  // ICCCM 4.1.3.1, 4.1.4 , NETWM 2.5.1
400  void setMappingState( int s );
401  int mappingState() const;
402  bool isIconicState() const;
403  bool isNormalState() const;
404  bool isManaged() const; // returns false if this client is not yet managed
405  void updateAllowedActions( bool force = false );
406  TQSize sizeForClientSize( const TQSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
407  void changeMaximize( bool horizontal, bool vertical, bool adjust );
408  void checkMaximizeGeometry();
409  int checkFullScreenHack( const TQRect& geom ) const; // 0 - none, 1 - one xinerama screen, 2 - full area
410  void updateFullScreenHack( const TQRect& geom );
411  void getWmNormalHints();
412  void getMotifHints();
413  void getIcons();
414  void getWmClientLeader();
415  void getWmClientMachine();
416  void fetchName();
417  void fetchIconicName();
418  TQString readName() const;
419  void setCaption( const TQString& s, bool force = false );
420  bool hasTransientInternal( const Client* c, bool indirect, ConstClientList& set ) const;
421  void finishWindowRules();
422  void setShortcutInternal( const TDEShortcut& cut );
423 
424  void updateWorkareaDiffs();
425  void checkDirection( int new_diff, int old_diff, TQRect& rect, const TQRect& area );
426  static int computeWorkareaDiff( int left, int right, int a_left, int a_right );
427  void configureRequest( int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool );
428  NETExtendedStrut strut() const;
429  int checkShadeGeometry( int w, int h );
430  void postponeGeometryUpdates( bool postpone );
431 
432  bool startMoveResize();
433  void finishMoveResize( bool cancel );
434  void leaveMoveResize();
435  void checkUnrestrictedMoveResize();
436  void handleMoveResize( int x, int y, int x_root, int y_root );
437  void positionGeometryTip();
438  void grabButton( int mod );
439  void ungrabButton( int mod );
440  void resetMaximize();
441  void resizeDecoration( const TQSize& s );
442  void setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth);
443  void unsetDecoHashProperty();
444 
445  void pingWindow();
446  void killProcess( bool ask, Time timestamp = CurrentTime );
447  void updateUrgency();
448  static void sendClientMessage( Window w, Atom a, Atom protocol,
449  long data1 = 0, long data2 = 0, long data3 = 0 );
450 
451  void embedClient( Window w, const XWindowAttributes &attr );
452  void detectNoBorder();
453  void detectShapable();
454  void destroyDecoration();
455  void updateFrameExtents();
456 
457  void rawShow(); // just shows it
458  void rawHide(); // just hides it
459 
460  Time readUserTimeMapTimestamp( const TDEStartupInfoId* asn_id, const TDEStartupInfoData* asn_data,
461  bool session ) const;
462  Time readUserCreationTime() const;
463  static bool sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool active_hack );
464  void startupIdChanged();
465 
466  Window client;
467  Window wrapper;
468  Window frame;
469  KDecoration* decoration;
470  Workspace* wspace;
471  Bridge* bridge;
472  int desk;
473  bool buttonDown;
474  bool moveResizeMode;
475  bool move_faked_activity;
476  Window move_resize_grab_window;
477  bool unrestrictedMoveResize;
478  bool isMove() const
479  {
480  return moveResizeMode && mode == PositionCenter;
481  }
482  bool isResize() const
483  {
484  return moveResizeMode && mode != PositionCenter;
485  }
486 
487  Position mode;
488  TQPoint moveOffset;
489  TQPoint invertedMoveOffset;
490  TQRect moveResizeGeom;
491  TQRect initialMoveResizeGeom;
492  XSizeHints xSizeHint;
493  void sendSyntheticConfigureNotify();
494  int mapping_state;
495  void readTransient();
496  Window verifyTransientFor( Window transient_for, bool set );
497  void addTransient( Client* cl );
498  void removeTransient( Client* cl );
499  void removeFromMainClients();
500  void cleanGrouping();
501  void checkGroupTransients();
502  void setTransient( Window new_transient_for_id );
503  Client* transient_for;
504  Window transient_for_id;
505  Window original_transient_for_id;
506  ClientList transients_list; // SELI make this ordered in stacking order?
507  ShadeMode shade_mode;
508  uint active :1;
509  uint deleting : 1; // true when doing cleanup and destroying the client
510  uint keep_above : 1; // NET::KeepAbove (was stays_on_top)
511  uint is_shape :1;
512  uint skip_taskbar :1;
513  uint original_skip_taskbar :1; // unaffected by KWin
514  uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
515  uint Ptakefocus :1;// does the window understand the TakeFocus protocol?
516  uint Ptakeactivity : 1; // does it support _NET_WM_TAKE_ACTIVITY
517  uint Pcontexthelp : 1; // does the window understand the ContextHelp protocol?
518  uint Pping : 1; // does it support _NET_WM_PING?
519  uint input :1; // does the window want input in its wm_hints
520  uint skip_pager : 1;
521  uint motif_noborder : 1;
522  uint motif_may_resize : 1;
523  uint motif_may_move :1;
524  uint motif_may_close : 1;
525  uint keep_below : 1; // NET::KeepBelow
526  uint minimized : 1;
527  uint hidden : 1; // forcibly hidden by calling hide()
528  uint modal : 1; // NET::Modal
529  uint noborder : 1;
530  uint user_noborder : 1;
531  uint urgency : 1; // XWMHints, UrgencyHint
532  uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client
533  uint demands_attention : 1;
534  WindowRules client_rules;
535  void getWMHints();
536  void readIcons();
537  void getWindowProtocols();
538  TQPixmap icon_pix;
539  TQPixmap miniicon_pix;
540  TQCursor cursor;
541  // FullScreenHack - non-NETWM fullscreen (noborder,size of desktop)
542  // DON'T reorder - saved to config files !!!
543  enum FullScreenMode { FullScreenNone, FullScreenNormal, FullScreenHack };
544  FullScreenMode fullscreen_mode;
545  MaximizeMode max_mode;
546  TQRect geom_restore;
547  TQRect geom_fs_restore;
548  MaximizeMode maxmode_restore;
549  int workarea_diff_x, workarea_diff_y;
550  WinInfo* info;
551  TQTimer* autoRaiseTimer;
552  TQTimer* shadeHoverTimer;
553  Colormap cmap;
554  TQCString resource_name;
555  TQCString resource_class;
556  TQCString client_machine;
557  TQString cap_normal, cap_iconic, cap_suffix;
558  WId wmClientLeaderWin;
559  TQCString window_role;
560  Group* in_group;
561  Window window_group;
562  Layer in_layer;
563  TQTimer* ping_timer;
564  TDEProcess* process_killer;
565  TDEProcess* process_resumer;
566  Time ping_timestamp;
567  Time user_time;
568  unsigned long allowed_actions;
569  TQRect frame_geometry;
570  TQSize client_size;
571  int postpone_geometry_updates; // >0 - new geometry is remembered, but not actually set
572  bool pending_geometry_update;
573  bool shade_geometry_change;
574  int border_left, border_right, border_top, border_bottom;
575 
576  Client* shadowAfterClient;
577  TQWidget* shadowWidget;
578  TQMemArray<double> activeOpacityCache;
579  TQMemArray<double> inactiveOpacityCache;
580  TQMemArray<double>* opacityCache;
581  TQRegion shapeBoundingRegion;
582  TQTimer* shadowDelayTimer;
583  bool shadowMe;
584 
585  TQRegion _mask;
586  static bool check_active_modal; // see Client::checkActiveModal()
587  TDEShortcut _shortcut;
588  friend struct FetchNameInternalPredicate;
589  friend struct CheckIgnoreFocusStealingProcedure;
590  friend struct ResetupRulesProcedure;
591  friend class GeometryUpdatesPostponer;
592  void show() { assert( false ); } // SELI remove after Client is no longer TQWidget
593  void hide() { assert( false ); }
594  uint opacity_;
595  uint savedOpacity_;
596  bool custom_opacity;
597  uint rule_opacity_active; //translucency rules
598  uint rule_opacity_inactive; //dto.
599  //int shadeOriginalHeight;
600  bool isBMP_;
601  TQTimer* demandAttentionKNotifyTimer;
602 
603  friend bool performTransiencyCheck();
604  bool minimized_before_suspend;
605  };
606 
607 // helper for Client::postponeGeometryUpdates() being called in pairs (true/false)
608 class GeometryUpdatesPostponer
609  {
610  public:
611  GeometryUpdatesPostponer( Client* c )
612  : cl( c ) { cl->postponeGeometryUpdates( true ); }
613  ~GeometryUpdatesPostponer()
614  { cl->postponeGeometryUpdates( false ); }
615  private:
616  Client* cl;
617  };
618 
619 
620 // NET WM Protocol handler class
621 class WinInfo : public NETWinInfo
622  {
623  private:
624  typedef KWinInternal::Client Client; // because of NET::Client
625  public:
626  WinInfo( Client* c, Display * display, Window window,
627  Window rwin, const unsigned long pr[], int pr_size );
628  virtual void changeDesktop(int desktop);
629  virtual void changeState( unsigned long state, unsigned long mask );
630  private:
631  Client * m_client;
632  };
633 
634 inline Window Client::window() const
635  {
636  return client;
637  }
638 
639 inline Window Client::frameId() const
640  {
641  return frame;
642  }
643 
644 inline Window Client::wrapperId() const
645  {
646  return wrapper;
647  }
648 
649 inline Window Client::decorationId() const
650  {
651  return decoration != NULL ? decoration->widget()->winId() : None;
652  }
653 
654 inline Workspace* Client::workspace() const
655  {
656  return wspace;
657  }
658 
659 inline const Client* Client::transientFor() const
660  {
661  return transient_for;
662  }
663 
664 inline Client* Client::transientFor()
665  {
666  return transient_for;
667  }
668 
669 inline bool Client::groupTransient() const
670  {
671  return transient_for_id == workspace()->rootWin();
672  }
673 
674 // needed because verifyTransientFor() may set transient_for_id to root window,
675 // if the original value has a problem (window doesn't exist, etc.)
676 inline bool Client::wasOriginallyGroupTransient() const
677  {
678  return original_transient_for_id == workspace()->rootWin();
679  }
680 
681 inline bool Client::isTransient() const
682  {
683  return transient_for_id != None;
684  }
685 
686 inline const ClientList& Client::transients() const
687  {
688  return transients_list;
689  }
690 
691 inline const Group* Client::group() const
692  {
693  return in_group;
694  }
695 
696 inline Group* Client::group()
697  {
698  return in_group;
699  }
700 
701 inline int Client::mappingState() const
702  {
703  return mapping_state;
704  }
705 
706 inline TQCString Client::resourceName() const
707  {
708  return resource_name; // it is always lowercase
709  }
710 
711 inline TQCString Client::resourceClass() const
712  {
713  return resource_class; // it is always lowercase
714  }
715 
716 inline
717 bool Client::isMinimized() const
718  {
719  return minimized;
720  }
721 
722 inline bool Client::isActive() const
723  {
724  return active;
725  }
726 
733 inline int Client::desktop() const
734  {
735  return desk;
736  }
737 
738 inline bool Client::isOnAllDesktops() const
739  {
740  return desk == NET::OnAllDesktops;
741  }
746 inline bool Client::isOnDesktop( int d ) const
747  {
748  return desk == d || /*desk == 0 ||*/ isOnAllDesktops();
749  }
750 
751 inline
752 bool Client::isShown( bool shaded_is_shown ) const
753  {
754  return !isMinimized() && ( !isShade() || shaded_is_shown ) && !hidden;
755  }
756 
757 inline
758 bool Client::isShade() const
759  {
760  return shade_mode == ShadeNormal;
761  }
762 
763 inline
764 ShadeMode Client::shadeMode() const
765  {
766  return shade_mode;
767  }
768 
769 inline TQPixmap Client::icon() const
770  {
771  return icon_pix;
772  }
773 
774 inline TQPixmap Client::miniIcon() const
775  {
776  return miniicon_pix;
777  }
778 
779 inline TQRect Client::geometryRestore() const
780  {
781  return geom_restore;
782  }
783 
784 inline Client::MaximizeMode Client::maximizeModeRestore() const
785  {
786  return maxmode_restore;
787  }
788 
789 inline Client::MaximizeMode Client::maximizeMode() const
790  {
791  return max_mode;
792  }
793 
794 inline bool Client::skipTaskbar( bool from_outside ) const
795  {
796  return from_outside ? original_skip_taskbar : skip_taskbar;
797  }
798 
799 inline bool Client::skipPager() const
800  {
801  return skip_pager;
802  }
803 
804 inline bool Client::keepBelow() const
805  {
806  return keep_below;
807  }
808 
809 inline bool Client::shape() const
810  {
811  return is_shape;
812  }
813 
814 
815 inline bool Client::isFullScreen() const
816  {
817  return fullscreen_mode != FullScreenNone;
818  }
819 
820 inline bool Client::isModal() const
821  {
822  return modal;
823  }
824 
825 inline bool Client::hasNETSupport() const
826  {
827  return info->hasNETSupport();
828  }
829 
830 inline Colormap Client::colormap() const
831  {
832  return cmap;
833  }
834 
835 inline pid_t Client::pid() const
836  {
837  return info->pid();
838  }
839 
840 inline void Client::invalidateLayer()
841  {
842  in_layer = UnknownLayer;
843  }
844 
845 inline bool Client::isIconicState() const
846  {
847  return mapping_state == IconicState;
848  }
849 
850 inline bool Client::isNormalState() const
851  {
852  return mapping_state == NormalState;
853  }
854 
855 inline bool Client::isManaged() const
856  {
857  return mapping_state != WithdrawnState;
858  }
859 
860 inline TQCString Client::windowRole() const
861  {
862  return window_role;
863  }
864 
865 inline TQRect Client::geometry() const
866  {
867  return frame_geometry;
868  }
869 
870 inline TQSize Client::size() const
871  {
872  return frame_geometry.size();
873  }
874 
875 inline TQPoint Client::pos() const
876  {
877  return frame_geometry.topLeft();
878  }
879 
880 inline int Client::x() const
881  {
882  return frame_geometry.x();
883  }
884 
885 inline int Client::y() const
886  {
887  return frame_geometry.y();
888  }
889 
890 inline int Client::width() const
891  {
892  return frame_geometry.width();
893  }
894 
895 inline int Client::height() const
896  {
897  return frame_geometry.height();
898  }
899 
900 inline TQRect Client::rect() const
901  {
902  return TQRect( 0, 0, width(), height());
903  }
904 
905 inline TQPoint Client::clientPos() const
906  {
907  return TQPoint( border_left, border_top );
908  }
909 
910 inline TQSize Client::clientSize() const
911  {
912  return client_size;
913  }
914 
915 inline void Client::setGeometry( const TQRect& r, ForceGeometry_t force )
916  {
917  setGeometry( r.x(), r.y(), r.width(), r.height(), force );
918  }
919 
920 inline void Client::move( const TQPoint & p, ForceGeometry_t force )
921  {
922  move( p.x(), p.y(), force );
923  }
924 
925 inline void Client::plainResize( const TQSize& s, ForceGeometry_t force )
926  {
927  plainResize( s.width(), s.height(), force );
928  }
929 
930 inline bool Client::isShadowed() const
931  {
932  return shadowMe;
933  }
934 
935 inline Window Client::shadowId() const
936  {
937  return shadowWidget != NULL ? shadowWidget->winId() : None;
938  }
939 
940 inline void Client::resizeWithChecks( const TQSize& s, ForceGeometry_t force )
941  {
942  resizeWithChecks( s.width(), s.height(), force );
943  }
944 
945 inline bool Client::hasUserTimeSupport() const
946  {
947  return info->userTime() != -1U;
948  }
949 
950 inline bool Client::ignoreFocusStealing() const
951  {
952  return ignore_focus_stealing;
953  }
954 
955 inline const WindowRules* Client::rules() const
956  {
957  return &client_rules;
958  }
959 
960 KWIN_PROCEDURE( CheckIgnoreFocusStealingProcedure, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing( cl ));
961 
962 inline Window Client::moveResizeGrabWindow() const
963  {
964  return move_resize_grab_window;
965  }
966 
967 inline TDEShortcut Client::shortcut() const
968  {
969  return _shortcut;
970  }
971 
972 inline bool Client::isBMP()
973  {
974  return isBMP_;
975  }
976 
977 inline void Client::setBMP(bool b)
978  {
979  isBMP_ = b;
980  }
981 
982 inline void Client::removeRule( Rules* rule )
983  {
984  client_rules.remove( rule );
985  }
986 
987 #ifdef NDEBUG
988 inline
989 kndbgstream& operator<<( kndbgstream& stream, const Client* ) { return stream; }
990 inline
991 kndbgstream& operator<<( kndbgstream& stream, const ClientList& ) { return stream; }
992 inline
993 kndbgstream& operator<<( kndbgstream& stream, const ConstClientList& ) { return stream; }
994 #else
995 kdbgstream& operator<<( kdbgstream& stream, const Client* );
996 kdbgstream& operator<<( kdbgstream& stream, const ClientList& );
997 kdbgstream& operator<<( kdbgstream& stream, const ConstClientList& );
998 #endif
999 
1000 KWIN_COMPARE_PREDICATE( WindowMatchPredicate, Window, cl->window() == value );
1001 KWIN_COMPARE_PREDICATE( FrameIdMatchPredicate, Window, cl->frameId() == value );
1002 KWIN_COMPARE_PREDICATE( WrapperIdMatchPredicate, Window, cl->wrapperId() == value );
1003 
1004 } // namespace
1005 
1006 #endif

twin

Skip menu "twin"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

twin

Skip menu "twin"
  • kate
  • libkonq
  • twin
  •   lib
Generated for twin by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.