undo

undo — Undo and redo.

Synopsis




gulong      gwy_app_undo_checkpoint         (GwyContainer *data,
                                             ...);
gulong      gwy_app_undo_checkpointv        (GwyContainer *data,
                                             guint n,
                                             const gchar **keys);
void        gwy_app_undo_undo_container     (GwyContainer *data);
void        gwy_app_undo_redo_container     (GwyContainer *data);
gboolean    gwy_app_undo_container_has_undo (GwyContainer *data);
gboolean    gwy_app_undo_container_has_redo (GwyContainer *data);
gint        gwy_app_undo_container_get_modified
                                            (GwyContainer *data);
void        gwy_app_undo_container_set_unmodified
                                            (GwyContainer *data);

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,
                                             guint 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_container ()

void        gwy_app_undo_undo_container     (GwyContainer *data);

Performs undo on a data container.

It must have undo available.

data : A data container.

gwy_app_undo_redo_container ()

void        gwy_app_undo_redo_container     (GwyContainer *data);

data :

gwy_app_undo_container_has_undo ()

gboolean    gwy_app_undo_container_has_undo (GwyContainer *data);

Returns whether there is any undo available for a container.

data : Data container to get undo infomation of.
Returns : TRUE if there is undo, FALSE otherwise.

gwy_app_undo_container_has_redo ()

gboolean    gwy_app_undo_container_has_redo (GwyContainer *data);

Returns whether there is any redo available for a container.

data : Data container to get redo infomation of.
Returns : TRUE if there is redo, FALSE otherwise.

gwy_app_undo_container_get_modified ()

gint        gwy_app_undo_container_get_modified
                                            (GwyContainer *data);

Tests whether a container was modified.

FIXME: it may not work.

data : Data container to get modification infomation of.
Returns : TRUE if container was modified, FALSE otherwise.

gwy_app_undo_container_set_unmodified ()

void        gwy_app_undo_container_set_unmodified
                                            (GwyContainer *data);

Marks a data container as umodified (that is, saved).

data : Data container to set modification infomation of.