\section{KWin Class Reference}
\label{classKWin}\index{KWin@{KWin}}
Convenience access to certain properties and features of the window manager. Class for interaction with the window manager.  


{\tt \#include $<$kwin.h$>$}

\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
void {\bf set\-Active\-Window} (WId win)
\begin{CompactList}\small\item\em Sets window {\tt win} to be the active window. \item\end{CompactList}\item 
void {\bf invoke\-Context\-Help} ()
\begin{CompactList}\small\item\em Invokes interactive context help. \item\end{CompactList}\item 
void {\bf set\-System\-Tray\-Window\-For} (WId tray\-Win, WId for\-Win)
\begin{CompactList}\small\item\em Makes {\tt tray\-Win} a system tray window for {\tt for\-Win}. \item\end{CompactList}\item 
{\bf Info} {\bf info} (WId win)
\begin{CompactList}\small\item\em Returns information about window {\tt win}. \item\end{CompactList}\item 
{\bf QPixmap} {\bf icon} (WId win, int width=-1, int height=-1, bool scale=false)
\begin{CompactList}\small\item\em Returns an icon for window {\tt win}. \item\end{CompactList}\item 
void {\bf set\-Icons} (WId win, const  {\bf QPixmap} \&icon, const  {\bf QPixmap} \&mini\-Icon)
\begin{CompactList}\small\item\em Sets an {\tt icon} and a {\tt mini\-Icon} on window {\tt win}. \item\end{CompactList}\item 
void {\bf set\-Type} (WId win, {\bf NET::Window\-Type} window\-Type)
\begin{CompactList}\small\item\em Sets the type of window {\tt win} to {\tt window\-Type}. \item\end{CompactList}\item 
void {\bf set\-State} (WId win, unsigned long state)
\begin{CompactList}\small\item\em Sets the state of window {\tt win} to {\tt state}. \item\end{CompactList}\item 
void {\bf clear\-State} (WId win, unsigned long state)
\begin{CompactList}\small\item\em Clears the state of window {\tt win} from {\tt state}. \item\end{CompactList}\item 
void {\bf set\-On\-All\-Desktops} (WId win, bool b)
\begin{CompactList}\small\item\em Sets window {\tt win} to be present on all virtual desktops if {\tt is} true. \item\end{CompactList}\item 
void {\bf set\-On\-Desktop} (WId win, int desktop)
\begin{CompactList}\small\item\em Moves window {\tt win} to desktop {\tt desktop}. \item\end{CompactList}\item 
void {\bf set\-Strut} (WId win, int left, int right, int top, int bottom)
\begin{CompactList}\small\item\em Sets the strut of window {\tt win} to {\tt left}, {\tt right}, {\tt top}, {\tt bottom}. \item\end{CompactList}\item 
int {\bf current\-Desktop} ()
\begin{CompactList}\small\item\em Convenience function to access the current desktop. \item\end{CompactList}\item 
int {\bf number\-Of\-Desktops} ()
\begin{CompactList}\small\item\em Convenience function to access the number of desktops. \item\end{CompactList}\item 
void {\bf set\-Current\-Desktop} (int desktop)
\begin{CompactList}\small\item\em Convenience function to set the current desktop to {\tt desktop}. \item\end{CompactList}\item 
void {\bf iconify\-Window} (WId win, bool animation=true)
\begin{CompactList}\small\item\em Iconifies a window. \item\end{CompactList}\item 
void {\bf de\-Iconify\-Window} (WId win, bool animation=true)
\begin{CompactList}\small\item\em De\-Iconifies a window. \item\end{CompactList}\item 
void {\bf app\-Started} ()
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} Use KStartup\-Info::app\-Started \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Convenience access to certain properties and features of the window manager. Class for interaction with the window manager. 

This class is not supposed to be instantiated. It exists mostly as a namespace for the static member functions.

