70 lines
1.8 KiB
C
70 lines
1.8 KiB
C
/*
|
|
* File: Hierarchical_Menu.h
|
|
* Created: Created: Sunday September 2025 07:47:35
|
|
* Author: Chris
|
|
*/
|
|
#ifndef HIERARCHICAL_MENU_H
|
|
#define HIERARCHICAL_MENU_H
|
|
|
|
// ============================================================================================
|
|
// Includes
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#include "Display.h"
|
|
#include "Display_Objects.h"
|
|
#include "Display_Objects_Datatypes.h"
|
|
|
|
|
|
// ============================================================================================
|
|
// Defines
|
|
|
|
|
|
// ============================================================================================
|
|
// Forward declarations
|
|
typedef struct Menu_Item_S Menu_Item;
|
|
typedef struct Menu_List_S Menu_List;
|
|
typedef struct Hierarchical_Menu_S Hierarchical_Menu;
|
|
|
|
|
|
// ============================================================================================
|
|
// Datatypes
|
|
typedef enum {
|
|
NONE,
|
|
BOOL,
|
|
RGB
|
|
} Variable_Type;
|
|
|
|
typedef struct Menu_Item_S {
|
|
const char* Text;
|
|
const Menu_List* List;
|
|
const bool Is_Back;
|
|
const Menu_List* Containing_List;
|
|
|
|
const Variable_Type Type;
|
|
const char* Variable_Title;
|
|
const void* Variable;
|
|
} Menu_Item;
|
|
|
|
typedef struct Menu_List_S {
|
|
const char* Title;
|
|
const Menu_Item* Items;
|
|
const uint32_t Item_Count;
|
|
const Menu_Item* Parent;
|
|
const Hierarchical_Menu* Root;
|
|
} Menu_List;
|
|
|
|
typedef struct Hierarchical_Menu_S {
|
|
const Menu_List* List;
|
|
const void (*Parent_Function)(Screen_Transition_Direction, Screen_Transition_Direction, Easing, uint32_t, int32_t);
|
|
const int32_t Parent_Selected_Setting;
|
|
} Hierarchical_Menu;
|
|
|
|
|
|
// ============================================================================================
|
|
// Variables
|
|
|
|
|
|
|
|
#endif // HIERARCHICAL_MENU_H
|