12 #define BSE_TYPE_ITEM (BSE_TYPE_ID (BseItem))
13 #define BSE_ITEM(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_ITEM, BseItem))
14 #define BSE_ITEM_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_ITEM, BseItemClass))
15 #define BSE_IS_ITEM(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_ITEM))
16 #define BSE_IS_ITEM_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_ITEM))
17 #define BSE_ITEM_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_ITEM, BseItemClass))
21 #define BSE_ITEM_SINGLETON(object) ((BSE_OBJECT_FLAGS (object) & BSE_ITEM_FLAG_SINGLETON) != 0)
22 #define BSE_ITEM_INTERNAL(item) ((BSE_OBJECT_FLAGS (item) & BSE_ITEM_FLAG_INTERN_BRANCH) != 0)
28 BSE_ITEM_FLAG_SINGLETON = 1 << (BSE_OBJECT_FLAGS_USHIFT + 0),
29 BSE_ITEM_FLAG_INTERN = 1 << (BSE_OBJECT_FLAGS_USHIFT + 1),
30 BSE_ITEM_FLAG_INTERN_BRANCH = 1 << (BSE_OBJECT_FLAGS_USHIFT + 2)
32 #define BSE_ITEM_FLAGS_USHIFT (BSE_OBJECT_FLAGS_USHIFT + 3)
37 BseParasite *parasite;
41 void (*get_candidates) (
BseItem *item,
43 BsePropertyCandidates *pc,
45 void (*set_parent) (
BseItem *item,
47 gboolean (*needs_storage) (
BseItem *item,
49 void (*compat_setup) (
BseItem *item,
53 guint (*get_seqid) (
BseItem *item);
54 BseUndoStack* (*get_undo) (
BseItem *item);
57 typedef void (*BseItemUncross) (
BseItem *owner,
59 typedef gboolean (*BseItemCheckContainer) (
BseContainer *container,
62 typedef gboolean (*BseItemCheckProxy) (
BseItem *proxy,
68 BseItemSeq* bse_item_gather_items (
BseItem *item,
71 BseItemCheckContainer ccheck,
72 BseItemCheckProxy pcheck,
78 gboolean allow_ancestor);
79 gboolean bse_item_get_candidates (
BseItem *item,
80 const gchar *property,
81 BsePropertyCandidates *pc);
82 void bse_item_set_internal (gpointer item,
84 gboolean bse_item_needs_storage (
BseItem *item,
86 void bse_item_compat_setup (
BseItem *item,
90 guint bse_item_get_seqid (
BseItem *item);
91 void bse_item_queue_seqid_changed (
BseItem *item);
96 gboolean bse_item_has_ancestor (
BseItem *item,
102 BseItemUncross uncross_func);
105 BseItemUncross uncross_func);
109 void bse_item_unuse (
BseItem *item);
110 void bse_item_set_parent (
BseItem *item,
112 Bse::ErrorType bse_item_exec (gpointer item,
113 const gchar *procedure,
115 Bse::ErrorType bse_item_exec_void (gpointer item,
116 const gchar *procedure,
119 void bse_item_set_valist_undoable (gpointer
object,
120 const gchar *first_property_name,
122 void bse_item_set_undoable (gpointer
object,
123 const gchar *first_property_name,
124 ...) G_GNUC_NULL_TERMINATED;
125 void bse_item_set_property_undoable (
BseItem *self,
127 const GValue *value);
129 BseUndoStack* bse_item_undo_open_str (
void *item, const
std::
string &
string);
130 #define bse_item_undo_open(item,...) bse_item_undo_open_str (item, Rapicorn::string_format (__VA_ARGS__).c_str())
131 void bse_item_undo_close (BseUndoStack *ustack);
133 void bse_item_push_undo_proc (gpointer item,
134 const gchar *procedure,
136 void bse_item_push_redo_proc (gpointer item,
137 const gchar *procedure,
139 void bse_item_backup_to_undo (
BseItem *
self,
140 BseUndoStack *ustack);
141 void bse_item_push_undo_storage (
BseItem *
self,
142 BseUndoStack *ustack,
145 #define bse_item_set bse_item_set_undoable
146 #define bse_item_get g_object_get
156 void push_item_undo (
const String &blurb,
const UndoLambda &lambda);
157 struct UndoDescriptorData {
160 UndoDescriptorData() : projectid (0) {}
162 UndoDescriptorData make_undo_descriptor_data (
ItemImpl &item);
163 ItemImpl& resolve_undo_descriptor_data (
const UndoDescriptorData &udd);
171 template<
typename ItemT,
typename... FuncArgs,
typename... CallArgs>
void
172 push_undo (
const String &blurb, ItemT &
self, ErrorType (ItemT::*
function) (FuncArgs...), CallArgs... args)
174 assert_return (
this == &
self);
175 UndoLambda lambda = [
function, args...] (
ItemImpl &item, BseUndoStack *ustack) {
176 ItemT &
self =
dynamic_cast<ItemT&
> (item);
177 return (
self.*
function) (args...);
179 push_item_undo (blurb, lambda);
181 template<
typename ItemT,
typename R,
typename... FuncArgs,
typename... CallArgs>
void
182 push_undo (
const String &blurb, ItemT &
self, R (ItemT::*
function) (FuncArgs...), CallArgs... args)
184 assert_return (
this == &
self);
185 UndoLambda lambda = [
function, args...] (
ItemImpl &item, BseUndoStack *ustack) {
186 ItemT &
self =
dynamic_cast<ItemT&
> (item);
187 (
self.*
function) (args...);
190 push_item_undo (blurb, lambda);
192 template<
typename ItemT,
typename ItemTLambda>
void
193 push_undo (
const String &blurb, ItemT &
self,
const ItemTLambda &itemt_lambda)
196 assert_return (
this == &
self);
197 UndoLambda lambda = [undo_lambda] (ItemImpl &item, BseUndoStack *ustack) {
198 ItemT &
self =
dynamic_cast<ItemT&
> (item);
199 return undo_lambda (
self, ustack);
201 push_item_undo (blurb, lambda);
203 template<
typename ItemT,
typename ItemTLambda>
void
204 push_undo_to_redo (
const String &blurb, ItemT &
self,
const ItemTLambda &itemt_lambda)
207 assert_return (
this == &
self);
208 auto lambda = [blurb, undo_lambda] (ItemT &
self, BseUndoStack *ustack) -> ErrorType {
209 self.push_undo (blurb,
self, undo_lambda);
218 UndoDescriptorData data_;
UndoDescriptor - type safe object handle to persist undo/redo steps.
Definition: bseitem.hh:216
void bse_item_cross_unlink(BseItem *owner, BseItem *link, BseItemUncross uncross_func)
Definition: bseitem.cc:595
Definition: bsecontainer.hh:108
Definition: bsecontainer.hh:26
The Bse namespace contains all functions of the synthesis engine.
Definition: bstbseutils.cc:67
virtual ItemIfaceP common_ancestor(ItemIface &other) override
See Item::common_ancestor()
Definition: bseitem.cc:1339
Definition: bsesnet.hh:36
Definition: bsesuper.hh:25
Definition: bseobject.hh:60
void bse_item_uncross_links(BseItem *owner, BseItem *link)
Definition: bseitem.cc:623
UndoDescriptor< Obj > undo_descriptor(Obj &item)
Create an object descriptor that persists undo/redo steps.
Definition: bseitem.hh:225
BseItemSeq * bse_item_gather_items_typed(BseItem *item, BseItemSeq *iseq, GType proxy_type, GType container_type, gboolean allow_ancestor)
Definition: bseitem.cc:389
Obj & undo_resolve(UndoDescriptor< Obj > udo)
Resolve an undo descriptor back to an object, see also undo_descriptor().
Definition: bseitem.hh:228
Definition: bseobject.hh:93
BseMusicalTuningType bse_item_current_musical_tuning(BseItem *self)
Definition: bseitem.cc:706
Definition: bseitem.hh:153
Definition: bseitem.hh:40
Definition: bsestorage.hh:49
void bse_item_cross_link(BseItem *owner, BseItem *link, BseItemUncross uncross_func)
Definition: bseitem.cc:566
Definition: bseobject.hh:9
Definition: bseproject.hh:26
See also the corresponding IDL class Item.
Definition: bseserverapi.hh:455
Definition: bseitem.hh:34
void push_undo(const String &blurb, ItemT &self, ErrorType(ItemT::*function)(FuncArgs...), CallArgs...args)
Push handler onto the undo stack, self must match this.
Definition: bseitem.hh:172