kdecore Library API Documentation

KWinModule Class Reference

The class KWinModule provides information about the state of the window manager as required by windowmanager modules. Base class for KDE Window Manager modules. More...

#include <kwinmodule.h>

Inheritance diagram for KWinModule:

Inheritance graph
[legend]
Collaboration diagram for KWinModule:

Collaboration graph
[legend]
List of all members.

Signals

void currentDesktopChanged (int desktop)
 Switched to another virtual desktop.

void windowAdded (WId id)
 A window has been added.

void windowRemoved (WId id)
 A window has been removed.

void activeWindowChanged (WId)
 Hint that is active (= has focus) now.

void desktopNamesChanged ()
 Desktops have been renamed.

void numberOfDesktopsChanged (int num)
 The number of desktops changed.

void systemTrayWindowAdded (WId id)
 Emitted when a dock window has been added.

void systemTrayWindowRemoved (WId id)
 Emitted when a dock window has been removed.

void workAreaChanged ()
 The workarea has changed.

void strutChanged ()
 Something changed with the struts, may or may not have changed the work area.

void stackingOrderChanged ()
 Emitted when the stacking order of the window changed.

void windowChanged (WId id, unsigned int properties)
 The window changed.

void windowChanged (WId id)
 The window changed somehow.


Public Member Functions

 KWinModule (QObject *parent=0)
 Creates a KWinModule object and connects to the window manager.

 ~KWinModule ()
 Destructor.

const QValueList< WId > & windows () const
 Returns the list of all toplevel windows currently managed by the window manager in the order of creation.

const QValueList< WId > & stackingOrder () const
 Returns the list of all toplevel windows currently managed by the window manager in the current stacking order (from lower to higher).

bool hasWId (WId id) const
 Test to see if id still managed at present.

const QValueList< WId > & systemTrayWindows () const
 Returns a list of the system tray windows.

int currentDesktop () const
 Returns the current virtual desktop.

int numberOfDesktops () const
 Returns the number of virtual desktops.

WId activeWindow () const
 Returns the currently active window, or 0 if no window is active.

QRect workArea (int desktop=-1) const
 Returns the workarea for the specified desktop, or the current work area if no desktop has been specified.

QRect workArea (const QValueList< WId > &excludes, int desktop=-1) const
 Returns the workarea for the specified desktop, or the current work area if no desktop has been specified.

QString desktopName (int desktop) const
 Returns the name of the specified desktop.

void setDesktopName (int desktop, const QString &name)
 Sets the name of the specified desktop.

void doNotManage (const QString &title)
 Informs kwin via dcop to not manage a window with the specified title.


Friends

class KWinModulePrivate

Detailed Description

The class KWinModule provides information about the state of the window manager as required by windowmanager modules. Base class for KDE Window Manager modules.

It informs a module about all currently managed windows and changes to them (via Qt signals).

KWinModule uses NETRootInfo internally. Modules written with this class will work fine under any window manager that implements the NET_WM protocol.

There are no methods to manipulate windows. Those are defined in the classes KWin, NETWinInfo and NETRootInfo.

Author:
Matthias Ettrich (ettrich@kde.org)
Version:
Id
kwinmodule.h,v 1.16 2002/09/27 22:50:16 tjansen Exp

Definition at line 50 of file kwinmodule.h.


Constructor & Destructor Documentation

KWinModule::KWinModule QObject parent = 0  ) 
 

Creates a KWinModule object and connects to the window manager.

Parameters:
parent the parent for the QObject

KWinModule::~KWinModule  ) 
 

Destructor.

Internal cleanup, nothing fancy.


Member Function Documentation

const QValueList<WId>& KWinModule::windows  )  const
 

Returns the list of all toplevel windows currently managed by the window manager in the order of creation.

Please do not rely on indexes of this list: Whenever you enter Qt's event loop in your application, it may happen that entries are removed or added. Your module should perhaps work on a copy of this list and verify a window with hasWindow() before any operations.

Iteration over this list can be done easily with

