| 1 |
#ifndef QTRENDER_H |
| 2 |
#define QTRENDER_H |
| 3 |
|
| 4 |
#include <X11/X.h> |
| 5 |
#include <X11/Xlib.h> |
| 6 |
#include <X11/Xutil.h> |
| 7 |
#include <X11/extensions/XShm.h> |
| 8 |
|
| 9 |
#include <avm_locker.h> |
| 10 |
|
| 11 |
class QPaintDevice; |
| 12 |
class QPainter; |
| 13 |
class QWidget; |
| 14 |
|
| 15 |
class ShmRenderer |
| 16 |
{ |
| 17 |
XImage* xshmimg; |
| 18 |
Pixmap xshmpm; |
| 19 |
XShmSegmentInfo xshminfo; |
| 20 |
GC gc; |
| 21 |
avm::PthreadMutex mutex; |
| 22 |
int xpos, ypos; |
| 23 |
int m_w, m_h, pic_w, pic_h; |
| 24 |
QPaintDevice* dev; |
| 25 |
bool xshminit; |
| 26 |
|
| 27 |
void alloc(); |
| 28 |
int free(); |
| 29 |
public: |
| 30 |
ShmRenderer(QWidget* w, int x, int y, int xpos = 0, int ypos = 0); |
| 31 |
~ShmRenderer(); |
| 32 |
|
| 33 |
int resize(int& new_w, int& new_h); |
| 34 |
int draw(QPainter* pm, const void* data, bool deinterlace = false); |
| 35 |
int getWidth() const {return m_w;} |
| 36 |
int getHeight() const {return m_h;} |
| 37 |
void move(int x, int y); |
| 38 |
int sync(); |
| 39 |
}; |
| 40 |
|
| 41 |
#endif // QTRENDER_H |