![]() |
![]() |
![]() |
DiaCanvas2 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Signals |
#define DIA_UNDO_MANAGER (obj) DiaUndoManager; void dia_undo_manager_begin_transaction (DiaUndoManager *undo_manager
); void dia_undo_manager_commit_transaction (DiaUndoManager *undo_manager
); void dia_undo_manager_discard_transaction (DiaUndoManager *undo_manager
); void dia_undo_manager_undo_transaction (DiaUndoManager *undo_manager
); void dia_undo_manager_redo_transaction (DiaUndoManager *undo_manager
); gboolean dia_undo_manager_in_transaction (DiaUndoManager *undo_manager
); gboolean dia_undo_manager_can_undo (DiaUndoManager *undo_manager
); gboolean dia_undo_manager_can_redo (DiaUndoManager *undo_manager
); struct DiaUndoAction; DiaUndoAction * dia_undo_action_new (gsize sizeof_undo_action
,DiaUndoFunc undo
,DiaUndoFunc redo
,GDestroyNotify destroy
); void dia_undo_action_undo (DiaUndoAction *action
); void dia_undo_action_redo (DiaUndoAction *action
); void dia_undo_action_destroy (DiaUndoAction *action
);
"add-undo-action" :Run Last
"begin-transaction" :Run Last
"commit-transaction" :Run Last
"discard-transaction" :Run Last
"redo-transaction" :Run Last
"undo-transaction" :Run Last
The DiaUndoManager interface provides an interface to the pluggable undo mechanism in DiaCanvas2.
#define DIA_UNDO_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIA_TYPE_UNDO_MANAGER, DiaUndoManager))
typedef struct _DiaUndoManager DiaUndoManager;
This interface provides the functions that are used to gather and act on undo information.
void dia_undo_manager_begin_transaction (DiaUndoManager *undo_manager
);
Begin a new transaction.
void dia_undo_manager_commit_transaction (DiaUndoManager *undo_manager
);
Store the transaction on the undo stack. If there are no actions to be undone, a specific implementation may consider no storing it.
void dia_undo_manager_discard_transaction
(DiaUndoManager *undo_manager
);
Discard the current transaction. It is not stored on the undo stack.
void dia_undo_manager_undo_transaction (DiaUndoManager *undo_manager
);
Undo the actions in the last commited transaction.
void dia_undo_manager_redo_transaction (DiaUndoManager *undo_manager
);
gboolean dia_undo_manager_in_transaction (DiaUndoManager *undo_manager
);
This function returns TRUE if there is an open transaction.
gboolean dia_undo_manager_can_undo (DiaUndoManager *undo_manager
);
Returns : |
TRUE if there are transactions that can be undone. |
gboolean dia_undo_manager_can_redo (DiaUndoManager *undo_manager
);
Returns : |
TRUE if there are transactions that can be redone. |
struct DiaUndoAction { DiaUndoFunc undo; DiaUndoFunc redo; GDestroyNotify destroy; };
DiaUndoAction * dia_undo_action_new (gsize sizeof_undo_action
,DiaUndoFunc undo
,DiaUndoFunc redo
,GDestroyNotify destroy
);
Create a new DiaUndoAction. DiaUndoAction is the object that is passed to the UndoManager. This "class" is normally subclassed, so specific attributes can be stored (this struct is an "abstract class").
|
Size of the real undo entry |
|
function called on an undo operation |
|
function called in a redo operation |
|
function called to free the resources held by this undo entry |
"add-undo-action"
signalvoid user_function (DiaUndoManager *diaundomanager,
gpointer arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"begin-transaction"
signalvoid user_function (DiaUndoManager *diaundomanager,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"commit-transaction"
signalvoid user_function (DiaUndoManager *diaundomanager,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"discard-transaction"
signalvoid user_function (DiaUndoManager *diaundomanager,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"redo-transaction"
signalvoid user_function (DiaUndoManager *diaundomanager,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"undo-transaction"
signalvoid user_function (DiaUndoManager *diaundomanager,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |