/* lib.h */

/* adapted from Steve Mumford's AULib */

#ifndef LIB_H
#define LIB_H

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "kernel.h"
#include "swis.h"

#define OS_FILE         8
#define READ_CATINFO    17
#define WRITE_CATINFO   18
#define IS_FILE         1
#define FILETYPE_VOB    0xa8d
#define FILETYPE_MPEG   0xbf8
#define FILETYPE_AVI    0xfb2
#define FILETYPE_OBEY   0xfeb
#define FILETYPE_TEXT   0xfff

#define MOUSE_ADJUST          1
#define MOUSE_MENU            2
#define MOUSE_SELECT          4
#define MOUSE_ADJUST_DRAG     0x10
#define MOUSE_SELECT_DRAG     0x40

// window handles
#define ICONBAR         -2

// icon flags
#define IFLAG_SELECTED  1<<21
#define IFLAG_SHADED    1<<22

// Message types
#define MESSAGE_QUIT          0
#define MESSAGE_DATASAVE      1
#define MESSAGE_DATASAVEACK   2
#define MESSAGE_DATALOAD      3
#define MESSAGE_DATALOADACK   4
#define MESSAGE_PALETTECHANGE 9
#define MESSAGE_HELPREQUEST   0x502
#define MESSAGE_HELPREPLY     0x503
#define MESSAGE_MODECHANGE    0x400c1


typedef struct window_data
{
  int win_handle;
  unsigned char *buffer;
  unsigned char *workspace;
} window_data;

#ifdef __CC_NORCROFT
#pragma -v1 // hint to the compiler to check f/s/printf format
#endif
void icon_text_format(int, int, const char*format, ...);
#ifdef __CC_NORCROFT
#pragma -v0 // return to default
#endif
int  loadtemplate(const char*, window_data*, int);
void icon_text_change(int, int, const char*);
const char* icon_gettext(int, int);
void icon_setselected(int, int, int);
void icon_setshaded(int, int, int);

#endif
