Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
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 
8 #define BSE_UNDO_STACK_VOID(ustack) ((ustack)->max_steps == 0)
9 
10 
11 /* --- BseUndoStack structs --- */
12 typedef struct {
13  SfiTime stamp;
14  gchar *name;
15  SfiRing *undo_steps;
16 } BseUndoGroup;
17 typedef void (*BseUndoNotify) (BseProject *project,
18  BseUndoStack *ustack,
19  gboolean step_added);
21 {
22  BseProject *project;
23  BseUndoNotify notify;
24  guint n_open_groups;
25  BseUndoGroup *group;
26  GSList *debug_names;
27  guint max_steps;
28  guint ignore_steps;
29  guint n_undo_groups;
30  SfiRing *undo_groups;
31  gint dirt_counter; /* signed! */
32  guint n_merge_requests;
33  gchar *merge_name;
34  guint merge_next : 1;
35 };
36 typedef void (*BseUndoFunc) (BseUndoStep *ustep,
37  BseUndoStack *ustack);
38 typedef void (*BseUndoFree) (BseUndoStep *ustep);
40 {
41  BseUndoFunc undo_func;
42  BseUndoFree free_func;
43  gchar *debug_name;
44  union {
45  gpointer v_pointer;
46  glong v_long;
47  gulong v_ulong;
48  } data[1]; /* flexible array */
49 };
50 
51 
52 /* --- prototypes --- */
53 BseUndoStack* bse_undo_stack_dummy (void);
54 BseUndoStack* bse_undo_stack_new (BseProject *project,
55  BseUndoNotify notify);
56 void bse_undo_stack_limit (BseUndoStack *self,
57  guint max_steps);
58 void bse_undo_group_open (BseUndoStack *self,
59  const gchar *name);
60 void bse_undo_stack_ignore_steps (BseUndoStack *self);
61 void bse_undo_stack_push (BseUndoStack *self,
62  BseUndoStep *ustep);
63 void bse_undo_stack_push_add_on (BseUndoStack *self,
64  BseUndoStep *ustep);
65 void bse_undo_stack_unignore_steps (BseUndoStack *self);
66 void bse_undo_group_close (BseUndoStack *self);
67 void bse_undo_stack_add_merger (BseUndoStack *self,
68  const gchar *name);
69 void bse_undo_stack_remove_merger (BseUndoStack *self);
70 void bse_undo_stack_clear (BseUndoStack *self);
71 gboolean bse_undo_stack_dirty (BseUndoStack *self);
72 void bse_undo_stack_clean_dirty (BseUndoStack *self);
73 void bse_undo_stack_force_dirty (BseUndoStack *self);
74 void bse_undo_stack_destroy (BseUndoStack *self);
75 guint bse_undo_stack_depth (BseUndoStack *self);
76 void bse_undo_stack_undo (BseUndoStack *self);
77 const gchar* bse_undo_stack_peek (BseUndoStack *self);
78 BseUndoStep* bse_undo_step_new (BseUndoFunc undo_func,
79  BseUndoFree undo_free,
80  guint n_data_fields);
81 void bse_undo_step_exec (BseUndoStep *ustep,
82  BseUndoStack *ustack);
83 void bse_undo_step_free (BseUndoStep *ustep);
84 gchar* bse_undo_pointer_pack (gpointer item,
85  BseUndoStack *ustack);
86 gpointer bse_undo_pointer_unpack (const gchar *packed_pointer,
87  BseUndoStack *ustack);
88 const BseUndoStep* bse_undo_group_peek_last_atom (BseUndoStack *self,
89  SfiTime *stamp_p);
90 
91 #endif /* __BSE_UNDO_STACK_H__ */
Definition: bseundostack.hh:20
Definition: bseundostack.hh:12
Definition: bseundostack.hh:39
Definition: sfiring.hh:21
Definition: bseproject.hh:17