comparison src/video/qtopia/SDL_QWin.h @ 567:969fbd4dcd4e

From: David Hedbor Subject: Qtopia patches (input grabbing and iconify) Ok, here's a patch that adds support for SDL_WM_GrabInput (default state is "ungrabbed") and SDL_WM_IconifyWindow. Also has some other tweaks such as taking additional steps to clean up when exiting (bypassing certain bugs in some versions of Qtopia and/or OPIE) and it also maps Key_F33 to Key_Return (this is the Zaurus 'ok' key).
author Sam Lantinga <slouken@libsdl.org>
date Mon, 20 Jan 2003 01:08:20 +0000
parents c96e2137f9eb
children b8d311d90021
comparison
equal deleted inserted replaced
566:d6e7d7006062 567:969fbd4dcd4e
68 } 68 }
69 void GetXYOffset(int &x, int &y) { 69 void GetXYOffset(int &x, int &y) {
70 x = my_offset.x(); 70 x = my_offset.x();
71 y = my_offset.y(); 71 y = my_offset.y();
72 } 72 }
73 bool beginDraw(void) { 73 QImage *image(void) { return my_image; }
74 return true;
75 }
76 void endDraw(void) {
77 }
78 QImage *image(void) {
79 return my_image;
80 }
81 74
82 void setWFlags(WFlags flags) { 75 void setWFlags(WFlags flags) {
83 QWidget::setWFlags(flags); 76 QWidget::setWFlags(flags);
84 my_flags = flags; 77 my_flags = flags;
85 } 78 }
86 const QPoint& mousePos() const { return my_mouse_pos; } 79 const QPoint& mousePos() const { return my_mouse_pos; }
87 void setMousePos(const QPoint& newpos); 80 void setMousePos(const QPoint& newpos);
88 void setFullscreen(bool); 81 void setFullscreen(bool);
89 82
90 void lockScreen() { 83 bool lockScreen(bool force=false);
91 if(!my_painter) { 84 void unlockScreen();
92 my_painter = new QDirectPainter(this);
93 }
94 my_locked++; // Increate lock refcount
95 }
96 void unlockScreen() {
97 if(my_locked > 0) {
98 my_locked--; // decrease lock refcount;
99 }
100 if(!my_locked && my_painter) {
101 my_painter->end();
102 delete my_painter;
103 my_painter = 0;
104 }
105 }
106 void repaintRect(const QRect& rect); 85 void repaintRect(const QRect& rect);
107 protected: 86 protected:
108 /* Handle resizing of the window */ 87 /* Handle resizing of the window */
109 virtual void resizeEvent(QResizeEvent *e); 88 virtual void resizeEvent(QResizeEvent *e);
110 void focusInEvent(QFocusEvent *); 89 void focusInEvent(QFocusEvent *);
112 void closeEvent(QCloseEvent *e); 91 void closeEvent(QCloseEvent *e);
113 void mouseMoveEvent(QMouseEvent *e); 92 void mouseMoveEvent(QMouseEvent *e);
114 void mousePressEvent(QMouseEvent *e); 93 void mousePressEvent(QMouseEvent *e);
115 void mouseReleaseEvent(QMouseEvent *e); 94 void mouseReleaseEvent(QMouseEvent *e);
116 void paintEvent(QPaintEvent *ev); 95 void paintEvent(QPaintEvent *ev);
117 void keyPressEvent(QKeyEvent *e) { 96 void keyPressEvent(QKeyEvent *e) { QueueKey(e, 1); }
118 QueueKey(e, 1); 97 void keyReleaseEvent(QKeyEvent *e) { QueueKey(e, 0); }
119 }
120 void keyReleaseEvent(QKeyEvent *e) {
121 QueueKey(e, 0);
122 }
123 private: 98 private:
99 bool repaintRotation0(const QRect& rect);
100 bool repaintRotation1(const QRect& rect);
101 bool repaintRotation3(const QRect& rect);
124 void enableFullscreen(); 102 void enableFullscreen();
125 QDirectPainter *my_painter; 103 QDirectPainter *my_painter;
126 QImage *my_image; 104 QImage *my_image;
127 bool my_inhibit_resize; 105 bool my_inhibit_resize;
128 QPoint my_offset; 106 QPoint my_offset;