EekContainer

## EekContainer EekContainer — Base class of a keyboard container |

## Synopsis

    void                (*EekCallback)                      (EekElement *element,
                                                             gpointer user_data);
    gint                (*EekCompareFunc)                   (EekElement *element,
                                                             gpointer user_data);
                        EekContainer;
    struct              EekContainerClass;
    void                eek_container_add_child             (EekContainer *container,
                                                             EekElement *element);
    EekElement *        eek_container_find                  (EekContainer *container,
                                                             EekCompareFunc func,
                                                             gpointer user_data);
    void                eek_container_foreach_child         (EekContainer *container,
                                                             EekCallback callback,
                                                             gpointer user_data);

## Object Hierarchy

      GObject
       +----EekElement
             +----EekContainer
                   +----EekKeyboard
                   +----EekSection

## Signals

      "child-added"                                    : Run First
      "child-removed"                                  : Run First

## Description

The EekContainerClass class represents a keyboard container, which shall be used to implement EekKeyboard and EekSection.

## Details

### EekCallback ()

    void                (*EekCallback)                      (EekElement *element,
                                                             gpointer user_data);

The type of the callback function used for iterating over the children of a container, see `eek_container_foreach_child()`.

`element` : | an EekElement
`user_data` : | user-supplied data

### EekCompareFunc ()

    gint                (*EekCompareFunc)                   (EekElement *element,
                                                             gpointer user_data);

### EekContainer

    typedef struct _EekContainer EekContainer;

### struct EekContainerClass

    struct EekContainerClass {
        void        (* foreach_child)  (EekContainer      *self,
                                        EekCallback        callback,
                                        gpointer           user_data);
        EekElement *(* find)           (EekContainer      *self,
                                        EekCompareFunc     func,
                                        gpointer           data);

        /* signals */
        void        (* child_added)    (EekContainer      *self,
                                        EekElement        *element);
        void        (* child_removed)  (EekContainer      *self,
                                        EekElement        *element);
    };

`foreach_child` () | virtual function for iterating over the container's children
`find` () | virtual function for looking up a child
`child_added` () | class handler for "child-added"
`child_removed` () | class handler for "child-added"

### eek_container_add_child ()

    void                eek_container_add_child             (EekContainer *container,
                                                             EekElement *element);

### eek_container_find ()

    EekElement *        eek_container_find                  (EekContainer *container,
                                                             EekCompareFunc func,
                                                             gpointer user_data);

Find a child which matches the criteria supplied as `func`, in `container`.

`container` : | an EekContainer
`func` : | function to be used to compare two children
`user_data` : | additional data passed to `func`
Returns : | an EekElement or NULL on failure

### eek_container_foreach_child ()

    void                eek_container_foreach_child         (EekContainer *container,
                                                             EekCallback callback,
                                                             gpointer user_data);

Enumerate children of `container` and run `callback` with each child.

`container` : | an EekContainer
`callback` : | an EekCallback. [scope call]
`user_data` : | additional data passed to `callback`

## Signal Details

### The `"child-added"` signal

    void                user_function                      (EekContainer *container,
                                                            EekElement   *element,
                                                            gpointer      user_data)      : Run First

The ::child-added signal is emitted each time an element is added to `container`.

`container` : | an EekContainer
`element` : | an EekElement
`user_data` : | user data set when the signal handler was connected.

### The `"child-removed"` signal

    void                user_function                      (EekContainer *container,
                                                            EekElement   *element,
                                                            gpointer      user_data)      : Run First

The ::child-removed signal is emitted each time an element is removed from `container`.

`container` : | an EekContainer
`element` : | an EekElement
`user_data` : | user data set when the signal handler was connected.