#if ! defined ( LIBOCELLI_ICON_CATALOG )
#define LIBOCELLI_ICON_CATALOG
//----------------------------------------------------------------------------
///
/// \file   icon_catalog.hpp
///
/// \brief  Enums for icon categorization
///
/// \date   20221113
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//----------------------------------------------------------------------------


//---Documentation------------------------------------------------------------


//---Includes -----------------------------------------------------------------


//---General--------------------------


//--- Own ----------------------------

//#include <ocelli/icon.hpp>
#include <lepto/lepto.h>      // address_t
#if defined (__arm__)
   #include <stdint.h>
#else
   // We force 32bit compilation to generate media file on host.
   // But for <stdint.h> the package "libc6-dev-i386" would be needed to be
   // installed.
   typedef unsigned char uint8_t;
   typedef unsigned int uint32_t;
   typedef signed int int32_t;
   static_assert( sizeof(uint32_t) == 4, "Wrong size");
   static_assert( sizeof(int32_t) == 4, "Wrong size");
#endif


//---Declaration---------------------------------------------------------------


#define  ICON_MAGIC       0x4E4F4349   // LSB "ICON" MSB

typedef uint8_t flashEnumType;

enum class EImageType: flashEnumType;

enum class EImageType: flashEnumType
{
   Null    = 0x00,
   Version = 0x10,
   Splash  = 0x11,
   Icon32  = 0x12,
   Icon48  = 0x13,
   End     = 0x14,
};

enum class EImageSize: flashEnumType
{
   Null        = 0x00,
   None        = 0x20,
   s48         = 0x21,
   s32         = 0x22,
   FullScreen  = 0x23,
};

enum EImageContent: flashEnumType;
/*
{
   Nullptr,
   Minutnik,
   Wink,
   Pizza,
   Bretzel,
   Coffee,
   Socks,
   Spaghetti,
   Egg,
   Frenchfries,
   Potato,
   Hourglass,
   Thermometer,
   Lightbulb,
   Plant,
   Television,
   Microscope,
   Wrench,
   Wine,
};
*/

enum class EImageFormat: flashEnumType
{
   Null  = 0x00,
   None  = 0x30,
   RGB   = 0x31,
   PNG   = 0x32,
   Alpha = 0x33,
   RGBA  = 0x34,
};

struct SFlashIconHeader
{
   uint32_t magic;
   EImageType type;
   flashEnumType reserved;
   //EImageSize size;
   EImageContent content;
   EImageFormat format;
   int32_t width;
   int32_t height;
   uint32_t dataSize;
   address32_t startData;
   address32_t nextHeader;
}; // __attribute__ ((aligned (64)));

static_assert( sizeof( SFlashIconHeader ) == ( 6 * 4 ) + ( 4 * 1 ) );


//---fin-----------------------------------------------------------------------
#endif // ! ? LIBOCELLI_ICON_CATALOG
