|
14 | 14 | namespace libscratchcpp
|
15 | 15 | {
|
16 | 16 |
|
17 |
| -class IBlockSection; |
| 17 | +class IExtension; |
18 | 18 | class Broadcast;
|
19 | 19 | class Block;
|
20 | 20 | class Target;
|
@@ -217,66 +217,60 @@ class LIBSCRATCHCPP_EXPORT IEngine
|
217 | 217 | /*! Returns the timer of the project. */
|
218 | 218 | virtual ITimer *timer() const = 0;
|
219 | 219 |
|
220 |
| - /*! |
221 |
| - * Registers the given block section. |
222 |
| - * \see <a href="blockSections.html">Block sections</a> |
223 |
| - */ |
224 |
| - virtual void registerSection(std::shared_ptr<IBlockSection> section) = 0; |
225 |
| - |
226 | 220 | /*! Returns the index of the given block function. */
|
227 | 221 | virtual unsigned int functionIndex(BlockFunc f) = 0;
|
228 | 222 |
|
229 | 223 | /*! Returns the list of block functions. */
|
230 | 224 | virtual const std::vector<BlockFunc> &blockFunctions() const = 0;
|
231 | 225 |
|
232 | 226 | /*!
|
233 |
| - * Call this from IBlockSection#registerBlocks() to add a compile function to a block section. |
234 |
| - * \see <a href="blockSections.html">Block sections</a> |
| 227 | + * Call this from IExtension#registerBlocks() to add a compile function to a block section. |
| 228 | + * \see <a href="extensions.html">Extensions</a> |
235 | 229 | */
|
236 |
| - virtual void addCompileFunction(IBlockSection *section, const std::string &opcode, BlockComp f) = 0; |
| 230 | + virtual void addCompileFunction(IExtension *extension, const std::string &opcode, BlockComp f) = 0; |
237 | 231 |
|
238 | 232 | /*!
|
239 |
| - * Call this from IBlockSection#registerBlocks() to add a hat block predicate compile function to a block section. |
| 233 | + * Call this from IExtension#registerBlocks() to add a hat block predicate compile function to a block section. |
240 | 234 | * \note This only works with edge-activated hats.
|
241 |
| - * \see <a href="blockSections.html">Block sections</a> |
| 235 | + * \see <a href="extensions.html">Extensions</a> |
242 | 236 | */
|
243 |
| - virtual void addHatPredicateCompileFunction(IBlockSection *section, const std::string &opcode, HatPredicateCompileFunc f) = 0; |
| 237 | + virtual void addHatPredicateCompileFunction(IExtension *extension, const std::string &opcode, HatPredicateCompileFunc f) = 0; |
244 | 238 |
|
245 | 239 | /*!
|
246 |
| - * Call this from IBlockSection#registerBlocks() to add a monitor name function to a block section. |
247 |
| - * \see <a href="blockSections.html">Block sections</a> |
| 240 | + * Call this from IExtension#registerBlocks() to add a monitor name function to a block section. |
| 241 | + * \see <a href="extensions.html">Extensions</a> |
248 | 242 | */
|
249 |
| - virtual void addMonitorNameFunction(IBlockSection *section, const std::string &opcode, MonitorNameFunc f) = 0; |
| 243 | + virtual void addMonitorNameFunction(IExtension *extension, const std::string &opcode, MonitorNameFunc f) = 0; |
250 | 244 |
|
251 | 245 | /*!
|
252 |
| - * Call this from IBlockSection#registerBlocks() to add a monitor value change function to a block section. |
253 |
| - * \see <a href="blockSections.html">Block sections</a> |
| 246 | + * Call this from IExtension#registerBlocks() to add a monitor value change function to a block section. |
| 247 | + * \see <a href="extensions.html">Extensions</a> |
254 | 248 | */
|
255 |
| - virtual void addMonitorChangeFunction(IBlockSection *section, const std::string &opcode, MonitorChangeFunc f) = 0; |
| 249 | + virtual void addMonitorChangeFunction(IExtension *extension, const std::string &opcode, MonitorChangeFunc f) = 0; |
256 | 250 |
|
257 | 251 | /*!
|
258 |
| - * Call this from IBlockSection#registerBlocks() to add a hat block to a block section. |
259 |
| - * \see <a href="blockSections.html">Block sections</a> |
| 252 | + * Call this from IExtension#registerBlocks() to add a hat block to a block section. |
| 253 | + * \see <a href="extensions.html">Extensions</a> |
260 | 254 | */
|
261 |
| - virtual void addHatBlock(IBlockSection *section, const std::string &opcode) = 0; |
| 255 | + virtual void addHatBlock(IExtension *extension, const std::string &opcode) = 0; |
262 | 256 |
|
263 | 257 | /*!
|
264 |
| - * Call this from IBlockSection#registerBlocks() to add an input to a block section. |
265 |
| - * \see <a href="blockSections.html">Block sections</a> |
| 258 | + * Call this from IExtension#registerBlocks() to add an input to a block section. |
| 259 | + * \see <a href="extensions.html">Extensions</a> |
266 | 260 | */
|
267 |
| - virtual void addInput(IBlockSection *section, const std::string &name, int id) = 0; |
| 261 | + virtual void addInput(IExtension *extension, const std::string &name, int id) = 0; |
268 | 262 |
|
269 | 263 | /*!
|
270 |
| - * Call this from IBlockSection#registerBlocks() to add a field to a block section. |
271 |
| - * \see <a href="blockSections.html">Block sections</a> |
| 264 | + * Call this from IExtension#registerBlocks() to add a field to a block section. |
| 265 | + * \see <a href="extensions.html">Extensions</a> |
272 | 266 | */
|
273 |
| - virtual void addField(IBlockSection *section, const std::string &name, int id) = 0; |
| 267 | + virtual void addField(IExtension *extension, const std::string &name, int id) = 0; |
274 | 268 |
|
275 | 269 | /*!
|
276 |
| - * Call this from IBlockSection#registerBlocks() to add a field value to a block section. |
277 |
| - * \see <a href="blockSections.html">Block sections</a> |
| 270 | + * Call this from IExtension#registerBlocks() to add a field value to a block section. |
| 271 | + * \see <a href="extensions.html">Extensions</a> |
278 | 272 | */
|
279 |
| - virtual void addFieldValue(IBlockSection *section, const std::string &value, int id) = 0; |
| 273 | + virtual void addFieldValue(IExtension *extension, const std::string &value, int id) = 0; |
280 | 274 |
|
281 | 275 | /*! Returns the list of broadcasts. */
|
282 | 276 | virtual const std::vector<std::shared_ptr<Broadcast>> &broadcasts() const = 0;
|
@@ -381,11 +375,13 @@ class LIBSCRATCHCPP_EXPORT IEngine
|
381 | 375 | /*! Emits when a question is answered. */
|
382 | 376 | virtual sigslot::signal<const std::string &> &questionAnswered() = 0;
|
383 | 377 |
|
| 378 | +#ifndef USE_LLVM |
384 | 379 | /*! Returns the list of extension names. */
|
385 | 380 | virtual const std::vector<std::string> &extensions() const = 0;
|
386 | 381 |
|
387 | 382 | /*! Sets the list of extension names. */
|
388 | 383 | virtual void setExtensions(const std::vector<std::string> &newExtensions) = 0;
|
| 384 | +#endif |
389 | 385 |
|
390 | 386 | /*! Returns the map of scripts (each top level block has a Script object). */
|
391 | 387 | virtual const std::unordered_map<std::shared_ptr<Block>, std::shared_ptr<Script>> &scripts() const = 0;
|
|
0 commit comments