## MxOffscreen MxOffscreen — an offscreen container widget |

## Synopsis

    struct              MxOffscreen;
    struct              MxOffscreenClass;
    ClutterActor *      mx_offscreen_new                    (void);
    void                mx_offscreen_set_child              (MxOffscreen *offscreen,
                                                             ClutterActor *actor);
    ClutterActor *      mx_offscreen_get_child              (MxOffscreen *offscreen);
    void                mx_offscreen_set_pick_child         (MxOffscreen *offscreen,
                                                             gboolean pick);
    gboolean            mx_offscreen_get_pick_child         (MxOffscreen *offscreen);
    void                mx_offscreen_set_auto_update        (MxOffscreen *offscreen,
                                                             gboolean auto_update);
    gboolean            mx_offscreen_get_auto_update        (MxOffscreen *offscreen);
    void                mx_offscreen_set_redirect_enabled   (MxOffscreen *offscreen,
                                                             gboolean enabled);
    gboolean            mx_offscreen_get_redirect_enabled   (MxOffscreen *offscreen);
    CoglHandle          mx_offscreen_get_buffer             (MxOffscreen *offscreen);
    void                mx_offscreen_update                 (MxOffscreen *offscreen);
    void                mx_offscreen_set_accumulation_enabled
                                                            (MxOffscreen *offscreen,
                                                             gboolean enable);
    gboolean            mx_offscreen_get_accumulation_enabled
                                                            (MxOffscreen *offscreen);
    CoglHandle          mx_offscreen_get_accumulation_material
                                                            (MxOffscreen *offscreen);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ClutterActor
                   +----ClutterTexture
                         +----MxOffscreen

## Implemented Interfaces

MxOffscreen implements ClutterScriptable, ClutterAnimatable, AtkImplementorIface, ClutterContainer and MxFocusable.

## Properties

      "accumulation-enabled"     gboolean              : Read / Write
      "accumulation-material"    gpointer              : Read
      "auto-update"              gboolean              : Read / Write
      "buffer"                   gpointer              : Read
      "child"                    ClutterActor*         : Read / Write
      "pick-child"               gboolean              : Read / Write
      "redirect-enabled"         gboolean              : Read / Write

## Description

MxOffscreen allows you to redirect the painting of a ClutterActor to a texture. It can either contain this actor, or optionally, it can redirect the painting of an actor that it does not contain.

This is often useful for applying a ClutterShader effect to an actor or group of actors that is not a texture.

## Details

### struct MxOffscreen

    struct MxOffscreen;

The contents of this structure is private and should only be accessed using the provided API.

### struct MxOffscreenClass

    struct MxOffscreenClass {
      ClutterTextureClass parent_class;

      /* vfuncs */
      void (* paint_child) (MxOffscreen *self);

      /* padding for future expansion */
      void (*_padding_0) (void);
      void (*_padding_1) (void);
      void (*_padding_2) (void);
      void (*_padding_3) (void);
      void (*_padding_4) (void);
    };

### mx_offscreen_new ()

    ClutterActor *      mx_offscreen_new                    (void);

Creates a new MxOffscreen.

Returns : | a newly allocated MxOffscreen

### mx_offscreen_set_child ()

    void                mx_offscreen_set_child              (MxOffscreen *offscreen,
                                                             ClutterActor *actor);

Redirects the painting of `actor` to the offscreen surface owned by `offscreen`. In the event that `actor` is unparented, it will be parented to `offscreen`. Note that when you redirect the painting of `actor`, it will no longer be painted in its original position in the scenegraph.

`offscreen` : | A MxOffscreen
`actor` : | A ClutterActor

### mx_offscreen_get_child ()

    ClutterActor *      mx_offscreen_get_child              (MxOffscreen *offscreen);

Gets the value of the "child" property.

`offscreen` : | A MxOffscreen
Returns : | The child of the offscreen widget. [transfer none]

### mx_offscreen_set_pick_child ()

    void                mx_offscreen_set_pick_child         (MxOffscreen *offscreen,
                                                             gboolean pick);

Enable picking of the child actor.

`offscreen` : | A MxOffscreen
`pick` : | TRUE to enable picking of the child actor

### mx_offscreen_get_pick_child ()

    gboolean            mx_offscreen_get_pick_child         (MxOffscreen *offscreen);

Gets the value of the "pick-child" property.

