Files
Upsilon/python/port/port.h
Léa Saviot a9f4da92c0 [code/python] Fixed the Kandinsky module in Python.
User can draw on the 320*220 drawing screen.

Change-Id: I25034b05f21aacc35608358fdb7a4d9924dd22e8
2017-11-21 17:12:38 +01:00

37 lines
791 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();
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