diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2003-04-19 13:15:33 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2003-04-19 13:15:33 +0000 |
commit | c6fb565dd98d2da0cd5ba0e29b73c49617edcb9c (patch) | |
tree | 44ab870d30d5f5872a4bb35d49936185296616e3 /uisimulator/win32/uisw32.c | |
parent | 6d522179dcbba409768a02845237967f39264e85 (diff) | |
download | rockbox-c6fb565dd98d2da0cd5ba0e29b73c49617edcb9c.tar.gz rockbox-c6fb565dd98d2da0cd5ba0e29b73c49617edcb9c.zip |
most of UI sim patch 708460 from Magnus Holmgren, except the bitmap removal
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3571 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/win32/uisw32.c')
-rw-r--r-- | uisimulator/win32/uisw32.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/uisimulator/win32/uisw32.c b/uisimulator/win32/uisw32.c index b4747b138e..3cfa3aed7c 100644 --- a/uisimulator/win32/uisw32.c +++ b/uisimulator/win32/uisw32.c | |||
@@ -34,6 +34,8 @@ | |||
34 | extern void app_main (void *); // mod entry point | 34 | extern void app_main (void *); // mod entry point |
35 | extern void new_key(int key); | 35 | extern void new_key(int key); |
36 | 36 | ||
37 | void button_event(int key, bool pressed); | ||
38 | |||
37 | // variables | 39 | // variables |
38 | HWND hGUIWnd; // the GUI window handle | 40 | HWND hGUIWnd; // the GUI window handle |
39 | unsigned int uThreadID; // id of mod thread | 41 | unsigned int uThreadID; // id of mod thread |
@@ -172,7 +174,7 @@ LRESULT GUIWndProc ( | |||
172 | RECT r; | 174 | RECT r; |
173 | 175 | ||
174 | GetClientRect (hWnd, &r); | 176 | GetClientRect (hWnd, &r); |
175 | // blit to screen | 177 | // blit background image to screen |
176 | StretchBlt (hDc, 0, 0, r.right, r.bottom, | 178 | StretchBlt (hDc, 0, 0, r.right, r.bottom, |
177 | hMemDc, 0, 0, UI_WIDTH, UI_HEIGHT, SRCCOPY); | 179 | hMemDc, 0, 0, UI_WIDTH, UI_HEIGHT, SRCCOPY); |
178 | EndPaint (hWnd, &ps); | 180 | EndPaint (hWnd, &ps); |
@@ -187,8 +189,10 @@ LRESULT GUIWndProc ( | |||
187 | GetClientRect (hWnd, &r); | 189 | GetClientRect (hWnd, &r); |
188 | // draw lcd screen | 190 | // draw lcd screen |
189 | StretchDIBits (hDc, | 191 | StretchDIBits (hDc, |
190 | UI_LCD_POSX * r.right / UI_WIDTH, UI_LCD_POSY * r.bottom / UI_HEIGHT, | 192 | UI_LCD_POSX * r.right / UI_WIDTH, |
191 | LCD_WIDTH * r.right / UI_WIDTH, LCD_HEIGHT * r.bottom / UI_HEIGHT, | 193 | UI_LCD_POSY * r.bottom / UI_HEIGHT, |
194 | UI_LCD_WIDTH * r.right / UI_WIDTH, | ||
195 | UI_LCD_HEIGHT * r.bottom / UI_HEIGHT, | ||
192 | 0, 0, LCD_WIDTH, LCD_HEIGHT, | 196 | 0, 0, LCD_WIDTH, LCD_HEIGHT, |
193 | bitmap, (BITMAPINFO *) &bmi, DIB_RGB_COLORS, SRCCOPY); | 197 | bitmap, (BITMAPINFO *) &bmi, DIB_RGB_COLORS, SRCCOPY); |
194 | 198 | ||
@@ -206,6 +210,12 @@ LRESULT GUIWndProc ( | |||
206 | hGUIWnd = NULL; | 210 | hGUIWnd = NULL; |
207 | PostQuitMessage (0); | 211 | PostQuitMessage (0); |
208 | break; | 212 | break; |
213 | case WM_KEYDOWN: | ||
214 | button_event(wParam, true); | ||
215 | break; | ||
216 | case WM_KEYUP: | ||
217 | button_event(wParam, false); | ||
218 | break; | ||
209 | } | 219 | } |
210 | 220 | ||
211 | return DefWindowProc (hWnd, uMsg, wParam, lParam); | 221 | return DefWindowProc (hWnd, uMsg, wParam, lParam); |