QValueList<WId>::ConstIterator it; for ( it = module->windows().begin(); it != modules->windows().end(); ++it ) { ... do something here, (*it) is the current WId. }
Returns:
the list of all toplevel windows

const QValueList<WId>& KWinModule::stackingOrder  )  const
 

Returns the list of all toplevel windows currently managed by the window manager in the current stacking order (from lower to higher).

May be useful for pagers.

Returns:
the list of all toplevel windows in stacking order

bool KWinModule::hasWId WId  id  )  const
 

Test to see if id still managed at present.

Parameters:
id the window id to test
Returns:
true if the window id is still managed

const QValueList<WId>& KWinModule::systemTrayWindows  )  const
 

Returns a list of the system tray windows.

Returns:
a list of all system tray windows

int KWinModule::currentDesktop  )  const
 

Returns the current virtual desktop.

Returns:
the current virtual desktop

int KWinModule::numberOfDesktops  )  const
 

Returns the number of virtual desktops.

Returns:
the number of virtual desktops

WId KWinModule::activeWindow  )  const
 

Returns the currently active window, or 0 if no window is active.

Returns:
the window id of the active window, or 0 if no window is active

QRect KWinModule::workArea int  desktop = -1  )  const
 

Returns the workarea for the specified desktop, or the current work area if no desktop has been specified.

Parameters:
desktop the number of the desktop to check, -1 for the current desktop
Returns:
the size and position of the desktop

QRect KWinModule::workArea const QValueList< WId > &  excludes,
int  desktop = -1
const
 

Returns the workarea for the specified desktop, or the current work area if no desktop has been specified.

Excludes struts of clients in the exclude List.

Parameters:
clients the list of clients whose struts will be excluded
desktop the number of the desktop to check, -1 for the current desktop
Returns:
the size and position of the desktop

QString KWinModule::desktopName int  desktop  )  const
 

Returns the name of the specified desktop.

Parameters:
desktop the number of the desktop
Returns:
the name of the desktop

void KWinModule::setDesktopName int  desktop,
const QString name
 

Sets the name of the specified desktop.

Parameters:
desktop the number of the desktop
name the new name for the desktop

void KWinModule::doNotManage const QString title  ) 
 

Informs kwin via dcop to not manage a window with the specified title.

Useful for swallowing legacy applications, for example java applets.

Parameters:
title the title of the window

void KWinModule::currentDesktopChanged int  desktop  )  [signal]
 

Switched to another virtual desktop.

Parameters:
desktop the number of the new desktop

void KWinModule::windowAdded WId  id  )  [signal]
 

A window has been added.

Parameters:
id the id of the the window

void KWinModule::windowRemoved WId  id  )  [signal]
 

A window has been removed.

Parameters:
id the id of the window that has been removed

void KWinModule::activeWindowChanged WId   )  [signal]
 

Hint that is active (= has focus) now.

Parameters:
id the id of the window that is active

void KWinModule::desktopNamesChanged  )  [signal]
 

Desktops have been renamed.

void KWinModule::numberOfDesktopsChanged int  num  )  [signal]
 

The number of desktops changed.

Parameters:
num the new number of desktops

void KWinModule::systemTrayWindowAdded WId  id  )  [signal]
 

Emitted when a dock window has been added.

Parameters:
id the id of the new system tray window

void KWinModule::systemTrayWindowRemoved WId  id  )  [signal]
 

Emitted when a dock window has been removed.

Parameters:
id the id of the former system tray window

void KWinModule::workAreaChanged  )  [signal]
 

The workarea has changed.

void KWinModule::strutChanged  )  [signal]
 

Something changed with the struts, may or may not have changed the work area.

void KWinModule::stackingOrderChanged  )  [signal]
 

Emitted when the stacking order of the window changed.

The new order can be obtained with stackingOrder().

void KWinModule::windowChanged WId  id,
unsigned int  properties
[signal]
 

The window changed.

The unsigned int parameter contains the NET properties that were modified (see netem_def.h).

Parameters:
id the id of the window
properties the properties that were modified

void KWinModule::windowChanged WId  id  )  [signal]
 

The window changed somehow.

Parameters:
id the id of the window


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:51:51 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001