BtChangeLog

BtChangeLog — class for the editor action journaling

Synopsis

#include "bt-edit.h"

                    BtChangeLog;
BtChangeLog *       bt_change_log_new                   (void);
void                bt_change_log_add                   (BtChangeLog *self,
                                                         BtChangeLogger *owner,
                                                         gchar *undo_data,
                                                         gchar *redo_data);
void                bt_change_log_redo                  (BtChangeLog *self);
void                bt_change_log_undo                  (BtChangeLog *self);

Object Hierarchy

  GObject
   +----BtChangeLog

Properties

  "can-redo"                 gboolean              : Read
  "can-undo"                 gboolean              : Read

Description

Tracks edits actions since last save. Logs those to disk for crash recovery. Provides undo/redo.

Details

BtChangeLog

typedef struct _BtChangeLog BtChangeLog;

Editor action journal.


bt_change_log_new ()

BtChangeLog *       bt_change_log_new                   (void);

Create a new instance on first call and return a reference later on.

Returns :

the new signleton instance

bt_change_log_add ()

void                bt_change_log_add                   (BtChangeLog *self,
                                                         BtChangeLogger *owner,
                                                         gchar *undo_data,
                                                         gchar *redo_data);

Add a new change to the change log. Changes are passed as serialized strings. The change-log takes ownership of undo_data and redo_data.

self :

the change log

owner :

the owner of the change

undo_data :

how to undo the change

redo_data :

how to redo the change

bt_change_log_redo ()

void                bt_change_log_redo                  (BtChangeLog *self);

bt_change_log_undo ()

void                bt_change_log_undo                  (BtChangeLog *self);

Property Details

The "can-redo" property

  "can-redo"                 gboolean              : Read

Where there are action to redo.

Default value: FALSE


The "can-undo" property

  "can-undo"                 gboolean              : Read

Where there are action to undo.

Default value: FALSE