mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 09:17:23 +01:00
A SandboxController is now pushed on the StackViewController and sets the KDIonContext::sharedContext before drawing, sets a white background and handles user input after the Python computation to dismiss the drawing screen. Change-Id: I51b0474365a85e845227379a16d090541fa8ded7
36 lines
762 B
C++
36 lines
762 B
C++
#ifndef PYTHON_PORT_H
|
|
#define PYTHON_PORT_H
|
|
|
|
namespace MicroPython {
|
|
|
|
class ScriptProvider {
|
|
public:
|
|
virtual const char * contentOfScript(const char * name) = 0;
|
|
};
|
|
|
|
class ExecutionEnvironment {
|
|
public:
|
|
ExecutionEnvironment();
|
|
static ExecutionEnvironment * currentExecutionEnvironment();
|
|
void runCode(const char * );
|
|
virtual void displaySandbox() {
|
|
}
|
|
virtual void printText(const char * text, size_t length) {
|
|
}
|
|
protected:
|
|
bool m_sandboxIsDisplayed;
|
|
};
|
|
|
|
void init(void * heapStart, void * heapEnd);
|
|
void deinit();
|
|
void registerScriptProvider(ScriptProvider * s);
|
|
|
|
};
|
|
|
|
// Will implement :
|
|
// mp_lexer_new_from_file -> Ask the context about a file
|
|
// mp_import_stat
|
|
// mp_hal_stdout_tx_strn_cooked -> Tell the context Python printed text
|
|
|
|
#endif
|