
#define CHARACTER_NOT_FOUND   -1
#define CHARACTER_SHAPE       0
#define CHARACTER_BITMAP      1
#define CHARACTER_BUTTON      2
#define CHARACTER_TEXT        3
#define CHARACTER_FONT        4
#define CHARACTER_SOUND       5

typedef struct CHARACTER {
  U8 type;          // shape, font etc.
  U8 used;
  U16 id;
  union {
    SHAPE *shape;
    BITMAP *bitmap;
    BUTTON *button;
    TEXT *text;
    FONT *font;
    SOUND *sound;
    void *raw;
  } data;
} CHARACTER;


extern CHARACTER *dictionary[65536];
extern U32 used_characters;

void dictionary_init(void);
S32 is_id_used(U16 id);
void use_id(U16 id);
S32 add_character(U16 id, void *data, S32 type);
S32 is_depth_used(U16 depth);
void use_depth(U16 depth, S32 use);
S32 get_character_type(U16 id);
