.TH "KRootPixmap" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KRootPixmap \- Creates pseudo-transparent widgets.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <krootpixmap.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "virtual void \fBstart\fP ()"
.br
.RI "\fIStarts background handling. \fP"
.ti -1c
.RI "virtual void \fBstop\fP ()"
.br
.RI "\fIStops background handling. \fP"
.ti -1c
.RI "void \fBsetFadeEffect\fP (double strength, const  \fBQColor\fP &color)"
.br
.RI "\fISets the fade effect. \fP"
.ti -1c
.RI "void \fBrepaint\fP (bool force)"
.br
.RI "\fIRepaints the widget background. \fP"
.ti -1c
.RI "void \fBrepaint\fP ()"
.br
.RI "\fIRepaints the widget background. \fP"
.ti -1c
.RI "void \fBsetCustomPainting\fP (bool enable)"
.br
.RI "\fIEnables custom handling of the background painting. \fP"
.ti -1c
.RI "void \fBenableExports\fP ()"
.br
.RI "\fIAsks KDesktop to export the desktop background as a \fBKSharedPixmap\fP. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBbackgroundUpdated\fP (const  \fBQPixmap\fP &pm)"
.br
.RI "\fIEmitted when the background needs updating and custom painting (see \fBsetCustomPainting\fP(bool) ) is enabled. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKRootPixmap\fP (\fBQWidget\fP *target, const  char *\fBname\fP=0)"
.br
.RI "\fIConstructs a KRootPixmap. \fP"
.ti -1c
.RI "\fBKRootPixmap\fP (\fBQWidget\fP *target, \fBQObject\fP *\fBparent\fP, const  char *\fBname\fP=0)"
.br
.RI "\fIConstructs a KRootPixmap where the parent \fBQObject\fP and target \fBQWidget\fP are different. \fP"
.ti -1c
.RI "virtual \fB~KRootPixmap\fP ()"
.br
.RI "\fIDestructs the object. \fP"
.ti -1c
.RI "bool \fBisAvailable\fP () const "
.br
.RI "\fIChecks if pseudo-transparency is available. \fP"
.ti -1c
.RI "bool \fBisActive\fP () const "
.br
.RI "\fIReturns true if the KRootPixmap is active. \fP"
.ti -1c
.RI "int \fBcurrentDesktop\fP () const "
.br
.RI "\fIReturns the number of the current desktop. \fP"
.ti -1c
.RI "bool \fBcustomPainting\fP () const "
.br
.RI "\fIReturns true if custom painting is enabled, false otherwise. \fP"
.ti -1c
.RI "bool \fBcheckAvailable\fP (bool)"
.br
.RI "\fIDeprecated, use \fBisAvailable\fP() instead. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBeventFilter\fP (\fBQObject\fP *, \fBQEvent\fP *)"
.br
.RI "\fIReimplemented to filter the events from the target widget and track its movements. \fP"
.ti -1c
.RI "virtual void \fBupdateBackground\fP (\fBKSharedPixmap\fP *)"
.br
.RI "\fICalled when the pixmap has been updated. \fP"
.in -1c
.SH "Detailed Description"
.PP 
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.
.PP
To create a transparent widget, construct a KRootPixmap and pass it a pointer to your widget. That's it! Moving, resizing and background changes are handled automatically.
.PP
Instead of using the default behaviour, you can ask KRootPixmap to emit a \fBbackgroundUpdated\fP(const \fBQPixmap\fP &) signal whenever the background needs updating by using \fBsetCustomPainting\fP(bool). Alternatively by reimplementing \fBupdateBackground\fP(KSharedPixmap*) you can take complete control of the behaviour.
.PP
\fBAuthor:\fP
.RS 4
Geert Jansen <jansen@kde.org> 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkrootpixmap.h\fP,v 1.14 2002/03/08 18:01:07 rich Exp 
.RE
.PP
.RE
.PP

