Update the ClutterBox API and structure

ClutterBox is meant to work like the HTML boxing model: it has a margin and
a backgrdound color, and every child actor is added with a pack type and a
padding. The ClutterBoxChild structure holds the child actor, the padding,
the packing type and the allocated coordinates for the actor.
This commit is contained in:
Emmanuele Bassi
2007-08-06 19:36:27 +00:00
parent b3c8ff186c
commit 54b77d12cd
4 changed files with 369 additions and 79 deletions

View File

@ -35,6 +35,8 @@ G_BEGIN_DECLS
#define CLUTTER_TYPE_GEOMETRY (clutter_geometry_get_type ())
#define CLUTTER_TYPE_KNOT (clutter_knot_get_type ())
#define CLUTTER_TYPE_MARGIN (clutter_margin_get_type ())
#define CLUTTER_TYPE_PADDING (clutter_padding_get_type ())
#define CLUTTER_TYPE_VERTEX (clutter_vertex_get_type ())
/**
@ -71,6 +73,8 @@ typedef enum { /*< prefix=CLUTTER_GRAVITY >*/
typedef struct _ClutterGeometry ClutterGeometry;
typedef struct _ClutterKnot ClutterKnot;
typedef struct _ClutterMargin ClutterMargin;
typedef struct _ClutterPadding ClutterPadding;
typedef struct _ClutterVertex ClutterVertex;
/**
@ -164,6 +168,48 @@ typedef enum { /*< prefix=CLUTTER_ROTATE >*/
CLUTTER_ROTATE_CCW
} ClutterRotateDirection;
/**
* ClutterMargin:
* @top: top margin
* @right: right margin
* @bottom: bottom margin
* @left: left margin
*
* Margins from the inner borders of a container
*
* Since: 0.4
*/
struct _ClutterMargin
{
ClutterUnit top;
ClutterUnit right;
ClutterUnit bottom;
ClutterUnit left;
};
GType clutter_margin_get_type (void) G_GNUC_CONST;
/**
* ClutterPadding
* @top: top padding
* @right: right padding
* @bottom: bottom padding
* @left: left padding
*
* Padding of the children of a container
*
* Since: 0.4
*/
struct _ClutterPadding
{
ClutterUnit top;
ClutterUnit right;
ClutterUnit bottom;
ClutterUnit left;
};
GType clutter_padding_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __CLUTTER_TYPES_H__ */