kdecore Library API Documentation

KWin::WindowInfo Class Reference

Information about a window. More...

#include <kwin.h>

List of all members.

Public Methods

 WindowInfo (WId window, unsigned long properties, unsigned long properties2)
bool valid (bool withdrawn_is_valid=false) const
WId win () const
unsigned long state () const
bool isMinimized () const
NET::MappingState mappingState () const
NETStrut strut () const
NET::WindowType windowType (int supported_types) const
QString visibleName () const
QString visibleNameWithState () const
QString name () const
QString visibleIconName () const
QString visibleIconNameWithState () const
QString iconName () const
bool isOnCurrentDesktop () const
bool isOnDesktop (int desktop) const
bool onAllDesktops () const
int desktop () const
QRect geometry () const
QRect frameGeometry () const
WId transientFor () const
WId groupLeader () const
bool actionSupported (NET::Action action) const


Detailed Description

Information about a window.

Since:
3.2

Definition at line 444 of file kwin.h.


Constructor & Destructor Documentation

KWin::WindowInfo::WindowInfo WId    window,
unsigned long    properties,
unsigned long    properties2
 

Reads all the info about the given window.

Definition at line 651 of file kwin.cpp.

References KXErrorHandler::error(), QString::fromUtf8(), NETSize::height, NETRect::pos, KWin::readNameProperty(), NETRect::size, NETSize::width, win(), NETPoint::x, and NETPoint::y.


Member Function Documentation

bool KWin::WindowInfo::valid bool    withdrawn_is_valid = false const
 

