Files
Upsilon/python/port/port.h
Léa Saviot 1ce6f36651 [code] Fixed the wait for user input after drawing using Python.
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
2017-12-01 13:19:28 +01:00

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