summaryrefslogtreecommitdiff
path: root/utils/wpseditor/gui/src/qwpsdrawer.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/wpseditor/gui/src/qwpsdrawer.h')
-rw-r--r--utils/wpseditor/gui/src/qwpsdrawer.h118
1 files changed, 0 insertions, 118 deletions
diff --git a/utils/wpseditor/gui/src/qwpsdrawer.h b/utils/wpseditor/gui/src/qwpsdrawer.h
deleted file mode 100644
index fd290a24ae..0000000000
--- a/utils/wpseditor/gui/src/qwpsdrawer.h
+++ /dev/null
@@ -1,118 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 by Rostilav Checkan
10 * $Id$
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef WPSDRAWER_H
23#define WPSDRAWER_H
24
25#include <QWidget>
26#include <QPixmap>
27#include <QPointer>
28#include <QTemporaryFile>
29#include <QMap>
30
31#include "wpsstate.h"
32
33struct proxy_api;
34
35class QWpsState;
36class QTrackState;
37
38typedef int (*pfwps_init)(const char* buff,struct proxy_api *api, bool isfile);
39typedef int (*pfwps_display)();
40typedef int (*pfwps_refresh)();
41typedef const char* (*pfget_model_name)();
42
43class QWpsDrawer : public QWidget {
44 Q_OBJECT
45
46 pfwps_init lib_wps_init;
47 pfwps_display lib_wps_display;
48 pfwps_refresh lib_wps_refresh;
49 pfget_model_name lib_get_model_name;
50
51 static QPixmap *pix;
52 static QImage backdrop;
53
54 QWpsState *wpsState;
55 QTrackState *trackState;
56
57 bool showGrid;
58 bool mResolved;
59 QString mWpsString;
60 QString mCurTarget;
61 static QString mTmpWpsString;
62
63 struct lib_t
64 {
65 QString target_name;
66 QString lib;
67 };
68 QMap<int, lib_t> libs_array;
69
70
71protected:
72 virtual void paintEvent(QPaintEvent * event);
73 virtual void closeEvent(QCloseEvent *event);
74 virtual void mouseReleaseEvent ( QMouseEvent * event ) ;
75 void drawBackdrop();
76 void newTempWps();
77 void cleanTemp(bool fileToo=true);
78 bool tryResolve();
79 QString getModelName(QString libraryName);
80public:
81 QWpsDrawer(QWpsState *ws,QTrackState *ms, QWidget *parent=0);
82 ~QWpsDrawer();
83 void WpsInit(QString buffer, bool isFile = true);
84
85 QString wpsString() const {
86 return mWpsString;
87 };
88 QString tempWps() const {
89 return mTmpWpsString;
90 };
91 QList<QString> getTargets();
92 bool setTarget(QString target);
93
94
95 static proxy_api api;
96 /***********Drawing api******************/
97 static void putsxy(int x, int y, const unsigned char *str);
98 static void transparent_bitmap_part(const void *src, int src_x, int src_y,
99 int stride, int x, int y, int width, int height);
100 static void bitmap_part(const void *src, int src_x, int src_y,
101 int stride, int x, int y, int width, int height);
102 static void drawpixel(int x, int y);
103 static void fillrect(int x, int y, int width, int height);
104 static void hline(int x1, int x2, int y);
105 static void vline(int x, int y1, int y2);
106 static void clear_viewport(int x,int y,int w,int h, int color);
107 static bool load_wps_backdrop(char* filename);
108 static int read_bmp_file(const char* filename,int *width, int *height);
109 /****************************************/
110public slots:
111 void slotSetVolume();
112 void slotSetProgress();
113 void slotShowGrid(bool);
114 void slotWpsStateChanged(wpsstate);
115 void slotTrackStateChanged(trackstate);
116 void slotSetAudioStatus(int);
117};
118#endif