20 #include "pedigree/native/graphics/Graphics.h" 21 #include "pedigree/native/types.h" 38 std::cout <<
"uitest: rendering widget." << std::endl;
40 void *pFramebuffer = getRawFramebuffer();
41 uint32_t *buffer = (uint32_t *) pFramebuffer;
42 for (
size_t y = 0; y < rt.getH(); ++y)
44 for (
size_t x = 0; x < rt.getW(); ++x)
45 buffer[y * rt.getW() + x] = m_Rgb;
48 dirty.update(0, 0, rt.getW(), rt.getH());
57 volatile bool bRun =
true;
59 bool callback(WidgetMessages message,
size_t msgSize,
const void *msgData)
61 std::cout <<
"uitest: callback for '" <<
static_cast<int>(message) <<
"'." 64 if (message == Terminate)
72 int main(
int argc,
char *argv[])
74 std::cout <<
"uitest: starting up" << std::endl;
76 Rect rt(20, 20, 20, 20);
79 if (!pWidgetA->
construct(
"uitest.A",
"UI Test A", callback, rt))
81 std::cerr <<
"uitest: widget A construction failed" << std::endl;
87 if (!pWidgetB->
construct(
"uitest.B",
"UI Test B", callback, rt))
89 std::cerr <<
"uitest: widget B construction failed" << std::endl;
95 std::cout <<
"uitest: widgets created (handles are " 102 std::cout <<
"Widgets are visible!" << std::endl;
105 pWidgetA->
render(rt, dirtyA);
106 pWidgetB->
render(rt, dirtyB);