`offscreen` : | A MxOffscreen
Returns : | TRUE if picking of the child is enabled.

### mx_offscreen_set_auto_update ()

    void                mx_offscreen_set_auto_update        (MxOffscreen *offscreen,
                                                             gboolean auto_update);

Enable automatic updating of the offscreen surface when the child is updated.

`offscreen` : | A MxOffscreen
`auto_update` : | TRUE if the offscreen surface should be automatically updated

### mx_offscreen_get_auto_update ()

    gboolean            mx_offscreen_get_auto_update        (MxOffscreen *offscreen);

Gets the value of the "auto-update" property.

`offscreen` : | A MxOffscreen
Returns : | TRUE if automatic updating of the offscreen surface is enabled

### mx_offscreen_set_redirect_enabled ()

    void                mx_offscreen_set_redirect_enabled   (MxOffscreen *offscreen,
                                                             gboolean enabled);

Sets the value of the "redirect-enabled" property. When redirection is enabled, the painting of the child of `offscreen` will be redirected to the texture of `offscreen`.

`offscreen` : | A MxOffscreen
`enabled` : | TRUE if redirection to the offscreen surface should be enabled

Since 1.2

### mx_offscreen_get_redirect_enabled ()

    gboolean            mx_offscreen_get_redirect_enabled   (MxOffscreen *offscreen);

Gets the value of the "redirect-enabled" property.

`offscreen` : | A MxOffscreen
Returns : | TRUE if offscreen redirection is enabled

Since 1.2

### mx_offscreen_get_buffer ()

    CoglHandle          mx_offscreen_get_buffer             (MxOffscreen *offscreen);

Gets the value of the "buffer" property.

`offscreen` : | A MxOffscreen
Returns : | the CoglHandle for the offscreen buffer object. [transfer none]

Since 1.2

### mx_offscreen_update ()

    void                mx_offscreen_update                 (MxOffscreen *offscreen);

Updates the offscreen surface. This causes the child of `offscreen` to be drawn into the texture of `offscreen`.

`offscreen` : | A MxOffscreen

### mx_offscreen_set_accumulation_enabled ()

    void                mx_offscreen_set_accumulation_enabled
                                                            (MxOffscreen *offscreen,
                                                             gboolean enable);

Sets whether the accumulation buffer is enabled. When enabled, an extra offscreen buffer is allocated, and the contents of the offscreen texture are blended with this accumulation buffer. By default, the blend function is set to blend the contents of the offscreen texture with the accumulation buffer at the opacity specified in the alpha component of the blend constant. This opacity is 50% by default.

`offscreen` : | A MxOffscreen
`enable` : | TRUE to enable an accumulation buffer

Since 1.2

### mx_offscreen_get_accumulation_enabled ()

    gboolean            mx_offscreen_get_accumulation_enabled
                                                            (MxOffscreen *offscreen);

Gets the value of the "accumulation-enabled" property.

`offscreen` : | A MxOffscreen
Returns : | TRUE if the accumulation buffer is enabled

Since 1.2

### mx_offscreen_get_accumulation_material ()

    CoglHandle          mx_offscreen_get_accumulation_material
                                                            (MxOffscreen *offscreen);

Gets the "accumulation-material" property.

`offscreen` : | A MxOffscreen
Returns : | The CoglHandle for the material used for the accumulation buffer. [transfer none]

Since 1.2

## Property Details

### The `"accumulation-enabled"` property

      "accumulation-enabled"     gboolean              : Read / Write

Enable an accumulation buffer via a secondary buffer.

Default value: FALSE

### The `"accumulation-material"` property

      "accumulation-material"    gpointer              : Read

Material used for the accumulation buffer.

### The `"auto-update"` property

      "auto-update"              gboolean              : Read / Write

Update child actor automatically when painting.

Default value: TRUE

### The `"buffer"` property

      "buffer"                   gpointer              : Read

The off-screen buffer used to draw the child.

### The `"child"` property

      "child"                    ClutterActor*         : Read / Write

Child actor of the offscreen texture.

### The `"pick-child"` property

      "pick-child"               gboolean              : Read / Write

Whether to pick the child.

Default value: FALSE

### The `"redirect-enabled"` property

      "redirect-enabled"         gboolean              : Read / Write

Enable redirection of the child actor to the off-screen surface.

Default value: TRUE