.developing rainbow: Framebuffer GUI backend

git-svn-id: svn://ultimatepp.org/upp/trunk@3544 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-06-17 19:55:53 +00:00
commit 60c6d288dc
40 changed files with 358 additions and 107 deletions

59
rainbow/WinFb/Win.cpp Normal file
View file

@ -0,0 +1,59 @@
#include "WinFb.h"
NAMESPACE_UPP
HWND fbHWND;
bool fbEndSession;
bool FBEndSession()
{
return fbEndSession;
}
bool FBIsWaitingEvent()
{
MSG msg;
return PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
}
bool FBProcessEvent(bool *quit)
{
MSG msg;
if(PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) {
if(msg.message == WM_QUIT && quit)
*quit = true;
DispatchMessageW(&msg);
return true;
}
return false;
}
void FBSleep(int ms)
{
MsgWaitForMultipleObjects(0, NULL, FALSE, ms, QS_ALLINPUT);
}
void FBInit(HINSTANCE hInstance)
{
GuiLock __;
Ctrl::InitFB();
WNDCLASSW wc;
Zero(wc);
wc.style = CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC)fbWindowProc;
wc.hInstance = hInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)NULL;
wc.lpszClassName = L"UPP-FB-CLASS";
RegisterClassW(&wc);
fbHWND = CreateWindowW(L"UPP-FB-CLASS", L"", WS_OVERLAPPED,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL);
SetTimer(fbHWND, 1, 10, NULL);
// Csizeinit();
}
END_UPP_NAMESPACE