GCancellable

GCancellable

Synopsis




                    GCancellable;
GCancellable*       g_cancellable_new                   (void);
gboolean            g_cancellable_is_cancelled          (GCancellable *cancellable);
gboolean            g_cancellable_set_error_if_cancelled
                                                        (GCancellable *cancellable,
                                                         GError **error);
int                 g_cancellable_get_fd                (GCancellable *cancellable);
GCancellable*       g_cancellable_get_current           (void);
void                g_push_current_cancellable          (GCancellable *cancellable);
void                g_pop_current_cancellable           (GCancellable *cancellable);
void                g_cancellable_reset                 (GCancellable *cancellable);
void                g_cancellable_cancel                (GCancellable *cancellable);


Object Hierarchy


  GObject
   +----GCancellable

Signals


  "cancelled"                                      : Run Last

Description

Details

GCancellable

typedef struct _GCancellable GCancellable;


g_cancellable_new ()

GCancellable*       g_cancellable_new                   (void);

Returns :

a new GCancellable object.

g_cancellable_is_cancelled ()

gboolean            g_cancellable_is_cancelled          (GCancellable *cancellable);

cancellable :

a GCancellable or NULL.

Returns :

TRUE if cancellable is is cancelled, FALSE if called with NULL or if item is not cancelled.

g_cancellable_set_error_if_cancelled ()

gboolean            g_cancellable_set_error_if_cancelled
                                                        (GCancellable *cancellable,
                                                         GError **error);

Sets the current error to notify that the operation was cancelled.

cancellable :

a GCancellable object.

error :

GError to append error state to.

Returns :

TRUE if cancellable was cancelled, FALSE if it was not.

g_cancellable_get_fd ()

int                 g_cancellable_get_fd                (GCancellable *cancellable);

cancellable :

a GCancellable.

Returns :

A valid file descriptor. -1 if the file descriptor is not supported, or on errors.

g_cancellable_get_current ()

GCancellable*       g_cancellable_get_current           (void);

Returns :

a GCancellable from the top of the stack, or NULL if the stack is empty.

g_push_current_cancellable ()

void                g_push_current_cancellable          (GCancellable *cancellable);

Pushes cancellable onto the cancellable stack.

cancellable :

optional GCancellable object, NULL to ignore.

g_pop_current_cancellable ()

void                g_pop_current_cancellable           (GCancellable *cancellable);

Pops cancellable off the cancellable stack if cancellable is on the top of the stack.

cancellable :

optional GCancellable object, NULL to ignore.

g_cancellable_reset ()

void                g_cancellable_reset                 (GCancellable *cancellable);

Resets cancellable to its uncancelled state.

cancellable :

a GCancellable object.

g_cancellable_cancel ()

void                g_cancellable_cancel                (GCancellable *cancellable);

Will set cancellable to cancelled, and will emit the CANCELLED signal. This function is thread-safe.

cancellable :

a GCancellable object.

Signal Details

The "cancelled" signal

void                user_function                      (GCancellable *gcancellable,
                                                        gpointer      user_data)         : Run Last

gcancellable :

the object which received the signal.

user_data :

user data set when the signal handler was connected.