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