## ShellGenericContainer

ShellGenericContainer — A container class with signals for allocation

## Synopsis

    struct              ShellGenericContainer;
                        ShellGenericContainerAllocation;
    struct              ShellGenericContainerClass;
    guint               shell_generic_container_get_n_skip_paint
                                                            (ShellGenericContainer *self);
    gboolean            shell_generic_container_get_skip_paint
                                                            (ShellGenericContainer *self,
                                                             ClutterActor *child);
    void                shell_generic_container_set_skip_paint
                                                            (ShellGenericContainer *self,
                                                             ClutterActor *child,
                                                             gboolean skip);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ClutterActor
                   +----StWidget
                         +----StContainer
                               +----ShellGenericContainer

      GBoxed
       +----ShellGenericContainerAllocation

## Implemented Interfaces

ShellGenericContainer implements ClutterScriptable, ClutterAnimatable, AtkImplementorIface and ClutterContainer.

## Signals

      "allocate"                                       : Run Last
      "get-preferred-height"                           : Run Last
      "get-preferred-width"                            : Run Last

## Description

ShellGenericContainer is mainly a workaround for the current lack of GObject subclassing + vfunc overrides in gjs. We implement the container interface, but proxy the virtual functions into signals, which gjs can catch.

ShellGenericContainer is an StWidget, and automatically takes its borders and padding into account during size request and allocation.

## Details

### struct ShellGenericContainer

    struct ShellGenericContainer;

### ShellGenericContainerAllocation

    typedef struct {
      float min_size;
      float natural_size;
    } ShellGenericContainerAllocation;

### struct ShellGenericContainerClass

    struct ShellGenericContainerClass {
        StContainerClass parent_class;
    };

### shell_generic_container_get_n_skip_paint ()

    guint               shell_generic_container_get_n_skip_paint
                                                            (ShellGenericContainer *self);

`self` : | A ShellGenericContainer
Returns : | Number of children which will not be painted.

### shell_generic_container_get_skip_paint ()

    gboolean            shell_generic_container_get_skip_paint
                                                            (ShellGenericContainer *self,
                                                             ClutterActor *child);

Gets whether or not `actor` is skipped when painting.

`self` : | A ShellGenericContainer
`child` : | Child ClutterActor
Returns : | `TRUE` or `FALSE`

### shell_generic_container_set_skip_paint ()

    void                shell_generic_container_set_skip_paint
                                                            (ShellGenericContainer *self,
                                                             ClutterActor *child,
                                                             gboolean skip);

Set whether or not we should skip painting `actor`. Workaround for lack of gjs ability to override _paint vfunc.

`self` : | A ShellGenericContainer
`child` : | Child ClutterActor
`skip` : | `TRUE` if we should skip painting

## Signal Details

### The `"allocate"` signal

    void                user_function                      (ShellGenericContainer *self,
                                                            ClutterActorBox       *box,
                                                            ClutterAllocationFlags flags,
                                                            gpointer               user_data)      : Run Last

Emitted when `self` is allocated, after chaining up to the parent allocate method.

Note that `box` is `self`'s content box (qv `st_theme_node_get_content_box()`), NOT its allocation.

`self` : | the ShellGenericContainer
`box` : | `self`'s content box
`flags` : | the allocation flags.
`user_data` : | user data set when the signal handler was connected.

### The `"get-preferred-height"` signal

    void                user_function                      (ShellGenericContainer           *self,
                                                            gfloat                           for_width,
                                                            ShellGenericContainerAllocation *alloc,
                                                            gpointer                         user_data)      : Run Last

Emitted when `clutter_actor_get_preferred_height()` is called on `self`. You should fill in the fields of `alloc` with the your minimum and natural heights. ShellGenericContainer will deal with taking its borders and padding into account for you.

`alloc`'s fields are initialized to 0, so unless you have a fixed height specified (via "height" or CSS), you must connect to this signal and fill in the values.

`self` : | the ShellGenericContainer
`for_width` : | as in `clutter_actor_get_preferred_height()`
`alloc` : | a ShellGenericContainerAllocation to be filled in
`user_data` : | user data set when the signal handler was connected.

### The `"get-preferred-width"` signal

    void                user_function                      (ShellGenericContainer           *self,
                                                            gfloat                           for_height,
                                                            ShellGenericContainerAllocation *alloc,
                                                            gpointer                         user_data)       : Run Last

Emitted when `clutter_actor_get_preferred_width()` is called on `self`. You should fill in the fields of `alloc` with the your minimum and natural widths. ShellGenericContainer will deal with taking its borders and padding into account for you.

`alloc`'s fields are initialized to 0, so unless you have a fixed width specified (via "width" or CSS), you must connect to this signal and fill in the values.

`self` : | the ShellGenericContainer
`for_height` : | as in `clutter_actor_get_preferred_width()`
`alloc` : | a ShellGenericContainerAllocation to be filled in
`user_data` : | user data set when the signal handler was connected.