Files
Upsilon/python/port/port.h
Léa Saviot 9d82804ff3 [code/emscripten] On emscripten, fixed waiting after a Python drawing.
The user can now push OK or Back to remove a Python drawing.

Change-Id: I293064a9458f8c0c6d0da5351500600fd9e82706
2017-12-01 12:06:05 +01:00

39 lines
899 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 didModifyFramebuffer();
bool isFramebufferModified() const { return m_framebufferHasBeenModified; }
void didCleanFramebuffer();
void runCode(const char * );
virtual void printText(const char * text, size_t length) {
}
virtual void redraw() {
}
private:
bool m_framebufferHasBeenModified;
};
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