mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-26 22:03:35 -06:00
.reference: Rainbow example (RM #158)
git-svn-id: svn://ultimatepp.org/upp/trunk@4176 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
452430a587
commit
1bd36aa9cc
43 changed files with 4961 additions and 0 deletions
105
reference/Framebuffer/Draw.cpp
Normal file
105
reference/Framebuffer/Draw.cpp
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_FB
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
#define LTIMING(x) // RTIMING(x)
|
||||
|
||||
SystemDraw::SystemDraw()
|
||||
: BufferPainter(Ctrl::framebuffer, Ctrl::renderingMode)
|
||||
{
|
||||
}
|
||||
|
||||
SystemDraw::~SystemDraw()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void SystemDraw::Push()
|
||||
{
|
||||
Point p = GetOffset();
|
||||
offset.Add(p);
|
||||
BufferPainter::BeginOp();
|
||||
}
|
||||
|
||||
void SystemDraw::Pop()
|
||||
{
|
||||
if(offset.GetCount())
|
||||
offset.Drop();
|
||||
BufferPainter::EndOp();
|
||||
}
|
||||
|
||||
Point SystemDraw::GetOffset() const
|
||||
{
|
||||
return offset.GetCount() ? offset.Top() : Point(0, 0);
|
||||
}
|
||||
|
||||
void SystemDraw::BeginOp()
|
||||
{
|
||||
Push();
|
||||
}
|
||||
|
||||
void SystemDraw::EndOp()
|
||||
{
|
||||
Pop();
|
||||
}
|
||||
|
||||
void SystemDraw::OffsetOp(Point p)
|
||||
{
|
||||
Push();
|
||||
offset.Top() += p;
|
||||
Translate(p.x, p.y);
|
||||
}
|
||||
|
||||
bool SystemDraw::ClipOp(const Rect& r)
|
||||
{
|
||||
Push();
|
||||
RectPath(r);
|
||||
Painter::Clip();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SystemDraw::ClipoffOp(const Rect& r)
|
||||
{
|
||||
Push();
|
||||
offset.Top() += r.TopLeft();
|
||||
RectPath(r);
|
||||
Painter::Clip();
|
||||
Translate(r.left, r.top);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SystemDraw::IsPaintingOp(const Rect& r) const
|
||||
{
|
||||
Rect rr = r + GetOffset();
|
||||
for(int i = 0; i < Ctrl::invalid.GetCount(); i++)
|
||||
if(Ctrl::invalid[i].Intersects(rr))
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*Rect SystemDraw::GetVirtualScreenArea()
|
||||
{
|
||||
GuiLock __;
|
||||
}*/
|
||||
|
||||
/*
|
||||
void BackDraw::Destroy()
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void BackDraw::Create(SystemDraw& w, int cx, int cy) {
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void BackDraw::Put(SystemDraw& w, int x, int y) {
|
||||
GuiLock __;
|
||||
}
|
||||
*/
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue