83 lines
2.4 KiB
C
83 lines
2.4 KiB
C
/*
|
|
* h2_ui.h -- OreBolt OS v1.4 shared UI header
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*
|
|
* Declares the LVGL-based UI surface that every OreBolt OS module links against
|
|
* via liblvgl.so. All 16 modules include this header and register their
|
|
* menu entries through h2_ui_register_module().
|
|
*
|
|
* v1.4: includes the new bitchat module entry in H2_MODULE_ID, which is
|
|
* the only module compiled under AGPL-3.0-only (see LICENSE.md §3).
|
|
* The rest of the UI surface stays GPL-2.0-or-later so proprietary
|
|
* overlay modules can continue to link against liblvgl.so.
|
|
*/
|
|
#ifndef H2_UI_H
|
|
#define H2_UI_H
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include "lvgl/lvgl.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* v1.4: 16 modules, reconciled with Makefile.h2-core-v6.1 */
|
|
typedef enum {
|
|
H2_MOD_VAULT = 0,
|
|
H2_MOD_NETTAP,
|
|
H2_MOD_DEPLOY,
|
|
H2_MOD_STUDIO,
|
|
H2_MOD_PROBE,
|
|
H2_MOD_VTERM,
|
|
H2_MOD_RADAR,
|
|
H2_MOD_DUCKY,
|
|
H2_MOD_EXTRACT,
|
|
H2_MOD_NOISE,
|
|
H2_MOD_RESET,
|
|
H2_MOD_EMULATE,
|
|
H2_MOD_EMULATOR_INPUT_MAPPER,
|
|
H2_MOD_RFID, /* v1.4 restored */
|
|
H2_MOD_WIFI, /* v1.4 restored */
|
|
H2_MOD_GLITCH, /* v1.4 restored */
|
|
H2_MOD_PWDB, /* v1.4 restored */
|
|
H2_MOD_BITCHAT, /* v1.4 NEW -- AGPL-3.0-only */
|
|
H2_MOD_COUNT
|
|
} H2_MODULE_ID;
|
|
|
|
typedef struct {
|
|
H2_MODULE_ID id;
|
|
const char *name;
|
|
const char *version;
|
|
const char *license; /* SPDX identifier string */
|
|
void (*init)(lv_obj_t *parent);
|
|
void (*deinit)(void);
|
|
int (*handle_input)(uint32_t key, int32_t val);
|
|
} h2_module_t;
|
|
|
|
/* Module registration -- called by main.c for each entry in modules[]. */
|
|
int h2_ui_register_module(const h2_module_t *mod);
|
|
void h2_ui_unregister_module(H2_MODULE_ID id);
|
|
|
|
/* Module lookup by name (used by S99broker init script). */
|
|
const h2_module_t *h2_ui_lookup_module(const char *name);
|
|
|
|
/* LCD framebuffer geometry for the H2 (320x240 RGB565). */
|
|
#define H2_LCD_WIDTH 320
|
|
#define H2_LCD_HEIGHT 240
|
|
#define H2_LCD_BPP 16
|
|
|
|
/* Common color palette (RGB565). */
|
|
#define H2_COLOR_BG 0x0000
|
|
#define H2_COLOR_FG 0xFFFF
|
|
#define H2_COLOR_ACCENT 0xFD20 /* orange */
|
|
#define H2_COLOR_WARN 0xFFE0 /* yellow */
|
|
#define H2_COLOR_DANGER 0xF800 /* red */
|
|
#define H2_COLOR_OK 0x07E0 /* green */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* H2_UI_H */
|