mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
Rename text_input to utils, add a util in it.
Change-Id: I5d37ed0a3a21e7d62aa061a6b09f30065c4cd8a6
This commit is contained in:
@@ -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)
|
||||
|
||||
12
app/app.cpp
12
app/app.cpp
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user