undo

undo — Undo and redo.

Synopsis




gulong      gwy_app_undo_checkpoint         (GwyContainer *data,
                                             ...);
gulong      gwy_app_undo_checkpointv        (GwyContainer *data,
                                             gsize n,
                                             const gchar **keys);
void        gwy_app_undo_undo               (void);
void        gwy_app_undo_undo_window        (GwyDataWindow *data_window);
void        gwy_app_undo_redo               (void);
void        gwy_app_undo_redo_window        (GwyDataWindow *data_window);
gboolean    gwy_app_data_window_has_undo    (GwyDataWindow *data_window);
gboolean    gwy_app_data_window_has_redo    (GwyDataWindow *data_window);
void        gwy_app_undo_clear              (GwyDataWindow *data_window);

Description

For a module developer, the only two useful undo/redo functions are probably gwy_app_undo_checkpoint() and gwy_app_undo_checkpointv() creating a checkpoint in the undo history to which is possible to return to later. You should use these functions before commiting changes to data.

The other functions actually perform undo or redo, and has little use outside main application.

Details

gwy_app_undo_checkpoint ()

gulong      gwy_app_undo_checkpoint         (GwyContainer *data,
                                             ...);

Create a point in the undo history it is possible to return to.

XXX: It can only save the state of standard datafields.

data: A data container.
...: NULL-terminated list of container item names to save.
Returns : Undo level id. Not useful (yet).

gwy_app_undo_checkpointv ()

gulong      gwy_app_undo_checkpointv        (GwyContainer *data,
                                             gsize n,
                                             const gchar **keys);

Create a point in the undo history is is possible to return to.

XXX: It can only save the state of standard datafields.

data: A data container.
n: The number of strings in keys.
keys: An array of container keys to save data.
Returns : Undo level id. Not useful (yet).

gwy_app_undo_undo ()

void        gwy_app_undo_undo               (void);

Performs undo for the current data window.


gwy_app_undo_undo_window ()

void        gwy_app_undo_undo_window        (GwyDataWindow *data_window);

Performs undo for the data window data_window.

data_window: A data window (with undo available).

Since 1.2.


gwy_app_undo_redo ()

void        gwy_app_undo_redo               (void);

Performs redo for the current data window.


gwy_app_undo_redo_window ()

void        gwy_app_undo_redo_window        (GwyDataWindow *data_window);

Performs redo for the data window data_window.

data_window: A data window (with redo available).

Since 1.2.


gwy_app_data_window_has_undo ()

gboolean    gwy_app_data_window_has_undo    (GwyDataWindow *data_window);

Returns wheter there is any undo available for data_window.

data_window: A data window.
Returns : TRUE if there is undo, FALSE otherwise.

gwy_app_data_window_has_redo ()

gboolean    gwy_app_data_window_has_redo    (GwyDataWindow *data_window);

Returns wheter there is any redo available for data_window.

data_window: A data window.
Returns : TRUE if there is redo, FALSE otherwise.

gwy_app_undo_clear ()

void        gwy_app_undo_clear              (GwyDataWindow *data_window);

Removes all undo and redo information for a data window.

data_window: A data window.