• 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
5Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
6Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
7
8You can Freely distribute this program under the GNU General Public
9License. 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
33class TQTimer;
34class TDEProcess;
35class TDEStartupInfoData;
36
37namespace KWinInternal
38{
39
40class Workspace;
41class Client;
42class WinInfo;
43class SessionInfo;
44class Bridge;
45
46class Client : public TQObject, public KDecorationDefines
47 {
48 TQ_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 void setActiveBorderMode( ActiveMaximizingMode mode );
236 void setActiveBorder( ActiveBorder border);
237 ActiveMaximizingMode activeBorderMode() const;
238 ActiveBorder activeBorder() const;
239 void setActiveBorderMaximizing(bool maximizing);
240 void cancelActiveBorderMaximizing();
241 bool isActiveBorderMaximizing() const;
242 TQRect activeBorderMaximizeGeometry();
243
244 void growHorizontal();
245 void shrinkHorizontal();
246 void growVertical();
247 void shrinkVertical();
248
249 bool providesContextHelp() const;
250 TDEShortcut shortcut() const;
251 void setShortcut( const TQString& cut );
252
253 bool performMouseCommand( Options::MouseCommand, TQPoint globalPos, bool handled = false );
254
255 TQCString windowRole() const;
256 TQCString sessionId();
257 TQCString resourceName() const;
258 TQCString resourceClass() const;
259 TQCString wmCommand();
260 TQCString wmClientMachine( bool use_localhost ) const;
261 Window wmClientLeader() const;
262 pid_t pid() const;
263
264 TQRect adjustedClientArea( const TQRect& desktop, const TQRect& area ) const;
265
266 Colormap colormap() const;
267
268 // updates visibility depending on being shaded, virtual desktop, etc.
269 void updateVisibility();
270 // hides a client - basically like minimize, but without effects, it's simply hidden
271 void hideClient( bool hide );
272
273 TQString caption( bool full = true ) const;
274 void updateCaption();
275
276 void keyPressEvent( uint key_code ); // FRAME ??
277 void updateMouseGrab();
278 Window moveResizeGrabWindow() const;
279
280 const TQPoint calculateGravitation( bool invert, int gravity = 0 ) const; // FRAME public?
281
282 void NETMoveResize( int x_root, int y_root, NET::Direction direction );
283 void NETMoveResizeWindow( int flags, int x, int y, int width, int height );
284 void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp, bool send_event = false );
285
286 void gotPing( Time timestamp );
287
288 static TQCString staticWindowRole(WId);
289 static TQCString staticSessionId(WId);
290 static TQCString staticWmCommand(WId);
291 static TQCString staticWmClientMachine(WId);
292 static Window staticWmClientLeader(WId);
293
294 void checkWorkspacePosition();
295 void updateUserTime( Time time = CurrentTime );
296 Time userTime() const;
297 bool hasUserTimeSupport() const;
298 bool ignoreFocusStealing() const;
299
300 // does 'delete c;'
301 static void deleteClient( Client* c, allowed_t );
302
303 static bool resourceMatch( const Client* c1, const Client* c2 );
304 static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
305 static void readIcons( Window win, TQPixmap* icon, TQPixmap* miniicon );
306
307 void minimize( bool avoid_animation = false );
308 void unminimize( bool avoid_animation = false );
309 void closeWindow();
310 void killWindow();
311 void suspendWindow();
312 void resumeWindow();
313 bool queryUserSuspendedResume();
314 void maximize( MaximizeMode );
315 void toggleShade();
316 void showContextHelp();
317 void cancelShadeHover();
318 void cancelAutoRaise();
319 void destroyClient();
320 void checkActiveModal();
321 void setOpacity(bool translucent, uint opacity = 0);
322 void setShadowSize(uint shadowSize);
323 void updateOpacity();
324 void updateShadowSize();
325 bool hasCustomOpacity(){return custom_opacity;}
326 void setCustomOpacityFlag(bool custom = true);
327 bool getWindowOpacity();
328 int opacityPercentage();
329 void checkAndSetInitialRuledOpacity();
330 uint ruleOpacityInactive();
331 uint ruleOpacityActive();
332 unsigned int opacity();
333 bool isBMP();
334 void setBMP(bool b);
335 bool touches(const Client* c);
336 void setShapable(bool b);
337 bool hasStrut() const;
338
339 private slots:
340 void autoRaise();
341 void shadeHover();
342 void shortcutActivated();
343 void updateOpacityCache();
344
345
346 private:
347 friend class Bridge; // FRAME
348 virtual void processMousePressEvent( TQMouseEvent* e );
349
350 private: // TODO cleanup the order of things in the .h file
351 // use Workspace::createClient()
352 virtual ~Client(); // use destroyClient() or releaseWindow()
353
354 Position mousePosition( const TQPoint& ) const;
355 void setCursor( Position m );
356 void setCursor( const TQCursor& c );
357
358 void animateMinimizeOrUnminimize( bool minimize );
359 TQPixmap animationPixmap( int w );
360 // transparent stuff
361 void drawbound( const TQRect& geom );
362 void clearbound();
363 void doDrawbound( const TQRect& geom, bool clear );
364
365 // handlers for X11 events
366 bool mapRequestEvent( XMapRequestEvent* e );
367 void unmapNotifyEvent( XUnmapEvent*e );
368 void destroyNotifyEvent( XDestroyWindowEvent*e );
369 void configureRequestEvent( XConfigureRequestEvent* e );
370 void propertyNotifyEvent( XPropertyEvent* e );
371 void clientMessageEvent( XClientMessageEvent* e );
372 void enterNotifyEvent( XCrossingEvent* e );
373 void leaveNotifyEvent( XCrossingEvent* e );
374 void focusInEvent( XFocusInEvent* e );
375 void focusOutEvent( XFocusOutEvent* e );
376
377 bool buttonPressEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
378 bool buttonReleaseEvent( Window w, int button, int state, int x, int y, int x_root, int y_root );
379 bool motionNotifyEvent( Window w, int state, int x, int y, int x_root, int y_root );
380
381 // drop shadows
382 void drawIntersectingShadows();
383 void drawOverlappingShadows(bool waitForMe);
384 TQRegion getExposedRegion(TQRegion occludedRegion, int x, int y,
385 int w, int h, int thickness, int xOffset, int yOffset);
386 void imposeCachedShadow(TQPixmap &pixmap, TQRegion exposed);
387 void imposeRegionShadow(TQPixmap &pixmap, TQRegion occluded,
388 TQRegion exposed, int thickness, double maxOpacity = 0.75);
389
390 void processDecorationButtonPress( int button, int state, int x, int y, int x_root, int y_root );
391
392 private slots:
393 void pingTimeout();
394 void processKillerExited();
395 void processResumerExited();
396 void demandAttentionKNotify();
397 void drawShadow();
398 void drawShadowAfter(Client *after);
399 void drawDelayedShadow();
400 void removeShadow();
401
402 signals:
403 void shadowDrawn();
404
405
406 private:
407 // ICCCM 4.1.3.1, 4.1.4 , NETWM 2.5.1
408 void setMappingState( int s );
409 int mappingState() const;
410 bool isIconicState() const;
411 bool isNormalState() const;
412 bool isManaged() const; // returns false if this client is not yet managed
413 void updateAllowedActions( bool force = false );
414 TQSize sizeForClientSize( const TQSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
415 void changeMaximize( bool horizontal, bool vertical, bool adjust );
416 void checkMaximizeGeometry();
417 int checkFullScreenHack( const TQRect& geom ) const; // 0 - none, 1 - one xinerama screen, 2 - full area
418 void updateFullScreenHack( const TQRect& geom );
419 void getWmNormalHints();
420 void getMotifHints();
421 void getIcons();
422 void getWmClientLeader();
423 void getWmClientMachine();
424 void fetchName();
425 void fetchIconicName();
426 TQString readName() const;
427 void setCaption( const TQString& s, bool force = false );
428 bool hasTransientInternal( const Client* c, bool indirect, ConstClientList& set ) const;
429 void finishWindowRules();
430 void setShortcutInternal( const TDEShortcut& cut );
431
432 void updateWorkareaDiffs();
433 void checkDirection( int new_diff, int old_diff, TQRect& rect, const TQRect& area );
434 static int computeWorkareaDiff( int left, int right, int a_left, int a_right );
435 void configureRequest( int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool );
436 NETExtendedStrut strut() const;
437 int checkShadeGeometry( int w, int h );
438 void postponeGeometryUpdates( bool postpone );
439
440 bool startMoveResize();
441 void finishMoveResize( bool cancel );
442 void leaveMoveResize();
443 void checkUnrestrictedMoveResize();
444 void handleMoveResize( int x, int y, int x_root, int y_root );
445 void positionGeometryTip();
446 void grabButton( int mod );
447 void ungrabButton( int mod );
448 void resetMaximize();
449 void resizeDecoration( const TQSize& s );
450 void setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth);
451 void unsetDecoHashProperty();
452
453 void pingWindow();
454 void killProcess( bool ask, Time timestamp = CurrentTime );
455 void updateUrgency();
456 static void sendClientMessage( Window w, Atom a, Atom protocol,
457 long data1 = 0, long data2 = 0, long data3 = 0 );
458
459 void embedClient( Window w, const XWindowAttributes &attr );
460 void detectNoBorder();
461 void detectShapable();
462 void destroyDecoration();
463 void updateFrameExtents();
464
465 void rawShow(); // just shows it
466 void rawHide(); // just hides it
467
468 Time readUserTimeMapTimestamp( const TDEStartupInfoId* asn_id, const TDEStartupInfoData* asn_data,
469 bool session ) const;
470 Time readUserCreationTime() const;
471 static bool sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool active_hack );
472 void startupIdChanged();
473
474 Window client;
475 Window wrapper;
476 Window frame;
477 KDecoration* decoration;
478 Workspace* wspace;
479 Bridge* bridge;
480 int desk;
481 bool buttonDown;
482 bool moveResizeMode;
483 bool move_faked_activity;
484 Window move_resize_grab_window;
485 bool unrestrictedMoveResize;
486 bool isMove() const
487 {
488 return moveResizeMode && mode == PositionCenter;
489 }
490 bool isResize() const
491 {
492 return moveResizeMode && mode != PositionCenter;
493 }
494
495 Position mode;
496 TQPoint moveOffset;
497 TQPoint invertedMoveOffset;
498 TQRect moveResizeGeom;
499 TQRect initialMoveResizeGeom;
500 XSizeHints xSizeHint;
501 void sendSyntheticConfigureNotify();
502 int mapping_state;
503 void readTransient();
504 Window verifyTransientFor( Window transient_for, bool set );
505 void addTransient( Client* cl );
506 void removeTransient( Client* cl );
507 void removeFromMainClients();
508 void cleanGrouping();
509 void checkGroupTransients();
510 void setTransient( Window new_transient_for_id );
511 Client* transient_for;
512 Window transient_for_id;
513 Window original_transient_for_id;
514 ClientList transients_list; // SELI make this ordered in stacking order?
515 ShadeMode shade_mode;
516 uint active :1;
517 uint deleting : 1; // true when doing cleanup and destroying the client
518 uint keep_above : 1; // NET::KeepAbove (was stays_on_top)
519 uint is_shape :1;
520 uint skip_taskbar :1;
521 uint original_skip_taskbar :1; // unaffected by KWin
522 uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
523 uint Ptakefocus :1;// does the window understand the TakeFocus protocol?
524 uint Ptakeactivity : 1; // does it support _NET_WM_TAKE_ACTIVITY
525 uint Pcontexthelp : 1; // does the window understand the ContextHelp protocol?
526 uint Pping : 1; // does it support _NET_WM_PING?
527 uint input :1; // does the window want input in its wm_hints
528 uint skip_pager : 1;
529 uint motif_noborder : 1;
530 uint motif_may_resize : 1;
531 uint motif_may_move :1;
532 uint motif_may_close : 1;
533 uint keep_below : 1; // NET::KeepBelow
534 uint minimized : 1;
535 uint hidden : 1; // forcibly hidden by calling hide()
536 uint modal : 1; // NET::Modal
537 uint noborder : 1;
538 uint user_noborder : 1;
539 uint urgency : 1; // XWMHints, UrgencyHint
540 uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client
541 uint demands_attention : 1;
542 WindowRules client_rules;
543 void getWMHints();
544 void readIcons();
545 void getWindowProtocols();
546 TQPixmap icon_pix;
547 TQPixmap miniicon_pix;
548 TQCursor cursor;
549 // FullScreenHack - non-NETWM fullscreen (noborder,size of desktop)
550 // DON'T reorder - saved to config files !!!
551 enum FullScreenMode { FullScreenNone, FullScreenNormal, FullScreenHack };
552 FullScreenMode fullscreen_mode;
553 MaximizeMode max_mode;
554 TQRect geom_restore;
555 TQRect geom_fs_restore;
556 MaximizeMode maxmode_restore;
557 int workarea_diff_x, workarea_diff_y;
558 WinInfo* info;
559 TQTimer* autoRaiseTimer;
560 TQTimer* shadeHoverTimer;
561 Colormap cmap;
562 TQCString resource_name;
563 TQCString resource_class;
564 TQCString client_machine;
565 TQString cap_normal, cap_iconic, cap_suffix;
566 WId wmClientLeaderWin;
567 TQCString window_role;
568 Group* in_group;
569 Window window_group;
570 Layer in_layer;
571 TQTimer* ping_timer;
572 TDEProcess* process_killer;
573 TDEProcess* process_resumer;
574 Time ping_timestamp;
575 Time user_time;
576 unsigned long allowed_actions;
577 TQRect frame_geometry;
578 TQSize client_size;
579 int postpone_geometry_updates; // >0 - new geometry is remembered, but not actually set
580 bool pending_geometry_update;
581 bool shade_geometry_change;
582 int border_left, border_right, border_top, border_bottom;
583
584 Client* shadowAfterClient;
585 TQWidget* shadowWidget;
586 TQMemArray<double> activeOpacityCache;
587 TQMemArray<double> inactiveOpacityCache;
588 TQMemArray<double>* opacityCache;
589 TQRegion shapeBoundingRegion;
590 TQTimer* shadowDelayTimer;
591 bool shadowMe;
592
593 TQRegion _mask;
594 static bool check_active_modal; // see Client::checkActiveModal()
595 TDEShortcut _shortcut;
596 friend struct FetchNameInternalPredicate;
597 friend struct CheckIgnoreFocusStealingProcedure;
598 friend struct ResetupRulesProcedure;
599 friend class GeometryUpdatesPostponer;
600 void show() { assert( false ); } // SELI remove after Client is no longer TQWidget
601 void hide() { assert( false ); }
602 uint opacity_;
603 uint savedOpacity_;
604 bool custom_opacity;
605 uint rule_opacity_active; //translucency rules
606 uint rule_opacity_inactive; //dto.
607 //int shadeOriginalHeight;
608 bool isBMP_;
609 TQTimer* demandAttentionKNotifyTimer;
610
611 bool activeMaximizing;
612 bool activeTiled;
613 TQRect activeTiledOrigGeom;
614 ActiveMaximizingMode activeMode;
615 ActiveBorder currentActiveBorder;
616
617 friend bool performTransiencyCheck();
618 bool minimized_before_suspend;
619 };
620
621// helper for Client::postponeGeometryUpdates() being called in pairs (true/false)
622class GeometryUpdatesPostponer
623 {
624 public:
625 GeometryUpdatesPostponer( Client* c )
626 : cl( c ) { cl->postponeGeometryUpdates( true ); }
627 ~GeometryUpdatesPostponer()
628 { cl->postponeGeometryUpdates( false ); }
629 private:
630 Client* cl;
631 };
632
633
634// NET WM Protocol handler class
635class WinInfo : public NETWinInfo
636 {
637 private:
638 typedef KWinInternal::Client Client; // because of NET::Client
639 public:
640 WinInfo( Client* c, Display * display, Window window,
641 Window rwin, const unsigned long pr[], int pr_size );
642 virtual void changeDesktop(int desktop);
643 virtual void changeState( unsigned long state, unsigned long mask );
644 private:
645 Client * m_client;
646 };
647
648inline Window Client::window() const
649 {
650 return client;
651 }
652
653inline Window Client::frameId() const
654 {
655 return frame;
656 }
657
658inline Window Client::wrapperId() const
659 {
660 return wrapper;
661 }
662
663inline Window Client::decorationId() const
664 {
665 return decoration != NULL ? decoration->widget()->winId() : None;
666 }
667
668inline Workspace* Client::workspace() const
669 {
670 return wspace;
671 }
672
673inline const Client* Client::transientFor() const
674 {
675 return transient_for;
676 }
677
678inline Client* Client::transientFor()
679 {
680 return transient_for;
681 }
682
683inline bool Client::groupTransient() const
684 {
685 return transient_for_id == workspace()->rootWin();
686 }
687
688// needed because verifyTransientFor() may set transient_for_id to root window,
689// if the original value has a problem (window doesn't exist, etc.)
690inline bool Client::wasOriginallyGroupTransient() const
691 {
692 return original_transient_for_id == workspace()->rootWin();
693 }
694
695inline bool Client::isTransient() const
696 {
697 return transient_for_id != None;
698 }
699
700inline const ClientList& Client::transients() const
701 {
702 return transients_list;
703 }
704
705inline const Group* Client::group() const
706 {
707 return in_group;
708 }
709
710inline Group* Client::group()
711 {
712 return in_group;
713 }
714
715inline int Client::mappingState() const
716 {
717 return mapping_state;
718 }
719
720inline TQCString Client::resourceName() const
721 {
722 return resource_name; // it is always lowercase
723 }
724
725inline TQCString Client::resourceClass() const
726 {
727 return resource_class; // it is always lowercase
728 }
729
730inline
731bool Client::isMinimized() const
732 {
733 return minimized;
734 }
735
736inline bool Client::isActive() const
737 {
738 return active;
739 }
740
747inline int Client::desktop() const
748 {
749 return desk;
750 }
751
752inline bool Client::isOnAllDesktops() const
753 {
754 return desk == NET::OnAllDesktops;
755 }
760inline bool Client::isOnDesktop( int d ) const
761 {
762 return desk == d || /*desk == 0 ||*/ isOnAllDesktops();
763 }
764
765inline
766bool Client::isShown( bool shaded_is_shown ) const
767 {
768 return !isMinimized() && ( !isShade() || shaded_is_shown ) && !hidden;
769 }
770
771inline
772bool Client::isShade() const
773 {
774 return shade_mode == ShadeNormal;
775 }
776
777inline
778ShadeMode Client::shadeMode() const
779 {
780 return shade_mode;
781 }
782
783inline TQPixmap Client::icon() const
784 {
785 return icon_pix;
786 }
787
788inline TQPixmap Client::miniIcon() const
789 {
790 return miniicon_pix;
791 }
792
793inline TQRect Client::geometryRestore() const
794 {
795 return geom_restore;
796 }
797
798inline Client::MaximizeMode Client::maximizeModeRestore() const
799 {
800 return maxmode_restore;
801 }
802
803inline Client::MaximizeMode Client::maximizeMode() const
804 {
805 return max_mode;
806 }
807
808inline bool Client::skipTaskbar( bool from_outside ) const
809 {
810 return from_outside ? original_skip_taskbar : skip_taskbar;
811 }
812
813inline bool Client::skipPager() const
814 {
815 return skip_pager;
816 }
817
818inline bool Client::keepBelow() const
819 {
820 return keep_below;
821 }
822
823inline bool Client::shape() const
824 {
825 return is_shape;
826 }
827
828
829inline bool Client::isFullScreen() const
830 {
831 return fullscreen_mode != FullScreenNone;
832 }
833
834inline bool Client::isModal() const
835 {
836 return modal;
837 }
838
839inline bool Client::hasNETSupport() const
840 {
841 return info->hasNETSupport();
842 }
843
844inline Colormap Client::colormap() const
845 {
846 return cmap;
847 }
848
849inline pid_t Client::pid() const
850 {
851 return info->pid();
852 }
853
854inline void Client::invalidateLayer()
855 {
856 in_layer = UnknownLayer;
857 }
858
859inline bool Client::isIconicState() const
860 {
861 return mapping_state == IconicState;
862 }
863
864inline bool Client::isNormalState() const
865 {
866 return mapping_state == NormalState;
867 }
868
869inline bool Client::isManaged() const
870 {
871 return mapping_state != WithdrawnState;
872 }
873
874inline TQCString Client::windowRole() const
875 {
876 return window_role;
877 }
878
879inline TQRect Client::geometry() const
880 {
881 return frame_geometry;
882 }
883
884inline TQSize Client::size() const
885 {
886 return frame_geometry.size();
887 }
888
889inline TQPoint Client::pos() const
890 {
891 return frame_geometry.topLeft();
892 }
893
894inline int Client::x() const
895 {
896 return frame_geometry.x();
897 }
898
899inline int Client::y() const
900 {
901 return frame_geometry.y();
902 }
903
904inline int Client::width() const
905 {
906 return frame_geometry.width();
907 }
908
909inline int Client::height() const
910 {
911 return frame_geometry.height();
912 }
913
914inline TQRect Client::rect() const
915 {
916 return TQRect( 0, 0, width(), height());
917 }
918
919inline TQPoint Client::clientPos() const
920 {
921 return TQPoint( border_left, border_top );
922 }
923
924inline TQSize Client::clientSize() const
925 {
926 return client_size;
927 }
928
929inline void Client::setGeometry( const TQRect& r, ForceGeometry_t force )
930 {
931 setGeometry( r.x(), r.y(), r.width(), r.height(), force );
932 }
933
934inline void Client::move( const TQPoint & p, ForceGeometry_t force )
935 {
936 move( p.x(), p.y(), force );
937 }
938
939inline void Client::plainResize( const TQSize& s, ForceGeometry_t force )
940 {
941 plainResize( s.width(), s.height(), force );
942 }
943
944inline bool Client::isShadowed() const
945 {
946 return shadowMe;
947 }
948
949inline Window Client::shadowId() const
950 {
951 return shadowWidget != NULL ? shadowWidget->winId() : None;
952 }
953
954inline void Client::resizeWithChecks( const TQSize& s, ForceGeometry_t force )
955 {
956 resizeWithChecks( s.width(), s.height(), force );
957 }
958
959inline bool Client::hasUserTimeSupport() const
960 {
961 return info->userTime() != -1U;
962 }
963
964inline bool Client::ignoreFocusStealing() const
965 {
966 return ignore_focus_stealing;
967 }
968
969inline const WindowRules* Client::rules() const
970 {
971 return &client_rules;
972 }
973
974KWIN_PROCEDURE( CheckIgnoreFocusStealingProcedure, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing( cl ));
975
976inline Window Client::moveResizeGrabWindow() const
977 {
978 return move_resize_grab_window;
979 }
980
981inline TDEShortcut Client::shortcut() const
982 {
983 return _shortcut;
984 }
985
986inline bool Client::isBMP()
987 {
988 return isBMP_;
989 }
990
991inline void Client::setBMP(bool b)
992 {
993 isBMP_ = b;
994 }
995
996inline void Client::removeRule( Rules* rule )
997 {
998 client_rules.remove( rule );
999 }
1000
1001#ifdef NDEBUG
1002inline
1003kndbgstream& operator<<( kndbgstream& stream, const Client* ) { return stream; }
1004inline
1005kndbgstream& operator<<( kndbgstream& stream, const ClientList& ) { return stream; }
1006inline
1007kndbgstream& operator<<( kndbgstream& stream, const ConstClientList& ) { return stream; }
1008#else
1009kdbgstream& operator<<( kdbgstream& stream, const Client* );
1010kdbgstream& operator<<( kdbgstream& stream, const ClientList& );
1011kdbgstream& operator<<( kdbgstream& stream, const ConstClientList& );
1012#endif
1013
1014KWIN_COMPARE_PREDICATE( WindowMatchPredicate, Window, cl->window() == value );
1015KWIN_COMPARE_PREDICATE( FrameIdMatchPredicate, Window, cl->frameId() == value );
1016KWIN_COMPARE_PREDICATE( WrapperIdMatchPredicate, Window, cl->wrapperId() == value );
1017
1018} // namespace
1019
1020#endif
KWinInternal::Client
The Client class encapsulates a window decoration frame.
Definition: client.h:47
KWinInternal::Client::desktop
int desktop() const
Definition: client.h:747
KWinInternal::Client::showContextHelp
void showContextHelp()
Definition: client.cpp:2268
KWinInternal::Client::staticWmClientLeader
static Window staticWmClientLeader(WId)
Definition: client.cpp:2515
KWinInternal::Client::sessionId
TQCString sessionId()
Definition: client.cpp:2547
KWinInternal::Client::providesContextHelp
bool providesContextHelp() const
Definition: client.cpp:2254
KWinInternal::Client::adjustedClientArea
TQRect adjustedClientArea(const TQRect &desktop, const TQRect &area) const
Definition: geometry.cpp:741
KWinInternal::Client::killWindow
void killWindow()
Definition: client.cpp:1755
KWinInternal::Client::setGeometry
void setGeometry(int x, int y, int w, int h, ForceGeometry_t force=NormalGeometrySet)
Definition: geometry.cpp:1712
KWinInternal::Client::performMouseCommand
bool performMouseCommand(Options::MouseCommand, TQPoint globalPos, bool handled=false)
Definition: useractions.cpp:473
KWinInternal::Client::setActive
void setActive(bool, bool updateOpacity=true)
Definition: activation.cpp:856
KWinInternal::Client::isMovable
bool isMovable() const
Definition: geometry.cpp:1647
KWinInternal::Client::isMinimizable
bool isMinimizable() const
Definition: client.cpp:626
KWinInternal::Client::keepAbove
bool keepAbove() const
Definition: client.cpp:659
KWinInternal::Client::manage
bool manage(Window w, bool isMapped)
Definition: manage.cpp:36
KWinInternal::Client::Client
Client(Workspace *ws)
Definition: client.cpp:94
KWinInternal::Client::minimize
void minimize(bool avoid_animation=false)
Definition: client.cpp:669
KWinInternal::Client::staticSessionId
static TQCString staticSessionId(WId)
Definition: client.cpp:2499
KWinInternal::Client::windowEvent
bool windowEvent(XEvent *e)
Definition: events.cpp:507
KWinInternal::Client::wmClientMachine
TQCString wmClientMachine(bool use_localhost) const
Definition: client.cpp:2580
KWinInternal::Client::isResizable
bool isResizable() const
Definition: geometry.cpp:1663
KWinInternal::Client::adjustedSize
TQSize adjustedSize(const TQSize &, Sizemode mode=SizemodeAny) const
Definition: geometry.cpp:1071
KWinInternal::Client::staticWindowRole
static TQCString staticWindowRole(WId)
Definition: client.cpp:2491
KWinInternal::Client::staticWmCommand
static TQCString staticWmCommand(WId)
Definition: client.cpp:2507
KWinInternal::Client::updateUserTime
void updateUserTime(Time time=CurrentTime)
Definition: activation.cpp:674
KWinInternal::Client::isOnDesktop
bool isOnDesktop(int d) const
Definition: client.h:760
KWinInternal::Client::wmCommand
TQCString wmCommand()
Definition: client.cpp:2559
KWinInternal::Client::releaseWindow
void releaseWindow(bool on_shutdown=false)
Definition: client.cpp:217
KWinInternal::Client::setMaximize
void setMaximize(bool vertically, bool horizontally)
Definition: geometry.cpp:1880
KWinInternal::Client::closeWindow
void closeWindow()
Definition: client.cpp:1731
KWinInternal::Client::wmClientLeader
Window wmClientLeader() const
Definition: client.cpp:2595
KWinInternal::Client::caption
TQString caption(bool full=true) const
Definition: client.cpp:2367
KWinInternal::Client::move
void move(int x, int y, ForceGeometry_t force=NormalGeometrySet)
Definition: geometry.cpp:1829

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.9.4
This website is maintained by Timothy Pearson.