10 #include <ggraphics.hpp>
23 class GRenderGraphics :
public GGraphics {
25 GRenderGraphics(GWindow&);
26 bool setClipRect(Gadget&);
27 GRect area_, cliprect_;
35 DrawNone = 0, DrawBackground = 1<<0, DrawBorder = 1<<1, DrawText = 1<<2,
37 DrawAll = (DrawBackground | DrawBorder | DrawText | AddMargin)
41 StyleNode() : level_(0), style_(nullptr) {}
42 StyleNode(
int level, GStyle* style) : level_(level), style_(style) {}
49 GRender(Gadget&, GRender* parent_render);
50 GRender(
const Gadget&) =
delete;
52 GRender& operator=(GRender
const&);
54 Gadget& gadget() {
return *obj_;}
55 void print(std::ostream& out);
57 void addCombinator(GStyle*);
58 void applyStyles(Gadget*, GStyle& class_style );
59 void applyInStyles(StyleNode& asc_style, Gadget*, GStyle& desc_style );
61 bool paintGadget(GRenderGraphics&,
int options);
62 void paintPieBackground(GRenderGraphics&);
63 void paintBox(GRenderGraphics&, GBox&);
64 void drawText(GRenderGraphics&,
float offest);
65 void drawHotkey(GRenderGraphics&);
66 void drawIcon(GRenderGraphics&);
67 void drawCaret(GRenderGraphics&, GString
const& text,
68 class GFontValue
const&, GTextAttributes
const*,
69 size_t begline, ssize_t caretpos,
bool richtext,
70 float x,
float y,
float h);
71 void setAutoColor(GRenderGraphics&);
72 void setTextAutoColor(GRenderGraphics&);
73 void setTextAutoColor(GRenderGraphics&,
float pos,
float offset);
74 static bool formatText(
class GFormatValue
const&, GString
const& from, GString& to);
79 size_t own_inscount_{}, child_inscount_{};
80 std::vector<StyleNode>* instyles_{};
81 GString
const* text_{};
82 GString
const* tip_{};
83 GString
const* hotkey_{};
93 class GFormatValue* format_{};
94 class GRgba const* color_{};
95 class GRgba const* background_{};
96 class GIconValue* icon_{};
97 class GMarginValue* margin_{};
98 class GBorderValue* border_{};