Returns false if this window info is not valid (most probably the given window doesn't exist).

Parameters:
withdrawn_is_valid  if true, windows in the withdrawn state (i.e. not managed) are also considered. This is usually not the case.

Definition at line 735 of file kwin.cpp.

References mappingState().

WId KWin::WindowInfo::win  
 

Returns the window identifier.

Definition at line 744 of file kwin.cpp.

Referenced by WindowInfo().

unsigned long KWin::WindowInfo::state  
 

Returns the window's state flags(see the NET::State enum for details).

Requires NET::WMState passed to KWin::windowInfo().

Definition at line 749 of file kwin.cpp.

References endl().

Referenced by isMinimized().

bool KWin::WindowInfo::isMinimized  
 

Returns true if the window is minimized.

Note that it is true only if the window is truly minimized, not shaded or on another virtual desktops, which makes it different from mappingState() == NET::Iconic or QWidget::isMinimized(). Requires NET::WMState and NET::XAWMState passed to KWin::windowInfo().

Definition at line 970 of file kwin.cpp.

References NET::Hidden, mappingState(), and state().

Referenced by visibleIconNameWithState(), and visibleNameWithState().

NET::MappingState KWin::WindowInfo::mappingState  
 

Returns the mapping state of the window (see NET::MappingState).

Note that it's very likely that you don't want to use this function, and use isOnDesktop(), isMinimized() etc. instead. Requires NET::XAWMState passed to KWin::windowInfo().

Definition at line 760 of file kwin.cpp.

References endl(), and NET::MappingState.

Referenced by isMinimized(), and valid().

NETStrut KWin::WindowInfo::strut  
 

Returns the window strut.

Requires NET::WMStrut passed to KWin::windowInfo().

Definition at line 771 of file kwin.cpp.

References endl().

NET::WindowType KWin::WindowInfo::windowType int    supported_types const
 

Returns the window type of this window (see NET::WindowType).

The argument should be all window types your application supports (see NET::WindowTypeMask). Requires NET::WMWindowType passed to KWin::windowInfo().

Definition at line 783 of file kwin.cpp.

References endl(), and NET::WindowType.

QString KWin::WindowInfo::visibleName  
 

Returns the visible name of the window (i.e.

including possible <2> appended when there are two or more windows with the same name). Requires NET::WMVisibleName passed to KWin::windowInfo().

Definition at line 814 of file kwin.cpp.

References endl(), QString::fromUtf8(), and name().

Referenced by visibleIconName(), and visibleNameWithState().

QString KWin::WindowInfo::visibleNameWithState  
 

Returns a visible name with state.

This is a simple convenience function that returns the visible name but with parentheses around minimized windows. Requires NET::WMVisibleName, NET::WMState and NET::XAWMState passed to KWin::windowInfo().

Returns:
the window name with state

Definition at line 794 of file kwin.cpp.

References QString::append(), isMinimized(), QString::prepend(), and visibleName().

QString KWin::WindowInfo::name  
 

Returns the name of the window, as specified by the application, without any modifications.

You should often use visibleName() instead. Requires NET::WMName passed to KWin::windowInfo().

Definition at line 826 of file kwin.cpp.

References endl().

Referenced by iconName(), and visibleName().

QString KWin::WindowInfo::visibleIconName  
 

Returns the visible name of the window that should be shown in taskbar and all other "iconic" representations of the window.

Note that this has nothing to do with normal icons. Requires NET::WMVisibleIconName passed to KWin::windowInfo().

Definition at line 847 of file kwin.cpp.

References endl(), QString::fromUtf8(), and visibleName().

Referenced by visibleIconNameWithState().

QString KWin::WindowInfo::visibleIconNameWithState  
 

Returns a visible name with state.

This is a simple convenience function that returns the visible iconic name but with parentheses around minimized windows. Note that this has nothing to do with normal icons. Requires NET::WMVisibleIconName, NET::WMState and NET::XAWMState passed to KWin::windowInfo().

Returns:
the window iconic name with state

Definition at line 837 of file kwin.cpp.

References QString::append(), isMinimized(), QString::prepend(), and visibleIconName().

QString KWin::WindowInfo::iconName  
 

Returns the name of the window that should be shown in taskbar and all other "iconic" representations of the window.

Note that this has nothing to do with normal icons. Requires NET::WMIconName passed to KWin::windowInfo().

Definition at line 862 of file kwin.cpp.

References endl(), QString::fromUtf8(), and name().

bool KWin::WindowInfo::isOnCurrentDesktop  
 

Returns true if the window is on the currently active virtual desktop.

Requires NET::WMDesktop passed to KWin::windowInfo().

Definition at line 875 of file kwin.cpp.

References KWin::currentDesktop(), and isOnDesktop().

bool KWin::WindowInfo::isOnDesktop int    desktop const
 

Returns true if the window is on the given virtual desktop.

Requires NET::WMDesktop passed to KWin::windowInfo().

Definition at line 884 of file kwin.cpp.

References desktop(), and endl().

Referenced by isOnCurrentDesktop().

bool KWin::WindowInfo::onAllDesktops  
 

Returns true if the window is on all desktops (equal to desktop()==NET::OnAllDesktops).

Requires NET::WMDesktop passed to KWin::windowInfo().

Definition at line 895 of file kwin.cpp.

References endl().

int KWin::WindowInfo::desktop  
 

Returns the virtual desktop this window is on (NET::OnAllDesktops if the window is on all desktops).

You should prefer using isOnDesktop(). Requires NET::WMDesktop passed to KWin::windowInfo().

Definition at line 906 of file kwin.cpp.

References endl().

Referenced by isOnDesktop().

QRect KWin::WindowInfo::geometry  
 

Returns the position and size of the window contents.

Requires NET::WMGeometry passed to KWin::windowInfo().

Definition at line 917 of file kwin.cpp.

References endl().

QRect KWin::WindowInfo::frameGeometry  
 

Returns the frame geometry of the window, i.e.

including the window decoration. Requires NET::WMKDEFrameStrut passed to KWin::windowInfo().

Definition at line 928 of file kwin.cpp.

References endl().

WId KWin::WindowInfo::transientFor  
 

Returns the WM_TRANSIENT_FOR property for the window, i.e.

the mainwindow for this window. Requires NET::WM2TransientFor passed to KWin::windowInfo().

Definition at line 935 of file kwin.cpp.

References endl().

WId KWin::WindowInfo::groupLeader  
 

Returns the leader window for the group the window is in, if any.

Requires NET::WM2GroupLeader passed to KWin::windowInfo().

Definition at line 946 of file kwin.cpp.

References endl().

bool KWin::WindowInfo::actionSupported NET::Action    action const
 

Returns true if the given action is currently supported for the window by the window manager.

Requires NET::WM2AllowedActions passed to KWin::windowInfo().

Definition at line 957 of file kwin.cpp.

References NET::Action, KWin::allowedActionsSupported(), and endl().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 4 12:33:59 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003