12 #include <ggraphics.hpp>
15 class GShape :
public Gadget {
17 friend GadgetType_<GShape,Gadget>;
18 GShape(GadgetType&, GString
const& css);
19 GShape(GString
const& css);
23 Gadget& clone(GClone
const&)
override;
25 GShape* toShape()
override {
return this;}
27 using Gadget::findProp;
28 GProp* findProp(GPropType&)
const override;
31 GProp& prop(GPropType&,
bool compute_style =
false)
override;
43 void move(
float x,
float y)
override;
44 void move(GPoint
const& p)
override {move(p.x, p.y);}
46 void resize(
float w,
float h)
override;
47 void resize(GDim
const&)
override;
49 using GType = GadgetType_<GShape,Gadget>;
51 GType& type()
const override {
return Type();}
57 void onAdd(GBox* parent)
override;
58 void addProp(GProp& prop,
bool add_to_list)
override;
75 GType& type()
const override {
return Type();}
79 void doPaint(GRenderGraphics&, GRender* parent_render)
override;
84 GRectShape& RectShape(GString
const& title =
"");
99 GType& type()
const override {
return Type();}
103 void doPaint(GRenderGraphics&, GRender* parent_render)
override;
110 GOvalShape& OvalShape(GString
const& title =
"");
126 float extent()
const;
129 GFloat& extentProp() {
return *extent_;}
132 static GType& Type();
133 GType& type()
const override {
return Type();}
138 void doPaint(GRenderGraphics&, GRender* parent_render)
override;
144 GArcShape& ArcShape(GString
const& title =
"");
174 void move(
float x,
float y)
override;
180 static GType& Type();
181 GType& type()
const override {
return Type();}
187 void addProp(
GProp& prop,
bool add_to_list)
override;
188 void doPaint(GRenderGraphics&, GRender* parent_render)
override;
190 void packPos(
float parentx,
float parenty)
override;
191 void moveImpl(
float x,
float y,
bool callcb)
override;
192 virtual void updateFrame();
193 GHandle handleDown(
GPoint const&
wpos,
bool inter)
override;
194 void handleDrag(
float dx,
float dy, GHandle
const&)
override;
195 void handleUp(
GPoint const&
wpos, GHandle
const&)
override;
197 void readAux(std::istream&,
class GIOBuffer&)
override;
198 void writeAux(std::ostream&,
class GIOBuffer&)
const override;
203 GLineShape& LineShape(GString
const& title =
"");
216 void addPoint(
float x,
float y) {addPoint(
GPoint(x, y));}
217 void addPoint(
GPoint const&);
219 void getPoints(
GPoints&)
const;
222 static GType& Type();
223 GType& type()
const override {
return Type();}
229 void packPos(
float parentx,
float parenty)
override;
230 void moveImpl(
float x,
float y,
bool callcb)
override;
231 GHandle handleDown(
GPoint const&
wpos,
bool inter)
override;
232 void handleDrag(
float dx,
float dy, GHandle
const&)
override;
233 void handleUp(
GPoint const&
wpos, GHandle
const&)
override;
234 void doPaint(GRenderGraphics&, GRender* parent_render)
override;
235 void readAux(std::istream&,
class GIOBuffer&)
override;
236 void writeAux(std::ostream&,
class GIOBuffer&)
const override;