BtChangeLogger

BtChangeLogger — interface for the editor action journaling

Synopsis

#include "bt-edit.h"

#define             BT_CHANGE_LOGGER_METHOD             (name,
                                                         name_len,
                                                         regexp)
gboolean            bt_change_logger_change             (const BtChangeLogger *self,
                                                         const gchar *data);
gint                bt_change_logger_match_method       (BtChangeLoggerMethods *change_logger_methods,
                                                         const gchar *data,
                                                         GMatchInfo **match_info);

Description

Defines undo/redo interface.

Details

BT_CHANGE_LOGGER_METHOD()

#define             BT_CHANGE_LOGGER_METHOD(name,name_len,regexp)

Structure entry for a change log line parser array (array of BtChangeLoggerMethods).

name :

name of method

name_len :

length of the string

regexp :

regular expression for parsing the parameter part

bt_change_logger_change ()

gboolean            bt_change_logger_change             (const BtChangeLogger *self,
                                                         const gchar *data);

Run the editor action pointed to by data.

self :

an object that implements logging changes

data :

serialised data of the action to apply

Returns :

TRUE for success.

bt_change_logger_match_method ()

gint                bt_change_logger_match_method       (BtChangeLoggerMethods *change_logger_methods,
                                                         const gchar *data,
                                                         GMatchInfo **match_info);

Matches commands registered in the change_logger_methods against data. If a match is found the parameters are returned in match_info.

change_logger_methods :

array of change log methods

data :

the string to match agains

match_info :

resulting parameter on a positive match

Returns :

the command id from change_logger_methods or -1 for no match. Free the match_info on positive matches.