# kdeui Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KSharedPixmap Class Reference

Shared pixmap client. More...

`#include <ksharedpixmap.h>`

Inheritance diagram for KSharedPixmap:

[legend]
Collaboration diagram for KSharedPixmap:

[legend]
List of all members.

## Signals

void | done (bool success)

## Public Member Functions

| KSharedPixmap ()
| ~KSharedPixmap ()
bool | loadFromShared (const QString &name, const QRect &rect=QRect())
bool | isAvailable (const QString &name) const

## Protected Member Functions

bool | x11Event (XEvent *)

## Detailed Description

Shared pixmap client.

A shared pixmap is a pixmap that resides on the X server, is referenced by a global id string, and can be accessed by all X clients.

This class is a client class to shared pixmaps in KDE. You can use it to copy (a part of) a shared pixmap into. KSharedPixmap inherits KPixmap for that purpose.

The server part of shared pixmaps is not implemented here. That part is provided by KPixmapServer, in the source file: kdebase/kdesktop/pixmapserver.cc.

An example: copy from a shared pixmap:

       KSharedPixmap *pm = new KSharedPixmap;
       connect(pm, SIGNAL(done(bool)), SLOT(slotDone(bool)));
       pm->loadFromShared("My Pixmap");

Author:
  Geert Jansen <jansen@kde.org>

Version:
  Id
    ksharedpixmap.h 363180 2004-11-15 14:50:36Z mueller

Definition at line 52 of file ksharedpixmap.h.

## Constructor & Destructor Documentation

KSharedPixmap::KSharedPixmap | ( |  | ) |

| Construct an empty pixmap. Definition at line 64 of file ksharedpixmap.cpp.

KSharedPixmap::~KSharedPixmap | ( |  | ) |

| Destroys the pixmap. Definition at line 72 of file ksharedpixmap.cpp.

## Member Function Documentation

bool KSharedPixmap::loadFromShared | ( | const QString & | name,
|  | const QRect & | rect = `QRect()`
| ) |

Load from a shared pixmap reference.

The signal done() is emitted when the operation has finished.

Parameters:

  | name | The shared pixmap name.
  | rect | If you pass a nonzero rectangle, a tile is generated which is able to fill up the specified rectangle completely. This is solely for optimization: in some cases the tile will be much smaller than the original pixmap. It reflects KSharedPixmap's original use: sharing of the desktop background to achieve pseudo transparency.

Returns:
  True if the shared pixmap exists and loading has started successfully, false otherwise.

Definition at line 98 of file ksharedpixmap.cpp.

References QString::latin1(), and QPixmap::resize().

Referenced by KRootPixmap::repaint().

bool KSharedPixmap::isAvailable | ( | const QString & | name | ) | const

Check whether a shared pixmap is available.

Parameters:

  | name | The shared pixmap name.

Returns:
  True if the shared pixmap is available, false otherwise.

Definition at line 88 of file ksharedpixmap.cpp.

References QString::latin1().

Referenced by KRootPixmap::isAvailable().

void KSharedPixmap::done | ( | bool | success | ) | `[signal]`

This signal is raised when a pixmap load operation has finished.

Parameters:

  | success | True if successful, false otherwise.

The documentation for this class was generated from the following files:

- ksharedpixmap.h
- ksharedpixmap.cpp

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:22:05 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003