Back to index

nux  3.0.0
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
nux::Area Class Reference

#include <Area.h>

Inheritance diagram for nux::Area:
Inheritance graph
[legend]
Collaboration diagram for nux::Area:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Area (NUX_FILE_LINE_DECL)
virtual ~Area ()
int GetBaseX () const
int GetBaseY () const
int GetBaseWidth () const
int GetBaseHeight () const
void SetBaseX (int x)
void SetBaseY (int y)
void SetBaseXY (int x, int y)
void SetBaseWidth (int w)
void SetBaseHeight (int h)
virtual void SetBaseSize (int w, int h)
 Set the size of the object.
virtual void SetMinimumSize (int w, int h)
virtual void SetMaximumSize (int w, int h)
virtual void SetMinMaxSize (int w, int h)
virtual void SetMinimumWidth (int w)
virtual void SetMaximumWidth (int w)
virtual void SetMinimumHeight (int h)
virtual void SetMaximumHeight (int h)
virtual int GetMinimumWidth () const
virtual int GetMaximumWidth () const
virtual int GetMinimumHeight () const
virtual int GetMaximumHeight () const
virtual void ApplyMinWidth ()
virtual void ApplyMinHeight ()
virtual void ApplyMaxWidth ()
virtual void ApplyMaxHeight ()
virtual Size GetMinimumSize () const
virtual Size GetMaximumSize () const
Geometry const & GetGeometry () const
 Get the geometry of the object.
void SetGeometry (int x, int y, int w, int h)
 Set the geometry of the object.
void SetGeometry (const Geometry &geo)
 Set the geometry of the object.
void IncreaseSize (int x, int y)
void SetBaseString (const char *Caption)
const NStringGetBaseString () const
AreaGetToplevel ()
 Deprecated. Use GetToplevel.
AreaGetRootParent ()
 Return the root parent of the rendering tree for this area.
AreaGetTopLevelViewWindow ()
 Return the Top level BaseWindow of this area.
bool HasTopLevelParent ()
 Return true is this area has a top level parent.
bool IsChildOf (Area *parent)
 Return true is area is a child of the given parent in the widget tree.
bool TestMousePointerInclusion (const Point &mouse_position, NuxEventType event_type)
 Test if a point is inside the area.
bool TestMousePointerInclusionFilterMouseWheel (const Point &mouse_position, NuxEventType event)
 Test if a point is inside the area and if the area accepts mouse wheel events.
bool IsMousePointerInside () const
 Test if the mouse pointer is inside the area.
virtual long ComputeContentSize ()
virtual void ComputeContentPosition (float offsetX, float offsetY)
virtual bool IsArea () const
virtual bool IsInputArea () const
virtual bool IsView () const
virtual bool IsLayout () const
virtual bool IsSpaceLayout () const
virtual bool IsViewWindow () const
AreaGetParentObject () const
void SetVisible (bool visible)
 Set visibility of the area.
bool IsVisible ()
 Get the visibility of the area.
void SetSensitive (bool)
 Deprecated. Use SetInputEventSensitivity.
void SetInputEventSensitivity (bool sensitive)
 Set input event sensitivity of the area.
bool IsSensitive () const
 Deprecated. Use GetInputEventSensitivity.
bool GetInputEventSensitivity () const
 Get input event sensitivity of the area is sensitive.
void QueueRelayout ()
 Queue a relayout.
virtual unsigned int GetScaleFactor ()
 Get the area scale factor.
virtual void SetScaleFactor (unsigned int sf)
 Set the area scale factor.
virtual MinorDimensionPosition GetPositioning ()
virtual void SetPositioning (MinorDimensionPosition p)
virtual MinorDimensionSize GetExtend ()
virtual void SetExtend (MinorDimensionSize ext)
virtual float GetPercentage ()
virtual void SetPercentage (float f)
virtual bool IsLayoutDone ()
virtual void SetLayoutDone (bool b)
void Set2DMatrix (const Matrix4 &mat)
void Set2DTranslation (float tx, float ty, float tz)
Matrix4 Get2DMatrix () const
Matrix4 Get3DMatrix () const
bool Is3DArea () const
virtual Geometry GetAbsoluteGeometry () const
 Return the position of this object with regard to the top left corner of the physical window.
int GetAbsoluteX () const
 Return the area absolute x coordinate.
int GetAbsoluteY () const
 Return the area absolute y coordinate.
int GetAbsoluteWidth () const
 Return the area absolute width.
int GetAbsoluteHeight () const
 Return the area absolute height.
virtual Geometry GetRootGeometry () const
 Return the position of this object with regard to its top level parent(the main layout or a BaseWindow).
int GetRootX () const
 Return the area root x coordinate.
int GetRootY () const
 Return the area root y coordinate.
int GetRootWidth () const
 Return the area root width.
int GetRootHeight () const
 Return the area root height.
virtual bool SetParentObject (Area *parent)
 SetParentObject/UnParentObject are protected API.
virtual void UnParentObject ()
 Un-parent and area.
virtual AreaFindAreaUnderMouse (const Point &mouse_position, NuxEventType event_type)
 Return the area under the mouse pointer.
virtual AreaFindKeyFocusArea (unsigned int key_symbol, unsigned long x11_key_code, unsigned long special_keys_state)
void SetPathToKeyFocusArea ()
 Mark the path from this area to its top level parent as the one to follow
to get to the area that has the keyboard.
void ResetDownwardPathToKeyFocusArea ()
 Erase the path from this area to the child area that has the keyboard.
void ResetUpwardPathToKeyFocusArea ()
 Erase the path that marks this object as part of the keyboard focus chain,
from this area to its top level parent.
virtual bool InspectKeyEvent (unsigned int event_type, unsigned int keysym, const char *character)
 Return True if the the area knows what to do with the key event.
virtual AreaKeyNavIteration (KeyNavDirection direction)
bool HasKeyFocus () const
void SetReconfigureParentLayoutOnGeometryChange (bool reconfigure_parent_layout)
 Set to True to initiate a layout reconfiguration when the geometry of this widget changes.
bool ReconfigureParentLayoutOnGeometryChange ()
 Return True if the the parent layouts of this area should be reconfigured on geometry changed.
void SetAcceptKeyboardEvent (bool accept_key_event)
 Enable keyboard event processing.
bool AcceptKeyboardEvent () const
 Return true if the Area is interested in keyboard events.
void SetAcceptMouseWheelEvent (bool accept_mouse_wheel_event)
 Enable mouse wheel event processing.
bool AcceptMouseWheelEvent () const
 Return true if the area is accepts mouse wheel events.
 NUX_DECLARE_OBJECT_TYPE (InitiallyUnownedObject, Object)
 NUX_DECLARE_OBJECT_TYPE (BaseObject, Trackable)
bool Reference ()
 Increase reference count.
bool UnReference ()
 Decrease reference count.
virtual bool SinkReference ()
 Mark the object as owned.
virtual bool Dispose ()
 Destroy and object that has a floating reference.
int GetReferenceCount () const
 Get the reference count of this object.
std::string GetAllocationLoation () const
 NUX_DECLARE_ROOT_OBJECT_TYPE (Trackable)
bool OwnsTheReference ()
 Test if object reference is owned.
bool IsHeapAllocated ()
 Test if object was allocated dynamically.
bool IsDynamic () const
 Test if object was allocated dynamically.
