#include <Area.h>
Inheritance diagram for Teddy::PhysicalComponents::Area:
Public Types | |
enum | e_ordering { pre_self, post_self, separate_self } |
Public Methods | |
Area () | |
Area (std::string &name) | |
Constructor. More... | |
Area (const std::string &name) | |
virtual | ~Area () |
Destructor. More... | |
virtual Area * | getHit (const Vector2 &pos) |
Area Input Interface - Get Hit Area, NULL if none. More... | |
virtual void | insert (Area *area) |
Area Layout interface - Insert Area to Layer. More... | |
virtual bool | remove (Area *area) |
Remove child from Area. More... | |
virtual void | setParent (Area *parent, View *view=NULL) |
Set parent Area. More... | |
Area * | getParent () |
Parent accessor. More... | |
View * | getView () const |
Return View of Area. More... | |
const Rect & | getRect () const |
const Vector2 & | getSize () const |
virtual void | draw () |
Draw area recursively - draw all areas in layer. More... | |
virtual void | drawSelf () |
Draw area - draw area self component. More... | |
virtual void | drawString (const Vector2 &pos, const char *str, Font *font) |
Area Graphics interface - Draw string - no formatting. More... | |
virtual void | drawRect (const float x1, const float y1, const float x2, const float y2) |
Area Graphics interface - Draw non-filled rectangle. More... | |
virtual void | drawFillRect (const float x1, const float y1, const float x2, const float y2) |
Area Graphics interface - Draw filled rectangle. More... | |
virtual void | drawBiColRect (const float x1, const float y1, const float x2, const float y2, const Color &top_left, const Color &bottom_right) |
Area Graphics interface - Draw twocolor rectangle. More... | |
virtual void | drawVertex (const float x1, const float y1) |
virtual const Vector2 & | doSize (const Vector2 &ref) |
virtual void | beginSize (const Vector2 &ref) |
virtual void | callSize (Area *a) |
virtual void | endSize () |
virtual const Vector2 & | doPlace (const Rect &ref) |
virtual void | beginPlace (const Rect &ref) |
virtual void | callPlace (Area *a) |
virtual void | endPlace () |
Static Public Methods | |
void | setDefaultWindowManager (WindowManager *wm) |
Public Attributes | |
Vector2 | offset_pixels |
offset in pixels. More... | |
Vector2 | offset_self_size_relative |
offset relative to self size. More... | |
Vector2 | offset_free_size_relative |
offset relative to remaining free size. More... | |
Vector2 | fill_base_pixels |
Vector2 | fill_free_size_relative |
Static Public Attributes | |
const unsigned long | CLIP_LAYOUT = (1L<<0L) |
Area::. More... | |
const unsigned long | CLIP_RENDERING = (1L<<1L) |
Area::. More... | |
const unsigned long | CLEAR = (1L<<2L) |
Projecti. More... | |
const unsigned long | PICK = (1L<<3L) |
Projecti. More... | |
const unsigned long | USE_OFFSET_SELF_SIZE_RELATIVE = (1L<<8L) |
const unsigned long | USE_OFFSET_FREE_SIZE_RELATIVE = (1L<<9L) |
const unsigned long | USE_FILL_MAX_PIXELS = (1L<<10L) |
const unsigned long | USE_FILL_FREE_SIZE_RELATIVE = (1L<<11L) |
const unsigned long | USE_CLIP_TO_REFERENCE = (1L<<12L) |
Protected Attributes | |
WindowManager * | window_manager |
Window manager. More... | |
Style * | style |
Style spesification object. More... | |
Area * | parent |
Parent Area hosting this Area. More... | |
list< Area * > | areas |
Child Areas. More... | |
e_ordering | drawing_ordering |
Draw before or after children? More... | |
e_ordering | event_ordering |
Consume event before or after children? More... | |
Vector2 | size |
Rect | rect |
Rect | in_rect |
Static Protected Attributes | |
WindowManager * | default_window_manager = NULL |
Area is the basic base class for all Physical Components.
Area provides a drawing context. Drawing is not currently clipped.
Area can contain subareas, thus areas can be hierarchial. When Area is drawn, all subareas are also drawn.
Area knows how to determine size and position for itself. This is called layout. The layout is determined through LayoutConstraints when place method is called.
setPos() and setSize() methods are protected low level methods; to actually set position or size of area you must use LayoutConstraint of that Area. At the moment it is public member, but that will change later.
Notice that you should use drawSelf() method for drawing in subclasses and leave draw() method as it is. The draw() method will take care of rendering children as well.
Area can also be interactive such that they can be operated with input device. Area is not interactive by default. To make Area interactive, it must be registered (as potential focus area) to WindowManager. See WindowManager for details on this.
Visual Area properties link font, color and size should be stored in Style.
Definition at line 89 of file Area.h.
|
|
|
Definition at line 108 of file Area.cpp. References default_window_manager, drawing_ordering, event_ordering, fill_base_pixels, fill_free_size_relative, offset_free_size_relative, offset_pixels, offset_self_size_relative, parent, post_self, pre_self, style, Vector2, and window_manager. Referenced by Area, draw, Teddy::PhysicalComponents::Layer::drawLayer, Teddy::PhysicalComponents::Layer::getHit, and getHit. |
|
Constructor.
Definition at line 66 of file Area.cpp. References Area, default_window_manager, drawing_ordering, event_ordering, fill_base_pixels, fill_free_size_relative, Teddy::MixIn::Named::Named, offset_free_size_relative, offset_pixels, offset_self_size_relative, parent, post_self, pre_self, style, Vector2, and window_manager. |
|
Definition at line 89 of file Area.cpp. References default_window_manager, drawing_ordering, event_ordering, fill_base_pixels, fill_free_size_relative, offset_free_size_relative, offset_pixels, offset_self_size_relative, parent, post_self, pre_self, style, Vector2, and window_manager. |
|
Destructor.
|
|
Reimplemented in Teddy::PhysicalComponents::Dock. Definition at line 89 of file AreaLayout.cpp. References Teddy::SysSupport::dmsg, in_rect, Teddy::MixIn::Options::isEnabled, Teddy::SysSupport::M_WML, offset_free_size_relative, offset_pixels, offset_self_size_relative, rect, size, and style. Referenced by doPlace. |
|
Reimplemented in Teddy::PhysicalComponents::Dock. Definition at line 54 of file AreaLayout.cpp. References Teddy::SysSupport::dmsg, fill_base_pixels, fill_free_size_relative, Teddy::SysSupport::M_WML, and size. Referenced by doSize. |
|
Reimplemented in Teddy::PhysicalComponents::Dock. Definition at line 105 of file AreaLayout.cpp. References Teddy::SysSupport::dmsg, Teddy::SysSupport::M_WML, and rect. Referenced by doPlace. |
|
Reimplemented in Teddy::PhysicalComponents::Dock. Definition at line 64 of file AreaLayout.cpp. References Teddy::SysSupport::dmsg, Teddy::SysSupport::M_WML, and size. Referenced by doSize. |
|
Definition at line 75 of file AreaLayout.cpp. References areas, beginPlace, callPlace, Teddy::SysSupport::dmsg, endPlace, Teddy::SysSupport::M_WML, and size. |
|
Definition at line 40 of file AreaLayout.cpp. References areas, beginSize, callSize, Teddy::SysSupport::dmsg, endSize, Teddy::SysSupport::M_WML, and size. |
|
Draw area recursively - draw all areas in layer.
Definition at line 44 of file AreaDraw.cpp. References Area, areas, Teddy::SysSupport::dmsg, drawing_ordering, drawSelf, Teddy::SysSupport::M_WM, Teddy::MixIn::Named::name, post_self, pre_self, and rect. |
|
Area Graphics interface - Draw twocolor rectangle.
Definition at line 97 of file AreaDraw.cpp. References rect, and Teddy::Graphics::ViewClient::view. Referenced by Teddy::PhysicalComponents::MenuList::drawSelf, Teddy::PhysicalComponents::Frame::drawSelf, and Teddy::PhysicalComponents::ActionButton::drawSelf. |
|
Area Graphics interface - Draw filled rectangle.
Definition at line 88 of file AreaDraw.cpp. References Teddy::MixIn::Named::getName, Teddy::SysSupport::M_GL, Teddy::SysSupport::msg, Teddy::MixIn::Named::name, rect, and Teddy::Graphics::ViewClient::view. Referenced by Teddy::PhysicalComponents::MenuList::drawSelf, and Teddy::PhysicalComponents::ActionButton::drawSelf. |
|
Area Graphics interface - Draw non-filled rectangle.
Definition at line 82 of file AreaDraw.cpp. References rect, and Teddy::Graphics::ViewClient::view. Referenced by Teddy::PhysicalComponents::Frame::drawSelf. |
|
Draw area - draw area self component.
Reimplemented in Teddy::PhysicalComponents::ActionButton. Definition at line 67 of file AreaDraw.cpp. Referenced by draw. |
|
Area Graphics interface - Draw string - no formatting.
Definition at line 103 of file AreaDraw.cpp. References rect, and Teddy::Graphics::ViewClient::view. Referenced by Teddy::PhysicalComponents::Label::drawSelf, Teddy::PhysicalComponents::Console::drawSelf, Teddy::PhysicalComponents::Button::drawSelf, and Teddy::PhysicalComponents::ActionButton::drawSelf. |
|
Definition at line 76 of file AreaDraw.cpp. References rect, and Teddy::Graphics::ViewClient::view. Referenced by Teddy::PhysicalComponents::GradientFill::drawSelf. |
|
Definition at line 111 of file AreaLayout.cpp. Referenced by doPlace. |
|
Reimplemented in Teddy::PhysicalComponents::Dock. Definition at line 70 of file AreaLayout.cpp. References Teddy::SysSupport::dmsg, Teddy::SysSupport::M_WML, and size. Referenced by doSize. |
|
Area Input Interface - Get Hit Area, NULL if none.
Reimplemented in Teddy::PhysicalComponents::Layer. Definition at line 133 of file Area.cpp. References Area, areas, Teddy::SysSupport::dmsg, event_ordering, Teddy::MixIn::Named::getName, Teddy::SysSupport::M_WME, Teddy::MixIn::Named::name, post_self, pre_self, and rect. |
|
Parent accessor.
Definition at line 193 of file Area.cpp. References parent. |
|
Definition at line 198 of file Area.cpp. References rect. |
|
Definition at line 203 of file Area.cpp. References size. |
|
Return View of Area.
Reimplemented from Teddy::Graphics::ViewClient. Definition at line 71 of file AreaDraw.cpp. References Teddy::Graphics::ViewClient::view. |
|
Area Layout interface - Insert Area to Layer.
Definition at line 209 of file Area.cpp. References areas, Teddy::SysSupport::dmsg, and Teddy::SysSupport::M_WM. Referenced by Teddy::PhysicalComponents::Layer::addProjection, Teddy::PhysicalComponents::Popup::close, Teddy::PhysicalComponents::Console::Console, Teddy::PhysicalComponents::Popup::open, and Teddy::PhysicalComponents::Popup::Popup. |
|
Remove child from Area.
Definition at line 220 of file Area.cpp. References areas, Teddy::SysSupport::dmsg, and Teddy::SysSupport::M_WM. Referenced by Teddy::PhysicalComponents::Popup::close, and Teddy::PhysicalComponents::Popup::open. |
|
|
|
Set parent Area.
Definition at line 177 of file Area.cpp. References areas, parent, Teddy::Graphics::ViewClient::setView, and Teddy::Graphics::ViewClient::view. |
|
Child Areas.
Definition at line 161 of file Area.h. Referenced by doPlace, doSize, draw, Teddy::PhysicalComponents::Layer::drawLayer, Teddy::PhysicalComponents::Layer::getHit, getHit, insert, Teddy::PhysicalComponents::Layer::place, remove, and setParent. |
|
Projecti.
|
|
Area::.
|
|
Area::.
|
|
Definition at line 57 of file Area.cpp. Referenced by Area. |
|
Draw before or after children?
Definition at line 162 of file Area.h. Referenced by Teddy::PhysicalComponents::ActionButton::ActionButton, Area, Teddy::PhysicalComponents::Button::Button, Teddy::PhysicalComponents::Console::Console, draw, Teddy::PhysicalComponents::Label::Label, Teddy::PhysicalComponents::Layer::Layer, and Teddy::PhysicalComponents::Projection::Projection. |
|
Consume event before or after children?
Definition at line 163 of file Area.h. Referenced by Teddy::PhysicalComponents::ActionButton::ActionButton, Area, Teddy::PhysicalComponents::Button::Button, Teddy::PhysicalComponents::Dock::Dock, Teddy::PhysicalComponents::Frame::Frame, Teddy::PhysicalComponents::Layer::getHit, and getHit. |
|
Definition at line 154 of file Area.h. Referenced by Teddy::PhysicalComponents::ActionButton::ActionButton, Area, beginSize, Teddy::PhysicalComponents::Button::Button, Teddy::PhysicalComponents::Console::Console, Teddy::PhysicalComponents::Frame::Frame, and Teddy::PhysicalComponents::Label::Label. |
|
Definition at line 155 of file Area.h. Referenced by Area, beginSize, Teddy::PhysicalComponents::Fill::Fill, Teddy::PhysicalComponents::Frame::Frame, and Teddy::PhysicalComponents::Projection::Projection. |
|
Definition at line 168 of file Area.h. Referenced by Teddy::PhysicalComponents::Dock::beginPlace, and beginPlace. |
|
offset relative to remaining free size.
Definition at line 153 of file Area.h. Referenced by Area, Teddy::PhysicalComponents::Dock::beginPlace, and beginPlace. |
|
offset in pixels.
Definition at line 151 of file Area.h. Referenced by Area, Teddy::PhysicalComponents::Dock::beginPlace, beginPlace, and Teddy::PhysicalComponents::Frame::Frame. |
|
offset relative to self size.
Definition at line 152 of file Area.h. Referenced by Area, Teddy::PhysicalComponents::Dock::beginPlace, and beginPlace. |
|
Parent Area hosting this Area.
Definition at line 160 of file Area.h. Referenced by Area, Teddy::PhysicalComponents::Popup::close, getParent, Teddy::PhysicalComponents::Layer::Layer, Teddy::PhysicalComponents::Popup::open, and setParent. |
|
Projecti.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Window manager.
Definition at line 158 of file Area.h. Referenced by Area, Teddy::PhysicalComponents::Popup::close, and Teddy::PhysicalComponents::Popup::open. |