org.kde.koala

Class KRootPixmap

public class KRootPixmap extends QObject

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(QPixmap) signal whenever the background needs updating by using setCustomPainting(boolean). Alternatively by reimplementing updateBackground(KSharedPixmap) you can take complete control of the behavior. See KRootPixmapSignals for signals emitted by KRootPixmap

Version: $Id: KRootPixmap.java 473384 2005-10-23 14:17:09Z rdale $

Author: Geert Jansen

UNKNOWN: Creates pseudo-transparent widgets.

Constructor Summary
protected KRootPixmap(Class dummy)
KRootPixmap(QWidget target, String name)
Constructs a KRootPixmap.
KRootPixmap(QWidget target)
KRootPixmap(QWidget target, QObject parent, String name)
Constructs a KRootPixmap where the parent QObject and target QWidget are different.
KRootPixmap(QWidget target, QObject parent)
Method Summary
StringclassName()
QColorcolor()
intcurrentDesktop()
Returns the number of the current desktop.
booleancustomPainting()
Returns true if custom painting is enabled, false otherwise.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
voidenableExports()
Asks KDesktop to export the desktop background as a KSharedPixmap.
booleaneventFilter(QObject arg1, QEvent arg2)
Reimplemented to filter the events from the target widget and track its movements.
protected voidfinalize()
Deletes the wrapped C++ instance
booleanisActive()
Returns true if the KRootPixmap is active.
booleanisAvailable()
Checks if pseudo-transparency is available.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
QMetaObjectmetaObject()
doubleopacity()
static StringpixmapName(int desk)
Returns the name of the shared pixmap (only needed for low level access)
voidrepaint(boolean force)
Repaints the widget background.
voidrepaint()
Repaints the widget background.
voidsetCustomPainting(boolean enable)
Enables custom handling of the background painting.
voidsetFadeEffect(double opacity, QColor color)
Sets the fade effect.
voidstart()
Starts background handling.
voidstop()
Stops background handling.

Constructor Detail

KRootPixmap

protected KRootPixmap(Class dummy)

KRootPixmap

public KRootPixmap(QWidget target, String name)
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: target A pointer to the widget that you want to make pseudo transparent. name The internal name of the pixmap

UNKNOWN: Constructs a KRootPixmap.

KRootPixmap

public KRootPixmap(QWidget target)

KRootPixmap

public KRootPixmap(QWidget target, QObject parent, String name)
Constructs a KRootPixmap where the parent QObject and target QWidget are different.

UNKNOWN: Constructs a KRootPixmap where the parent QObject and target QWidget are different.

KRootPixmap

public KRootPixmap(QWidget target, QObject parent)

Method Detail

className

public String className()

color

public QColor color()

Returns: the fade color.

Since: 3.2

UNKNOWN: @since 3.

currentDesktop

public int currentDesktop()
Returns the number of the current desktop.

UNKNOWN: Returns the number of the current desktop.

customPainting

public boolean customPainting()
Returns true if custom painting is enabled, false otherwise.

See Also: KRootPixmap

UNKNOWN: Returns true if custom painting is enabled, false otherwise.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

enableExports

public void enableExports()
Asks KDesktop to export the desktop background as a KSharedPixmap. This method uses DCOP to call KBackgroundIface/setExport(int).

UNKNOWN: Asks KDesktop to export the desktop background as a KSharedPixmap.

eventFilter

public boolean eventFilter(QObject arg1, QEvent arg2)
Reimplemented to filter the events from the target widget and track its movements.

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

finalize

protected void finalize()
Deletes the wrapped C++ instance

isActive

public boolean isActive()
Returns true if the KRootPixmap is active.

UNKNOWN: Returns true if the KRootPixmap is active.

isAvailable

public boolean isAvailable()
Checks if pseudo-transparency is available.

Returns: true if transparency is available, false otherwise.

UNKNOWN: Checks if pseudo-transparency is available.

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

metaObject

public QMetaObject metaObject()

opacity

public double opacity()

Returns: the color opacity.

Since: 3.2

UNKNOWN: @since 3.

pixmapName

public static String pixmapName(int desk)
Returns the name of the shared pixmap (only needed for low level access)

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

repaint

public void repaint(boolean force)
Repaints the widget background. Normally, you shouldn't need this as it is handled automatically.

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

UNKNOWN: Repaints the widget background.

repaint

public void repaint()
Repaints the widget background. Normally, you shouldn't need this as it is handled automatically. This is equivalent to calling repaint( false ).

UNKNOWN: Repaints the widget background.

setCustomPainting

public void setCustomPainting(boolean enable)
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.

UNKNOWN: Enables custom handling of the background painting.

setFadeEffect

public void setFadeEffect(double opacity, QColor color)
Sets the fade effect. This effect will fade the background to the specified color.

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

UNKNOWN: Sets the fade effect.

start

public void start()
Starts background handling.

UNKNOWN: Starts background handling.

stop

public void stop()
Stops background handling.

UNKNOWN: Stops background handling.