mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
.developing fb backend
git-svn-id: svn://ultimatepp.org/upp/trunk@3568 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7929ad78dc
commit
1b438f125c
8 changed files with 83 additions and 58 deletions
|
|
@ -35,5 +35,5 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nCmdSh
|
|||
void GuiMainFn_()
|
||||
#endif
|
||||
|
||||
void SetDesktop(Ctrl& desktop);
|
||||
extern Ctrl *desktop;
|
||||
void SetDesktop(Ctrl& desktop);
|
||||
Ctrl *GetDesktop();
|
||||
|
|
|
|||
|
|
@ -10,10 +10,6 @@ void Ctrl::GuiPlatformConstruct()
|
|||
{
|
||||
}
|
||||
|
||||
void Ctrl::GuiPlatformDestruct()
|
||||
{
|
||||
}
|
||||
|
||||
void Ctrl::GuiPlatformRemove()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
public:
|
||||
static void InitFB();
|
||||
static void DoMouseFB(int event, Point p, int zdelta = 0);
|
||||
static bool DoKeyFB(dword key, int cnt);
|
||||
|
||||
void SetOpen(bool b) { isopen = b; }
|
||||
void SetTop() { top = new Top; }
|
||||
|
|
|
|||
|
|
@ -2,20 +2,45 @@
|
|||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) LOG(x)
|
||||
|
||||
static Point fbmousepos;
|
||||
|
||||
Point GetMousePos() {
|
||||
return fbmousepos;
|
||||
}
|
||||
|
||||
void Ctrl::DoMouseFB(int event, Point p, int zdelta)
|
||||
{
|
||||
fbmousepos = p;
|
||||
int a = event & Ctrl::ACTION;
|
||||
// if(a == DOWN)
|
||||
// ClickActivateWnd();
|
||||
if(a == Ctrl::UP && Ctrl::ignoreclick)
|
||||
if(a == Ctrl::UP && Ctrl::ignoreclick) {
|
||||
EndIgnore();
|
||||
return;
|
||||
}
|
||||
else
|
||||
if(a != Ctrl::DOWN || !ignoreclick)
|
||||
LOG("Mouse " << p << ' ' << zdelta);
|
||||
desktop->DispatchMouse(event, p, zdelta);
|
||||
desktop->PostInput();
|
||||
if(a == Ctrl::DOWN && ignoreclick)
|
||||
return;
|
||||
LLOG("Mouse event: " << event << " position " << p << " zdelta " << zdelta);
|
||||
Ctrl *desktop = GetDesktop();
|
||||
if(desktop) {
|
||||
desktop->DispatchMouse(event, p, zdelta);
|
||||
desktop->PostInput();
|
||||
}
|
||||
// if(a == Ctrl::MOUSEMOVE)
|
||||
// DoCursorShape();
|
||||
}
|
||||
|
||||
bool Ctrl::DoKeyFB(dword key, int cnt)
|
||||
{
|
||||
bool b = DispatchKey(key, cnt);
|
||||
SyncCaret();
|
||||
Ctrl *desktop = GetDesktop();
|
||||
if(desktop)
|
||||
desktop->PostInput();
|
||||
return b;
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ NAMESPACE_UPP
|
|||
|
||||
#define LLOG(x)
|
||||
|
||||
Ctrl *desktop;
|
||||
Ptr<Ctrl> desktop;
|
||||
ImageBuffer framebuffer;
|
||||
Vector<Rect> invalid;
|
||||
|
||||
|
|
@ -19,6 +19,11 @@ void SetDesktop(Ctrl& q)
|
|||
invalid.Add(framebuffer.GetSize());
|
||||
}
|
||||
|
||||
Ctrl *GetDesktop()
|
||||
{
|
||||
return desktop;
|
||||
}
|
||||
|
||||
void Ctrl::InitFB()
|
||||
{
|
||||
Ctrl::GlobalBackBuffer();
|
||||
|
|
@ -26,7 +31,6 @@ void Ctrl::InitFB()
|
|||
framebuffer.Create(1000, 1000);
|
||||
}
|
||||
|
||||
|
||||
bool Ctrl::IsAlphaSupported()
|
||||
{
|
||||
return false;
|
||||
|
|
@ -40,7 +44,8 @@ bool Ctrl::IsCompositedGui()
|
|||
Vector<Ctrl *> Ctrl::GetTopCtrls()
|
||||
{
|
||||
Vector<Ctrl *> ctrl;
|
||||
ctrl.Add(desktop);
|
||||
if(desktop)
|
||||
ctrl.Add(desktop);
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
|
|
@ -292,32 +297,33 @@ void Ctrl::WndEnable0(bool *b)
|
|||
void Ctrl::SetWndFocus0(bool *b)
|
||||
{
|
||||
GuiLock __;
|
||||
*b = true;
|
||||
}
|
||||
|
||||
bool Ctrl::HasWndFocus() const
|
||||
{
|
||||
GuiLock __;
|
||||
return false;
|
||||
return focusCtrl && focusCtrl->GetTopCtrl() == this;
|
||||
}
|
||||
|
||||
bool Ctrl::SetWndCapture()
|
||||
{
|
||||
GuiLock __;
|
||||
ASSERT(IsMainThread());
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Ctrl::ReleaseWndCapture()
|
||||
{
|
||||
GuiLock __;
|
||||
ASSERT(IsMainThread());
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Ctrl::HasWndCapture() const
|
||||
{
|
||||
GuiLock __;
|
||||
return false;
|
||||
return captureCtrl && captureCtrl->GetTopCtrl() == this;
|
||||
}
|
||||
|
||||
void Ctrl::WndInvalidateRect0(const Rect& r)
|
||||
|
|
|
|||
Loading…
Reference in a new issue