Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Ewl_Object Struct Reference
[Object: Basic Object Inherited by Ewl_WidgetObject: Basic Object Inherited by Ewl_Widget]

Provides facilities for sizing, position, alignment and fill policy. More...


Data Fields

struct {
   int   x
 Horizontal position.

   int   y
 Vertical position.

   int   w
 Width.

   int   h
 Height.

current
 The current size and position of an object.

struct {
   int   w
 Width.

   int   h
 Height.

preferred
 The optimal size of the object in ideal circumstances.

struct {
   int   w
 Width.

   int   h
 Height.

maximum
 The guaranteed maximum size this object will receive.

struct {
   int   w
 Width.

   int   h
 Height.

minimum
 The guaranteed minimum size this object will receive.

struct {
   int   l
 Left value.

   int   r
 Right value.

   int   t
 Top value.

   int   b
 Bottom value.

pad
 The space padded around the outside of the object.

struct {
   int   l
 Left value.

   int   r
 Right value.

   int   t
 Top value.

   int   b
 Bottom value.

insets
 The space inside where children should not be laid out.

unsigned int flags
 Bitmask indicating fill policy and alignment.


Detailed Description

Provides facilities for sizing, position, alignment and fill policy.

The fields of the object, while their explanations are fairly clear, can be visualized with the following diagram:

object_fields.png
The CURRENT_W(w) and CURRENT_H(w) are macros that provide easy access to the data fields describing the internal area of the Ewl_Object. While the functions ewl_object_get_current_w(w) and ewl_object_get_current_h(w) are to access the overall size of the area this Ewl_Object resides in. There are corresponding macros and functions for preferred, minimum and maximum sizes as well. There are also functions for setting each of these values.

The affect of the fields when performing layout is as follows:

object_sizing.png
As illustrated, the fill policy determines how much space an object will use when the request for a specific size is made. When the fill policy contains EWL_FLAG_FILL_HSHRINK, EWL_FLAG_FILL_VSHRINK or both, the Ewl_Object can be resized down to it's minimum size in width, height or both respectively.

The opposite is true for a fill policy containing EWL_FLAG_FILL_HFILL, EWL_FLAG_FILL_VFILL or both, The Ewl_Object will now expand to fill the space up to it's maximum size in the respective direction.