blob: 11b700fc5bc2f5a20ee910eecd1ea6cacc4a1866 [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001// fill.cpp - GUIFill object
2
3#include <stdarg.h>
4#include <stdio.h>
5#include <stdlib.h>
6#include <string.h>
7#include <fcntl.h>
8#include <sys/reboot.h>
9#include <sys/stat.h>
10#include <sys/time.h>
11#include <sys/mman.h>
12#include <sys/types.h>
13#include <sys/ioctl.h>
14#include <time.h>
15#include <unistd.h>
16#include <stdlib.h>
17
18#include <string>
19
20extern "C" {
21#include "../common.h"
22#include "../minuitwrp/minui.h"
23#include "../recovery_ui.h"
24}
25
26#include "rapidxml.hpp"
27#include "objects.hpp"
28
29GUIFill::GUIFill(xml_node<>* node)
30{
31 xml_attribute<>* attr;
32 xml_node<>* child;
33
34 if (!node)
35 return;
36
37 attr = node->first_attribute("color");
Dees_Troya13d74f2013-03-24 08:54:55 -050038 if (!attr) {
39 LOGE("No color specified for fill\n");
Dees_Troy51a0e822012-09-05 15:24:24 -040040 return;
Dees_Troya13d74f2013-03-24 08:54:55 -050041 }
Dees_Troy51a0e822012-09-05 15:24:24 -040042
43 std::string color = attr->value();
44 ConvertStrToColor(color, &mColor);
45
46 // Load the placement
47 LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH);
48
49 return;
50}
51
52int GUIFill::Render(void)
53{
54 gr_color(mColor.red, mColor.green, mColor.blue, mColor.alpha);
55 gr_fill(mRenderX, mRenderY, mRenderW, mRenderH);
56 return 0;
57}
58