In {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} 2 and {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} 3, communication with the windowmanager is done with the NET-protocol, a common window manager specification designed by various authors of X11 window managers (including those of the {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} project). The full specification can be found in kdebase/kwin/wm-spec/

To access features of the NET-protocol, use the classes NETRoot\-Info and NETWin\-Info.

The purpose of this class is to to provide easy access to the most-commonly used NET-features with a simpler, KDEish interface.

In addition, it encapsulates {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} functionality not yet provided by the {\bf NET}{\rm (p.\,\pageref{classNET})} hints. Currently that is {\bf invoke\-Context\-Help()}{\rm (p.\,\pageref{classKWin_e1})} and {\bf set\-System\-Tray\-Window\-For()}{\rm (p.\,\pageref{classKWin_e2})} only.

\begin{Desc}
\item[See also:]{\bf NET}{\rm (p.\,\pageref{classNET})} 

Net\-Win\-Info \end{Desc}
\begin{Desc}
\item[Author:]Matthias Ettrich ({\tt ettrich@kde.org}) \end{Desc}




Definition at line 57 of file kwin.h.

\subsection{Member Function Documentation}
\index{KWin@{KWin}!setActiveWindow@{setActiveWindow}}
\index{setActiveWindow@{setActiveWindow}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::set\-Active\-Window (WId {\em win})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e0}


Sets window {\tt win} to be the active window. 

This is a request to the window manager. It may or may not be obeyed. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the if of the window to make active \end{description}
\end{Desc}


Definition at line 188 of file kwin.cpp.

References info().

Referenced by KUnique\-Application::new\-Instance().\index{KWin@{KWin}!invokeContextHelp@{invokeContextHelp}}
\index{invokeContextHelp@{invokeContextHelp}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::invoke\-Context\-Help ()\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e1}


Invokes interactive context help. 



Definition at line 176 of file kwin.cpp.\index{KWin@{KWin}!setSystemTrayWindowFor@{setSystemTrayWindowFor}}
\index{setSystemTrayWindowFor@{setSystemTrayWindowFor}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::set\-System\-Tray\-Window\-For (WId {\em tray\-Win}, WId {\em for\-Win})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e2}


Makes {\tt tray\-Win} a system tray window for {\tt for\-Win}. 

A system tray window serves as an icon replacement. It's displayed inside the panel's system tray. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tray\-Win}]the id of the system tray window \item[{\em tray\-Win}]the id of the window represented by the system tray window \end{description}
\end{Desc}


Definition at line 181 of file kwin.cpp.

References info().\index{KWin@{KWin}!info@{info}}
\index{info@{info}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KWin::Info} KWin::info (WId {\em win})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e3}


Returns information about window {\tt win}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the windoe \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the window information \end{Desc}


Definition at line 194 of file kwin.cpp.

References KWin::Info::desktop, KWin::Info::frame\-Geometry, QString::from\-Local8Bit(), QString::from\-Utf8(), KWin::Info::geometry, NETSize::height, KWin::Info::mapping\-State, KWin::Info::name, KWin::Info::on\-All\-Desktops, KWin::Info::pid, NETRect::pos, QRect::set\-Rect(), NETRect::size, KWin::Info::state, KWin::Info::strut, KWin::Info::visible\-Name, NETSize::width, KWin::Info::win, KWin::Info::window\-Type, NETPoint::x, and NETPoint::y.

Referenced by clear\-State(), current\-Desktop(), icon(), number\-Of\-Desktops(), set\-Active\-Window(), set\-Current\-Desktop(), set\-Icons(), set\-On\-All\-Desktops(), set\-On\-Desktop(), set\-State(), set\-Strut(), set\-System\-Tray\-Window\-For(), and set\-Type().\index{KWin@{KWin}!icon@{icon}}
\index{icon@{icon}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KWin::icon (WId {\em win}, int {\em width} = -1, int {\em height} = -1, bool {\em scale} = false)\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e4}


Returns an icon for window {\tt win}. 

If {\tt width} and {\tt height} are specified, the best icon for the requested size is returned.

