kwin.h
/* This file is part of the KDE libraries
Copyright (C) 1999 Matthias Ettrich (ettrich@kde.org)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KWIN_H
#define KWIN_H
#include <sys/types.h>
#include <qwindowdefs.h>
#include <qstring.h>
#include <qpixmap.h>
#include "kdelibs_export.h"
#ifdef Q_OS_UNIX
#include <netwm_def.h>
class NETWinInfo;
class KDECORE_EXPORT KWin
{
public:
static void activateWindow( WId win, long time = 0 );
static void forceActiveWindow( WId win, long time = 0 );
static void setActiveWindow( WId win ) KDE_DEPRECATED;
static void demandAttention( WId win, bool set = true );
static void setUserTime( WId win, long time );
static void invokeContextHelp();
static void setMainWindow( QWidget* subwindow, WId mainwindow );
static void setSystemTrayWindowFor( WId trayWin, WId forWin );
class WindowInfo;
class WindowInfoPrivate;
static WindowInfo windowInfo( WId win, unsigned long properties = 0, unsigned long properties2 = 0 );
static WId transientFor( WId window );
static WId groupLeader( WId window );
static QPixmap icon( WId win, int width = -1, int height = -1, bool scale = false );
enum IconSource { NETWM = 1,
WMHints = 2,
ClassHint = 4,
XApp = 8
};
static QPixmap icon( WId win, int width, int height, bool scale, int flags );
static void setIcons( WId win, const QPixmap& icon, const QPixmap& miniIcon );
static void setType( WId win, NET::WindowType windowType );
static void setState( WId win, unsigned long state );
static void clearState( WId win, unsigned long state );
static void setOpacity( WId win, uint percent );
static void setShadowSize( WId win, uint percent );
static void setOnAllDesktops( WId win, bool b );
static void setOnDesktop( WId win, int desktop);
static void setExtendedStrut( WId win, int left_width, int left_start, int left_end,
int right_width, int right_start, int right_end, int top_width, int top_start, int top_end,
int bottom_width, int bottom_start, int bottom_end );
static void setStrut( WId win, int left, int right, int top, int bottom );
static int currentDesktop();
static int numberOfDesktops();
static void setCurrentDesktop( int desktop );
static void setCurrentDesktopViewport( int desktop, QPoint viewport );
static void iconifyWindow( WId win, bool animation = true );
static void deIconifyWindow( WId win, bool animation = true );
static void raiseWindow( WId win );
static void lowerWindow( WId win );
static bool icccmCompliantMappingState();
static bool allowedActionsSupported();
static QString readNameProperty( WId window, unsigned long atom );
static bool compositingActive();
struct KDECORE_EXPORT Info
{
WId win;
long unsigned int state;
bool isMinimized() const;
bool isIconified() const;
NET::MappingState mappingState;
NETStrut strut;
NET::WindowType windowType;
QString visibleName;
QString name;
int desktop;
bool onAllDesktops;
pid_t pid;
QRect geometry;
QRect frameGeometry;
QString visibleNameWithState() const;
};
static Info info( WId win ) KDE_DEPRECATED;
#ifdef KDE_NO_COMPAT
private:
#endif
static void appStarted() KDE_DEPRECATED;
};
class KDECORE_EXPORT KWin::WindowInfo
{
public:
WindowInfo( WId window, unsigned long properties, unsigned long properties2 );
WindowInfo(); // to make QValueList and others happy
~WindowInfo();
bool valid( bool withdrawn_is_valid = false ) const;
WId win() const;
unsigned long state() const;
bool hasState( unsigned long s ) const { return ( state() & s ) == s; }
bool isMinimized() const;
NET::MappingState mappingState() const;
NETExtendedStrut extendedStrut() 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;
QCString windowClassClass() const;
QCString windowClassName() const;
QCString windowRole() const;
QCString clientMachine() const;
bool actionSupported( NET::Action action ) const;
WindowInfo( const WindowInfo& );
WindowInfo& operator=( const WindowInfo& );
private:
WindowInfoPrivate* d;
};
#endif //Q_OS_UNIX
#endif
KWin::WindowInfo
Information about a window.
Definition: kwin.h:522
KWin::Info::frameGeometry
QRect frameGeometry
Position and size of the window's frame.
Definition: kwin.h:496
NETStrut
Definition: netwm_def.h:195
KWin::Info::visibleName
QString visibleName
The visible name of the window.
Definition: kwin.h:484
NETExtendedStrut
Partial strut class for NET classes.
Definition: netwm_def.h:153
KWin::Info::geometry
QRect geometry
Position and size of the window contents.
Definition: kwin.h:494
KWin::Info::windowType
NET::WindowType windowType
The window type.
Definition: kwin.h:482
NET::MappingState
MappingState
Client window mapping state.
Definition: netwm_def.h:464
NET::WindowType
WindowType
Window type.
Definition: netwm_def.h:294
KWin::Info::onAllDesktops
bool onAllDesktops
true if the window is on all desktops.
Definition: kwin.h:490
KWin::Info::win
WId win
The window's id.
Definition: kwin.h:472
KWin::Info::pid
pid_t pid
The process id of the window's owner.
Definition: kwin.h:492
KWin::Info::strut
NETStrut strut
The strut.
Definition: kwin.h:480
KWin::Info::state
long unsigned int state
The window's state.
Definition: kwin.h:474
KWin
Convenience access to certain properties and features of the window manager.
Definition: kwin.h:61
KWin::Info
Definition: kwin.h:469
KWin::WindowInfo::hasState
bool hasState(unsigned long s) const
Returns true if the window has the given state flag set (see the NET::State enum for details)...
Definition: kwin.h:552
KWin::Info::name
QString name
The name of the window.
Definition: kwin.h:486
NET::Action
Action
Actions that can be done with a window (_NET_WM_ALLOWED_ACTIONS).
Definition: netwm_def.h:474
KWin::IconSource
IconSource
Masks specifying from which sources to read an icon.
Definition: kwin.h:231
KWin::Info::desktop
int desktop
The number of the window's desktop.
Definition: kwin.h:488

KDE Home | KDE Accessibility Home | Description of Access Keys