From d3d4804c34ebb93895df66ea6bc7a5e100fca8df Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 22 Jul 2011 20:29:07 +0000 Subject: [PATCH] .developing rainbow git-svn-id: svn://ultimatepp.org/upp/trunk@3704 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- rainbow/Framebuffer/DnD.cpp | 31 +++---------------------------- rainbow/Framebuffer/Wnd.cpp | 6 +++--- rainbow/Paint/Draw.cpp | 1 - 3 files changed, 6 insertions(+), 32 deletions(-) diff --git a/rainbow/Framebuffer/DnD.cpp b/rainbow/Framebuffer/DnD.cpp index c684f2974..61aa2d953 100644 --- a/rainbow/Framebuffer/DnD.cpp +++ b/rainbow/Framebuffer/DnD.cpp @@ -4,7 +4,7 @@ NAMESPACE_UPP -#define LLOG(x) DLOG(x) +#define LLOG(x) // DLOG(x) // -------------------------------------------------------------------------------------------- @@ -38,7 +38,6 @@ Ptr dndloop; bool PasteClip::IsAvailable(const char *fmt) const { - DDUMP(fmt); GuiLock __; return dnd ? dndloop && FindIndex(dndloop->fmts, fmt) >= 0 : IsClipboardAvailable(fmt); @@ -76,7 +75,7 @@ void DnDLoop::DnD(bool paste) d.action = GetCtrl() ? DND_COPY : DND_MOVE; d.dnd = true; if(target) - target->DnD(GetMousePos() - target->GetScreenRect().TopLeft(), d); + target->DnD(GetMousePos(), d); action = d.IsAccepted() ? d.GetAction() : DND_NONE; } @@ -97,30 +96,6 @@ void DnDLoop::LeftUp(Point, dword) GuiLock __; LLOG("DnDLoop::LeftUp"); DnD(true); -/* if(target) { - LLOG("Sending XdndDrop to " << target); - XEvent e = ClientMsg(target, XdndDrop); - e.xclient.data.l[0] = src; - e.xclient.data.l[1] = 0; - e.xclient.data.l[2] = Xeventtime; - Xdnd_waiting_finished = true; - XSendEvent(Xdisplay, target, XFalse, 0, &e); - XFlush(Xdisplay); - int timeout = GetTickCount(); - LLOG("Waiting for XdndFinished"); - while(Xdnd_waiting_finished && GetTickCount() - timeout < 200) { - GuiSleep(0); - ProcessEvents(); - } - LLOG("Waiting finished " << GetTickCount() - timeout << "ms"); - if(Xdnd_waiting_status) { - LLOG("XdndFinished timeout"); - Xdnd_status = DND_NONE; - Xdnd_waiting_finished = false; - } - else - LLOG("XdndFinished recieved"); - }*/ EndLoop(); } @@ -150,7 +125,7 @@ int Ctrl::DoDragAndDrop(const char *fmts, const Image& sample, dword actions, { GuiLock __; DnDLoop d; - d.actions = actions; + d.actions = (byte)actions; d.reject = actions & DND_EXACTIMAGE ? CtrlCoreImg::DndNone() : MakeDragImage(CtrlCoreImg::DndNone(), sample); if(actions & DND_COPY) d.copy = actions & DND_EXACTIMAGE ? sample : MakeDragImage(CtrlCoreImg::DndCopy(), sample); diff --git a/rainbow/Framebuffer/Wnd.cpp b/rainbow/Framebuffer/Wnd.cpp index afb024139..677ee73be 100644 --- a/rainbow/Framebuffer/Wnd.cpp +++ b/rainbow/Framebuffer/Wnd.cpp @@ -4,9 +4,9 @@ NAMESPACE_UPP -#define LLOG(x) DLOG(x) -#define LDUMP(x) DDUMP(x) -#define LDUMPC(x) DDUMPC(x) +#define LLOG(x) //DLOG(x) +#define LDUMP(x) //DDUMP(x) +#define LDUMPC(x) //DDUMPC(x) ImageBuffer Ctrl::framebuffer; Vector Ctrl::invalid; diff --git a/rainbow/Paint/Draw.cpp b/rainbow/Paint/Draw.cpp index ad34f9dd8..bf5eb2ff7 100644 --- a/rainbow/Paint/Draw.cpp +++ b/rainbow/Paint/Draw.cpp @@ -16,7 +16,6 @@ struct App : public Ctrl { void Paint(Draw& w) { Size sz = GetSize(); - DDUMP(sz); w.DrawRect(0, 0, sz.cx, sz.cy, SWhite); w.DrawRect(10, 10, 30, 30, SRed); w.DrawLine(45, 45, 80, 120, 4, Blue);