ClutterContent

ClutterContent — Delegate for painting the content of an actor

Functions

Types and Values

Description

ClutterContent is an interface to implement types responsible for painting the content of a ClutterActor.

Multiple actors can use the same ClutterContent instance, in order to share the resources associated with painting the same content.

ClutterContent is available since Clutter 1.10.

Functions

clutter_content_get_preferred_size ()

gboolean
clutter_content_get_preferred_size (ClutterContent *content,
                                    gfloat *width,
                                    gfloat *height);

Retrieves the natural size of the content , if any.

The natural size of a ClutterContent is defined as the size the content would have regardless of the allocation of the actor that is painting it, for instance the size of an image data.

Parameters

content

a ClutterContent

 

width

return location for the natural width of the content.

[out]

height

return location for the natural height of the content.

[out]

Returns

TRUE if the content has a preferred size, and FALSE otherwise

Since: 1.10


clutter_content_invalidate ()

void
clutter_content_invalidate (ClutterContent *content);

Invalidates a ClutterContent.

This function should be called by ClutterContent implementations when they change the way a the content should be painted regardless of the actor state.

Parameters

content

a ClutterContent

 

Since: 1.10

Types and Values

struct ClutterContentIface

struct ClutterContentIface {
  gboolean      (* get_preferred_size)  (ClutterContent   *content,
                                         gfloat           *width,
                                         gfloat           *height);
  void          (* paint_content)       (ClutterContent   *content,
                                         ClutterActor     *actor,
                                         ClutterPaintNode *node);

  void          (* attached)            (ClutterContent   *content,
                                         ClutterActor     *actor);
  void          (* detached)            (ClutterContent   *content,
                                         ClutterActor     *actor);

  void          (* invalidate)          (ClutterContent   *content);
};

The ClutterContentIface structure contains only private data.

Members

get_preferred_size ()

virtual function; should be overridden by subclasses of ClutterContent that have a natural size

 

paint_content ()

virtual function; called each time the content needs to paint itself

 

attached ()

virtual function; called each time a ClutterContent is attached to a ClutterActor.

 

detached ()

virtual function; called each time a ClutterContent is detached from a ClutterActor.

 

invalidate ()

virtual function; called each time a ClutterContent state is changed.

 

Since: 1.10