2016-01-12 08:00:58 +00:00
|
|
|
#ifndef HEADER_InfoScreen
|
|
|
|
#define HEADER_InfoScreen
|
|
|
|
|
2020-09-19 11:55:23 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2016-01-12 08:00:58 +00:00
|
|
|
#include "FunctionBar.h"
|
|
|
|
#include "IncSet.h"
|
2020-09-19 11:55:23 +00:00
|
|
|
#include "Macros.h"
|
|
|
|
#include "Object.h"
|
2020-09-18 17:23:04 +00:00
|
|
|
#include "Panel.h"
|
|
|
|
#include "Process.h"
|
2020-09-19 11:55:23 +00:00
|
|
|
#include "Vector.h"
|
|
|
|
|
2016-01-12 08:00:58 +00:00
|
|
|
|
2020-09-19 11:55:23 +00:00
|
|
|
typedef struct InfoScreen_ {
|
|
|
|
Object super;
|
|
|
|
const Process* process;
|
|
|
|
Panel* display;
|
|
|
|
FunctionBar* bar;
|
|
|
|
IncSet* inc;
|
|
|
|
Vector* lines;
|
|
|
|
} InfoScreen;
|
2016-01-12 08:00:58 +00:00
|
|
|
|
|
|
|
typedef void(*InfoScreen_Scan)(InfoScreen*);
|
|
|
|
typedef void(*InfoScreen_Draw)(InfoScreen*);
|
|
|
|
typedef void(*InfoScreen_OnErr)(InfoScreen*);
|
|
|
|
typedef bool(*InfoScreen_OnKey)(InfoScreen*, int);
|
|
|
|
|
|
|
|
typedef struct InfoScreenClass_ {
|
2020-10-04 15:55:08 +00:00
|
|
|
const ObjectClass super;
|
2016-01-12 08:00:58 +00:00
|
|
|
const InfoScreen_Scan scan;
|
|
|
|
const InfoScreen_Draw draw;
|
|
|
|
const InfoScreen_OnErr onErr;
|
|
|
|
const InfoScreen_OnKey onKey;
|
|
|
|
} InfoScreenClass;
|
|
|
|
|
2020-10-04 15:55:08 +00:00
|
|
|
#define As_InfoScreen(this_) ((const InfoScreenClass*)(((InfoScreen*)(this_))->super.klass))
|
2016-01-12 08:00:58 +00:00
|
|
|
#define InfoScreen_scan(this_) As_InfoScreen(this_)->scan((InfoScreen*)(this_))
|
|
|
|
#define InfoScreen_draw(this_) As_InfoScreen(this_)->draw((InfoScreen*)(this_))
|
|
|
|
#define InfoScreen_onErr(this_) As_InfoScreen(this_)->onErr((InfoScreen*)(this_))
|
|
|
|
#define InfoScreen_onKey(this_, ch_) As_InfoScreen(this_)->onKey((InfoScreen*)(this_), ch_)
|
|
|
|
|
2020-10-07 17:02:15 +00:00
|
|
|
InfoScreen* InfoScreen_init(InfoScreen* this, const Process* process, FunctionBar* bar, int height, const char* panelHeader);
|
2016-01-12 08:00:58 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
InfoScreen* InfoScreen_done(InfoScreen* this);
|
2016-01-12 08:00:58 +00:00
|
|
|
|
2020-09-08 14:29:25 +00:00
|
|
|
ATTR_FORMAT(printf, 2, 3)
|
2020-09-02 07:38:44 +00:00
|
|
|
void InfoScreen_drawTitled(InfoScreen* this, const char* fmt, ...);
|
2016-01-12 08:00:58 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void InfoScreen_addLine(InfoScreen* this, const char* line);
|
2016-01-12 08:00:58 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void InfoScreen_appendLine(InfoScreen* this, const char* line);
|
2016-01-12 08:00:58 +00:00
|
|
|
|
2020-09-02 07:38:44 +00:00
|
|
|
void InfoScreen_run(InfoScreen* this);
|
2016-01-12 08:00:58 +00:00
|
|
|
|
|
|
|
#endif
|