\section{KRoot\-Pixmap Class Reference}
\label{classKRootPixmap}\index{KRootPixmap@{KRootPixmap}}
Creates pseudo-transparent widgets.  


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

Inheritance diagram for KRoot\-Pixmap:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=58pt]{classKRootPixmap__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KRoot\-Pixmap:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=298pt]{classKRootPixmap__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
virtual void {\bf start} ()
\begin{CompactList}\small\item\em Starts background handling. \item\end{CompactList}\item 
virtual void {\bf stop} ()
\begin{CompactList}\small\item\em Stops background handling. \item\end{CompactList}\item 
void {\bf set\-Fade\-Effect} (double strength, const  {\bf QColor} \&color)
\begin{CompactList}\small\item\em Sets the fade effect. \item\end{CompactList}\item 
void {\bf repaint} (bool force)
\begin{CompactList}\small\item\em Repaints the widget background. \item\end{CompactList}\item 
void {\bf repaint} ()
\begin{CompactList}\small\item\em Repaints the widget background. \item\end{CompactList}\item 
void {\bf set\-Custom\-Painting} (bool enable)
\begin{CompactList}\small\item\em Enables custom handling of the background painting. \item\end{CompactList}\item 
void {\bf enable\-Exports} ()
\begin{CompactList}\small\item\em Asks KDesktop to export the desktop background as a {\bf KShared\-Pixmap}{\rm (p.\,\pageref{classKSharedPixmap})}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf background\-Updated} (const  {\bf QPixmap} \&pm)
\begin{CompactList}\small\item\em Emitted when the background needs updating and custom painting (see {\bf set\-Custom\-Painting}{\rm (p.\,\pageref{classKRootPixmap_i5})}(bool) ) is enabled. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KRoot\-Pixmap} ({\bf QWidget} $\ast$target, const  char $\ast${\bf name}=0)
\begin{CompactList}\small\item\em Constructs a KRoot\-Pixmap. \item\end{CompactList}\item 
{\bf KRoot\-Pixmap} ({\bf QWidget} $\ast$target, {\bf QObject} $\ast${\bf parent}, const  char $\ast${\bf name}=0)
\begin{CompactList}\small\item\em Constructs a KRoot\-Pixmap where the parent {\bf QObject} and target {\bf QWidget} are different. \item\end{CompactList}\item 
virtual {\bf $\sim$KRoot\-Pixmap} ()
\begin{CompactList}\small\item\em Destructs the object. \item\end{CompactList}\item 
bool {\bf is\-Available} () const 
\begin{CompactList}\small\item\em Checks if pseudo-transparency is available. \item\end{CompactList}\item 
bool {\bf is\-Active} () const 
\begin{CompactList}\small\item\em Returns true if the KRoot\-Pixmap is active. \item\end{CompactList}\item 
int {\bf current\-Desktop} () const 
\begin{CompactList}\small\item\em Returns the number of the current desktop. \item\end{CompactList}\item 
bool {\bf custom\-Painting} () const 
\begin{CompactList}\small\item\em Returns true if custom painting is enabled, false otherwise. \item\end{CompactList}\item 
bool {\bf check\-Available} (bool)
\begin{CompactList}\small\item\em Deprecated, use {\bf is\-Available}{\rm (p.\,\pageref{classKRootPixmap_a3})}() instead. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual bool {\bf event\-Filter} ({\bf QObject} $\ast$, {\bf QEvent} $\ast$)
\begin{CompactList}\small\item\em Reimplemented to filter the events from the target widget and track its movements. \item\end{CompactList}\item 
virtual void {\bf update\-Background} ({\bf KShared\-Pixmap} $\ast$)
\begin{CompactList}\small\item\em Called when the pixmap has been updated. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Creates pseudo-transparent widgets. 

A pseudo-transparent widget is a widget with its background pixmap set to that part of the desktop background that it is currently obscuring. This gives a transparency effect.

To create a transparent widget, construct a KRoot\-Pixmap and pass it a pointer to your widget. That's it! Moving, resizing and background changes are handled automatically.

Instead of using the default behaviour, you can ask KRoot\-Pixmap to emit a {\bf background\-Updated}{\rm (p.\,\pageref{classKRootPixmap_l0})}(const {\bf QPixmap} \&) signal whenever the background needs updating by using {\bf set\-Custom\-Painting}{\rm (p.\,\pageref{classKRootPixmap_i5})}(bool). Alternatively by reimplementing {\bf update\-Background}{\rm (p.\,\pageref{classKRootPixmap_b1})}(KShared\-Pixmap$\ast$) you can take complete control of the behaviour.

\begin{Desc}
\item[Author:]Geert Jansen $<${\tt jansen@kde.org}$>$ \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf krootpixmap.h}{\rm (p.\,\pageref{krootpixmap_8h})},v 1.14 2002/03/08 18:01:07 rich Exp \end{Desc}
\end{Desc}




