Little fix after the last commit (mostly a git fail)
[eigenmath-fx.git] / console.h
blobaef830f73d544121bd999bb3aaa51a80818937af
1 /*
2 Console Lib for CASIO fx-9860G
3 by Mike Smith.
4 */
6 #ifndef CONSOLE_H
7 #define CONSOLE_H
9 #ifdef __cplusplus
10 extern "C"{
11 #endif
13 #include <stdlib.h>
14 #include <string.h>
15 #include "fxlib.h"
17 enum CONSOLE_SCREEN_SPEC{
18 LINE_MAX = 32,
19 LINE_DISP_MAX = 7,
20 COL_DISP_MAX = 21,//21
21 EDIT_LINE_MAX = 2048
24 enum CONSOLE_RETURN_VAL{
25 CONSOLE_NEW_LINE_SET = 1,
26 CONSOLE_SUCCEEDED = 0,
27 CONSOLE_MEM_ERR = -1,
28 CONSOLE_ARG_ERR = -2,
29 CONSOLE_NO_EVENT = -3
32 enum CONSOLE_CURSOR_DIRECTION{
33 CURSOR_UP,
34 CURSOR_DOWN,
35 CURSOR_LEFT,
36 CURSOR_RIGHT
39 enum CONSOLE_LINE_TYPE{
40 LINE_TYPE_INPUT,
41 LINE_TYPE_OUTPUT
44 enum CONSOLE_CASE{
45 LOWER_CASE,
46 UPPER_CASE
49 struct line{
50 unsigned char *str;
51 unsigned char *tex_str;
52 int readonly;
53 int type;
54 int start_col;
55 int disp_len;
56 unsigned char tex_flag;
57 int tex_height, tex_width;
60 struct FMenu{
61 char* name;
62 char** str;
63 unsigned char count;
66 struct location{
67 int x;
68 int y;
71 #define MAX_FMENU_ITEMS 7
72 #define FMENU_TITLE_LENGHT 4
74 #define is_wchar(c) ((c == 0x7F) || (c == 0xF7) || (c == 0xF9) || (c == 0xE5) || (c == 0xE6) || (c == 0xE7))
75 #define printf(s) Console_Output((const unsigned char *)s);
77 int Console_DelStr(unsigned char *str, int end_pos, int n);
78 int Console_InsStr(unsigned char *dest, const unsigned char *src, int disp_pos);
79 int Console_GetActualPos(const unsigned char *str, int disp_pos);
80 int Console_GetDispLen(const unsigned char *str);
81 int Console_MoveCursor(int direction);
82 int Console_Input(const unsigned char *str);
83 int Console_Output(const unsigned char *str);
84 int Console_Clear_EditLine();
85 int Console_NewLine(int pre_line_type, int pre_line_readonly);
86 int Console_Backspace(void);
87 int Console_GetKey(void);
88 int Console_Init(void);
89 int Console_Disp(void);
90 int Console_FMenu(int key);
91 void Console_FMenu_Init(void);
92 int Console_Draw_FMenu(int key, struct FMenu* menu);
93 char *Console_Make_Entry(const unsigned char* str);
94 unsigned char *Console_GetLine(void);
95 unsigned char* Console_GetEditLine();
96 void Console_Draw_TeX_Popup(unsigned char* str, int width, int height);
98 #ifdef __cplusplus
100 #endif
101 #endif