BEAST - Free Software Audio Synthesizer and Tracker  0.9.2
bseundostack.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __BSE_UNDO_STACK_H__
3 #define __BSE_UNDO_STACK_H__
4 
5 #include <bse/bseitem.hh>
6 
7 G_BEGIN_DECLS
8 
9 
10 #define BSE_UNDO_STACK_VOID(ustack) ((ustack)->max_steps == 0)
11 
12 
13 /* --- BseUndoStack structs --- */
14 typedef struct {
15  SfiTime stamp;
16  gchar *name;
17  SfiRing *undo_steps;
18 } BseUndoGroup;
19 typedef void (*BseUndoNotify) (BseProject *project,
20  BseUndoStack *ustack,
21  gboolean step_added);
23 {
24  BseProject *project;
25  BseUndoNotify notify;
26  guint n_open_groups;
27  BseUndoGroup *group;
28  GSList *debug_names;
29  guint max_steps;
30  guint ignore_steps;
31  guint n_undo_groups;
32  SfiRing *undo_groups;
33  gint dirt_counter; /* signed! */
34  guint n_merge_requests;
35  gchar *merge_name;
36  guint merge_next : 1;
37 };
38 typedef void (*BseUndoFunc) (BseUndoStep *ustep,
39  BseUndoStack *ustack);
40 typedef void (*BseUndoFree) (BseUndoStep *ustep);
42 {
43  BseUndoFunc undo_func;
44  BseUndoFree free_func;
45  gchar *debug_name;
46  union {
47  gpointer v_pointer;
48  glong v_long;
49  gulong v_ulong;
50  } data[1]; /* flexible array */
51 };
52 
53 
54 /* --- prototypes --- */
55 BseUndoStack* bse_undo_stack_dummy (void);
56 BseUndoStack* bse_undo_stack_new (BseProject *project,
57  BseUndoNotify notify);
58 void bse_undo_stack_limit (BseUndoStack *self,
59  guint max_steps);
60 void bse_undo_group_open (BseUndoStack *self,
61  const gchar *name);
62 void bse_undo_stack_ignore_steps (BseUndoStack *self);
63 void bse_undo_stack_push (BseUndoStack *self,
64  BseUndoStep *ustep);
65 void bse_undo_stack_push_add_on (BseUndoStack *self,
66  BseUndoStep *ustep);
67 void bse_undo_stack_unignore_steps (BseUndoStack *self);
68 void bse_undo_group_close (BseUndoStack *self);
69 void bse_undo_stack_add_merger (BseUndoStack *self,
70  const gchar *name);
71 void bse_undo_stack_remove_merger (BseUndoStack *self);
72 void bse_undo_stack_clear (BseUndoStack *self);
73 gboolean bse_undo_stack_dirty (BseUndoStack *self);
74 void bse_undo_stack_clean_dirty (BseUndoStack *self);
75 void bse_undo_stack_force_dirty (BseUndoStack *self);
76 void bse_undo_stack_destroy (BseUndoStack *self);
77 guint bse_undo_stack_depth (BseUndoStack *self);
78 void bse_undo_stack_undo (BseUndoStack *self);
79 const gchar* bse_undo_stack_peek (BseUndoStack *self);
80 BseUndoStep* bse_undo_step_new (BseUndoFunc undo_func,
81  BseUndoFree undo_free,
82  guint n_data_fields);
83 void bse_undo_step_exec (BseUndoStep *ustep,
84  BseUndoStack *ustack);
85 void bse_undo_step_free (BseUndoStep *ustep);
86 gchar* bse_undo_pointer_pack (gpointer item,
87  BseUndoStack *ustack);
88 gpointer bse_undo_pointer_unpack (const gchar *packed_pointer,
89  BseUndoStack *ustack);
90 const BseUndoStep* bse_undo_group_peek_last_atom (BseUndoStack *self,
91  SfiTime *stamp_p);
92 
93 G_END_DECLS
94 
95 #endif /* __BSE_UNDO_STACK_H__ */
Definition: bseundostack.hh:22
Definition: bseundostack.hh:14
Definition: bseundostack.hh:41
Definition: sfiring.hh:23
Definition: bseproject.hh:26