If {\tt scale} is true, the icon is smooth-scaled to have exactly the requested size.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the window \item[{\em the}]desired width, or -1 \item[{\em the}]desired height, or -1 \item[{\em if}]true the icon will be scaled to the desired size. Otherwise the icon will not be modified. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the icon of the window \end{Desc}


Definition at line 238 of file kwin.cpp.

References QPixmap::convert\-From\-Image(), QPixmap::convert\-To\-Image(), NETIcon::data, KIcon::Default\-State, QPixmap::detach(), NETSize::height, KInstance::icon\-Loader(), info(), KGlobal::instance(), QPixmap::is\-Null(), QImage::is\-Null(), KIcon\-Loader::load\-Icon(), QString::lower(), QImage::set\-Alpha\-Buffer(), QPixmap::set\-Mask(), QImage::size(), NETIcon::size, QImage::smooth\-Scale(), and NETSize::width.\index{KWin@{KWin}!setIcons@{setIcons}}
\index{setIcons@{setIcons}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::set\-Icons (WId {\em win}, const {\bf QPixmap} \& {\em icon}, const {\bf QPixmap} \& {\em mini\-Icon})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e5}


Sets an {\tt icon} and a {\tt mini\-Icon} on window {\tt win}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the window \item[{\em icon}]the new icon \item[{\em mini\-Icon}]the new mini icon \end{description}
\end{Desc}


Definition at line 341 of file kwin.cpp.

References QImage::bits(), QPixmap::convert\-To\-Image(), NETIcon::data, NETSize::height, info(), QPixmap::is\-Null(), QImage::size(), NETIcon::size, and NETSize::width.

Referenced by KApplication::set\-Top\-Widget().\index{KWin@{KWin}!setType@{setType}}
\index{setType@{setType}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::set\-Type (WId {\em win}, {\bf NET::Window\-Type} {\em window\-Type})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e6}


Sets the type of window {\tt win} to {\tt window\-Type}. 

Possible values are NET::Normal, NET::Desktop, NET::Dock, NET::Tool, NET::Menu, NET::Dialog, NET::Override (== no decoration frame) or NET::Top\-Menu

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the window \item[{\em window\-Type}]the type of the window \end{description}
\end{Desc}


Definition at line 361 of file kwin.cpp.

References info().\index{KWin@{KWin}!setState@{setState}}
\index{setState@{setState}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::set\-State (WId {\em win}, unsigned long {\em state})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e7}


Sets the state of window {\tt win} to {\tt state}. 

Possible values are or'ed combinations of NET::Modal, NET::Sticky, NET::Max\-Vert, NET::Max\-Horiz, NET::Shaded, NET::Skip\-Taskbar, NET::Stays\-On\-Top, NET::Skip\-Pager

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the window \item[{\em state}]the new flags that will be set \end{description}
\end{Desc}


Definition at line 367 of file kwin.cpp.

References info().\index{KWin@{KWin}!clearState@{clearState}}
\index{clearState@{clearState}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::clear\-State (WId {\em win}, unsigned long {\em state})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e8}


Clears the state of window {\tt win} from {\tt state}. 

Possible values are or'ed combinations of NET::Modal, NET::Sticky, NET::Max\-Vert, NET::Max\-Horiz, NET::Shaded, NET::Skip\-Taskbar, NET::Stays\-On\-Top, NET::Skip\-Pager

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the window \item[{\em state}]the flags that will be cleared \end{description}
\end{Desc}


Definition at line 373 of file kwin.cpp.

References info().\index{KWin@{KWin}!setOnAllDesktops@{setOnAllDesktops}}
\index{setOnAllDesktops@{setOnAllDesktops}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::set\-On\-All\-Desktops (WId {\em win}, bool {\em b})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e9}


Sets window {\tt win} to be present on all virtual desktops if {\tt is} true. 

Otherwise the window lives only on one single desktop.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the window \item[{\em b}]true to show the window on all desktops, false otherwise \end{description}
\end{Desc}


