2
SDL - Simple DirectMedia Layer
3
Copyright (C) 1997-2006 Sam Lantinga
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Lesser General Public License for more details.
15
You should have received a copy of the GNU Lesser General Public
16
License along with this library; if not, write to the Free Software
17
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
#include "SDL_config.h"
33
#include <qdirectpainter_qws.h>
35
#include "SDL_events.h"
38
#include "../../events/SDL_events_c.h"
42
SDL_QT_NO_ROTATION = 0,
47
extern screenRotationT screenRotation;
49
class SDL_QWin : public QWidget
51
void QueueKey(QKeyEvent *e, int pressed);
53
SDL_QWin(const QSize& size);
55
virtual bool shown(void) {
58
/* If called, the next resize event will not be forwarded to SDL. */
59
virtual void inhibitResize(void) {
60
my_inhibit_resize = true;
62
void setImage(QImage *image);
63
void setOffset(int x, int y) {
64
my_offset = QPoint(x, y);
66
void GetXYOffset(int &x, int &y) {
70
QImage *image(void) { return my_image; }
72
void setWFlags(WFlags flags) {
73
QWidget::setWFlags(flags);
76
const QPoint& mousePos() const { return my_mouse_pos; }
77
void setMousePos(const QPoint& newpos);
78
void setFullscreen(bool);
80
bool lockScreen(bool force=false);
82
void repaintRect(const QRect& rect);
84
/* Handle resizing of the window */
85
virtual void resizeEvent(QResizeEvent *e);
86
void focusInEvent(QFocusEvent *);
87
void focusOutEvent(QFocusEvent *);
88
void closeEvent(QCloseEvent *e);
89
void mouseMoveEvent(QMouseEvent *e);
90
void mousePressEvent(QMouseEvent *e);
91
void mouseReleaseEvent(QMouseEvent *e);
92
void paintEvent(QPaintEvent *ev);
93
void keyPressEvent(QKeyEvent *e) { QueueKey(e, 1); }
94
void keyReleaseEvent(QKeyEvent *e) { QueueKey(e, 0); }
96
bool repaintRotation0(const QRect& rect);
97
bool repaintRotation1(const QRect& rect);
98
bool repaintRotation3(const QRect& rect);
99
void enableFullscreen();
100
QDirectPainter *my_painter;
102
bool my_inhibit_resize;
106
WFlags my_has_fullscreen;
107
unsigned int my_locked;
110
#endif /* _SDL_QWin_h */