Definition at line 45 of file krootpixmap.h.

\subsection{Constructor \& Destructor Documentation}
\index{KRootPixmap@{KRoot\-Pixmap}!KRootPixmap@{KRootPixmap}}
\index{KRootPixmap@{KRootPixmap}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRoot\-Pixmap::KRoot\-Pixmap ({\bf QWidget} $\ast$ {\em target}, const char $\ast$ {\em name} = 0)}\label{classKRootPixmap_a0}


Constructs a KRoot\-Pixmap. 

The KRoot\-Pixmap will be created as a child of the target widget so it will be deleted automatically when the widget is destroyed.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em target}]A pointer to the widget that you want to make pseudo transparent. \end{description}
\end{Desc}


Definition at line 31 of file krootpixmap.cpp.

References KStd\-Accel::name().\index{KRootPixmap@{KRoot\-Pixmap}!KRootPixmap@{KRootPixmap}}
\index{KRootPixmap@{KRootPixmap}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRoot\-Pixmap::KRoot\-Pixmap ({\bf QWidget} $\ast$ {\em target}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = 0)}\label{classKRootPixmap_a1}


Constructs a KRoot\-Pixmap where the parent {\bf QObject} and target {\bf QWidget} are different. 



Definition at line 37 of file krootpixmap.cpp.

References KStd\-Accel::name().\index{KRootPixmap@{KRoot\-Pixmap}!~KRootPixmap@{$\sim$KRootPixmap}}
\index{~KRootPixmap@{$\sim$KRootPixmap}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRoot\-Pixmap::$\sim${\bf KRoot\-Pixmap} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKRootPixmap_a2}


Destructs the object. 



Definition at line 62 of file krootpixmap.cpp.

\subsection{Member Function Documentation}
\index{KRootPixmap@{KRoot\-Pixmap}!isAvailable@{isAvailable}}
\index{isAvailable@{isAvailable}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KRoot\-Pixmap::is\-Available () const}\label{classKRootPixmap_a3}


Checks if pseudo-transparency is available. 

\begin{Desc}
\item[Returns:]{\tt true} if transparency is available, {\tt false} otherwise. \end{Desc}


Definition at line 176 of file krootpixmap.cpp.

References current\-Desktop(), KShared\-Pixmap::is\-Available(), KStd\-Accel::name(), and QObject::name().

Referenced by check\-Available(), and start().\index{KRootPixmap@{KRoot\-Pixmap}!isActive@{isActive}}
\index{isActive@{isActive}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KRoot\-Pixmap::is\-Active () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRootPixmap_a4}


Returns true if the KRoot\-Pixmap is active. 



Definition at line 80 of file krootpixmap.h.\index{KRootPixmap@{KRoot\-Pixmap}!currentDesktop@{currentDesktop}}
\index{currentDesktop@{currentDesktop}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KRoot\-Pixmap::current\-Desktop () const}\label{classKRootPixmap_a5}


Returns the number of the current desktop. 



Definition at line 68 of file krootpixmap.cpp.

Referenced by event\-Filter(), is\-Available(), and repaint().\index{KRootPixmap@{KRoot\-Pixmap}!customPainting@{customPainting}}
\index{customPainting@{customPainting}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KRoot\-Pixmap::custom\-Painting () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRootPixmap_a6}


Returns true if custom painting is enabled, false otherwise. 

\begin{Desc}
\item[See also:]{\bf set\-Custom\-Painting(bool)}{\rm (p.\,\pageref{classKRootPixmap_i5})} \end{Desc}


Definition at line 91 of file krootpixmap.h.\index{KRootPixmap@{KRoot\-Pixmap}!checkAvailable@{checkAvailable}}
\index{checkAvailable@{checkAvailable}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KRoot\-Pixmap::check\-Available (bool)\hspace{0.3cm}{\tt  [inline]}}\label{classKRootPixmap_a7}


Deprecated, use {\bf is\-Available}{\rm (p.\,\pageref{classKRootPixmap_a3})}() instead. 

{\bf This class or method is obsolete, it is provided for compatibility only.} 

Definition at line 98 of file krootpixmap.h.

References is\-Available().\index{KRootPixmap@{KRoot\-Pixmap}!start@{start}}
\index{start@{start}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Pixmap::start ()\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKRootPixmap_i0}


Starts background handling. 



Definition at line 76 of file krootpixmap.cpp.

References enable\-Exports(), is\-Available(), and repaint().\index{KRootPixmap@{KRoot\-Pixmap}!stop@{stop}}
\index{stop@{stop}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Pixmap::stop ()\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKRootPixmap_i1}


Stops background handling. 



Definition at line 93 of file krootpixmap.cpp.

References QTimer::stop().\index{KRootPixmap@{KRoot\-Pixmap}!setFadeEffect@{setFadeEffect}}
\index{setFadeEffect@{setFadeEffect}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Pixmap::set\-Fade\-Effect (double {\em strength}, const {\bf QColor} \& {\em color})\hspace{0.3cm}{\tt  [slot]}}\label{classKRootPixmap_i2}


