Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
bseexports.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_EXPORTS_H__
3 #define __BSE_EXPORTS_H__
4 
5 #include <bse/bseprocedure.hh>
6 
7 /* --- export node types --- */
8 typedef enum {
9  BSE_EXPORT_NODE_NONE,
10  BSE_EXPORT_NODE_LINK,
11  BSE_EXPORT_NODE_HOOK,
12  BSE_EXPORT_NODE_ENUM,
13  BSE_EXPORT_NODE_RECORD,
14  BSE_EXPORT_NODE_SEQUENCE,
15  BSE_EXPORT_NODE_CLASS,
16  BSE_EXPORT_NODE_PROC
17 } BseExportNodeType;
18 
19 /* --- common export node data --- */
20 typedef struct {
21  /* strings which need to be looked up from catalogs after
22  * initialization (usually i18n strings).
23  */
24  const char *blurb;
25  const char *authors;
26  const char *license;
27  const char *i18n_category;
28  /* definition location */
29  const char *file;
30  guint line;
32 typedef void (*BseExportStringsFunc) (BseExportStrings *strings);
33 
34 /* --- basic export node --- */
36  BseExportNode *next;
37  BseExportNodeType ntype;
38  const char *name;
39  const char *options;
40  const char *category;
41  const guint8 *pixstream;
42  BseExportStringsFunc fill_strings;
43  GType type;
44 };
45 
46 /* --- hook export node --- */
47 typedef void (*BseExportHook) (void *data);
48 typedef struct {
49  BseExportNode node;
50  bool make_static;
51  BseExportHook hook;
52  void *data;
54 
55 /* --- enum export node --- */
56 typedef GEnumValue* (*BseExportGetEnumValues) (void);
57 typedef SfiChoiceValues (*BseExportGetChoiceValues) (void);
58 typedef struct {
59  BseExportNode node;
60  BseExportGetEnumValues get_enum_values;
61  BseExportGetChoiceValues get_choice_values;
63 
64 /* --- boxed export node --- */
65 typedef SfiRecFields (*BseExportGetRecordFields) (void);
66 typedef GParamSpec* (*BseExportGetSequenceElement) (void);
68  BseExportNode node;
69  GBoxedCopyFunc copy;
70  GBoxedFreeFunc free;
71  GValueTransform boxed2recseq;
72  GValueTransform seqrec2boxed;
73  union {
74  BseExportGetRecordFields get_fields;
75  BseExportGetSequenceElement get_element;
76  } func;
77 };
78 
79 /* --- class export node --- */
80 typedef struct {
81  BseExportNode node;
82  const char *parent;
83  /* GTypeInfo fields */
84  guint16 class_size;
85  GClassInitFunc class_init;
86  GClassFinalizeFunc class_finalize;
87  guint16 instance_size;
88  GInstanceInitFunc instance_init;
90 
91 /* --- procedure export node --- */
92 typedef struct {
93  BseExportNode node;
94  guint private_id;
95  BseProcedureInit init;
96  BseProcedureExec exec;
98 
99 /* --- plugin identity export --- */
100 /* plugin export identity (name, bse-version and actual types) */
101 #define BSE_EXPORT_IDENTITY_SYMBOL bse_export__identity
102 #define BSE_EXPORT_IDENTITY_STRING "bse_export__identity"
103 typedef struct {
104  uint major, minor, micro;
105  uint dummy1, dummy2, dummy3, dummy4, dummy5;
106  Bse::uint64 export_flags;
107  BseExportNode *export_chain;
109 #define BSE_EXPORT_IDENTITY(HEAD) \
110  { BST_MAJOR_VERSION, BST_MINOR_VERSION, BST_MICRO_VERSION, \
111  0, 0, 0, 0, 0, \
112  BSE_EXPORT_CONFIG, &HEAD }
113 
114 #define BSE_EXPORT_FLAG_MMX (0x1ull << 0)
115 #define BSE_EXPORT_FLAG_MMXEXT (0x1ull << 1)
116 #define BSE_EXPORT_FLAG_3DNOW (0x1ull << 2)
117 #define BSE_EXPORT_FLAG_3DNOWEXT (0x1ull << 3)
118 #define BSE_EXPORT_FLAG_SSE (0x1ull << 4)
119 #define BSE_EXPORT_FLAG_SSE2 (0x1ull << 5)
120 #define BSE_EXPORT_FLAG_SSE3 (0x1ull << 6)
121 #define BSE_EXPORT_FLAG_SSE4 (0x1ull << 7)
122 
123 #define BSE_EXPORT_CONFIG (BSE_EXPORT_CONFIG__MMX | BSE_EXPORT_CONFIG__3DNOW | \
124  BSE_EXPORT_CONFIG__SSE | BSE_EXPORT_CONFIG__SSE2 | \
125  BSE_EXPORT_CONFIG__SSE3)
126 
127 
128 
129 BsePlugin* bse_exports__add_node (const BseExportIdentity *identity, // bseplugin.cc
130  BseExportNode *enode);
131 void bse_exports__del_node (BsePlugin *plugin, // bseplugin.cc
132  BseExportNode *enode);
133 
134 /* implementation prototype */
135 void bse_procedure_complete_info (const BseExportNodeProc *pnode,
136  GTypeInfo *info);
137 
138 /* --- export config --- */
139 #ifdef __MMX__
140 #define BSE_EXPORT_CONFIG__MMX BSE_EXPORT_FLAG_MMX
141 #else
142 #define BSE_EXPORT_CONFIG__MMX 0
143 #endif
144 #ifdef __3dNOW__
145 #define BSE_EXPORT_CONFIG__3DNOW BSE_EXPORT_FLAG_3DNOW
146 #else
147 #define BSE_EXPORT_CONFIG__3DNOW 0
148 #endif
149 #ifdef __SSE__
150 #define BSE_EXPORT_CONFIG__SSE BSE_EXPORT_FLAG_SSE
151 #else
152 #define BSE_EXPORT_CONFIG__SSE 0
153 #endif
154 #ifdef __SSE2__
155 #define BSE_EXPORT_CONFIG__SSE2 BSE_EXPORT_FLAG_SSE2
156 #else
157 #define BSE_EXPORT_CONFIG__SSE2 0
158 #endif
159 #ifdef __SSE3__
160 #define BSE_EXPORT_CONFIG__SSE3 BSE_EXPORT_FLAG_SSE3
161 #else
162 #define BSE_EXPORT_CONFIG__SSE3 0
163 #endif
164 
165 #endif /* __BSE_EXPORTS_H__ */
Definition: bseexports.hh:48
free
Definition: bseplugin.hh:16
Definition: bseexports.hh:103
void info(const char *format, const Args &...args)
Issue an informative printf-like message.
Definition: bcore.hh:135
Definition: bseexports.hh:80
Definition: bseexports.hh:92
Pointer sized integer object handle.
Definition: sfitypes.hh:29
Definition: sfiparams.hh:69
Definition: bseexports.hh:58
uint64_t uint64
Definition: bseexports.hh:67
Definition: bseexports.hh:35
Definition: bseexports.hh:20