PgmRenderLayoutIFace

PgmRenderLayoutIFace — An interface to layout objects.

Synopsis




enum        PgmRenderLayoutAspectStyle;
            PgmRenderLayoutIFace;
PgmRenderError pgm_render_layout_set_size   (PgmRenderLayoutIFace *layout,
                                             gint width,
                                             gint height);
PgmRenderError pgm_render_layout_get_size   (PgmRenderLayoutIFace *layout,
                                             gint *width,
                                             gint *height);
PgmRenderError pgm_render_layout_set_position
                                            (PgmRenderLayoutIFace *layout,
                                             gint x,
                                             gint y);
PgmRenderError pgm_render_layout_get_position
                                            (PgmRenderLayoutIFace *layout,
                                             gint *x,
                                             gint *y);
PgmRenderError pgm_render_layout_set_alignment
                                            (PgmRenderLayoutIFace *layout,
                                             gfloat x,
                                             gfloat y);
PgmRenderError pgm_render_layout_get_alignment
                                            (PgmRenderLayoutIFace *layout,
                                             gfloat *x,
                                             gfloat *y);
PgmRenderError pgm_render_layout_set_aspect_style
                                            (PgmRenderLayoutIFace *layout,
                                             PgmRenderLayoutAspectStyle style);
PgmRenderError pgm_render_layout_get_aspect_style
                                            (PgmRenderLayoutIFace *layout,
                                             PgmRenderLayoutAspectStyle *style);
PgmRenderError pgm_render_layout_set_aspect_ratio
                                            (PgmRenderLayoutIFace *layout,
                                             gfloat ratio);
PgmRenderError pgm_render_layout_get_aspect_ratio
                                            (PgmRenderLayoutIFace *layout,
                                             gfloat *ratio);


Description

PgmRenderLayoutIFace is an interface to add different layout capabilities to an object.

Details

enum PgmRenderLayoutAspectStyle

typedef enum {
  PGM_RENDER_LAYOUT_FILLED   = 0,
  PGM_RENDER_LAYOUT_SCALED   = 1,
  PGM_RENDER_LAYOUT_CENTERED = 2
} PgmRenderLayoutAspectStyle;

The different aspect ratio style.

PGM_RENDER_LAYOUT_FILLED Sets the image on the whole surface ignoring its pixel-aspect-ratio.
PGM_RENDER_LAYOUT_SCALED Respects the pixel-aspect-ratio of the image adapting the size to the object allocated one.
PGM_RENDER_LAYOUT_CENTERED Centers the image in the middle of the object. It crops the image if the allocated object size is lesser than the image size.

PgmRenderLayoutIFace

typedef struct _PgmRenderLayoutIFace PgmRenderLayoutIFace;


pgm_render_layout_set_size ()

PgmRenderError pgm_render_layout_set_size   (PgmRenderLayoutIFace *layout,
                                             gint width,
                                             gint height);

Set the size of the object to (width, height).

layout : A PgmRenderLayoutIFace object.
width : The width of the object.
height : The height of the object.
Returns :

pgm_render_layout_get_size ()

PgmRenderError pgm_render_layout_get_size   (PgmRenderLayoutIFace *layout,
                                             gint *width,
                                             gint *height);

Retrieves the (width, height) size of the object.

layout : A PgmRenderLayoutIFace object.
width : The width of the object to fill.
height : The height of the object to fill.
Returns :

pgm_render_layout_set_position ()

PgmRenderError pgm_render_layout_set_position
                                            (PgmRenderLayoutIFace *layout,
                                             gint x,
                                             gint y);

Set the position of the object to (x, y).

layout : A PgmRenderLayoutIFace object.
x : The x position of the object.
y : The y position of the object.
Returns :

pgm_render_layout_get_position ()

PgmRenderError pgm_render_layout_get_position
                                            (PgmRenderLayoutIFace *layout,
                                             gint *x,
                                             gint *y);

Retrieves the (x, y) position of the object.

layout : A PgmRenderLayoutIFace object.
x : The x position of the object to fill.
y : The y position of the object to fill.
Returns :

pgm_render_layout_set_alignment ()

PgmRenderError pgm_render_layout_set_alignment
                                            (PgmRenderLayoutIFace *layout,
                                             gfloat x,
                                             gfloat y);

Set the alignment of the object to (x, y).

layout : A PgmRenderLayoutIFace object.
x : The x alignment of the object between 0.0 and 1.0.
y : The y alignment of the object between 0.0 and 1.0.
Returns :

pgm_render_layout_get_alignment ()

PgmRenderError pgm_render_layout_get_alignment
                                            (PgmRenderLayoutIFace *layout,
                                             gfloat *x,
                                             gfloat *y);

Retrieves the (x, y) position of the object.

layout : A PgmRenderLayoutIFace object.
x : The x alignment of the object to fill. 0.5 by default.
y : The y alignment of the object to fill. 0.5 by default.
Returns :

pgm_render_layout_set_aspect_style ()

PgmRenderError pgm_render_layout_set_aspect_style
                                            (PgmRenderLayoutIFace *layout,
                                             PgmRenderLayoutAspectStyle style);

Set the aspect-ratio style of the object.

layout : A PgmRenderLayoutIFace object.
style : The aspect-ratio style of the object.
Returns :

pgm_render_layout_get_aspect_style ()

PgmRenderError pgm_render_layout_get_aspect_style
                                            (PgmRenderLayoutIFace *layout,
                                             PgmRenderLayoutAspectStyle *style);

Retrieves the aspect-ratio style of the object.

layout : A PgmRenderLayoutIFace object.
style : The aspect-ratio style of the object to fill.
Returns :

pgm_render_layout_set_aspect_ratio ()

PgmRenderError pgm_render_layout_set_aspect_ratio
                                            (PgmRenderLayoutIFace *layout,
                                             gfloat ratio);

Set a custom aspect-ratio (width/height) to the object.

layout : A PgmRenderLayoutIFace object.
ratio : The custom ratio.
Returns :

pgm_render_layout_get_aspect_ratio ()

PgmRenderError pgm_render_layout_get_aspect_ratio
                                            (PgmRenderLayoutIFace *layout,
                                             gfloat *ratio);

Retrieves the custom aspect-ratio (width/height) of the object.

layout : A PgmRenderLayoutIFace object.
ratio : The custom ratio to fill.
Returns :