Sets the fade effect. 

This effect will fade the background to the specified color. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em strength}]A value between 0 and 1, indicating the strength of the fade. A value of 0 will not change the image, a value of 1 will make it the fade color everywhere, and in between. \item[{\em color}]The color to fade to. \end{description}
\end{Desc}


Definition at line 100 of file krootpixmap.cpp.

References repaint().\index{KRootPixmap@{KRoot\-Pixmap}!repaint@{repaint}}
\index{repaint@{repaint}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Pixmap::repaint (bool {\em force})\hspace{0.3cm}{\tt  [slot]}}\label{classKRootPixmap_i3}


Repaints the widget background. 

Normally, you shouldn't need this as it is handled automatically.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em force}]Force a repaint, even if the contents did not change. \end{description}
\end{Desc}


Definition at line 151 of file krootpixmap.cpp.

References current\-Desktop(), QWidget::height(), KShared\-Pixmap::load\-From\-Shared(), QWidget::map\-To\-Global(), QWidget::rect(), update\-Background(), and QWidget::width().\index{KRootPixmap@{KRoot\-Pixmap}!repaint@{repaint}}
\index{repaint@{repaint}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Pixmap::repaint ()\hspace{0.3cm}{\tt  [slot]}}\label{classKRootPixmap_i4}


Repaints the widget background. 

Normally, you shouldn't need this as it is handled automatically. This is equivalent to calling repaint( false ). 

Definition at line 145 of file krootpixmap.cpp.

Referenced by set\-Fade\-Effect(), and start().\index{KRootPixmap@{KRoot\-Pixmap}!setCustomPainting@{setCustomPainting}}
\index{setCustomPainting@{setCustomPainting}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Pixmap::set\-Custom\-Painting (bool {\em enable})\hspace{0.3cm}{\tt  [inline, slot]}}\label{classKRootPixmap_i5}


Enables custom handling of the background painting. 

If custom painting is enabled then KRoot\-Pixmap will emit a {\bf background\-Updated}{\rm (p.\,\pageref{classKRootPixmap_l0})}() signal when the background for the target widget changes, instead of applying the new background. 

Definition at line 145 of file krootpixmap.h.\index{KRootPixmap@{KRoot\-Pixmap}!enableExports@{enableExports}}
\index{enableExports@{enableExports}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Pixmap::enable\-Exports ()\hspace{0.3cm}{\tt  [slot]}}\label{classKRootPixmap_i6}


Asks KDesktop to export the desktop background as a {\bf KShared\-Pixmap}{\rm (p.\,\pageref{classKSharedPixmap})}. 

This method uses DCOP to call KBackground\-Iface/set\-Export(int). 

Definition at line 183 of file krootpixmap.cpp.

References DCOPClient::attach(), DCOPClient::is\-Attached(), and DCOPClient::send().

Referenced by start().\index{KRootPixmap@{KRoot\-Pixmap}!backgroundUpdated@{backgroundUpdated}}
\index{backgroundUpdated@{backgroundUpdated}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Pixmap::background\-Updated (const {\bf QPixmap} \& {\em pm})\hspace{0.3cm}{\tt  [signal]}}\label{classKRootPixmap_l0}


Emitted when the background needs updating and custom painting (see {\bf set\-Custom\-Painting}{\rm (p.\,\pageref{classKRootPixmap_i5})}(bool) ) is enabled. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pm}]A pixmap containing the new background. \end{description}
\end{Desc}


Referenced by update\-Background().\index{KRootPixmap@{KRoot\-Pixmap}!eventFilter@{eventFilter}}
\index{eventFilter@{eventFilter}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KRoot\-Pixmap::event\-Filter ({\bf QObject} $\ast$, {\bf QEvent} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKRootPixmap_b0}


Reimplemented to filter the events from the target widget and track its movements. 



Reimplemented from {\bf QObject}.

Definition at line 114 of file krootpixmap.cpp.

References current\-Desktop(), KNotify\-Client::event(), and QTimer::start().\index{KRootPixmap@{KRoot\-Pixmap}!updateBackground@{updateBackground}}
\index{updateBackground@{updateBackground}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Pixmap::update\-Background ({\bf KShared\-Pixmap} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKRootPixmap_b1}


Called when the pixmap has been updated. 

The default implementation applies the fade effect, then sets the target's background, or emits {\bf background\-Updated}{\rm (p.\,\pageref{classKRootPixmap_l0})}(const {\bf QPixmap} \&) depending on the painting mode. 

Definition at line 210 of file krootpixmap.cpp.

References background\-Updated(), KPixmap\-IO::convert\-To\-Image(), KPixmap\-IO::convert\-To\-Pixmap(), and KImage\-Effect::fade().

Referenced by repaint().

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