.TH "KRootPixmap" kde3 "11 Jun 2005" "Version Version 3.4.1" "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
.ti -1c
.RI "virtual void \fBstop\fP ()"
.br
.ti -1c
.RI "void \fBsetFadeEffect\fP (double opacity, const \fBQColor\fP &color)"
.br
.ti -1c
.RI "void \fBrepaint\fP (bool force)"
.br
.ti -1c
.RI "void \fBrepaint\fP ()"
.br
.ti -1c
.RI "void \fBsetCustomPainting\fP (bool enable)"
.br
.ti -1c
.RI "void \fBenableExports\fP ()"
.br
.ti -1c
.RI "static \fBQString\fP \fBpixmapName\fP (int desk)"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBbackgroundUpdated\fP (const \fBQPixmap\fP &pm)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKRootPixmap\fP (\fBQWidget\fP *target, const char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBKRootPixmap\fP (\fBQWidget\fP *target, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0)"
.br
.ti -1c
.RI "virtual \fB~KRootPixmap\fP ()"
.br
.ti -1c
.RI "bool \fBisAvailable\fP () const "
.br
.ti -1c
.RI "bool \fBisActive\fP () const "
.br
.ti -1c
.RI "int \fBcurrentDesktop\fP () const "
.br
.ti -1c
.RI "bool \fBcustomPainting\fP () const "
.br
.ti -1c
.RI "KDE_DEPRECATED bool \fBcheckAvailable\fP (bool)"
.br
.ti -1c
.RI "const \fBQColor\fP & \fBcolor\fP () const "
.br
.ti -1c
.RI "double \fBopacity\fP () const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBeventFilter\fP (\fBQObject\fP *, \fBQEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBupdateBackground\fP (\fBKSharedPixmap\fP *)"
.br
.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 behavior, you can ask KRootPixmap to emit a \fBbackgroundUpdated(const QPixmap &)\fP signal whenever the background needs updating by using \fBsetCustomPainting(bool)\fP. Alternatively by reimplementing \fBupdateBackground(KSharedPixmap*)\fP you can take complete control of the behavior.
.PP
\fBAuthor:\fP
.RS 4
Geert Jansen <jansen@kde.org> 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkrootpixmap.h\fP 345292 2004-09-09 20:07:27Z staniek 
.RE
.PP
.RE
.PP

.PP
Definition at line 46 of file krootpixmap.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KRootPixmap::KRootPixmap (\fBQWidget\fP * target, const char * name = \fC0\fP)"
.PP
Constructs a KRootPixmap. 
.PP
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. 
.br
\fIname\fP The internal name of the pixmap 
.RE
.PP

.PP
Definition at line 46 of file krootpixmap.cpp.
.SS "KRootPixmap::KRootPixmap (\fBQWidget\fP * target, \fBQObject\fP * parent, const char * name = \fC0\fP)"
.PP
Constructs a KRootPixmap where the parent \fBQObject\fP and target \fBQWidget\fP are different. 
.PP
Definition at line 52 of file krootpixmap.cpp.
.SS "KRootPixmap::~\fBKRootPixmap\fP ()\fC [virtual]\fP"
.PP
Destructs the object. 
.PP
Definition at line 83 of file krootpixmap.cpp.
.SH "Member Function Documentation"
.PP 
.SS "bool KRootPixmap::isAvailable () const"
.PP
Checks if pseudo-transparency is available. 
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP if transparency is available, \fCfalse\fP otherwise. 
.RE
.PP

.PP
Definition at line 247 of file krootpixmap.cpp.
.PP
References KSharedPixmap::isAvailable(), QPixmap::isNull(), and pixmapName().
.PP
Referenced by start().
.SS "bool KRootPixmap::isActive () const\fC [inline]\fP"
.PP
Returns true if the KRootPixmap is active. 
.PP
Definition at line 82 of file krootpixmap.h.
.SS "int KRootPixmap::currentDesktop () const"
.PP
Returns the number of the current desktop. 
.PP
Definition at line 90 of file krootpixmap.cpp.
.PP
References NETRootInfo::activate(), NETRootInfo::currentDesktop(), QApplication::desktop(), and NETRootInfo::screenNumber().
.PP
Referenced by eventFilter(), and repaint().
.SS "bool KRootPixmap::customPainting () const\fC [inline]\fP"
.PP
Returns true if custom painting is enabled, false otherwise. 
.PP
\fBSee also:\fP
.RS 4
\fBsetCustomPainting(bool)\fP 
.RE
.PP

.PP
Definition at line 93 of file krootpixmap.h.
.SS "KDE_DEPRECATED bool KRootPixmap::checkAvailable (bool)\fC [inline]\fP"
.PP
Deprecated, use \fBisAvailable()\fP instead. 
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.PP
Definition at line 100 of file krootpixmap.h.
.SS "const \fBQColor\fP& KRootPixmap::color () const\fC [inline]\fP"
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
\fBReturns:\fP
.RS 4
the fade color. 
.RE
.PP

.PP
Definition at line 106 of file krootpixmap.h.
.PP
Referenced by setFadeEffect().
.SS "double KRootPixmap::opacity () const\fC [inline]\fP"
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
\fBReturns:\fP
.RS 4
the color opacity. 
.RE
.PP

.PP
Definition at line 111 of file krootpixmap.h.
.SS "void KRootPixmap::start ()\fC [virtual, slot]\fP"
.PP
Starts background handling. 
.PP
Definition at line 103 of file krootpixmap.cpp.
.PP
References enableExports(), isAvailable(), and repaint().
.SS "void KRootPixmap::stop ()\fC [virtual, slot]\fP"
.PP
Stops background handling. 
.PP
Definition at line 120 of file krootpixmap.cpp.
.PP
References QTimer::stop().
.SS "void KRootPixmap::setFadeEffect (double opacity, const \fBQColor\fP & color)\fC [slot]\fP"
.PP
Sets the fade effect. 
.PP
This effect will fade the background to the specified color. 
.PP
\fBParameters:\fP
.RS 4
\fIopacity\fP 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. 
.br
\fIcolor\fP The color to fade to. 
.RE
.PP

.PP
Definition at line 127 of file krootpixmap.cpp.
.PP
References color(), and repaint().
.SS "void KRootPixmap::repaint (bool force)\fC [slot]\fP"
.PP
Repaints the widget background. 
.PP
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

.PP
Definition at line 208 of file krootpixmap.cpp.
.PP
References currentDesktop(), QRect::height(), QWidget::height(), QPixmap::isNull(), KPixmap::load(), KSharedPixmap::loadFromShared(), QWidget::mapToGlobal(), pixmapName(), QWidget::rect(), QWidget::resize(), QRect::size(), QRect::topLeft(), QWidget::topLevelWidget(), updateBackground(), QRect::width(), QWidget::width(), and QWidget::winId().
.SS "void KRootPixmap::repaint ()\fC [slot]\fP"
.PP
Repaints the widget background. 
.PP
Normally, you shouldn't need this as it is handled automatically. This is equivalent to calling repaint( false ). 
.PP
Definition at line 202 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. 
.PP
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. 
.PP
Definition at line 157 of file krootpixmap.h.
.SS "void KRootPixmap::enableExports ()\fC [slot]\fP"
.PP
Asks KDesktop to export the desktop background as a \fBKSharedPixmap\fP. 
.PP
This method uses \fBDCOP\fP to call KBackgroundIface/setExport(int). 
.PP
Definition at line 268 of file krootpixmap.cpp.
.PP
References DCOPClient::attach(), DCOPClient::isAttached(), k_lineinfo, kdDebug(), DCOPClient::send(), and QCString::sprintf().
.PP
Referenced by start().
.SS "\fBQString\fP KRootPixmap::pixmapName (int desk)\fC [static, slot]\fP"
.PP
Returns the name of the shared pixmap (only needed for low level access). 
.PP
Definition at line 256 of file krootpixmap.cpp.
.PP
References QString::arg().
.PP
Referenced by isAvailable(), and repaint().
.SS "void KRootPixmap::backgroundUpdated (const \fBQPixmap\fP & pm)\fC [signal]\fP"
.PP
Emitted when the background needs updating and custom painting (see \fBsetCustomPainting(bool)\fP ) is enabled. 
.PP
\fBParameters:\fP
.RS 4
\fIpm\fP A pixmap containing the new background. 
.RE
.PP

.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. 
.PP
Reimplemented from \fBQObject\fP.
.PP
Definition at line 141 of file krootpixmap.cpp.
.PP
References currentDesktop(), QTimer::start(), and QWidget::topLevelWidget().
.SS "void KRootPixmap::updateBackground (\fBKSharedPixmap\fP *)\fC [protected, virtual]\fP"
.PP
Called when the pixmap has been updated. 
.PP
The default implementation applies the fade effect, then sets the target's background, or emits \fBbackgroundUpdated(const QPixmap &)\fP depending on the painting mode. 
.PP
Definition at line 303 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.
