## OGMJobSpawn OGMJobSpawn — Base class for all spawns |

## Synopsis

    #include <ogmjob-spawn.h>

    struct              OGMJobSpawn;
    gint                ogmjob_spawn_run                    (OGMJobSpawn *spawn,
                                                             GError **error);
    void                ogmjob_spawn_cancel                 (OGMJobSpawn *spawn);
    void                ogmjob_spawn_suspend                (OGMJobSpawn *spawn);
    void                ogmjob_spawn_resume                 (OGMJobSpawn *spawn);
    void                ogmjob_spawn_set_async              (OGMJobSpawn *spawn,
                                                             gboolean async);
    gboolean            ogmjob_spawn_get_async              (OGMJobSpawn *spawn);
    OGMJobSpawn *       ogmjob_spawn_get_parent             (OGMJobSpawn *spawn);
    void                ogmjob_spawn_set_parent             (OGMJobSpawn *spawn,
                                                             OGMJobSpawn *parent);
    void                ogmjob_spawn_propagate_error        (OGMJobSpawn *spawn,
                                                             GError *error);

## Object Hierarchy

      GObject
       +----OGMJobSpawn
             +----OGMJobContainer
             +----OGMJobExec

## Signals

      "cancel"                                         : No Hooks
      "progress"                                       : No Hooks
      "resume"                                         : No Hooks
      "run"                                            : No Hooks
      "suspend"                                        : No Hooks

## Description

## Details

### struct OGMJobSpawn

    struct OGMJobSpawn;

### ogmjob_spawn_run ()

    gint                ogmjob_spawn_run                    (OGMJobSpawn *spawn,
                                                             GError **error);

Runs a spawn.

`spawn` : | An OGMJobSpawn
`error` : | Location for error, or `NULL`
Returns : | An OGMJobResultType

### ogmjob_spawn_cancel ()

    void                ogmjob_spawn_cancel                 (OGMJobSpawn *spawn);

Cancels a spawn.

`spawn` : | An OGMJobSpawn

### ogmjob_spawn_suspend ()

    void                ogmjob_spawn_suspend                (OGMJobSpawn *spawn);

Suspends a spawn.

`spawn` : | An OGMJobSpawn

### ogmjob_spawn_resume ()

    void                ogmjob_spawn_resume                 (OGMJobSpawn *spawn);

Resumes a suspended spawn.

`spawn` : | An OGMJobSpawn

### ogmjob_spawn_set_async ()

    void                ogmjob_spawn_set_async              (OGMJobSpawn *spawn,
                                                             gboolean async);

Sets whether to run the spawn asynchronously.

`spawn` : | An OGMJobSpawn
`async` : | TRUE if asynchronous

### ogmjob_spawn_get_async ()

    gboolean            ogmjob_spawn_get_async              (OGMJobSpawn *spawn);

Gets whether to run the spawn asynchronously.

`spawn` : | An OGMJobSpawn
Returns : | TRUE if asynchronous

### ogmjob_spawn_get_parent ()

    OGMJobSpawn *       ogmjob_spawn_get_parent             (OGMJobSpawn *spawn);

Returns the parent container of a spawn.

`spawn` : | An OGMJobSpawn
Returns : | An OGMJobSpawn, or NULL

### ogmjob_spawn_set_parent ()

    void                ogmjob_spawn_set_parent             (OGMJobSpawn *spawn,
                                                             OGMJobSpawn *parent);

Sets the container as the parent of a widget.

`spawn` : | An OGMJobSpawn
`parent` : | The parent container

### ogmjob_spawn_propagate_error ()

    void                ogmjob_spawn_propagate_error        (OGMJobSpawn *spawn,
                                                             GError *error);

Propagates `error` in `spawn`.

`spawn` : | An OGMJobSpawn
`error` : | An GError

## Signal Details

### The `"cancel"` signal

    void                user_function                      (OGMJobSpawn *spawn,
                                                            gpointer     user_data)      : No Hooks

Emitted each time a spawn is canceled.

`spawn` : | the spawn that received the signal
`user_data` : | user data set when the signal handler was connected.

### The `"progress"` signal

    void                user_function                      (OGMJobSpawn *spawn,
                                                            gdouble      fraction,
                                                            gpointer     user_data)      : No Hooks

Emitted each time a spawn progresses.

`spawn` : | the spawn that received the signal
`fraction` : | fraction of the spawn that's been completed
`user_data` : | user data set when the signal handler was connected.

### The `"resume"` signal

    void                user_function                      (OGMJobSpawn *spawn,
                                                            gpointer     user_data)      : No Hooks

Emitted each time a suspended spawn is resumed.

`spawn` : | the spawn that received the signal
`user_data` : | user data set when the signal handler was connected.

### The `"run"` signal

    gint                user_function                      (OGMJobSpawn *spawn,
                                                            gpointer     user_data)      : No Hooks

Emitted each time a spawn is run.

`spawn` : | the spawn that received the signal
`user_data` : | user data set when the signal handler was connected.
Returns : | An OGMJobResultType

### The `"suspend"` signal

    void                user_function                      (OGMJobSpawn *spawn,
                                                            gpointer     user_data)      : No Hooks

Emitted each time a spawn is suspended.

`spawn` : | the spawn that received the signal
`user_data` : | user data set when the signal handler was connected.