X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fcontrollerwidget.h;h=2613486d9faf5de626b969a2e891d18afb57d52a;hb=d207b11e613703aff7d00191c4595b7359f29700;hp=09dae521924e098d2baff5e8590ec11e487a447b;hpb=4ad544a2887b4fa558c9e15bc3d23988bada7480;p=virtualjaguar diff --git a/src/gui/controllerwidget.h b/src/gui/controllerwidget.h index 09dae52..2613486 100644 --- a/src/gui/controllerwidget.h +++ b/src/gui/controllerwidget.h @@ -1,7 +1,8 @@ #ifndef __CONTROLLERWIDGET_H__ #define __CONTROLLERWIDGET_H__ -#include +#include +#include class ControllerWidget: public QWidget { @@ -10,8 +11,37 @@ class ControllerWidget: public QWidget public: ControllerWidget(QWidget * parent = 0); ~ControllerWidget(); + QSize sizeHint(void) const; + QSizePolicy sizePolicy(void) const; - //need paint, mousemove, mousedown, mouseup, etc + protected: + void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void leaveEvent(QEvent *); + + private: + void DrawBorderedText(QPainter &, int, int, QString); + + signals: + void KeyDefined(int, uint32_t); + + public: + uint32_t keys[21]; + + private: + QImage controllerPic; + QSize widgetSize; + int keyToHighlight; + bool mouseDown; + + // Class data + static char keyName1[96][16]; + static char keyName2[64][16]; + static char hatName[4][16]; + static char axisName[2][8]; + static int buttonPos[21][2]; }; #endif // __CONTROLLERWIDGET_H__