X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fcanvas%2FCanvas.hxx;h=2c817f61bcbf98fe17805b505847204df1d41f7f;hb=36cb7a752b5d86d636aebd2379773923e0cbed1a;hp=10872f22d7f0574e35066cb9ec96257ebb7d2955;hpb=0b21181f1ae64f637faf3546556db43f8708e0b8;p=simgear.git diff --git a/simgear/canvas/Canvas.hxx b/simgear/canvas/Canvas.hxx index 10872f22..2c817f61 100644 --- a/simgear/canvas/Canvas.hxx +++ b/simgear/canvas/Canvas.hxx @@ -23,9 +23,12 @@ #include "ODGauge.hxx" #include +#include #include +#include #include #include + #include #include @@ -41,16 +44,19 @@ namespace canvas class MouseEvent; class Canvas: - public PropertyBasedElement + public PropertyBasedElement, + public nasal::Object { public: enum StatusFlags { STATUS_OK, - STATUS_DIRTY = 1, - MISSING_SIZE_X = STATUS_DIRTY << 1, + STATUS_DIRTY = 1, + LAYOUT_DIRTY = STATUS_DIRTY << 1, + MISSING_SIZE_X = LAYOUT_DIRTY << 1, MISSING_SIZE_Y = MISSING_SIZE_X << 1, + MISSING_SIZE = MISSING_SIZE_X | MISSING_SIZE_Y, CREATE_FAILED = MISSING_SIZE_Y << 1 }; @@ -121,6 +127,12 @@ namespace canvas */ GroupPtr getRootGroup(); + /** + * Set the layout of the canvas (the layout will automatically update with + * the viewport size of the canvas) + */ + void setLayout(const LayoutRef& layout); + /** * Enable rendering for the next frame * @@ -195,7 +207,9 @@ namespace canvas _visible; ODGauge _texture; - GroupPtr _root_group; + + GroupPtr _root_group; + LayoutRef _layout; CullCallbackPtr _cull_callback; bool _render_always; //