.PP
Definition at line 45 of file krootpixmap.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KRootPixmap::KRootPixmap (\fBQWidget\fP * target, const char * name = 0)"
.PP
Constructs a KRootPixmap. The KRootPixmap will be created as a child of the target widget so it will be deleted automatically when the widget is destroyed.
.PP
\fBParameters:\fP
.RS 4
\fItarget\fP A pointer to the widget that you want to make pseudo transparent. 
.RE
.PP
Definition at line 31 of file krootpixmap.cpp.
.PP
References KStdAccel::name().
.SS "KRootPixmap::KRootPixmap (\fBQWidget\fP * target, \fBQObject\fP * parent, const char * name = 0)"
.PP
Constructs a KRootPixmap where the parent \fBQObject\fP and target \fBQWidget\fP are different. Definition at line 37 of file krootpixmap.cpp.
.PP
References KStdAccel::name().
.SS "KRootPixmap::~\fBKRootPixmap\fP ()\fC [virtual]\fP"
.PP
Destructs the object. Definition at line 62 of file krootpixmap.cpp.
.SH "Member Function Documentation"
.PP 
.SS "bool KRootPixmap::isAvailable () const"
.PP
Checks if pseudo-transparency is available. \fBReturns:\fP
.RS 4
\fCtrue\fP if transparency is available, \fCfalse\fP otherwise. 
.RE
.PP
Definition at line 176 of file krootpixmap.cpp.
.PP
References currentDesktop(), KSharedPixmap::isAvailable(), KStdAccel::name(), and QObject::name().
.PP
Referenced by checkAvailable(), and start().
.SS "bool KRootPixmap::isActive () const\fC [inline]\fP"
.PP
Returns true if the KRootPixmap is active. Definition at line 80 of file krootpixmap.h.
.SS "int KRootPixmap::currentDesktop () const"
.PP
Returns the number of the current desktop. Definition at line 68 of file krootpixmap.cpp.
.PP
Referenced by eventFilter(), isAvailable(), and repaint().
.SS "bool KRootPixmap::customPainting () const\fC [inline]\fP"
.PP
Returns true if custom painting is enabled, false otherwise. \fBSee also:\fP
.RS 4
\fBsetCustomPainting(bool)\fP 
.RE
.PP
Definition at line 91 of file krootpixmap.h.
.SS "bool KRootPixmap::checkAvailable (bool)\fC [inline]\fP"
.PP
Deprecated, use \fBisAvailable\fP() instead. \fBThis class or method is obsolete, it is provided for compatibility only.\fP Definition at line 98 of file krootpixmap.h.
.PP
References isAvailable().
.SS "void KRootPixmap::start ()\fC [virtual, slot]\fP"
.PP
Starts background handling. Definition at line 76 of file krootpixmap.cpp.
.PP
References enableExports(), isAvailable(), and repaint().
.SS "void KRootPixmap::stop ()\fC [virtual, slot]\fP"
.PP
Stops background handling. Definition at line 93 of file krootpixmap.cpp.
.PP
References QTimer::stop().
.SS "void KRootPixmap::setFadeEffect (double strength, const \fBQColor\fP & color)\fC [slot]\fP"
.PP
Sets the fade effect. This effect will fade the background to the specified color. 
.PP
\fBParameters:\fP
.RS 4
\fIstrength\fP 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. 
.br
\fIcolor\fP The color to fade to. 
.RE
.PP
Definition at line 100 of file krootpixmap.cpp.
.PP
References repaint().
.SS "void KRootPixmap::repaint (bool force)\fC [slot]\fP"
.PP
Repaints the widget background. Normally, you shouldn't need this as it is handled automatically.
.PP
\fBParameters:\fP
.RS 4
\fIforce\fP Force a repaint, even if the contents did not change. 
.RE
.PP
Definition at line 151 of file krootpixmap.cpp.
.PP
References currentDesktop(), QWidget::height(), KSharedPixmap::loadFromShared(), QWidget::mapToGlobal(), QWidget::rect(), updateBackground(), and QWidget::width().
.SS "void KRootPixmap::repaint ()\fC [slot]\fP"
.PP
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.
.PP
Referenced by setFadeEffect(), and start().
.SS "void KRootPixmap::setCustomPainting (bool enable)\fC [inline, slot]\fP"
.PP
Enables custom handling of the background painting. If custom painting is enabled then KRootPixmap will emit a \fBbackgroundUpdated\fP() signal when the background for the target widget changes, instead of applying the new background. Definition at line 145 of file krootpixmap.h.
.SS "void KRootPixmap::enableExports ()\fC [slot]\fP"
.PP
Asks KDesktop to export the desktop background as a \fBKSharedPixmap\fP. This method uses DCOP to call KBackgroundIface/setExport(int). Definition at line 183 of file krootpixmap.cpp.
.PP
References DCOPClient::attach(), DCOPClient::isAttached(), and DCOPClient::send().
.PP
Referenced by start().
.SS "void KRootPixmap::backgroundUpdated (const \fBQPixmap\fP & pm)\fC [signal]\fP"
.PP
Emitted when the background needs updating and custom painting (see \fBsetCustomPainting\fP(bool) ) is enabled. \fBParameters:\fP
.RS 4
\fIpm\fP A pixmap containing the new background. 
.RE
.PP
Referenced by updateBackground().
.SS "bool KRootPixmap::eventFilter (\fBQObject\fP *, \fBQEvent\fP *)\fC [protected, virtual]\fP"
.PP
Reimplemented to filter the events from the target widget and track its movements. Reimplemented from \fBQObject\fP.
.PP
Definition at line 114 of file krootpixmap.cpp.
.PP
References currentDesktop(), KNotifyClient::event(), and QTimer::start().
.SS "void KRootPixmap::updateBackground (\fBKSharedPixmap\fP *)\fC [protected, virtual]\fP"
.PP
Called when the pixmap has been updated. The default implementation applies the fade effect, then sets the target's background, or emits \fBbackgroundUpdated\fP(const \fBQPixmap\fP &) depending on the painting mode. Definition at line 210 of file krootpixmap.cpp.
.PP
References backgroundUpdated(), KPixmapIO::convertToImage(), KPixmapIO::convertToPixmap(), and KImageEffect::fade().
.PP
Referenced by repaint().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
