\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=56pt]{classKRootPixmap__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KRoot\-Pixmap:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=264pt]{classKRootPixmap__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
virtual void {\bf start} ()
\item 
virtual void {\bf stop} ()
\item 
void {\bf set\-Fade\-Effect} (double opacity, const {\bf QColor} \&color)
\item 
void {\bf repaint} (bool force)
\item 
void {\bf repaint} ()
\item 
void {\bf set\-Custom\-Painting} (bool enable)
\item 
void {\bf enable\-Exports} ()
\item 
static {\bf QString} {\bf pixmap\-Name} (int desk)
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf background\-Updated} (const {\bf QPixmap} \&pm)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KRoot\-Pixmap} ({\bf QWidget} $\ast$target, const char $\ast${\bf name}=0)
\item 
{\bf KRoot\-Pixmap} ({\bf QWidget} $\ast$target, {\bf QObject} $\ast${\bf parent}, const char $\ast${\bf name}=0)
\item 
virtual {\bf $\sim$KRoot\-Pixmap} ()
\item 
bool {\bf is\-Available} () const 
\item 
bool {\bf is\-Active} () const 
\item 
int {\bf current\-Desktop} () const 
\item 
bool {\bf custom\-Painting} () const 
\item 
KDE\_\-DEPRECATED bool {\bf check\-Available} (bool)
\item 
const {\bf QColor} \& {\bf color} () const 
\item 
double {\bf opacity} () const 
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual bool {\bf event\-Filter} ({\bf QObject} $\ast$, {\bf QEvent} $\ast$)
\item 
virtual void {\bf update\-Background} ({\bf KShared\-Pixmap} $\ast$)
\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 behavior, you can ask KRoot\-Pixmap to emit a {\bf background\-Updated(const QPixmap \&)}{\rm (p.\,\pageref{classKRootPixmap_l0})} signal whenever the background needs updating by using {\bf set\-Custom\-Painting(bool)}{\rm (p.\,\pageref{classKRootPixmap_i5})}. Alternatively by reimplementing {\bf update\-Background(KShared\-Pixmap$\ast$)}{\rm (p.\,\pageref{classKRootPixmap_b1})} you can take complete control of the behavior.

\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})} 345292 2004-09-09 20:07:27Z staniek \end{Desc}
\end{Desc}




Definition at line 46 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} = {\tt 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. \item[{\em name}]The internal name of the pixmap \end{description}
\end{Desc}


Definition at line 46 of file krootpixmap.cpp.\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} = {\tt 0})}\label{classKRootPixmap_a1}


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



Definition at line 52 of file krootpixmap.cpp.\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 83 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 247 of file krootpixmap.cpp.

References KShared\-Pixmap::is\-Available(), QPixmap::is\-Null(), and pixmap\-Name().

Referenced by 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 82 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 90 of file krootpixmap.cpp.

References NETRoot\-Info::activate(), NETRoot\-Info::current\-Desktop(), QApplication::desktop(), and NETRoot\-Info::screen\-Number().

Referenced by event\-Filter(), 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 93 of file krootpixmap.h.\index{KRootPixmap@{KRoot\-Pixmap}!checkAvailable@{checkAvailable}}
\index{checkAvailable@{checkAvailable}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDE\_\-DEPRECATED 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. 

\begin{Desc}
\item[{\bf Deprecated}]\end{Desc}


Definition at line 100 of file krootpixmap.h.\index{KRootPixmap@{KRoot\-Pixmap}!color@{color}}
\index{color@{color}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QColor}\& KRoot\-Pixmap::color () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRootPixmap_a8}


\begin{Desc}
\item[Since:]3.2 \end{Desc}


\begin{Desc}
\item[Returns:]the fade color. \end{Desc}


Definition at line 106 of file krootpixmap.h.

Referenced by set\-Fade\-Effect().\index{KRootPixmap@{KRoot\-Pixmap}!opacity@{opacity}}
\index{opacity@{opacity}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double KRoot\-Pixmap::opacity () const\hspace{0.3cm}{\tt  [inline]}}\label{classKRootPixmap_a9}


\begin{Desc}
\item[Since:]3.2 \end{Desc}


\begin{Desc}
\item[Returns:]the color opacity. \end{Desc}


Definition at line 111 of file krootpixmap.h.\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 103 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 120 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 opacity}, 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 opacity}]A value between 0 and 1, indicating the opacity of the color. A value of 0 will not change the image, a value of 1 will use the fade color unchanged. \item[{\em color}]The color to fade to. \end{description}
\end{Desc}


Definition at line 127 of file krootpixmap.cpp.

References color(), and 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 208 of file krootpixmap.cpp.

References current\-Desktop(), QRect::height(), QWidget::height(), QPixmap::is\-Null(), KPixmap::load(), KShared\-Pixmap::load\-From\-Shared(), QWidget::map\-To\-Global(), pixmap\-Name(), QWidget::rect(), QWidget::resize(), QRect::size(), QRect::top\-Left(), QWidget::top\-Level\-Widget(), update\-Background(), QRect::width(), QWidget::width(), and QWidget::win\-Id().\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 202 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 157 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 {\bf DCOP} to call KBackground\-Iface/set\-Export(int). 

Definition at line 268 of file krootpixmap.cpp.

References DCOPClient::attach(), DCOPClient::is\-Attached(), k\_\-lineinfo, kd\-Debug(), DCOPClient::send(), and QCString::sprintf().

Referenced by start().\index{KRootPixmap@{KRoot\-Pixmap}!pixmapName@{pixmapName}}
\index{pixmapName@{pixmapName}!KRootPixmap@{KRoot\-Pixmap}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KRoot\-Pixmap::pixmap\-Name (int {\em desk})\hspace{0.3cm}{\tt  [static, slot]}}\label{classKRootPixmap_i7}


Returns the name of the shared pixmap (only needed for low level access). 



Definition at line 256 of file krootpixmap.cpp.

References QString::arg().

Referenced by is\-Available(), and repaint().\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(bool)}{\rm (p.\,\pageref{classKRootPixmap_i5})} ) 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 141 of file krootpixmap.cpp.

References current\-Desktop(), QTimer::start(), and QWidget::top\-Level\-Widget().\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(const QPixmap \&)}{\rm (p.\,\pageref{classKRootPixmap_l0})} depending on the painting mode. 

Definition at line 303 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}