Definition at line 379 of file kwin.cpp.

References info().\index{KWin@{KWin}!setOnDesktop@{setOnDesktop}}
\index{setOnDesktop@{setOnDesktop}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::set\-On\-Desktop (WId {\em win}, int {\em desktop})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e10}


Moves window {\tt win} to desktop {\tt desktop}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the window \item[{\em desktop}]the number of the new desktop \end{description}
\end{Desc}


Definition at line 390 of file kwin.cpp.

References info().\index{KWin@{KWin}!setStrut@{setStrut}}
\index{setStrut@{setStrut}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::set\-Strut (WId {\em win}, int {\em left}, int {\em right}, int {\em top}, int {\em bottom})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e11}


Sets the strut of window {\tt win} to {\tt left}, {\tt right}, {\tt top}, {\tt bottom}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the window \item[{\em left}]the left strut \item[{\em right}]the right strut \item[{\em top}]the top strut \item[{\em bottom}]the bottom strut \end{description}
\end{Desc}


Definition at line 408 of file kwin.cpp.

References NETStrut::bottom, info(), NETStrut::left, NETStrut::right, and NETStrut::top.\index{KWin@{KWin}!currentDesktop@{currentDesktop}}
\index{currentDesktop@{currentDesktop}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KWin::current\-Desktop ()\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e12}


Convenience function to access the current desktop. 

See NETRoot\-Info. \begin{Desc}
\item[Returns:]the number of the current desktop \end{Desc}


Definition at line 419 of file kwin.cpp.

References info().\index{KWin@{KWin}!numberOfDesktops@{numberOfDesktops}}
\index{numberOfDesktops@{numberOfDesktops}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KWin::number\-Of\-Desktops ()\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e13}


Convenience function to access the number of desktops. 

See NETRoot\-Info. \begin{Desc}
\item[Returns:]the number of desktops \end{Desc}


Definition at line 427 of file kwin.cpp.

References info().\index{KWin@{KWin}!setCurrentDesktop@{setCurrentDesktop}}
\index{setCurrentDesktop@{setCurrentDesktop}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::set\-Current\-Desktop (int {\em desktop})\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e14}


Convenience function to set the current desktop to {\tt desktop}. 

See NETRoot\-Info. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em the}]number of the new desktop \end{description}
\end{Desc}


Definition at line 435 of file kwin.cpp.

References info().\index{KWin@{KWin}!iconifyWindow@{iconifyWindow}}
\index{iconifyWindow@{iconifyWindow}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::iconify\-Window (WId {\em win}, bool {\em animation} = true)\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e15}


Iconifies a window. 

Compatible to XIconify\-Window but has an additional parameter {\tt animation}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the window \item[{\em animation}]true to show an animation \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf de\-Iconify\-Window()}{\rm (p.\,\pageref{classKWin_e16})} \end{Desc}


Definition at line 442 of file kwin.cpp.\index{KWin@{KWin}!deIconifyWindow@{deIconifyWindow}}
\index{deIconifyWindow@{deIconifyWindow}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::de\-Iconify\-Window (WId {\em win}, bool {\em animation} = true)\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e16}


De\-Iconifies a window. 

Compatible to XMap\-Window but has an additional parameter {\tt animation}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em win}]the id of the window \item[{\em animation}]true to show an animation \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf iconify\-Window()}{\rm (p.\,\pageref{classKWin_e15})} \end{Desc}


Definition at line 450 of file kwin.cpp.\index{KWin@{KWin}!appStarted@{appStarted}}
\index{appStarted@{appStarted}!KWin@{KWin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KWin::app\-Started ()\hspace{0.3cm}{\tt  [static]}}\label{classKWin_e17}


{\bf This class or method is obsolete, it is provided for compatibility only.} Use KStartup\-Info::app\-Started 



Definition at line 457 of file kwin.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kwin.h\item 
kwin.cpp\end{CompactItemize}