virtual int GetObjectSize ()
 Return the size of allocated for this object.
bool SetProperty (std::string const &name, const char *value)
 If the property was not able to be set with the value, the method returns false.
template<typename T >
bool SetProperty (std::string const &name, T const &value)
template<typename T >
GetProperty (std::string const &name, T *foo=0)
void AddProperty (std::string const &name, PropertyBase *property)

Static Public Member Functions

static std::new_handler set_new_handler (std::new_handler handler)
static void * operator new (size_t size)
static void * operator new (size_t size, void *ptr)
static void operator delete (void *ptr)

Public Attributes

sigc::signal< void, Area * > ChildFocusChanged
sigc::signal< void, Area
*, bool, KeyNavDirection
key_nav_focus_change
 This signal is received whether the area receiving or loosing the keyboard focus.
sigc::signal< void, Area * > key_nav_focus_activate
 This signal is received when the area has the key focus and the ENTER key has been pressed.
sigc::signal< void, int, int,
int, int > 
OnResize
 Signal emitted when an area is resized.
sigc::signal< void, Area *, bool > OnVisibleChanged
sigc::signal< void, Area *, bool > OnSensitiveChanged
sigc::signal< void, Area
*, Geometry & > 
OnGeometryChanged
 This signal is only meant to inform of a change of size.
sigc::signal< void, Object * > object_destroyed
 Signal emitted immediately before the object is destroyed.

Protected Member Functions

virtual void GeometryChangePending ()
 This signal is only meant to inform that the size is about to change.
virtual void GeometryChanged ()
 This signal is only meant to inform that the size has changed.
virtual void RequestBottomUpLayoutComputation (Area *bo_initiator)
 Request a Layout recompute after a change of size.
void InnerGetAbsoluteGeometry (Geometry &geometry)
 Return the absolute geometry starting with a relative geometry passed as argument.
void InnerGetRootGeometry (Geometry &geometry)
 Return the absolute geometry starting with a relative geometry passed as argument.
void SetNextObjectToKeyFocusArea (Area *)
AreaGetNextObjectToKeyFocusArea ()
 Gets the next object in the chain that ends with the area that has the keyboard focus.
void SetOwnedReference (bool b)

Protected Attributes

bool on_geometry_change_reconfigure_parent_layout_
bool has_key_focus_
 If this variable is true, then this area has the keyboard focus.
Areanext_object_to_key_focus_area_
 If this variable is not NULL, then this area is part of the keyboard focus chain.
int _heap_allocated

Private Member Functions

 NUX_DECLARE_OBJECT_TYPE (Area, InitiallyUnownedObject)
void ReconfigureParentLayout (Area *child=0)
void CheckMinSize ()
void CheckMaxSize ()

Private Attributes

Geometry geometry_
 The area geometry.
Areaparent_area_
 Define a parent child structure.
bool visible_
 Visible state of the area.
bool sensitive_
 Input sensitive state of the area.
bool view_enabled_
 The enable state of a view.
NString _base_string
 A text string property for this area.
Size min_size_
 A text string property for this area.
Size max_size_
 A text string property for this area.
unsigned int scale_factor_
 Factor for element expansion.
MinorDimensionPosition minor_axis_position_
 Area position hint.
MinorDimensionSize minor_axis_size_
 Area dimension hint.
float minor_axis_size_scale_
 Area size percentage value.
bool layout_done_
 Area layout status flag.
Matrix4 _2d_xform
 2D transformation matrix for this area and its children.
Matrix4 _3d_xform
 3D transformation matrix for the area in a perspective space.
bool _3d_area
 True if the area is resides in a 3D space.
std::list< Area * > _children_list
bool accept_mouse_wheel_event_
bool accept_keyboard_event_
WindowThreadwindow_thread_

Friends

class Layout
class View
class WindowThread
class HSplitter
class VSplitter
class WindowCompositor

Detailed Description

Definition at line 147 of file Area.h.


Constructor & Destructor Documentation

nux::Area::~Area ( ) [virtual]

Definition at line 65 of file Area.cpp.

  {
  }

Member Function Documentation

Return true if the Area is interested in keyboard events.

Returns:
True if the area accepts in keyboard events.

Definition at line 858 of file Area.cpp.

Here is the caller graph for this function:

Return true if the area is accepts mouse wheel events.

Returns:
True if the area accepts mouse wheel events.

Definition at line 868 of file Area.cpp.

Here is the caller graph for this function:

void nux::Introspectable::AddProperty ( std::string const &  name,
PropertyBase property 
) [inline, inherited]

Definition at line 254 of file Property-inl.h.

{
  // check to see if it exists and if it does barf horribly as we can't
  // have two properties with the same name;
  properties_[name] = property;
}

Here is the caller graph for this function:

void nux::Area::ApplyMaxHeight ( ) [virtual]

Definition at line 192 of file Area.cpp.

Here is the call graph for this function:

void nux::Area::ApplyMaxWidth ( ) [virtual]

Definition at line 185 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::ApplyMinHeight ( ) [virtual]

Definition at line 178 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::ApplyMinWidth ( ) [virtual]

Reimplemented in nux::StaticText.

Definition at line 171 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::CheckMaxSize ( ) [private]

Definition at line 109 of file Area.cpp.

Here is the caller graph for this function:

void nux::Area::CheckMinSize ( ) [private]

Definition at line 79 of file Area.cpp.

  {
    int w = min_size_.width;
    w = Max<int>(AREA_MIN_WIDTH, w);
    int h = min_size_.height;
    h = Max<int>(AREA_MIN_HEIGHT, h);

    min_size_ = Size(w, h);

    if (min_size_.width > max_size_.width)
    {
      max_size_.width = min_size_.width;
    }

    if (min_size_.height > max_size_.height)
    {
      max_size_.height = min_size_.height;
    }

    if (geometry_.width < min_size_.width)
    {
      geometry_.width = min_size_.width;
    }

    if (geometry_.height < min_size_.height )
    {
      geometry_.height = min_size_.height;
    }
  }

Here is the caller graph for this function:

void nux::Area::ComputeContentPosition ( float  offsetX,
float  offsetY 
) [virtual]

Reimplemented in nux::SpaceLayout, nux::ScrollView, nux::BaseWindow, nux::TabView, nux::FloatingWindow, nux::GroupBox, nux::GroupBox2, nux::Panel, nux::View, nux::HLayout, and nux::VLayout.

Definition at line 406 of file Area.cpp.

  {

  }

Here is the caller graph for this function:

long nux::Area::ComputeContentSize ( ) [virtual]
bool nux::Object::Dispose ( ) [virtual, inherited]

Destroy and object that has a floating reference.

Returns:
True is the object has been destroyed

Reimplemented from nux::Trackable.

