#ifndef __iconize_h
#define __iconize_h

#include "pinboard.h"

// extra message defs missing from the Toolbox libs

typedef struct {
  int window_handle;
  int reserved;
  char sprite_name[8];
  char window_name[20];
} WimpWindowInfoMessage;

typedef struct {
  int window_handle;
  int task_handle;
  char title[20];
} WimpIconizeMessage;

typedef struct {
  int window_handle;
  int task_handle;
  int x;
  int y;
  int flags;
} WimpIconizeAtMessage;

typedef struct {
  int window_handle;
} WimpWindowClosedMessage;

typedef struct {
    struct
    {
        int    size;
        int    sender;
        int    my_ref;
        int    your_ref;
        int    action_code;
    } hdr;

    union {
      WimpWindowInfoMessage window_info;
      WimpIconizeMessage iconize;
      WimpWindowClosedMessage window_closed;
      WimpIconizeAtMessage iconize_at;
      int raw[240/sizeof(int)];
    } data;

} WimpMessageE;

void iconize_init(_backdrop_state *state);
void iconize_restore(int window_handle);
int wimp_sprite_exists(char *sprite);

#endif
