diff options
Diffstat (limited to 'utils/wpseditor/gui/src/qwpsdrawer.h')
-rw-r--r-- | utils/wpseditor/gui/src/qwpsdrawer.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/utils/wpseditor/gui/src/qwpsdrawer.h b/utils/wpseditor/gui/src/qwpsdrawer.h new file mode 100644 index 0000000000..d4dfa6c7a2 --- /dev/null +++ b/utils/wpseditor/gui/src/qwpsdrawer.h | |||
@@ -0,0 +1,82 @@ | |||
1 | #ifndef WPSDRAWER_H | ||
2 | #define WPSDRAWER_H | ||
3 | // | ||
4 | #include <QWidget> | ||
5 | #include <QPixmap> | ||
6 | #include <QPointer> | ||
7 | #include <QTemporaryFile> | ||
8 | #include "api.h" | ||
9 | #include "qtrackstate.h" | ||
10 | #include "qwpsstate.h" | ||
11 | // | ||
12 | |||
13 | typedef int (*pfwps_init)(const char* buff,struct proxy_api *api, bool isfile); | ||
14 | typedef int (*pfwps_display)(); | ||
15 | typedef int (*pfwps_refresh)(); | ||
16 | |||
17 | class QWpsDrawer : public QWidget { | ||
18 | Q_OBJECT | ||
19 | |||
20 | pfwps_init wps_init; | ||
21 | pfwps_display wps_display; | ||
22 | pfwps_refresh wps_refresh; | ||
23 | |||
24 | static QPixmap *pix; | ||
25 | static QImage backdrop; | ||
26 | |||
27 | QWpsState *wpsState; | ||
28 | QTrackState *trackState; | ||
29 | |||
30 | bool showGrid; | ||
31 | bool mResolved; | ||
32 | QString mWpsString; | ||
33 | QString mTargetLibName; | ||
34 | static QString mTmpWpsString; | ||
35 | |||
36 | |||
37 | protected: | ||
38 | virtual void paintEvent(QPaintEvent * event); | ||
39 | virtual void closeEvent(QCloseEvent *event); | ||
40 | virtual void mouseReleaseEvent ( QMouseEvent * event ) ; | ||
41 | void drawBackdrop(); | ||
42 | void newTempWps(); | ||
43 | void cleanTemp(bool fileToo=true); | ||
44 | bool tryResolve(); | ||
45 | public: | ||
46 | QWpsDrawer(QWpsState *ws,QTrackState *ms, QWidget *parent=0); | ||
47 | ~QWpsDrawer(); | ||
48 | void WpsInit(QString buffer, bool isFile = true); | ||
49 | |||
50 | QString wpsString() const { | ||
51 | return mWpsString; | ||
52 | }; | ||
53 | QString tempWps() const { | ||
54 | return mTmpWpsString; | ||
55 | }; | ||
56 | |||
57 | |||
58 | static proxy_api api; | ||
59 | /***********Drawing api******************/ | ||
60 | static void putsxy(int x, int y, const unsigned char *str); | ||
61 | static void transparent_bitmap_part(const void *src, int src_x, int src_y, | ||
62 | int stride, int x, int y, int width, int height); | ||
63 | static void bitmap_part(const void *src, int src_x, int src_y, | ||
64 | int stride, int x, int y, int width, int height); | ||
65 | static void drawpixel(int x, int y); | ||
66 | static void fillrect(int x, int y, int width, int height); | ||
67 | static void hline(int x1, int x2, int y); | ||
68 | static void vline(int x, int y1, int y2); | ||
69 | static void clear_viewport(int x,int y,int w,int h, int color); | ||
70 | static bool load_wps_backdrop(char* filename); | ||
71 | static int read_bmp_file(const char* filename,int *width, int *height); | ||
72 | /****************************************/ | ||
73 | public slots: | ||
74 | void slotSetVolume(); | ||
75 | void slotSetProgress(); | ||
76 | |||
77 | void slotShowGrid(bool); | ||
78 | void slotWpsStateChanged(wpsstate); | ||
79 | void slotTrackStateChanged(trackstate); | ||
80 | void slotSetAudioStatus(int); | ||
81 | }; | ||
82 | #endif | ||