3
* This file is part of the KPager.
4
* Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Library General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
12
#ifndef KSHAREDPIXMAP_H
13
#define KSHAREDPIXMAP_H
15
#include <QtGui/QWidget>
21
* Shared pixmap client.
23
* A shared pixmap is a pixmap that resides on the X server, is referenced
24
* by a global id string, and can be accessed by all X clients.
26
* This class is a client class to shared pixmaps in KDE. You can use it
27
* to copy (a part of) a shared pixmap into. KSharedPixmap provides a
28
* member of type QPixmap (@see pixmap()) for that purpose.
30
* The server part of shared pixmaps is not implemented here.
31
* That part is provided by KPixmapServer, in the source file:
32
* kdebase/kdesktop/pixmapserver.cc.
34
* An example: copy from a shared pixmap:
36
* KSharedPixmap *pm = new KSharedPixmap;
37
* connect(pm, SIGNAL(done(bool)), SLOT(slotDone(bool)));
38
* pm->loadFromShared("My Pixmap");
40
* // do something with the pixmap
44
* @author Geert Jansen <jansen@kde.org>
54
* Construct an empty pixmap.
59
* Destroys the pixmap.
64
* Load from a shared pixmap reference. The signal done() is emitted
65
* when the operation has finished.
67
* @param name The shared pixmap name.
68
* @param rect If you pass a nonzero rectangle, a tile is generated which
69
* is able to fill up the specified rectangle completely. This is solely
70
* for optimization: in some cases the tile will be much smaller than the
71
* original pixmap. It reflects KSharedPixmap's original use: sharing
72
* of the desktop background to achieve pseudo transparency.
73
* @return True if the shared pixmap exists and loading has started
74
* successfully, false otherwise.
76
bool loadFromShared(const QString & name, const QRect & rect=QRect());
79
* Check whether a shared pixmap is available.
81
* @param name The shared pixmap name.
82
* @return True if the shared pixmap is available, false otherwise.
84
bool isAvailable(const QString & name) const;
87
* Gives access to the shared pixmap data.
89
QPixmap pixmap() const;
93
* This signal is raised when a pixmap load operation has finished.
95
* @param success True if successful, false otherwise.
97
void done(bool success);
101
bool x11Event(XEvent *);
105
bool copy(const QString & id, const QRect & rect);
108
class KSharedPixmapPrivate;
109
KSharedPixmapPrivate *d;