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)
40 void (*get_candidates) (
BseItem *item,
42 BsePropertyCandidates *pc,
44 void (*set_parent) (
BseItem *item,
46 gboolean (*needs_storage) (
BseItem *item,
48 void (*compat_setup) (
BseItem *item,
52 guint (*get_seqid) (
BseItem *item);
53 BseUndoStack* (*get_undo) (
BseItem *item);
56 typedef void (*BseItemUncross) (
BseItem *owner,
58 typedef gboolean (*BseItemCheckContainer) (
BseContainer *container,
61 typedef gboolean (*BseItemCheckProxy) (
BseItem *proxy,
67 BseIt3mSeq* bse_item_gather_items (
BseItem *item,
70 BseItemCheckContainer ccheck,
71 BseItemCheckProxy pcheck,
77 gboolean allow_ancestor);
78 gboolean bse_item_get_candidates (
BseItem *item,
79 const gchar *property,
80 BsePropertyCandidates *pc);
81 void bse_item_set_internal (gpointer item,
83 gboolean bse_item_needs_storage (
BseItem *item,
85 void bse_item_compat_setup (
BseItem *item,
89 guint bse_item_get_seqid (
BseItem *item);
90 void bse_item_queue_seqid_changed (
BseItem *item);
95 gboolean bse_item_has_ancestor (
BseItem *item,
101 BseItemUncross uncross_func);
104 BseItemUncross uncross_func);
108 void bse_item_unuse (
BseItem *item);
109 void bse_item_set_parent (
BseItem *item,
111 Bse::Error bse_item_exec (gpointer item,
112 const gchar *procedure,
114 Bse::Error bse_item_exec_void (gpointer item,
115 const gchar *procedure,
118 void bse_item_set_valist_undoable (gpointer
object,
119 const gchar *first_property_name,
121 void bse_item_set_undoable (gpointer
object,
122 const gchar *first_property_name,
123 ...) G_GNUC_NULL_TERMINATED;
124 void bse_item_set_property_undoable (
BseItem *self,
126 const GValue *value);
128 BseUndoStack* bse_item_undo_open_str (
void *item, const
std::
string &
string);
129 #define bse_item_undo_open(item,...) bse_item_undo_open_str (item, Rapicorn::string_format (__VA_ARGS__).c_str())
130 void bse_item_undo_close (BseUndoStack *ustack);
132 void bse_item_push_undo_proc (gpointer item,
133 const gchar *procedure,
135 void bse_item_push_redo_proc (gpointer item,
136 const gchar *procedure,
138 void bse_item_backup_to_undo (
BseItem *
self,
139 BseUndoStack *ustack);
140 void bse_item_push_undo_storage (
BseItem *
self,
141 BseUndoStack *ustack,
144 #define bse_item_set bse_item_set_undoable
145 #define bse_item_get g_object_get
155 void push_item_undo (
const String &blurb,
const UndoLambda &lambda);
156 struct UndoDescriptorData {
159 UndoDescriptorData() : projectid (0) {}
161 UndoDescriptorData make_undo_descriptor_data (
ItemImpl &item);
162 ItemImpl& resolve_undo_descriptor_data (
const UndoDescriptorData &udd);
169 virtual Icon icon ()
const override;
170 virtual void icon (
const Icon&)
override;
174 template<
typename ItemT,
typename... FuncArgs,
typename... CallArgs>
void
175 push_undo (
const String &blurb, ItemT &
self, Error (ItemT::*
function) (FuncArgs...), CallArgs... args)
177 RAPICORN_ASSERT_RETURN (
this == &
self);
178 UndoLambda lambda = [
function, args...] (
ItemImpl &item, BseUndoStack *ustack) {
179 ItemT &
self =
dynamic_cast<ItemT&
> (item);
180 return (
self.*
function) (args...);
182 push_item_undo (blurb, lambda);
185 template<
typename ItemT,
typename R,
typename... FuncArgs,
typename... CallArgs>
void
186 push_undo (
const String &blurb, ItemT &
self, R (ItemT::*
function) (FuncArgs...), CallArgs... args)
188 RAPICORN_ASSERT_RETURN (
this == &
self);
189 UndoLambda lambda = [
function, args...] (
ItemImpl &item, BseUndoStack *ustack) {
190 ItemT &
self =
dynamic_cast<ItemT&
> (item);
191 (
self.*
function) (args...);
194 push_item_undo (blurb, lambda);
197 template<
typename ItemT,
typename ItemTLambda>
void
201 RAPICORN_ASSERT_RETURN (
this == &
self);
202 UndoLambda lambda = [undo_lambda] (
ItemImpl &item, BseUndoStack *ustack) {
203 ItemT &
self =
dynamic_cast<ItemT&
> (item);
204 return undo_lambda (
self, ustack);
206 push_item_undo (blurb, lambda);
209 template<
typename ItemT,
typename ItemTLambda>
void
213 RAPICORN_ASSERT_RETURN (
this == &
self);
214 auto lambda = [blurb, undo_lambda] (ItemT &
self, BseUndoStack *ustack) -> Error {
215 self.push_undo (blurb,
self, undo_lambda);
224 UndoDescriptorData data_;
UndoDescriptor - type safe object handle to persist undo/redo steps.
Definition: bseitem.hh:222
virtual Icon icon() const override
See Item::icon.
Definition: bseitem.cc:1362
void bse_item_cross_unlink(BseItem *owner, BseItem *link, BseItemUncross uncross_func)
Definition: bseitem.cc:590
Definition: bsecontainer.hh:108
Definition: bsecontainer.hh:26
The Bse namespace contains all functions of the synthesis engine.
Definition: bstbseutils.cc:88
void push_undo(const String &blurb, ItemT &self, const ItemTLambda &itemt_lambda)
Push an undo lambda, using the signature: Error lambda (TypeDerivedFromItem&, BseUndoStack*);.
Definition: bseitem.hh:198
virtual ItemIfaceP common_ancestor(ItemIface &other) override
See Item::common_ancestor()
Definition: bseitem.cc:1353
Representation of an icon pixel image.
Definition: bseapi.idl:387
Definition: bsesnet.hh:36
Definition: bsesuper.hh:25
void push_undo_to_redo(const String &blurb, ItemT &self, const ItemTLambda &itemt_lambda)
Push an undo step, that when executed, pushes itemt_lambda to the redo stack.
Definition: bseitem.hh:210
BseIt3mSeq * bse_item_gather_items_typed(BseItem *item, BseIt3mSeq *iseq, GType proxy_type, GType container_type, gboolean allow_ancestor)
Definition: bseitem.cc:384
Definition: bseobject.hh:61
void bse_item_uncross_links(BseItem *owner, BseItem *link)
Definition: bseitem.cc:618
UndoDescriptor< Obj > undo_descriptor(Obj &item)
Create an object descriptor that persists undo/redo steps.
Definition: bseitem.hh:231
Obj & undo_resolve(UndoDescriptor< Obj > udo)
Resolve an undo descriptor back to an object, see also undo_descriptor().
Definition: bseitem.hh:234
Definition: bseobject.hh:94
void push_property_undo(const String &property_name)
Save the value of property_name onto the undo stack.
Definition: bseitem.cc:1334
Definition: bseitem.hh:152
Definition: bseitem.hh:39
Definition: bsestorage.hh:49
void bse_item_cross_link(BseItem *owner, BseItem *link, BseItemUncross uncross_func)
Definition: bseitem.cc:561
Definition: bseobject.hh:9
Definition: bseproject.hh:26
void push_undo(const String &blurb, ItemT &self, Error(ItemT::*function)(FuncArgs...), CallArgs...args)
Push an undo function onto the undo stack, the self argument to function must match this...
Definition: bseitem.hh:175
See also the corresponding IDL class Item.
Definition: bseserverapi.hh:656
Definition: bseitem.hh:34
void push_undo(const String &blurb, ItemT &self, R(ItemT::*function)(FuncArgs...), CallArgs...args)
Push an undo function like push_undo(), but ignore the return value of function.
Definition: bseitem.hh:186
Bse::MusicalTuning bse_item_current_musical_tuning(BseItem *self)
Definition: bseitem.cc:701