| 1 |
/*************************************************************************** |
| 2 |
* Copyright (c) 2009 Enrico Ros * |
| 3 |
* 2009 Enrico Ros <enrico.ros@email.it> * |
| 4 |
* 2009 Alberto Scarpa <skaal.sl@gmail.com> * |
| 5 |
* * |
| 6 |
* Permission is hereby granted, free of charge, to any person * |
| 7 |
* obtaining a copy of this software and associated documentation * |
| 8 |
* files (the "Software"), to deal in the Software without * |
| 9 |
* restriction, including without limitation the rights to use, * |
| 10 |
* copy, modify, merge, publish, distribute, sublicense, and/or sell * |
| 11 |
* copies of the Software, and to permit persons to whom the * |
| 12 |
* Software is furnished to do so, subject to the following * |
| 13 |
* conditions: * |
| 14 |
* * |
| 15 |
* The above copyright notice and this permission notice shall be * |
| 16 |
* included in all copies or substantial portions of the Software. * |
| 17 |
* * |
| 18 |
***************************************************************************/ |
| 19 |
|
| 20 |
#ifndef __ScreenCapture_h__ |
| 21 |
#define __ScreenCapture_h__ |
| 22 |
|
| 23 |
#include <QObject> |
| 24 |
#include <QBasicTimer> |
| 25 |
#include <QList> |
| 26 |
#include <QImage> |
| 27 |
#include <QPixmap> |
| 28 |
|
| 29 |
class ScreenCapture : public QObject |
| 30 |
{ |
| 31 |
Q_OBJECT |
| 32 |
public: |
| 33 |
ScreenCapture( QObject * parent ); |
| 34 |
|
| 35 |
void setEnabled( bool enabled ); |
| 36 |
bool enabled() const; |
| 37 |
void setGeometry( const QRect & geometry ); |
| 38 |
QRect geometry() const; |
| 39 |
void setFrequency( int fps ); |
| 40 |
int frequency() const; |
| 41 |
|
| 42 |
QPixmap lastPixmap() const; |
| 43 |
|
| 44 |
Q_SIGNALS: |
| 45 |
void gotPixmap( const QPixmap & pixmap, const QPoint & cursorPos ); |
| 46 |
|
| 47 |
protected: |
| 48 |
void timerEvent( QTimerEvent * event ); |
| 49 |
|
| 50 |
private: |
| 51 |
QBasicTimer m_timer; |
| 52 |
QPixmap m_pixmap; |
| 53 |
QRect m_geometry; |
| 54 |
bool m_enabled; |
| 55 |
int m_fps; |
| 56 |
}; |
| 57 |
|
| 58 |
#endif |