46class Client :
public TQObject,
public KDecorationDefines
51 Window window()
const;
52 Window frameId()
const;
53 Window wrapperId()
const;
54 Window decorationId()
const;
56 Workspace* workspace()
const;
57 const Client* transientFor()
const;
59 bool isTransient()
const;
60 bool isModalSystemNotification()
const;
61 bool groupTransient()
const;
62 bool wasOriginallyGroupTransient()
const;
63 ClientList mainClients()
const;
64 bool hasTransient(
const Client* c,
bool indirect )
const;
65 const ClientList& transients()
const;
66 void checkTransient( Window w );
68 const Group* group()
const;
70 void checkGroup( Group* gr = NULL,
bool force =
false );
71 void changeClientLeaderGroup( Group* gr );
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();
80 TQRect geometry()
const;
82 TQSize minSize()
const;
83 TQSize maxSize()
const;
90 TQPoint clientPos()
const;
91 TQSize clientSize()
const;
94 virtual bool eventFilter( TQObject* o, TQEvent* e );
96 bool manage( Window w,
bool isMapped );
107 TQSize
adjustedSize(
const TQSize&, Sizemode mode = SizemodeAny )
const;
108 TQSize adjustedSize()
const;
110 TQPixmap icon()
const;
111 TQPixmap miniIcon()
const;
113 bool isActive()
const;
114 void setActive(
bool,
bool updateOpacity =
true );
116 bool isSuspendable()
const;
117 bool isResumeable()
const;
120 void setDesktop(
int );
122 bool isOnCurrentDesktop()
const;
123 bool isOnAllDesktops()
const;
124 void setOnAllDesktops(
bool set );
126 bool isOnScreen(
int screen )
const;
130 bool isShown(
bool shaded_is_shown )
const;
132 bool isShade()
const;
133 ShadeMode shadeMode()
const;
134 void setShade( ShadeMode mode );
135 bool isShadeable()
const;
137 bool isMinimized()
const;
138 bool isMaximizable()
const;
139 TQRect geometryRestore()
const;
140 MaximizeMode maximizeModeRestore()
const;
141 MaximizeMode maximizeMode()
const;
143 void setMaximize(
bool vertically,
bool horizontally );
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; }
150 int fullScreenMode()
const {
return fullscreen_mode; }
152 bool isUserNoBorder()
const;
153 void setUserNoBorder(
bool set );
154 bool userCanSetNoBorder()
const;
155 bool noBorder()
const;
157 bool skipTaskbar(
bool from_outside =
false )
const;
158 void setSkipTaskbar(
bool set,
bool from_outside );
160 bool skipPager()
const;
161 void setSkipPager(
bool );
164 void setKeepAbove(
bool );
165 bool keepBelow()
const;
166 void setKeepBelow(
bool );
168 Layer belongsToLayer()
const;
169 void invalidateLayer();
171 void setModal(
bool modal );
172 bool isModal()
const;
175 bool wantsTabFocus()
const;
176 bool wantsInput()
const;
177 bool hasNETSupport()
const;
179 bool isDesktop()
const;
181 bool isToolbar()
const;
182 bool isTopMenu()
const;
184 bool isNormalWindow()
const;
185 bool isDialog()
const;
186 bool isSplash()
const;
187 bool isUtility()
const;
192 bool isSpecialWindow()
const;
195 bool isCloseable()
const;
197 void takeActivity(
int flags,
bool handled, allowed_t );
198 void takeFocus( allowed_t );
199 void demandAttention(
bool set =
true );
201 void setMask(
const TQRegion& r,
int mode = X::Unsorted );
202 TQRegion mask()
const;
204 void updateDecoration(
bool check_workspace_pos,
bool force =
false );
205 void checkBorderSizes();
208 bool isShadowed()
const;
209 void setShadowed(
bool shadowed);
210 Window shadowId()
const;
214 friend void Workspace::raiseClient(
Client *);
218 friend void Workspace::updateOverlappingShadows(WId);
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 );
229 void plainResize(
int w,
int h, ForceGeometry_t force = NormalGeometrySet );
230 void plainResize(
const TQSize& s, ForceGeometry_t force = NormalGeometrySet );
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 void tileToBorder(ActiveBorder border);
245 void growHorizontal();
246 void shrinkHorizontal();
248 void shrinkVertical();
251 TDEShortcut shortcut()
const;
252 void setShortcut(
const TQString& cut );
254 bool performMouseCommand( Options::MouseCommand, TQPoint globalPos,
bool handled =
false );
256 TQCString windowRole()
const;
258 TQCString resourceName()
const;
259 TQCString resourceClass()
const;
267 Colormap colormap()
const;
270 void updateVisibility();
272 void hideClient(
bool hide );
274 TQString
caption(
bool full =
true )
const;
275 void updateCaption();
277 void keyPressEvent( uint key_code );
278 void updateMouseGrab();
279 Window moveResizeGrabWindow()
const;
281 const TQPoint calculateGravitation(
bool invert,
int gravity = 0 )
const;
283 void NETMoveResize(
int x_root,
int y_root, NET::Direction direction );
284 void NETMoveResizeWindow(
int flags,
int x,
int y,
int width,
int height );
285 void restackWindow( Window above,
int detail, NET::RequestSource source, Time timestamp,
bool send_event =
false );
287 void gotPing( Time timestamp );
292 static TQCString staticWmClientMachine(WId);
295 void checkWorkspacePosition();
297 Time userTime()
const;
298 bool hasUserTimeSupport()
const;
299 bool ignoreFocusStealing()
const;
302 static void deleteClient(
Client* c, allowed_t );
304 static bool resourceMatch(
const Client* c1,
const Client* c2 );
305 static bool belongToSameApplication(
const Client* c1,
const Client* c2,
bool active_hack =
false );
306 static void readIcons( Window win, TQPixmap* icon, TQPixmap* miniicon );
308 void minimize(
bool avoid_animation =
false );
309 void unminimize(
bool avoid_animation =
false );
312 void suspendWindow();
314 bool queryUserSuspendedResume();
315 void maximize( MaximizeMode );
318 void cancelShadeHover();
319 void cancelAutoRaise();
320 void destroyClient();
321 void checkActiveModal();
322 void setOpacity(
bool translucent, uint opacity = 0);
323 void setShadowSize(uint shadowSize);
324 void updateOpacity();
325 void updateShadowSize();
326 bool hasCustomOpacity(){
return custom_opacity;}
327 void setCustomOpacityFlag(
bool custom =
true);
328 bool getWindowOpacity();
329 int opacityPercentage();
330 void checkAndSetInitialRuledOpacity();
331 uint ruleOpacityInactive();
332 uint ruleOpacityActive();
333 unsigned int opacity();
336 bool touches(
const Client* c);
337 void setShapable(
bool b);
338 bool hasStrut()
const;
343 void configureRequestTimeout();
344 void shortcutActivated();
345 void updateOpacityCache();
350 virtual void processMousePressEvent( TQMouseEvent* e );
356 Position mousePosition(
const TQPoint& )
const;
357 void setCursor( Position m );
358 void setCursor(
const TQCursor& c );
360 void animateMinimizeOrUnminimize(
bool minimize );
361 TQPixmap animationPixmap(
int w );
363 void drawbound(
const TQRect& geom );
365 void doDrawbound(
const TQRect& geom,
bool clear );
368 bool mapRequestEvent( XMapRequestEvent* e );
369 void unmapNotifyEvent( XUnmapEvent*e );
370 void destroyNotifyEvent( XDestroyWindowEvent*e );
371 void configureRequestEvent( XConfigureRequestEvent* e );
372 void propertyNotifyEvent( XPropertyEvent* e );
373 void clientMessageEvent( XClientMessageEvent* e );
374 void enterNotifyEvent( XCrossingEvent* e );
375 void leaveNotifyEvent( XCrossingEvent* e );
376 void focusInEvent( XFocusInEvent* e );
377 void focusOutEvent( XFocusOutEvent* e );
379 bool buttonPressEvent( Window w,
int button,
int state,
int x,
int y,
int x_root,
int y_root );
380 bool buttonReleaseEvent( Window w,
int button,
int state,
int x,
int y,
int x_root,
int y_root );
381 bool motionNotifyEvent( Window w,
int state,
int x,
int y,
int x_root,
int y_root );
384 void drawIntersectingShadows();
385 void drawOverlappingShadows(
bool waitForMe);
386 TQRegion getExposedRegion(TQRegion occludedRegion,
int x,
int y,
387 int w,
int h,
int thickness,
int xOffset,
int yOffset);
388 void imposeCachedShadow(TQPixmap &pixmap, TQRegion exposed);
389 void imposeRegionShadow(TQPixmap &pixmap, TQRegion occluded,
390 TQRegion exposed,
int thickness,
double maxOpacity = 0.75);
392 void processDecorationButtonPress(
int button,
int state,
int x,
int y,
int x_root,
int y_root );
396 void processKillerExited();
397 void processResumerExited();
398 void demandAttentionKNotify();
400 void drawShadowAfter(
Client *after);
401 void drawDelayedShadow();
410 void setMappingState(
int s );
411 int mappingState()
const;
412 bool isIconicState()
const;
413 bool isNormalState()
const;
414 bool isManaged()
const;
415 void updateAllowedActions(
bool force =
false );
416 TQSize sizeForClientSize(
const TQSize&, Sizemode mode = SizemodeAny,
bool noframe =
false )
const;
417 void changeMaximize(
bool horizontal,
bool vertical,
bool adjust );
418 void checkMaximizeGeometry();
419 int checkFullScreenHack(
const TQRect& geom )
const;
420 void updateFullScreenHack(
const TQRect& geom );
421 void getWmNormalHints();
422 void getMotifHints();
424 void getWmClientLeader();
425 void getWmClientMachine();
427 void fetchIconicName();
428 TQString readName()
const;
429 void setCaption(
const TQString& s,
bool force =
false );
430 bool hasTransientInternal(
const Client* c,
bool indirect, ConstClientList& set )
const;
431 void finishWindowRules();
432 void setShortcutInternal(
const TDEShortcut& cut );
434 void updateWorkareaDiffs();
435 void checkDirection(
int new_diff,
int old_diff, TQRect& rect,
const TQRect& area );
436 static int computeWorkareaDiff(
int left,
int right,
int a_left,
int a_right );
437 void configureRequest(
int value_mask,
int rx,
int ry,
int rw,
int rh,
int gravity,
bool from_tool );
438 NETExtendedStrut strut()
const;
439 int checkShadeGeometry(
int w,
int h );
440 void postponeGeometryUpdates(
bool postpone );
442 bool startMoveResize();
443 void finishMoveResize(
bool cancel );
444 void leaveMoveResize();
445 void checkUnrestrictedMoveResize();
446 void handleMoveResize(
int x,
int y,
int x_root,
int y_root );
447 void positionGeometryTip();
448 void grabButton(
int mod );
449 void ungrabButton(
int mod );
450 void resetMaximize();
451 void resizeDecoration(
const TQSize& s );
452 void setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth);
453 void unsetDecoHashProperty();
456 void killProcess(
bool ask, Time timestamp = CurrentTime );
457 void updateUrgency();
458 static void sendClientMessage( Window w, Atom a, Atom protocol,
459 long data1 = 0,
long data2 = 0,
long data3 = 0 );
461 void embedClient( Window w,
const XWindowAttributes &attr );
462 void detectNoBorder();
463 void detectShapable();
464 void destroyDecoration();
465 void updateFrameExtents();
470 Time readUserTimeMapTimestamp(
const TDEStartupInfoId* asn_id,
const TDEStartupInfoData* asn_data,
471 bool session )
const;
472 Time readUserCreationTime()
const;
473 static bool sameAppWindowRoleMatch(
const Client* c1,
const Client* c2,
bool active_hack );
474 void startupIdChanged();
479 KDecoration* decoration;
485 bool inhibitConfigureRequests;
486 bool move_faked_activity;
487 Window move_resize_grab_window;
488 bool unrestrictedMoveResize;
491 return moveResizeMode && mode == PositionCenter;
493 bool isResize()
const
495 return moveResizeMode && mode != PositionCenter;
500 TQPoint invertedMoveOffset;
501 TQRect moveResizeGeom;
502 TQRect initialMoveResizeGeom;
503 XSizeHints xSizeHint;
504 void sendSyntheticConfigureNotify();
506 void readTransient();
507 Window verifyTransientFor( Window transient_for,
bool set );
508 void addTransient(
Client* cl );
509 void removeTransient(
Client* cl );
510 void removeFromMainClients();
511 void cleanGrouping();
512 void checkGroupTransients();
513 void setTransient( Window new_transient_for_id );
515 Window transient_for_id;
516 Window original_transient_for_id;
517 ClientList transients_list;
518 ShadeMode shade_mode;
523 uint skip_taskbar :1;
524 uint original_skip_taskbar :1;
525 uint Pdeletewindow :1;
527 uint Ptakeactivity : 1;
528 uint Pcontexthelp : 1;
532 uint motif_noborder : 1;
533 uint motif_may_resize : 1;
534 uint motif_may_move :1;
535 uint motif_may_close : 1;
541 uint user_noborder : 1;
543 uint ignore_focus_stealing : 1;
544 uint demands_attention : 1;
545 WindowRules client_rules;
548 void getWindowProtocols();
550 TQPixmap miniicon_pix;
554 enum FullScreenMode { FullScreenNone, FullScreenNormal, FullScreenHack };
555 FullScreenMode fullscreen_mode;
556 MaximizeMode max_mode;
558 TQRect geom_fs_restore;
559 MaximizeMode maxmode_restore;
560 int workarea_diff_x, workarea_diff_y;
562 TQTimer* autoRaiseTimer;
563 TQTimer* shadeHoverTimer;
564 TQTimer* configureRequestTimer;
566 TQCString resource_name;
567 TQCString resource_class;
568 TQCString client_machine;
569 TQString cap_normal, cap_iconic, cap_suffix;
570 WId wmClientLeaderWin;
571 TQCString window_role;
576 TDEProcess* process_killer;
577 TDEProcess* process_resumer;
580 unsigned long allowed_actions;
581 TQRect frame_geometry;
583 int postpone_geometry_updates;
584 bool pending_geometry_update;
585 bool shade_geometry_change;
586 int border_left, border_right, border_top, border_bottom;
588 Client* shadowAfterClient;
589 TQWidget* shadowWidget;
590 TQMemArray<double> activeOpacityCache;
591 TQMemArray<double> inactiveOpacityCache;
592 TQMemArray<double>* opacityCache;
593 TQRegion shapeBoundingRegion;
594 TQTimer* shadowDelayTimer;
598 static bool check_active_modal;
599 TDEShortcut _shortcut;
600 friend struct FetchNameInternalPredicate;
601 friend struct CheckIgnoreFocusStealingProcedure;
602 friend struct ResetupRulesProcedure;
603 friend class GeometryUpdatesPostponer;
604 void show() { assert(
false ); }
605 void hide() { assert(
false ); }
609 uint rule_opacity_active;
610 uint rule_opacity_inactive;
613 TQTimer* demandAttentionKNotifyTimer;
615 bool activeMaximizing;
617 TQRect activeTiledOrigGeom;
618 ActiveMaximizingMode activeMode;
619 ActiveBorder currentActiveBorder;
621 friend bool performTransiencyCheck();
622 bool minimized_before_suspend;