/*
  ArtToSpr Artworks/Draw to Sprite convertor
  Copyright (c) 1998 Tony Houghton

  This source is distributed under the GPL. Please see the file
  "COPYING" for details.
*/

/* Output options */
#ifndef __opts_h
#define __opts_h

#ifndef __toolbox_h
#include "toolbox.h"
#endif

typedef enum {
  dpi_22x22,
  dpi_45x45,
  dpi_90x45,
  dpi_90x90,
  dpi_180x180
} opts_dpi;

/* These colours correspond to stringset indexes
   Add 1 to obtain log2bpp */
typedef enum {
  colours_2,
  colours_4,
  colours_16,
  colours_256,
  colours_32K,
  colours_16M
} opts_colours;

typedef enum {
  quality_AntiAliased,
  quality_Normal,
  quality_Simple,
  quality_Outline
} opts_quality;

typedef struct {
  int colours;
  int resolution;
  unsigned long int bg_colour;
  bool mask;
  int quality;
  int margin;
  double angle;
  double scale_x, scale_y;
  bool scale_to_fit;
  int scale_fit_x, scale_fit_y;
  bool keep_aspect;
  int aspect;		/* ComponentId from bottom set of radios */
  unsigned long int temp_bg;
  int temp_mask;
  bool master;
} options;

/* Amount at end of above structure not to be included in file */
#define opts_DONTSAVE (3 * sizeof(int))

#ifdef __cplusplus
extern "C" {
#endif

/* Sets up handlers and initialises default values from filename; NULL for
   default choices file */
extern void opts_init(const char *filename);

/* Resets options from default values */
extern void opts_reset(options *);

/* Returns a mode number or -1 */
extern int opts_calculate_mode(int colours, int dpi);

/* Use these next two in conjunction */
/* Updates mode info in data from current mode */
extern void opts_set_current_mode(options *);

/* Updates mode info in window from current data */
extern void opts_update_mode(options const *, ObjectId);

/* Releases handlers for window before destroying */
extern void opts_release(options *, ObjectId);

extern options default_opts;
extern ObjectId opts_default_id;

#ifdef __cplusplus
}
#endif

#endif
