• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Public Slots | Signals | Public Member Functions | Protected Member Functions
KRootPixmap Class Reference

#include <krootpixmap.h>

Inheritance diagram for KRootPixmap:
TQObject

List of all members.

Public Slots

virtual void start ()
virtual void stop ()
void setFadeEffect (double opacity, const TQColor &color)
void setBlurEffect (double radius, double sigma)
void repaint (bool force)
void repaint ()
void setCustomPainting (bool enable)
void enableExports ()
static TQString pixmapName (int desk)

Signals

void backgroundUpdated (const TQPixmap &pm)

Public Member Functions

 KRootPixmap (TQWidget *target, const char *name=0)
 KRootPixmap (TQWidget *target, TQObject *parent, const char *name=0)
virtual ~KRootPixmap ()
bool isAvailable () const
bool isActive () const
int currentDesktop () const
bool customPainting () const
KDE_DEPRECATED bool checkAvailable (bool)
const TQColor & color () const
const double & blurRadius () const
const double & blurSigma () const
double opacity () const

Protected Member Functions

virtual bool eventFilter (TQObject *, TQEvent *)
virtual void updateBackground (TDESharedPixmap *)

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 KRootPixmap 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 KRootPixmap to emit a backgroundUpdated(const TQPixmap &) signal whenever the background needs updating by using setCustomPainting(bool). Alternatively by reimplementing updateBackground(TDESharedPixmap*) you can take complete control of the behavior.

Author:
Geert Jansen <jansen@kde.org>
Version:
$Id$

Definition at line 46 of file krootpixmap.h.


Constructor & Destructor Documentation

KRootPixmap::KRootPixmap ( TQWidget *  target,
const char *  name = 0 
)

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.

Parameters:
targetA pointer to the widget that you want to make pseudo transparent.
nameThe internal name of the pixmap

Definition at line 46 of file krootpixmap.cpp.

KRootPixmap::KRootPixmap ( TQWidget *  target,
TQObject *  parent,
const char *  name = 0 
)

Constructs a KRootPixmap where the parent TQObject and target TQWidget are different.

Definition at line 52 of file krootpixmap.cpp.

KRootPixmap::~KRootPixmap ( ) [virtual]

Destructs the object.

Definition at line 85 of file krootpixmap.cpp.


Member Function Documentation

void KRootPixmap::backgroundUpdated ( const TQPixmap &  pm) [signal]

Emitted when the background needs updating and custom painting (see setCustomPainting(bool) ) is enabled.

Parameters:
pmA pixmap containing the new background.
const double& KRootPixmap::blurRadius ( ) const [inline]
Since:
3.5
Returns:
the blur radius.

Definition at line 111 of file krootpixmap.h.

const double& KRootPixmap::blurSigma ( ) const [inline]
Since:
3.5
Returns:
the blur sigma.

Definition at line 116 of file krootpixmap.h.

KDE_DEPRECATED bool KRootPixmap::checkAvailable ( bool  ) [inline]

Deprecated, use isAvailable() instead.

Deprecated:

Definition at line 100 of file krootpixmap.h.

const TQColor& KRootPixmap::color ( ) const [inline]
Since:
3.2
Returns:
the fade color.

Definition at line 106 of file krootpixmap.h.

int KRootPixmap::currentDesktop ( ) const

Returns the number of the current desktop.

Definition at line 92 of file krootpixmap.cpp.

bool KRootPixmap::customPainting ( ) const [inline]

Returns true if custom painting is enabled, false otherwise.

See also:
setCustomPainting(bool)

Definition at line 93 of file krootpixmap.h.

void KRootPixmap::enableExports ( ) [slot]

Asks KDesktop to export the desktop background as a TDESharedPixmap.

This method uses DCOP to call KBackgroundIface/setExport(int).

Definition at line 276 of file krootpixmap.cpp.

bool KRootPixmap::eventFilter ( TQObject *  ,
TQEvent *  event 
) [protected, virtual]

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

Reimplemented from TQObject.

Definition at line 148 of file krootpixmap.cpp.

bool KRootPixmap::isActive ( ) const [inline]

Returns true if the KRootPixmap is active.

Definition at line 82 of file krootpixmap.h.

bool KRootPixmap::isAvailable ( ) const

Checks if pseudo-transparency is available.

Returns:
true if transparency is available, false otherwise.

Definition at line 255 of file krootpixmap.cpp.

double KRootPixmap::opacity ( ) const [inline]
Since:
3.2
Returns:
the color opacity.

Definition at line 121 of file krootpixmap.h.

TQString KRootPixmap::pixmapName ( int  desk) [static, slot]

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

Definition at line 264 of file krootpixmap.cpp.

void KRootPixmap::repaint ( bool  force) [slot]

Repaints the widget background.

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

Parameters:
forceForce a repaint, even if the contents did not change.

Definition at line 215 of file krootpixmap.cpp.

void KRootPixmap::repaint ( ) [slot]

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 209 of file krootpixmap.cpp.

void KRootPixmap::setBlurEffect ( double  radius,
double  sigma 
) [slot]

Sets the blue effect.

This effect will blur the background with the specified values. If both values are set to zero no blur is applied (this is the default).

Parameters:
radiusThe radius of the gaussian not counting the center pixel. Use 0 and a suitable radius will be automatically used.
sigmaThe standard deviation of the gaussian. Use 1 if you're not sure.

Definition at line 142 of file krootpixmap.cpp.

void KRootPixmap::setCustomPainting ( bool  enable) [inline, slot]

Enables custom handling of the background painting.

If custom painting is enabled then KRootPixmap will emit a backgroundUpdated() signal when the background for the target widget changes, instead of applying the new background.

Definition at line 179 of file krootpixmap.h.

void KRootPixmap::setFadeEffect ( double  opacity,
const TQColor &  color 
) [slot]

Sets the fade effect.

This effect will fade the background to the specified color.

Parameters:
opacityA 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.
colorThe color to fade to.

Definition at line 129 of file krootpixmap.cpp.

void KRootPixmap::start ( ) [virtual, slot]

Starts background handling.

Definition at line 105 of file krootpixmap.cpp.

void KRootPixmap::stop ( ) [virtual, slot]

Stops background handling.

Definition at line 122 of file krootpixmap.cpp.

void KRootPixmap::updateBackground ( TDESharedPixmap *  spm) [protected, virtual]

Called when the pixmap has been updated.

The default implementation applies the fade effect, then sets the target's background, or emits backgroundUpdated(const TQPixmap &) depending on the painting mode.

Definition at line 311 of file krootpixmap.cpp.


The documentation for this class was generated from the following files:
  • krootpixmap.h
  • krootpixmap.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.