diff options
author | horchi <vdr@jwendel.de> | 2017-03-05 16:47:41 +0100 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2017-03-05 16:47:41 +0100 |
commit | 22ffee20bbacbc3378e4ba0df5b7f0c3daaeffc0 (patch) | |
tree | de46c945c62d43d1febb027b5bfa075e58c5b69a /plasma/gtft.h | |
download | vdr-plugin-graphtftng-master.tar.gz vdr-plugin-graphtftng-master.tar.bz2 |
Diffstat (limited to 'plasma/gtft.h')
-rw-r--r-- | plasma/gtft.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/plasma/gtft.h b/plasma/gtft.h new file mode 100644 index 0000000..e2daa21 --- /dev/null +++ b/plasma/gtft.h @@ -0,0 +1,66 @@ + + +#ifndef _GTFT_H +#define _GTFT_H + +#include <QPainter> +#include <QGraphicsSceneMouseEvent> +#include <Plasma/Applet> + +#include <comthread.hpp> + +class ConfigDialog; + +// using namespace Plasma; + +class GtftApplet : public Plasma::Applet +{ + Q_OBJECT + + public: + + GtftApplet(QObject* parent, const QVariantList& args); + ~GtftApplet(); + + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* mouseEvent); + void mouseReleaseEvent(QGraphicsSceneMouseEvent* mouseEvent); + void wheelEvent(QGraphicsSceneWheelEvent* wheelEvent); + void mousePressEvent(QGraphicsSceneMouseEvent *event); + void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + void keyPressEvent(QKeyEvent* keyEvent); + + void paintInterface(QPainter* painter, const QStyleOptionGraphicsItem* option, + const QRect& contentsRect); + void init(); + + public slots: + + void updateImage(unsigned char* buffer, int size); + void createConfigurationInterface(KConfigDialog *parent); + + protected Q_SLOTS: + + void configAccepted(); + + protected: + + QPoint clickCoordinate(QPoint screenPos); + + private: + + ConfigDialog* configDialog; + bool smoothScaling; + QString host; + unsigned int port; + QRect paintRect; + + QPixmap picture; + ComThread* thread; + + int vdrWidth; + int vdrHeight; +}; + +K_EXPORT_PLASMA_APPLET(gtft, GtftApplet) + +#endif // _GTFT_H |