BEAST - Free Software Audio Synthesizer and Tracker  0.9.2
bsecontainer.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_CONTAINER_H__
3 #define __BSE_CONTAINER_H__
4 
5 #include <bse/bsesource.hh>
6 #include <sfi/gbsearcharray.hh>
7 
8 G_BEGIN_DECLS
9 
10 /* --- object type macros --- */
11 #define BSE_TYPE_CONTAINER (BSE_TYPE_ID (BseContainer))
12 #define BSE_CONTAINER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_CONTAINER, BseContainer))
13 #define BSE_CONTAINER_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_CONTAINER, BseContainerClass))
14 #define BSE_IS_CONTAINER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_CONTAINER))
15 #define BSE_IS_CONTAINER_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_CONTAINER))
16 #define BSE_CONTAINER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_CONTAINER, BseContainerClass))
17 #define BSE_CONTAINER_FLAGS_USHIFT (BSE_SOURCE_FLAGS_USHIFT + 0)
18 
19 
20 /* --- BseContainer object --- */
21 typedef gboolean (*BseForallItemsFunc) (BseItem *item,
22  gpointer data);
23 typedef gboolean (*BseForallCrossFunc) (BseItem *owner,
24  BseItem *link,
25  gpointer data);
27  guint n_items; /* paranoid checks */
28 };
30  void (*add_item) (BseContainer *container,
31  BseItem *item);
32  void (*remove_item) (BseContainer *container,
33  BseItem *item);
34  void (*forall_items) (BseContainer *container,
35  BseForallItemsFunc func,
36  gpointer data);
37  gboolean (*check_restore) (BseContainer *container,
38  const gchar *child_type);
39  BseItem* (*retrieve_child) (BseContainer *container,
40  GType child_type,
41  const gchar *uname);
42  GSList* (*context_children) (BseContainer *container);
43  void (*release_children) (BseContainer *container);
44 };
45 
46 
47 /* --- prototypes --- */
48 void bse_container_forall_items (BseContainer *container,
49  BseForallItemsFunc func,
50  gpointer data);
51 BseItemSeq* bse_container_list_children (BseContainer *container);
52 guint bse_container_get_item_seqid (BseContainer *container,
53  BseItem *item);
54 BseItem* bse_container_get_item (BseContainer *container,
55  GType item_type,
56  guint seq_id);
57 void bse_container_store_children (BseContainer *container,
58  BseStorage *storage);
59 BseItem* bse_container_lookup_item (BseContainer *container,
60  const gchar *uname);
61 BseItem* bse_container_retrieve_child (BseContainer *container,
62  const gchar *type_uname);
63 BseItem* bse_container_resolve_upath (BseContainer *container,
64  const gchar *upath);
65 gchar* /*fr*/ bse_container_make_upath (BseContainer *container,
66  BseItem *item);
67 gboolean bse_container_check_restore (BseContainer *container,
68  const gchar *child_type);
69 /* non-undo functions */
70 gpointer bse_container_new_child_bname (BseContainer *container,
71  GType child_type,
72  const gchar *base_name,
73  const gchar *first_param_name,
74  ...);
75 #define bse_container_new_child( container, child_type, ...) \
76  bse_container_new_child_bname( container, child_type, NULL, __VA_ARGS__)
77 void bse_container_add_item (BseContainer *container,
78  BseItem *item);
79 void bse_container_remove_item (BseContainer *container,
80  BseItem *item);
81 /* undo+redo functions or undo-only (backup) functions */
82 void bse_container_uncross_undoable (BseContainer *container,
83  BseItem *child);
84 void bse_container_remove_backedup (BseContainer *container,
85  BseItem *child,
86  BseUndoStack *ustack);
87 
88 
89 /* --- internal functions --- */
90 void _bse_container_cross_link (BseContainer *container,
91  BseItem *owner,
92  BseItem *link,
93  BseItemUncross uncross_func);
94 void _bse_container_cross_unlink (BseContainer *container,
95  BseItem *owner,
96  BseItem *link,
97  BseItemUncross uncross);
98 void _bse_container_uncross (BseContainer *container,
99  BseItem *owner,
100  BseItem *link);
101 void bse_container_debug_tree (BseContainer *container);
102 
103 
104 G_END_DECLS
105 
106 namespace Bse {
107 
108 class ContainerImpl : public SourceImpl, public virtual ContainerIface {
109 protected:
110  virtual ~ContainerImpl ();
111 public:
112  explicit ContainerImpl (BseObject*);
113  virtual ItemIfaceP lookup_item (const String &uname) override;
114 };
115 
116 } // Bse
117 
118 #endif /* __BSE_CONTAINER_H__ */
Definition: bsecontainer.hh:108
Definition: bsecontainer.hh:26
The Bse namespace contains all functions of the synthesis engine.
Definition: bstbseutils.cc:67
See also the corresponding IDL class Container.
Definition: bseserverapi.hh:742
STL class.
Definition: bsecontainer.hh:29
Definition: bseobject.hh:60
Definition: bsesource.hh:84
Definition: bsesource.hh:92
virtual ItemIfaceP lookup_item(const String &uname) override
See Container::lookup_item()
Definition: bsecontainer.cc:1362
Definition: bsestorage.hh:49
Definition: bseitem.hh:34
Definition: bsesource.hh:278
link
uname