2
* Copyright 2007 Zack Rusin <zack@kde.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Library General Public License version 2 as
6
* published by the Free Software Foundation
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details
13
* You should have received a copy of the GNU Library General Public
14
* License along with this program; if not, write to the
15
* Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
#ifndef PLASMA_GLAPPLET_H
20
#define PLASMA_GLAPPLET_H
22
#include <plasma/applet.h>
24
#include <QtOpenGL/QGLWidget>
30
* @short Plasma Applet that is fully rendererd using OpengGL
33
class PLASMA_EXPORT GLApplet : public Applet
39
* @arg parent the QGraphicsItem this applet is parented to
40
* @arg servideId the name of the .desktop file containing the
41
* information about the widget
42
* @arg appletId a unique id used to differentiate between multiple
43
* instances of the same Applet type
45
GLApplet(QGraphicsItem *parent,
46
const QString &serviceId,
50
* This constructor is to be used with the plugin loading systems
51
* found in KPluginInfo and KService. The argument list is expected
52
* to have two elements: the KService service ID for the desktop entry
53
* and an applet ID which must be a base 10 number.
55
* @arg parent a QObject parent; you probably want to pass in 0
56
* @arg args a list of strings containing two entries: the service id
59
GLApplet(QObject *parent, const QVariantList &args);
63
GLuint bindTexture(const QImage &image, GLenum target = GL_TEXTURE_2D);
64
void deleteTexture(GLuint texture_id);
67
* Reimplement this method to render using OpenGL. QPainter passed
68
* to this method will always use OpenGL engine and rendering
69
* using OpenGL api directly is supported.
71
virtual void paintGLInterface(QPainter *painter,
72
const QStyleOptionGraphicsItem *option) = 0;
75
virtual void paintInterface(QPainter *painter,
76
const QStyleOptionGraphicsItem *option,
77
const QRect &contentsRect);