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

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.