class KWinModule

# class KWinModule | Base class for KDE Window Manager modules. More...
Definition | `#include <kwinmodule.h>`
Inherits | QObject (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KWinModule ( QObject* parent = 0 )
- ~KWinModule ()
- const QValueList& windows () const
- const QValueList& stackingOrder () const
- bool hasWId (WId id) const
- const QValueList& systemTrayWindows () const
- int currentDesktop () const
- int numberOfDesktops () const
- WId activeWindow () const
- QRect workArea ( int desktop = - 1 ) const
- QRect workArea ( const QValueList &excludes, int desktop = -1) const
- QString desktopName ( int desktop ) const
- void setDesktopName ( int desktop, const QString& name )
- void doNotManage ( const QString& title )

#### Signals

- void currentDesktopChanged ( int desktop)
- void windowAdded (WId id)
- void windowRemoved (WId id)
- void activeWindowChanged (WId)
- void desktopNamesChanged ()
- void numberOfDesktopsChanged (int num)
- void systemTrayWindowAdded (WId id)
- void systemTrayWindowRemoved (WId id)
- void workAreaChanged ()
- void strutChanged ()
- void stackingOrderChanged ()
- void windowChanged (WId id, unsigned int properties)
- void windowChanged (WId id)

## Detailed Description

The class KWinModule provides information about the state of the window manager as required by windowmanager 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.

KWinModule ( QObject* parent = 0 ) | ### KWinModule

Creates a KWinModule object and connects to the window manager.

Parameters:

parent | the parent for the QObject

~KWinModule () | ### ~KWinModule

Destructor. Internal cleanup, nothing fancy.

const QValueList& windows () | ### 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::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& stackingOrder () | ### 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 hasWId (WId id) | ### hasWId

[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& systemTrayWindows () | ### systemTrayWindows

[const]

Returns a list of the system tray windows.

Returns: a list of all system tray windows

int currentDesktop () | ### currentDesktop

[const]

Returns the current virtual desktop.

Returns: the current virtual desktop

int numberOfDesktops () | ### numberOfDesktops

[const]

Returns the number of virtual desktops.

Returns: the number of virtual desktops

WId activeWindow () | ### 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 workArea ( int desktop = - 1 ) | ### workArea

[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 workArea ( const QValueList &excludes, int desktop = -1) | ### workArea

[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 desktopName ( int desktop ) | ### desktopName

[const]

Returns the name of the specified desktop.

Parameters:

desktop | the number of the desktop

Returns: the name of the desktop

void setDesktopName ( int desktop, const QString& name ) | ### setDesktopName

Sets the name of the specified desktop.

Parameters:

desktop | the number of the desktop
name | the new name for the desktop

void doNotManage ( const QString& title ) | ### doNotManage

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 currentDesktopChanged ( int desktop) | ### currentDesktopChanged

[signal]

Switched to another virtual desktop.

Parameters:

desktop | the number of the new desktop

void windowAdded (WId id) | ### windowAdded

[signal]

A window has been added.

Parameters:

id | the id of the the window

void windowRemoved (WId id) | ### windowRemoved

[signal]

A window has been removed.

Parameters:

id | the id of the window that has been removed

void activeWindowChanged (WId) | ### activeWindowChanged

[signal]

Hint that is active (= has focus) now.

Parameters:

id | the id of the window that is active

void desktopNamesChanged () | ### desktopNamesChanged

[signal]

Desktops have been renamed.

void numberOfDesktopsChanged (int num) | ### numberOfDesktopsChanged

[signal]

The number of desktops changed.

Parameters:

num | the new number of desktops

void systemTrayWindowAdded (WId id) | ### systemTrayWindowAdded

[signal]

Emitted when a dock window has been added.

Parameters:

id | the id of the new system tray window

void systemTrayWindowRemoved (WId id) | ### systemTrayWindowRemoved

[signal]

Emitted when a dock window has been removed.

Parameters:

id | the id of the former system tray window

void workAreaChanged () | ### workAreaChanged

[signal]

The workarea has changed.

void strutChanged () | ### strutChanged

[signal]

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

void stackingOrderChanged () | ### stackingOrderChanged

[signal]

Emitted when the stacking order of the window changed. The new order can be obtained with stackingOrder().

void windowChanged (WId id, unsigned int properties) | ### windowChanged

[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 windowChanged (WId id) | ### windowChanged

[signal]

The window changed somehow.

Parameters:

id | the id of the window

- Version: $Id: kwinmodule.h,v 1.16 2002/09/27 22:50:16 tjansen Exp $
- Author: Matthias Ettrich (ettrich@kde.org)
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:15 2003, using kdoc 2.0a54.