Rename text_input to utils, add a util in it.

Change-Id: I5d37ed0a3a21e7d62aa061a6b09f30065c4cd8a6
This commit is contained in:
Felix Raimundo
2016-03-24 13:45:51 +01:00
parent d105236da9
commit 3e632f5586
4 changed files with 16 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
app_objs += $(addprefix app/,\
app.o\
text_input.o)
utils.o)
products += $(app_objs) app.elf app.hex app.bin
app.elf: $(app_objs)

View File

@@ -6,7 +6,7 @@ extern "C" {
#include <poincare.h>
#include "text_input.h"
#include "utils.h"
void draw_lines_from_center() {
KDCoordinate width = SCREEN_WIDTH;
@@ -60,16 +60,6 @@ void funnyPlot() {
delete e;
}
static void clear_screen() {
KDRect r;
r.x = 0;
r.y = 0;
r.width = SCREEN_WIDTH;
r.height = SCREEN_HEIGHT;
KDFillRect(r, 0x00);
}
static void interactive_expression_parsing() {
while (1) {
char * text_input = get_text();

View File

@@ -7,6 +7,15 @@ extern "C" {
#define PROMPT_HEIGHT 30
void clear_screen() {
KDRect r;
r.x = 0;
r.y = 0;
r.width = SCREEN_WIDTH;
r.height = SCREEN_HEIGHT;
KDFillRect(r, 0x00);
}
static void clear_prompt() {
KDRect r;
r.x = 0;

View File

@@ -1,8 +1,10 @@
#ifndef APP_TEXTINPUT_H
#define APP_TEXTINPUT_H
#ifndef APP_UTILS_H
#define APP_UTILS_H
/* Returns a pointer to an input text, allocated by the functions (it is thus
* the caller's role to free it). */
char* get_text();
#endif // APP_TEXTINPUT_H
void clear_screen();
#endif // APP_UTILS_H