Definition at line 311 of file Object.cpp.

  {
    // The intent of the Dispose call is to destroy objects with a float
    // reference (reference count is equal to 1 and the '_owns_the_reference'
    // flag is set to false). In Nux, only widgets object can have a floating
    // reference.  And widgets are only visible if added to the widget tree.
    // When an object with a floating reference is added to the widget tree,
    // it becomes "owned'. It looses it floating reference status but it still
    // has a reference count number of 1.  In practice, since widgets must be
    // added to the widget tree, there should never be a need to call Dispose
    // (except in a few cases).

    // Dispose() was designed to only destroy objects with floating
    // references, while UnReference() destroys objects that are "owned".
    // That is now relaxed. Dispose() calls UnReference().
    return UnReference();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Area * nux::Area::FindAreaUnderMouse ( const Point mouse_position,
NuxEventType  event_type 
) [virtual]

Return the area under the mouse pointer.

Returns:
The Area under the mouse pointer.

Reimplemented in nux::MenuPage, nux::LayeredLayout, nux::View, nux::Layout, nux::ScrollView, nux::HScrollBar, nux::FloatingWindow, nux::TextEntry, nux::BaseWindow, nux::InputArea, nux::HSplitter, nux::VSplitter, nux::TabView, and nux::VScrollBar.

Definition at line 938 of file Area.cpp.

  {
    return NULL;
  }

Here is the caller graph for this function:

Area * nux::Area::FindKeyFocusArea ( unsigned int  key_symbol,
unsigned long  x11_key_code,
unsigned long  special_keys_state 
) [virtual]

Reimplemented in nux::View, and nux::InputArea.

Definition at line 943 of file Area.cpp.

  {
    if (has_key_focus_)
    {
      return this;
    }
    else if (next_object_to_key_focus_area_)
    {
      return next_object_to_key_focus_area_->FindKeyFocusArea(key_symbol, x11_key_code, special_keys_state);
    }
    return NULL;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nux::Area::GeometryChanged ( ) [inline, protected, virtual]

This signal is only meant to inform that the size has changed.

When overriding this function, don't do anything that could change the size of this object. Or you risk creating an infinite loop.

Reimplemented in nux::TextEntry, and nux::View.

Definition at line 592 of file Area.h.

{}

Here is the caller graph for this function:

virtual void nux::Area::GeometryChangePending ( ) [inline, protected, virtual]

This signal is only meant to inform that the size is about to change.

When overriding this function, don't do anything that could change the size of this object. Or you risk creating an infinite loop.

Reimplemented in nux::View.

Definition at line 586 of file Area.h.

{}

Here is the caller graph for this function:

Definition at line 666 of file Area.cpp.

  {
    return _2d_xform;
  }

Here is the caller graph for this function:

Definition at line 671 of file Area.cpp.

  {
    return _3d_xform;
  }

Return the position of this object with regard to the top left corner of the physical window.

Return the position of the Area inside the physical window. For the main layout set in WindowThread, The following functions are equivalent:

Reimplemented in nux::MenuPage.

Definition at line 705 of file Area.cpp.

  {
    if (Type().IsDerivedFromType(BaseWindow::StaticObjectType) ||
      Type().IsDerivedFromType(MenuPage::StaticObjectType) ||
      (this == window_thread_->GetLayout()))
    {
      // Do not apply the _2D_xform matrix  to a BaseWindow or the main layout
      return geometry_;
    }
    else
    {
      nux::Geometry geo = geometry_;
      MatrixXFormGeometry(_2d_xform, geo);

      Area *parent = GetParentObject();
      if (parent)
        parent->InnerGetAbsoluteGeometry(geo);

      return geo;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Return the area absolute height.

As long as _2d_xform contains only translations, the absolute height is the same as value returned by GetBaseHeight();

Definition at line 742 of file Area.cpp.

  {
    return GetAbsoluteGeometry().height;
  }

Here is the call graph for this function:

Return the area absolute width.

As long as _2d_xform contains only translations, the absolute width is the same as value returned by GetBaseWidth();

Definition at line 737 of file Area.cpp.

  {
    return GetAbsoluteGeometry().width;
  }

Here is the call graph for this function:

int nux::Area::GetAbsoluteX ( ) const

Return the area absolute x coordinate.

Definition at line 727 of file Area.cpp.

  {
    return GetAbsoluteGeometry().x;
  }

Here is the call graph for this function:

int nux::Area::GetAbsoluteY ( ) const

Return the area absolute y coordinate.

Definition at line 732 of file Area.cpp.

  {
    return GetAbsoluteGeometry().y;
  }

Here is the call graph for this function:

std::string nux::Object::GetAllocationLoation ( ) const [inherited]

Definition at line 348 of file Object.cpp.

{
  std::ostringstream sout;
  sout << allocation_file_name_ << ":" << allocation_line_number_;
  return sout.str();
}

Here is the caller graph for this function:

int nux::Area::GetBaseHeight ( ) const

Definition at line 333 of file Area.cpp.

  {
    return geometry_.height;
  }
const NString & nux::Area::GetBaseString ( ) const

Definition at line 69 of file Area.cpp.

  {
    return _base_string;
  }

Here is the caller graph for this function:

int nux::Area::GetBaseWidth ( ) const

Definition at line 328 of file Area.cpp.

  {
    return geometry_.width;
  }
int nux::Area::GetBaseX ( ) const

Definition at line 318 of file Area.cpp.

  {
    return geometry_.x;
  }
int nux::Area::GetBaseY ( ) const

Definition at line 323 of file Area.cpp.

  {
    return geometry_.y;
  }

Definition at line 596 of file Area.cpp.

  {
    return minor_axis_size_;
  }
Geometry const & nux::Area::GetGeometry ( ) const

Get the geometry of the object.

Returns:
The Geometry of the object.
See also:
GetBaseWidth(), GetBaseHeight(), GetBaseX(), GetBaseY().

Definition at line 360 of file Area.cpp.

  {
    return geometry_;
  }

Get input event sensitivity of the area is sensitive.

Gets whether the area is sensitive to input events

Returns:
whether the area is visible

Definition at line 581 of file Area.cpp.

  {
    return sensitive_;
  }

Here is the caller graph for this function:

int nux::Area::GetMaximumHeight ( ) const [virtual]

Definition at line 256 of file Area.cpp.

  {
    return max_size_.height;
  }

Here is the caller graph for this function:

Size nux::Area::GetMaximumSize ( ) const [virtual]

Definition at line 204 of file Area.cpp.

  {
    return max_size_;
  }
int nux::Area::GetMaximumWidth ( ) const [virtual]

Definition at line 246 of file Area.cpp.

  {
    return max_size_.width;
  }

Here is the caller graph for this function:

int nux::Area::GetMinimumHeight ( ) const [virtual]

Definition at line 251 of file Area.cpp.

  {
    return min_size_.height;
  }

Here is the caller graph for this function:

Size nux::Area::GetMinimumSize ( ) const [virtual]

Definition at line 199 of file Area.cpp.

  {
    return min_size_;
  }

Here is the caller graph for this function:

int nux::Area::GetMinimumWidth ( ) const [virtual]

Definition at line 241 of file Area.cpp.

  {
    return min_size_.width;
  }

Here is the caller graph for this function:

Gets the next object in the chain that ends with the area that has the keyboard focus.

Gets the next object in the chain that ends with the area that has the keyboard focus. The next object is a child of this area.

Returns:
An area that is the next object in the chain that leads to the area that has the keyboard focus.

Definition at line 963 of file Area.cpp.

int nux::Trackable::GetObjectSize ( ) [virtual, inherited]

Return the size of allocated for this object.

Returns:
The size allocated for this object.

Definition at line 217 of file Object.cpp.

  {
    return _size_of_this_object;
  }

Definition at line 313 of file Area.cpp.

  {
    return parent_area_;
  }

Here is the caller graph for this function:

float nux::Area::GetPercentage ( ) [virtual]

Definition at line 606 of file Area.cpp.

Definition at line 586 of file Area.cpp.

  {
    return minor_axis_position_;
  }
template<typename T >
T nux::Introspectable::GetProperty ( std::string const &  name,
T *  foo = 0 
) [inherited]

Definition at line 285 of file Property-inl.h.

{
  PropertyContainer::iterator i = properties_.find(name);
  if (i == properties_.end())
    return T();

  std::string s = i->second->GetSerializedValue();
  std::pair<T, bool> result = type::PropertyTrait<T>::from_string(s);
  // If this is called with a template type that the property does not
  // support nice conversion to, you'll get no error, but will get
  // a default constructed T.  We could use an exception here.
  return result.first;
}
int nux::Object::GetReferenceCount ( ) const [inherited]

Get the reference count of this object.

Returns:
The reference count of this object.

Definition at line 343 of file Object.cpp.

  {
    return reference_count_->GetValue();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Geometry nux::Area::GetRootGeometry ( ) const [virtual]

Return the position of this object with regard to its top level parent(the main layout or a BaseWindow).

Return the position of the Area inside the physical window. For the main layout set in WindowThread or for a BaseWindow, GetRootGeometry() is equivalent to GetGeometry().

Reimplemented in nux::MenuPage.

Definition at line 759 of file Area.cpp.

  {
    nux::Geometry geo = geometry_;
    MatrixXFormGeometry(_2d_xform, geo);

    if (Type().IsDerivedFromType(BaseWindow::StaticObjectType) || (this == window_thread_->GetLayout()))
    {
      return geo;
    }
    else
    {
      Area *parent = GetParentObject();
      if (parent)
        parent->InnerGetRootGeometry(geo);

      return geo;
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int nux::Area::GetRootHeight ( ) const

Return the area root height.

As long as _2d_xform contains only translations, the root width is the same as value returned by GetBaseWidth();

Definition at line 793 of file Area.cpp.

  {
    return GetRootGeometry().height;
  }

Here is the call graph for this function:

Return the root parent of the rendering tree for this area.

The root parent of the rendering tree is either a BaseWindow or the main layout. If the object isn't hooked to the rendering tree the function returns NULL.

Returns:
The root parent of the rendering tree or NULL.

Definition at line 803 of file Area.cpp.

  {
    if (Type().IsDerivedFromType(BaseWindow::StaticObjectType) || (this == window_thread_->GetLayout()))
    {
      return this;
    }

    Area* parent = GetParentObject();
    if (!parent) //we didn't find a way to salvation!
    {
      return 0;
    }
    return parent->GetRootParent();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int nux::Area::GetRootWidth ( ) const

Return the area root width.

As long as _2d_xform contains only translations, the root width is the same as value returned by GetBaseWidth();

Definition at line 788 of file Area.cpp.

  {
    return GetRootGeometry().width;
  }

Here is the call graph for this function:

int nux::Area::GetRootX ( ) const

Return the area root x coordinate.

Definition at line 778 of file Area.cpp.

  {
    return GetRootGeometry().x;
  }

Here is the call graph for this function:

int nux::Area::GetRootY ( ) const

Return the area root y coordinate.

Definition at line 783 of file Area.cpp.

  {
    return GetRootGeometry().y;
  }

Here is the call graph for this function:

unsigned int nux::Area::GetScaleFactor ( ) [virtual]

Get the area scale factor.

The scale factor is used to control the layout of area objects inside HLayout and VLayout.

See also:
HLayout, VLayout.
Returns:
the Area scale factor.

Definition at line 261 of file Area.cpp.

  {
    return scale_factor_;
  }

Here is the caller graph for this function:

Deprecated. Use GetToplevel.

Definition at line 798 of file Area.cpp.

  {
    return GetRootParent();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Return the Top level BaseWindow of this area.

Returns:
The top level BaseWindow or NULL.

Definition at line 818 of file Area.cpp.

  {
    Area* area = GetRootParent();

    if (area && area->IsViewWindow())
      return area;

    return NULL;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Area::HasKeyFocus ( ) const

Definition at line 1024 of file Area.cpp.

  {
    return has_key_focus_;
  }

Here is the caller graph for this function:

Return true is this area has a top level parent.

Returns:
True if this area has a top level parent.

Definition at line 828 of file Area.cpp.

  {
    if (GetRootParent())
    {
      return true;
    }
    return false;
  }

Here is the call graph for this function:

void nux::Area::IncreaseSize ( int  x,
int  y 
)

Definition at line 395 of file Area.cpp.

Here is the call graph for this function:

void nux::Area::InnerGetAbsoluteGeometry ( Geometry geometry) [protected]

Return the absolute geometry starting with a relative geometry passed as argument.

Definition at line 690 of file Area.cpp.

  {
    if (this->Type().IsDerivedFromType(BaseWindow::StaticObjectType) || (this == window_thread_->GetLayout()))
    {
      geometry.OffsetPosition(geometry_.x, geometry_.y);
      return;
    }

    MatrixXFormGeometry(_2d_xform, geometry);

    Area *parent = GetParentObject();
    if (parent)
      parent->InnerGetAbsoluteGeometry(geometry);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::InnerGetRootGeometry ( Geometry geometry) [protected]

Return the absolute geometry starting with a relative geometry passed as argument.

Definition at line 747 of file Area.cpp.

  {
    if (this->Type().IsDerivedFromType(BaseWindow::StaticObjectType) || (this == window_thread_->GetLayout()))
      return;

    MatrixXFormGeometry(_2d_xform, geometry);

    Area *parent = GetParentObject();
    if (parent)
      parent->InnerGetRootGeometry(geometry);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Area::InspectKeyEvent ( unsigned int  event_type,
unsigned int  keysym,
const char *  character 
) [virtual]

Return True if the the area knows what to do with the key event.

For a View to receive the key_up and key_down signal, it must override this function and return true.

Parameters:
even_typeEvent type is either EVENT_KEY_DOWN or EVENT_KEY_UP.
keysymThe key symbol.
charactersThe character string of the key.
Returns:
bool True if the View wants to received the key events signals.

Reimplemented in nux::TextEntry, nux::Coverflow, and nux::EditTextBox.

Definition at line 1012 of file Area.cpp.

  {
    return false;
  }

Here is the caller graph for this function:

bool nux::Area::Is3DArea ( ) const

Definition at line 676 of file Area.cpp.

  {
    return _3d_area;
  }
bool nux::Area::IsArea ( ) const [virtual]

Reimplemented in nux::InputArea.

Definition at line 626 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(Area::StaticObjectType);;
  }

Here is the caller graph for this function:

bool nux::Area::IsChildOf ( Area parent)

Return true is area is a child of the given parent in the widget tree.

Parameters:
parentArea to test if it is a parent of this area.
Returns:
True if this area is area is a child of parent in the widget tree.

Definition at line 837 of file Area.cpp.

  {
    if (this == parent)
      return true;

    if (!parent || !parent_area_)
      return false;

    return parent_area_->IsChildOf(parent);    
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Trackable::IsDynamic ( ) const [inherited]

Test if object was allocated dynamically.

Definition at line 201 of file Object.cpp.

  {
    // Get pointer to beginning of the memory occupied by this.
    const void *ptr = dynamic_cast<const void *> (this);

    // Search for ptr in allocation_list
#if defined(NUX_OS_WINDOWS) && !defined(NUX_VISUAL_STUDIO_2010)
    std::list<void*>::iterator i = std::find(GObjectStats._allocation_list.begin(),
      GObjectStats._allocation_list.end(), ptr);
#else
    auto i = std::find(GObjectStats._allocation_list.begin(),
                       GObjectStats._allocation_list.end(), ptr);
#endif
    return i != GObjectStats._allocation_list.end();
  }

Here is the caller graph for this function:

bool nux::Trackable::IsHeapAllocated ( ) [inherited]

Test if object was allocated dynamically.

Definition at line 191 of file Object.cpp.

  {
    if (_heap_allocated == -1)
    {
      _heap_allocated = (IsDynamic () ? 1 : 0);
    }

    return (_heap_allocated == 1 ? true : false);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Area::IsInputArea ( ) const [virtual]

Definition at line 631 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(InputArea::StaticObjectType);;
  }
bool nux::Area::IsLayout ( ) const [virtual]

Definition at line 641 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(Layout::StaticObjectType);
  }

Here is the caller graph for this function:

bool nux::Area::IsLayoutDone ( ) [virtual]

Definition at line 616 of file Area.cpp.

  {
    return layout_done_;
  }

Here is the caller graph for this function:

Test if the mouse pointer is inside the area.

Return true if the mouse pointer is inside the area.

Returns:
True if the mouse pointer is inside the area.

Definition at line 1029 of file Area.cpp.

  {
    Geometry geo = GetAbsoluteGeometry();
    Point position = GetWindowThread()->GetWindowCompositor().GetMousePosition();
    
    if (geo.IsInside(position))
      return true;

    return false;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Area::IsSensitive ( ) const

Deprecated. Use GetInputEventSensitivity.

Definition at line 576 of file Area.cpp.

  {
    return GetInputEventSensitivity();
  }

Here is the call graph for this function:

bool nux::Area::IsSpaceLayout ( ) const [virtual]

Definition at line 651 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(SpaceLayout::StaticObjectType);;
  }
bool nux::Area::IsView ( ) const [virtual]

Definition at line 636 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(View::StaticObjectType);;
  }

Here is the caller graph for this function:

bool nux::Area::IsViewWindow ( ) const [virtual]

Definition at line 646 of file Area.cpp.

  {
    return this->Type().IsDerivedFromType(BaseWindow::StaticObjectType);
  }

Here is the caller graph for this function:

Get the visibility of the area.

Gets whether the area is visible to the user and will be visible to the user. Default is true.

Returns:
whether the area is visible

Definition at line 553 of file Area.cpp.

  {
    return visible_;
  }

Here is the caller graph for this function:

Area * nux::Area::KeyNavIteration ( KeyNavDirection  direction) [virtual]

Reimplemented in nux::LayeredLayout, nux::View, nux::GridHLayout, nux::HSplitter, nux::VSplitter, nux::HLayout, and nux::VLayout.

Definition at line 1019 of file Area.cpp.

  {
    return NULL;
  }

Here is the caller graph for this function:

nux::Object::NUX_DECLARE_OBJECT_TYPE ( BaseObject  ,
Trackable   
) [inherited]
void nux::Trackable::operator delete ( void *  ptr) [static, inherited]

Definition at line 178 of file Object.cpp.

  {
    ObjectStats::AllocationList::iterator i = std::find (GObjectStats._allocation_list.begin(), GObjectStats._allocation_list.end(), ptr);

    if (i != GObjectStats._allocation_list.end() )
    {
      GObjectStats._total_allocated_size -= NUX_STATIC_CAST (Trackable *, ptr)->_size_of_this_object;
      --GObjectStats._number_of_objects;
      GObjectStats._allocation_list.erase (i);
      ::operator delete (ptr);
    }
  }
void * nux::Trackable::operator new ( size_t  size) [static, inherited]

Definition at line 140 of file Object.cpp.

  {
    // Set the new_handler for this call
    std::new_handler global_handler  = std::set_new_handler (_new_current_handler);

    // If allocation fails _new_current_handler is called, if specified,
    // otherwise the global new_handler is called.
    void *ptr;

    try
    {
      ptr = ::operator new (size);

      GObjectStats._allocation_list.push_front (ptr);
      NUX_STATIC_CAST (Trackable *, ptr)->_size_of_this_object = size;
      GObjectStats._total_allocated_size += size;
      ++GObjectStats._number_of_objects;
    }
    catch (std::bad_alloc &)
    {
      std::set_new_handler (global_handler);
      throw;
    }

    //  Reset gloabal new_handler
    std::set_new_handler (global_handler);
    return ptr;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void * nux::Trackable::operator new ( size_t  size,
void *  ptr 
) [static, inherited]

Definition at line 171 of file Object.cpp.

  {
    return ::operator new (size, ptr);
  }

Here is the call graph for this function:

bool nux::Trackable::OwnsTheReference ( ) [inherited]

Test if object reference is owned.

Definition at line 117 of file Object.cpp.

  {
    return _owns_the_reference;
  }

Here is the caller graph for this function:

Queue a relayout.

Queues a relayout before the next paint cycle. This is safe to call multiple times within a cycle.

Definition at line 848 of file Area.cpp.

Here is the call graph for this function:

void nux::Area::ReconfigureParentLayout ( Area child = 0) [private]

Definition at line 421 of file Area.cpp.

  {
    if (on_geometry_change_reconfigure_parent_layout_ == false)
      return;

    if (window_thread_ && window_thread_->IsComputingLayout())
    {
      // there is no need to do the following while we are already computing the layout.
      // If we do, we will end up in an infinite loop.
      return;
    }

    if (this->Type().IsDerivedFromType(View::StaticObjectType))
    {
      // The object that is being resized is a View object and it has a parent.
      if (this->OwnsTheReference() == false && this->GetParentObject())
      {
        // Only reference parented areas.
        this->Reference();
      }

      View *ic = static_cast<View *>(this);

      if (ic->CanBreakLayout())
      {

        if ((child != 0) &&
             (ic->Type().IsObjectType(VSplitter::StaticObjectType) || ic->Type().IsObjectType(HSplitter::StaticObjectType)))
        {
          // If this element is a Splitter, then we submit its child to the refresh list. We don't want to submit the
          // splitter because this will cause a redraw of all parts of the splitter(costly and unnecessary).
          window_thread_->QueueObjectLayout(child);
        }
        else
        {
          window_thread_->QueueObjectLayout(ic);
        }
      }
      else if (ic->parent_area_)
        ic->parent_area_->ReconfigureParentLayout(this);
      else
      {
        window_thread_->QueueObjectLayout(ic);
      }
    }
    else if (this->Type().IsDerivedFromType(Layout::StaticObjectType))
    {
      // The object that is being resized is a View object and it has a parent.
      if (this->OwnsTheReference() == false && this->GetParentObject())
      {
        // Only reference parented areas.
        this->Reference();
      }

      Layout *layout = static_cast<Layout *>(this);

      if (layout->parent_area_)
      {
        if (layout->parent_area_->Type().IsDerivedFromType(View::StaticObjectType))
        {
          View *ic = (View *) (layout->parent_area_);

          if (ic->CanBreakLayout())
          {
            if ((child != 0) &&
                 (ic->Type().IsObjectType(VSplitter::StaticObjectType) || ic->Type().IsObjectType(HSplitter::StaticObjectType)))
            {
              // If the parent of this element is a splitter, then we submit its child to the refresh list. We don't want to submit the
              // splitter because this will cause a redraw of all parts of the splitter(costly and unnecessary).
              window_thread_->QueueObjectLayout(this);
            }
            else
            {
              window_thread_->QueueObjectLayout(ic);
            }
          }
          else
          {
            // The parent object of an object of type View is a Layout object type.
            layout->parent_area_->ReconfigureParentLayout(this);
          }
        }
        else
        {
          layout->parent_area_->ReconfigureParentLayout(this);
        }
      }
      else
      {
        // This is possibly the Main layout or the layout of a floating object(popup for example) unless the layout is not part of the object tree.
        window_thread_->QueueObjectLayout(layout);
      }
    }
    else
    {
      // The object that is being resized is a InputArea object.
      if (this->parent_area_)
      {
        // The object that is being resized is a View object and it has a parent.
        if (this->OwnsTheReference() == false && this->GetParentObject())
        {
          // Only reference parented areas.
          this->Reference();
        }

        // The parent object of an object of type InputArea is a Layout object type.
        this->parent_area_->ReconfigureParentLayout(this);
      }
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Return True if the the parent layouts of this area should be reconfigured on geometry changed.

Returns:
True if the parent layouts of this area must be reconfigured on a geometry change.

Definition at line 416 of file Area.cpp.

bool nux::Object::Reference ( ) [virtual, inherited]

Increase reference count.

Returns:
True if the object has successfully referenced.

Reimplemented from nux::Trackable.

Definition at line 254 of file Object.cpp.

  {
    if (!IsHeapAllocated())
    {
      LOG_WARN(logger) << "Trying to reference an object that was not heap allocated."
                       << "\nObject allocated at: " << GetAllocationLoation() << "\n";
      return false;
    }

    if (!OwnsTheReference())
    {
      SetOwnedReference(true);
      // The ref count remains at 1. Exit the method.
      return true;
    }

    reference_count_->Increment();
    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::RequestBottomUpLayoutComputation ( Area bo_initiator) [protected, virtual]

Request a Layout recompute after a change of size.

Reimplemented in nux::Layout.

Definition at line 532 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Erase the path from this area to the child area that has the keyboard.

Definition at line 986 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Erase the path that marks this object as part of the keyboard focus chain,
from this area to its top level parent.

Definition at line 999 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::Set2DMatrix ( const Matrix4 mat)

Definition at line 656 of file Area.cpp.

  {
    _2d_xform = mat;
  }
void nux::Area::Set2DTranslation ( float  tx,
float  ty,
float  tz 
)

Definition at line 661 of file Area.cpp.

  {
    _2d_xform.Translate(tx, ty, tz);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

std::new_handler nux::Trackable::set_new_handler ( std::new_handler  handler) [static, inherited]

Definition at line 133 of file Object.cpp.

  {
    std::new_handler old_handler = _new_current_handler;
    _new_current_handler = handler;
    return old_handler;
  }

Here is the caller graph for this function:

void nux::Area::SetAcceptKeyboardEvent ( bool  accept_key_event)

Enable keyboard event processing.

Parameters:
accept_key_eventSet it to true if the area accepts keyboard events.

Definition at line 853 of file Area.cpp.

  {
    accept_keyboard_event_ = accept_keyboard_event;
  }

Here is the caller graph for this function:

void nux::Area::SetAcceptMouseWheelEvent ( bool  accept_mouse_wheel_event)

Enable mouse wheel event processing.

Parameters:
accept_mouse_wheel_eventSet it to true if the area accepts mouse wheel events.

Definition at line 863 of file Area.cpp.

  {
    accept_mouse_wheel_event_ = accept_mouse_wheel_event;
  }

Here is the caller graph for this function:

void nux::Area::SetBaseHeight ( int  h)

Definition at line 390 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetBaseSize ( int  w,
int  h 
) [virtual]

Set the size of the object.

Definition at line 380 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetBaseString ( const char *  Caption)

Reimplemented in nux::InputArea.

Definition at line 74 of file Area.cpp.

  {
    _base_string = Caption;
  }
void nux::Area::SetBaseWidth ( int  w)

Definition at line 385 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetBaseX ( int  x)

Definition at line 365 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetBaseXY ( int  x,
int  y 
)

Definition at line 375 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetBaseY ( int  y)

Definition at line 370 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetExtend ( MinorDimensionSize  ext) [virtual]

Definition at line 601 of file Area.cpp.

  {
    minor_axis_size_ = ext;
  }

Here is the caller graph for this function:

void nux::Area::SetGeometry ( int  x,
int  y,
int  w,
int  h 
)

Set the geometry of the object.

Set the width, height, and x, y position of the object on the screen.

Parameters:
xHorizontal position.
yVertical position.
wWidth.
hHeight.
See also:
SetBaseWidth(), SetBaseHeight(), SetBaseX(), SetBaseY().

Definition at line 338 of file Area.cpp.

  {
    h = nux::Clamp<int> (h, min_size_.height, max_size_.height);
    w = nux::Clamp<int> (w, min_size_.width, max_size_.width);

    nux::Geometry geometry(x, y, w, h);
    if (geometry_ == geometry)
      return;

    GeometryChangePending();
    geometry_ = geometry;
    ReconfigureParentLayout();
    GeometryChanged();

    OnGeometryChanged.emit(this, geometry_);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetGeometry ( const Geometry geo)

Set the geometry of the object.

This is an overloaded member function, provided for convenience. It behaves essentially like SetGeometry(int x, int y, int w, int h).

Parameters:
geoGeometry object.
See also:
SetWidth(), SetHeight(), SetX(), SetY().

Reimplemented in nux::MenuPage, nux::BaseWindow, nux::StaticTextBox, nux::View, nux::MouseAreaCtrl, and nux::ScrollView.

Definition at line 355 of file Area.cpp.

  {
    SetGeometry(geo.x, geo.y, geo.width, geo.height);
  }

Here is the call graph for this function:

void nux::Area::SetInputEventSensitivity ( bool  sensitive)

Set input event sensitivity of the area.

A insensitive Area will not receive input events.
If the Area has a layout, the event will be passed down to it. Sensitivity only control an area's ability to receive input events(keyboard, mouse, touch). An area that is not sensitive will return false in TestMousePointerInclusion, TestMousePointerInclusionFilterMouseWheel and AcceptKeyNavFocus.
Sensitivity does not affect layouts since they do not process events.

By default, an area is sensitive.

Parameters:
sensitiveIf the area should receive input events

Definition at line 563 of file Area.cpp.

  {
    if (IsLayout())
      return;

    if (sensitive_ == sensitive)
      return;

    sensitive_ = sensitive;

    OnSensitiveChanged.emit(this, sensitive_);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetLayoutDone ( bool  b) [virtual]

Definition at line 621 of file Area.cpp.

  {
    layout_done_ = b;
  }
void nux::Area::SetMaximumHeight ( int  h) [virtual]

Definition at line 233 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetMaximumSize ( int  w,
int  h 
) [virtual]

Definition at line 150 of file Area.cpp.

  {
    nuxAssert(w >= 0);
    nuxAssert(h >= 0);
    max_size_ = Size(w, h);

    CheckMaxSize();

    ReconfigureParentLayout();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetMaximumWidth ( int  w) [virtual]

Definition at line 217 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetMinimumHeight ( int  h) [virtual]

Definition at line 225 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetMinimumSize ( int  w,
int  h 
) [virtual]

Definition at line 139 of file Area.cpp.

  {
    nuxAssert(w >= 0);
    nuxAssert(h >= 0);
    min_size_ = Size(w, h);

    CheckMinSize();

    ReconfigureParentLayout();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetMinimumWidth ( int  w) [virtual]

Definition at line 209 of file Area.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetMinMaxSize ( int  w,
int  h 
) [virtual]

Definition at line 161 of file Area.cpp.

  {
    nuxAssert(w >= 0);
    nuxAssert(h >= 0);
    SetMinimumSize(w, h);
    SetMaximumSize(w, h);

    //ReconfigureParentLayout();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetNextObjectToKeyFocusArea ( Area area) [protected]

Definition at line 958 of file Area.cpp.

void nux::Trackable::SetOwnedReference ( bool  b) [protected, inherited]

Definition at line 122 of file Object.cpp.

  {
    if (_owns_the_reference == true)
    {
      LOG_DEBUG(logger) << "Do not change the ownership if is already set to true!" << "\n";
      return;
    }

    _owns_the_reference = b;
  }

Here is the caller graph for this function:

bool nux::Area::SetParentObject ( Area parent) [virtual]

SetParentObject/UnParentObject are protected API.

They are not meant to be used directly by users. Users add widgets to layouts and layout have to be attached to a composition for objects to be rendered. Setting a parent to and child widget does not mean that when the parent is rendered, the child is also rendered. For instance, setting a button to be the child of a check-box means absolutely nothing is terms of rendering. The check-box draw function would have to be aware of the existence of the button in order to render it.
A view with a parent cannot be parented to another area for rendering. It has to be un-parented first.
A layout with a parent cannot be parented to another area for rendering. It has to be un-parented first.
In essence only View and Layouts should be calling SetParentObject/UnParentObject.
SetParentObject returns true if it was successful.

Parameters:
parentThe object that will become the parent of this area.
Returns:
True if the object is successfully parented.

Definition at line 272 of file Area.cpp.

  {
    if (parent == 0)
    {
      nuxAssertMsg(0, "[Area::SetParentObject] Invalid parent obejct.");
      return false;
    }

    if (parent_area_ && (parent_area_ != parent))
    {
      nuxAssertMsg(0, "[Area::SetParentObject] Object already has a parent. You must UnParent the object before you can parenting again.");
      return false;
    }

    if (parent_area_)
    {
      // Already parented to the same area. Return.
      return true;
    }

    parent_area_ = parent;
    Reference();

    return true;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Mark the path from this area to its top level parent as the one to follow
to get to the area that has the keyboard.

Definition at line 968 of file Area.cpp.

  {
    has_key_focus_ = true;
    next_object_to_key_focus_area_ = NULL;

    Area* child = this;
    Area* parent = GetParentObject();

    while (parent)
    {
      parent->next_object_to_key_focus_area_ = child;
      parent->next_object_to_key_focus_area_->Reference();
      parent->has_key_focus_ = false;
      child = parent;
      parent = parent->GetParentObject();
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::SetPercentage ( float  f) [virtual]

Definition at line 611 of file Area.cpp.

Here is the caller graph for this function:

Definition at line 591 of file Area.cpp.

Here is the caller graph for this function:

bool nux::Introspectable::SetProperty ( std::string const &  name,
const char *  value 
) [inline, inherited]

If the property was not able to be set with the value, the method returns false.

Definition at line 262 of file Property-inl.h.

{
  PropertyContainer::iterator i = properties_.find(name);
  if (i == properties_.end())
    return false;
  else
    return i->second->SetValue(value);
}
template<typename T >
bool nux::Introspectable::SetProperty ( std::string const &  name,
T const &  value 
) [inherited]

Definition at line 273 of file Property-inl.h.

{
  PropertyContainer::iterator i = properties_.find(name);
  if (i == properties_.end())
    return false;
  else
  {
    return i->second->SetValue(type::PropertyTrait<T>::to_string(value));
  }
}
void nux::Area::SetReconfigureParentLayoutOnGeometryChange ( bool  reconfigure_parent_layout)

Set to True to initiate a layout reconfiguration when the geometry of this widget changes.

When the geometry of an area changes, the new geometry can be recursively propagated to all its parent so a layout reconfiguration is initiated.

See also:
ReconfigureParentLayout()
on_geometry_change_reconfigure_parent_layout_
Parameters:
reconfigure_parent_layoutSet it to True to reconfigure this area parent layouts.

Definition at line 411 of file Area.cpp.

  {
    on_geometry_change_reconfigure_parent_layout_ = reconfigure_parent_layout;
  }

Here is the caller graph for this function:

void nux::Area::SetScaleFactor ( unsigned int  sf) [virtual]

Set the area scale factor.

The scale factor is used to control the layout of area objects inside HLayout and VLayout.

See also:
HLayout, VLayout.
Parameters:
thescale factor.

Definition at line 266 of file Area.cpp.

  {
    // re implemented by Layout
    scale_factor_ = sf;
  }

Here is the caller graph for this function:

void nux::Area::SetSensitive ( bool  sensitive)

Deprecated. Use SetInputEventSensitivity.

Definition at line 558 of file Area.cpp.

  {
    SetInputEventSensitivity(sensitive);
  }

Here is the call graph for this function:

void nux::Area::SetVisible ( bool  visible)

Set visibility of the area.

If visible, an area will be drawn. Default: true.

Parameters:
visibleif the area is visible to the user

Definition at line 540 of file Area.cpp.

  {
    if (IsLayout())
      return;

    if (visible_ == visible)
      return;

    visible_ = visible;

    OnVisibleChanged.emit(this, visible_);
  }

Here is the call graph for this function:

bool nux::Object::SinkReference ( ) [virtual, inherited]

Mark the object as owned.

If this object is not owned, calling SinkReference() as the same effect as calling Reference().

Returns:
True if the object was not owned previously

Reimplemented from nux::Trackable.

Definition at line 306 of file Object.cpp.

  {
    return Reference();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Area::TestMousePointerInclusion ( const Point mouse_position,
NuxEventType  event_type 
)

Test if a point is inside the area.

Parameters:
pA 2D point.
event_typeThe type of mouse event(a parameter of FindAreaUnderMouse).
Returns:
True if p is located inside the Area.

Definition at line 873 of file Area.cpp.

   {
     if ((IsLayout() == false) && ((visible_ == false) ||
       (sensitive_ == false) ||
       (view_enabled_ == false)))
     {
       // If this area is not a view and:
       //    - it is insensitive to input event
       //    - it is not enabled
       //    - it is not visible
       // then return false.
       return false;
     }
 
     bool mouse_pointer_inside_area = false;
 
     if (Type().IsDerivedFromType(MenuPage::StaticObjectType))
     {
       // A MenuPage geometry is already in absolute coordinates.
       mouse_pointer_inside_area = geometry_.IsInside(mouse_position);
     }
     else
     {
       mouse_pointer_inside_area = GetAbsoluteGeometry().IsInside(mouse_position);
     }
 
     if ((event_type == NUX_MOUSE_WHEEL) && mouse_pointer_inside_area)
     {
       if (accept_mouse_wheel_event_ == false)
         return NULL;
     }
 
     return mouse_pointer_inside_area;
   }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Area::TestMousePointerInclusionFilterMouseWheel ( const Point mouse_position,
NuxEventType  event 
)

Test if a point is inside the area and if the area accepts mouse wheel events.

Parameters:
pA 2D point.
event_typeThe type of mouse event(a parameter of FindAreaUnderMouse).
filter_mouse_wheel_eventIf the event type is NUX_MOUSE_WHEEL and the mouse is over this area and this area does not accept mouse wheel events, then return false.
Returns:
True if p is located inside the Area.

Definition at line 908 of file Area.cpp.

   {
     if ((IsLayout() == false) && ((visible_ == false) ||
       (sensitive_ == false) ||
       (view_enabled_ == false)))
     {
       // If this area is not a view and:
       //    - it is insensitive to input event
       //    - it is not enabled
       //    - it is not visible
       // then return false.
 
       return false;
     }
 
     bool mouse_pointer_inside_area = false;
 
     if (Type().IsDerivedFromType(MenuPage::StaticObjectType))
     {
       // A MenuPage geometry is already in absolute coordinates.
       mouse_pointer_inside_area = geometry_.IsInside(mouse_position);
     }
     else
     {
       mouse_pointer_inside_area = GetAbsoluteGeometry().IsInside(mouse_position);
     }
 
     return mouse_pointer_inside_area;
   }

Here is the call graph for this function:

Here is the caller graph for this function:

void nux::Area::UnParentObject ( ) [virtual]

Un-parent and area.

For un-parented areas the following functions are equivalent:

Definition at line 298 of file Area.cpp.

  {
    // If the area is on the path to the key focus area, or has focus, reset it.
    if (has_key_focus_ || next_object_to_key_focus_area_)
    {
      GetWindowThread()->GetWindowCompositor().SetKeyFocusArea(NULL, KEY_NAV_NONE);
    }

    if (parent_area_)
    {
      parent_area_ = 0;
      UnReference();
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool nux::Object::UnReference ( ) [virtual, inherited]

Decrease reference count.

Returns:
True if the object reference count has reached 0 and the object has been destroyed.

Reimplemented from nux::Trackable.

Definition at line 274 of file Object.cpp.

  {
    if (!IsHeapAllocated())
    {
      LOG_WARN(logger) << "Trying to un-reference an object that was not heap allocated."
                       << "\nObject allocated at: " << GetAllocationLoation() << "\n";
      return false;
    }

    if (objectptr_count_->GetValue() == reference_count_->GetValue())
    {
      // There are ObjectPtr's hosting this object. Release all of them to
      // destroy this object.  This prevent from calling UnReference () many
      // times and destroying the object when there are ObjectPtr's hosting
      // it.  This method should not be called directly in that case.
      LOG_WARN(logger) << "There are ObjectPtr hosting this object. "
                       << "Release all of them to destroy this object. "
                       << "\nObject allocated at: " << GetAllocationLoation() << "\n";
      return false;
    }

    reference_count_->Decrement();

    if (reference_count_->GetValue() == 0)
    {
      Destroy();
      return true;
    }

    return false;
  }

Here is the call graph for this function:


Friends And Related Function Documentation

friend class HSplitter [friend]

Definition at line 674 of file Area.h.

friend class Layout [friend]

Reimplemented in nux::View.

Definition at line 671 of file Area.h.

friend class View [friend]

Definition at line 672 of file Area.h.

friend class VSplitter [friend]

Definition at line 675 of file Area.h.

friend class WindowCompositor [friend]

Reimplemented in nux::InputArea, nux::MenuPage, nux::BaseWindow, nux::View, and nux::FloatingWindow.

Definition at line 676 of file Area.h.

friend class WindowThread [friend]

Reimplemented in nux::BaseWindow.

Definition at line 673 of file Area.h.


Member Data Documentation

2D transformation matrix for this area and its children.

Contains only translations.

Definition at line 660 of file Area.h.

bool nux::Area::_3d_area [private]

True if the area is resides in a 3D space.

Definition at line 662 of file Area.h.

3D transformation matrix for the area in a perspective space.

Definition at line 661 of file Area.h.

A text string property for this area.

Definition at line 647 of file Area.h.

std::list<Area*> nux::Area::_children_list [private]

Definition at line 664 of file Area.h.

int nux::Trackable::_heap_allocated [protected, inherited]

Definition at line 158 of file Object.h.

Definition at line 667 of file Area.h.

Definition at line 666 of file Area.h.

sigc::signal<void, Area*> nux::Area::ChildFocusChanged

Definition at line 341 of file Area.h.

The area geometry.

Definition at line 632 of file Area.h.

bool nux::Area::has_key_focus_ [protected]

If this variable is true, then this area has the keyboard focus.

Definition at line 610 of file Area.h.

This signal is received when the area has the key focus and the ENTER key has been pressed.

Definition at line 354 of file Area.h.

This signal is received whether the area receiving or loosing the keyboard focus.

If the second parameter is true, it means the area is receiving the focus. The third parameter of this signal indicates the keyboard action that triggered this area to receive or loose the keyboard focus.

Definition at line 349 of file Area.h.

bool nux::Area::layout_done_ [private]

Area layout status flag.

Definition at line 657 of file Area.h.

A text string property for this area.

Definition at line 650 of file Area.h.

A text string property for this area.

Definition at line 649 of file Area.h.

Area position hint.

Definition at line 654 of file Area.h.

Area dimension hint.

Definition at line 655 of file Area.h.

Area size percentage value.

Definition at line 656 of file Area.h.

If this variable is not NULL, then this area is part of the keyboard focus chain.

Definition at line 624 of file Area.h.

sigc::signal<void, Object *> nux::Object::object_destroyed [inherited]

Signal emitted immediately before the object is destroyed.

Definition at line 214 of file Object.h.

Definition at line 607 of file Area.h.

sigc::signal<void, Area *, Geometry&> nux::Area::OnGeometryChanged

This signal is only meant to inform of a change of size.

When receiving this signal don't do anything that could change the size of this object. Or you risk creating an infinite loop.

Definition at line 459 of file Area.h.

sigc::signal<void, int, int, int, int> nux::Area::OnResize

Signal emitted when an area is resized.

Definition at line 451 of file Area.h.

sigc::signal<void, Area *, bool> nux::Area::OnSensitiveChanged

Definition at line 453 of file Area.h.

sigc::signal<void, Area *, bool> nux::Area::OnVisibleChanged

Definition at line 452 of file Area.h.

Define a parent child structure.

Definition at line 641 of file Area.h.

unsigned int nux::Area::scale_factor_ [private]

Factor for element expansion.

Definition at line 653 of file Area.h.

bool nux::Area::sensitive_ [private]

Input sensitive state of the area.

Definition at line 644 of file Area.h.

bool nux::Area::view_enabled_ [private]

The enable state of a view.

Definition at line 645 of file Area.h.

bool nux::Area::visible_ [private]

Visible state of the area.

Reimplemented in nux::TextEntry.

Definition at line 643 of file Area.h.

Definition at line 669 of file Area.h.


The documentation for this class was generated from the following files: