GOUndo

GOUndo

Synopsis

                    GOUndo;
                    GOUndoClass;
void                go_undo_undo                        (GOUndo *u);
void                go_undo_undo_with_data              (GOUndo *u,
                                                         gpointer data);
GOUndo *            go_undo_combine                     (GOUndo *a,
                                                         GOUndo *b);
#define             GO_TYPE_UNDO_GROUP
#define             GO_UNDO_GROUP                       (o)
#define             GO_IS_UNDO_GROUP                    (o)
GType               go_undo_group_get_type              (void);
                    GOUndoGroup;
                    GOUndoGroupClass;
GOUndoGroup *       go_undo_group_new                   (void);
void                go_undo_group_add                   (GOUndoGroup *g,
                                                         GOUndo *u);
#define             GO_TYPE_UNDO_BINARY
#define             GO_UNDO_BINARY                      (o)
#define             GO_IS_UNDO_BINARY                   (o)
GType               go_undo_binary_get_type             (void);
                    GOUndoBinary;
                    GOUndoBinaryClass;
void                (*GOUndoBinaryFunc)                 (gpointer a,
                                                         gpointer b,
                                                         gpointer data);
GOUndo *            go_undo_binary_new                  (gpointer a,
                                                         gpointer b,
                                                         GOUndoBinaryFunc undo,
                                                         GFreeFunc fa,
                                                         GFreeFunc fb);
#define             GO_TYPE_UNDO_UNARY
#define             GO_UNDO_UNARY                       (o)
#define             GO_IS_UNDO_UNARY                    (o)
GType               go_undo_unary_get_type              (void);
                    GOUndoUnary;
                    GOUndoUnaryClass;
void                (*GOUndoUnaryFunc)                  (gpointer a,
                                                         gpointer data);
GOUndo *            go_undo_unary_new                   (gpointer a,
                                                         GOUndoUnaryFunc undo,
                                                         GFreeFunc fa);

Object Hierarchy

  GObject
   +----GOUndo
         +----GOUndoBinary
         +----GOUndoGroup
         +----GOUndoUnary
  GObject
   +----GOUndo
         +----GOUndoGroup
  GObject
   +----GOUndo
         +----GOUndoBinary
  GObject
   +----GOUndo
         +----GOUndoUnary

Description

Details

GOUndo

typedef struct _GOUndo GOUndo;


GOUndoClass

typedef struct {
	GObjectClass base;

	void (*undo) (GOUndo *u, gpointer data);
} GOUndoClass;

GObjectClass base;

base class.

undo ()

undo. };

go_undo_undo ()

void                go_undo_undo                        (GOUndo *u);

Execute the stored undo operation.

u :

undo object

go_undo_undo_with_data ()

void                go_undo_undo_with_data              (GOUndo *u,
                                                         gpointer data);

Execute the stored undo operation. data is supplied to the undo operation as an extra argument. It is meant not to affect the undo operation in any way, but rather supply a context through which progress and errors can be reported.

u :

undo object

data :

user data

go_undo_combine ()

GOUndo *            go_undo_combine                     (GOUndo *a,
                                                         GOUndo *b);

This function takes ownership of the argument references and gives ownership of the result to the caller. Either argument may be NULL in which case the other is returned.

a :

optional first undo operation. [transfer full]

b :

optional last undo operation. [transfer full]

Returns :

the combination of two undo operations. [transfer full]

GO_TYPE_UNDO_GROUP

#define GO_TYPE_UNDO_GROUP  (go_undo_group_get_type ())


GO_UNDO_GROUP()

#define GO_UNDO_GROUP(o)    (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_TYPE_UNDO_GROUP, GOUndoGroup))

o :


GO_IS_UNDO_GROUP()

#define GO_IS_UNDO_GROUP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_TYPE_UNDO_GROUP))

o :


go_undo_group_get_type ()

GType               go_undo_group_get_type              (void);

Returns :


GOUndoGroup

typedef struct _GOUndoGroup GOUndoGroup;


GOUndoGroupClass

typedef struct {
	GOUndoClass base;
} GOUndoGroupClass;

GOUndoClass base;

base class.

go_undo_group_new ()

GOUndoGroup *       go_undo_group_new                   (void);

This function creates a new undo group for compounding undo objects.

Returns :

a new, empty undo group.

go_undo_group_add ()

void                go_undo_group_add                   (GOUndoGroup *g,
                                                         GOUndo *u);

This function adds u to g.

g :

undo group

u :

undo object

GO_TYPE_UNDO_BINARY

#define GO_TYPE_UNDO_BINARY  (go_undo_binary_get_type ())


GO_UNDO_BINARY()

#define GO_UNDO_BINARY(o)    (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_TYPE_UNDO_BINARY, GOUndoBinary))

o :


GO_IS_UNDO_BINARY()

#define GO_IS_UNDO_BINARY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_TYPE_UNDO_BINARY))

o :


go_undo_binary_get_type ()

GType               go_undo_binary_get_type             (void);

Returns :


GOUndoBinary

typedef struct _GOUndoBinary GOUndoBinary;


GOUndoBinaryClass

typedef struct {
	GOUndoClass base;
} GOUndoBinaryClass;

GOUndoClass base;

base class.

GOUndoBinaryFunc ()

void                (*GOUndoBinaryFunc)                 (gpointer a,
                                                         gpointer b,
                                                         gpointer data);

a :

b :

data :


go_undo_binary_new ()

GOUndo *            go_undo_binary_new                  (gpointer a,
                                                         gpointer b,
                                                         GOUndoBinaryFunc undo,
                                                         GFreeFunc fa,
                                                         GFreeFunc fb);

This function creates a new undo object for undo operations of two arguments. (In addition, an undo-time argument is added for context.)

a :

first argument for undo operation

b :

second argument for undo operation

undo :

function to call with arguments a and b for undo. [scope async]

fa :

optional function to free a. [scope async]

fb :

optional function to free b. [scope async]

Returns :

a new undo object. [transfer full]

GO_TYPE_UNDO_UNARY

#define GO_TYPE_UNDO_UNARY  (go_undo_unary_get_type ())


GO_UNDO_UNARY()

#define GO_UNDO_UNARY(o)    (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_TYPE_UNDO_UNARY, GOUndoUnary))

o :


GO_IS_UNDO_UNARY()

#define GO_IS_UNDO_UNARY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_TYPE_UNDO_UNARY))

o :


go_undo_unary_get_type ()

GType               go_undo_unary_get_type              (void);

Returns :


GOUndoUnary

typedef struct _GOUndoUnary GOUndoUnary;


GOUndoUnaryClass

typedef struct {
	GOUndoClass base;
} GOUndoUnaryClass;

GOUndoClass base;

base class.

GOUndoUnaryFunc ()

void                (*GOUndoUnaryFunc)                  (gpointer a,
                                                         gpointer data);

a :

data :


go_undo_unary_new ()

GOUndo *            go_undo_unary_new                   (gpointer a,
                                                         GOUndoUnaryFunc undo,
                                                         GFreeFunc fa);

This function creates a new undo object for undo operations of one argument. (In addition, an undo-time argument is added for context.)

a :

argument for undo operation

undo :

function to call with argument a for undo. [scope async]

fa :

optional function to free a. [scope async]

Returns :

a new undo object. [transfer full]