home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / xloadimg.zip / xloadimage.4.1 / options.h < prev    next >
C/C++ Source or Header  |  1993-10-28  |  3KB  |  101 lines

  1. /* options.h:
  2.  *
  3.  * optionNumber() definitions
  4.  *
  5.  * jim frost 10.03.89
  6.  *
  7.  * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
  8.  * copyright information.
  9.  */
  10.  
  11. /* enum with the options in it.  If you add one to this you also have to
  12.  * add its information to Options[] in options.c before it becomes available.
  13.  */
  14.  
  15. typedef enum option_id {
  16.  
  17.   /* global options
  18.    */
  19.  
  20.   OPT_NOTOPT= 0, OPT_BADOPT, OPT_SHORTOPT, OPT_IGNORE, BORDER, CONFIGURATION,
  21.   DBUG, DEFAULT, DELAY, DISPLAY, DUMP, FIT, FORK, FULLSCREEN, GEOMETRY, HELP,
  22.   IDENTIFY, INSTALL, LIST, ONROOT, PATH, PIXMAP, PRIVATE, QUIET,
  23.   SHRINKTOFIT, SUPPORTED, VERBOSE, VER_NUM, VIEW, VISUAL, WINDOWID,
  24.  
  25.   /* local options
  26.    */
  27.  
  28.   AT, BACKGROUND, BRIGHT, CENTER, CLIP, COLORS, DITHER, FOREGROUND,
  29.   GAMMA, GLOBAL, GOTO, GRAY, HALFTONE, IDELAY, INVERT, MERGE, NAME,
  30.   NEWOPTIONS, NORMALIZE, ROTATE, SMOOTH, TITLE, TILE, TYPE, UNDITHER,
  31.   XZOOM, YZOOM, ZOOM
  32. } OptionId;
  33.  
  34. /* option structure
  35.  */
  36. typedef struct option {
  37.   enum option_id type;
  38.   union {
  39.     struct {
  40.       unsigned int x, y;      /* location to load image at */
  41.     } at;
  42.     char         *background; /* background color for mono images */
  43.     char         *border;     /* border color */
  44.     unsigned int  bright;     /* brightness multiplier */
  45.     struct {
  46.       unsigned int x, y, w, h; /* area of image to be used */
  47.     } clip;
  48.     unsigned int  colors;     /* max # of colors to use for this image */
  49.     unsigned int  delay;      /* # of seconds delay before auto pic advance */
  50.     char         *display;    /* display name */
  51.     struct {
  52.       char *type; /* image type */
  53.       char *file; /* file name */
  54.     } dump;
  55.     char         *foreground; /* foreground color for mono images */
  56.     float         gamma;      /* display gamma value */
  57.     struct {
  58.       char *string;
  59.       unsigned int w;
  60.       unsigned int h;
  61.     } geometry;
  62.     char         *go_to;      /* label to go to */
  63.     char         *name;       /* name of image */
  64.     unsigned int  rotate;     /* # of degrees to rotate image */
  65.     char         *title;      /* title of image */
  66.     char         *type;       /* expected type of image */
  67.     unsigned int  windowid;   /* windowid for changing window backgrounds */
  68.     unsigned int  visual;     /* visual type to use */
  69.     struct {
  70.       unsigned int x, y;      /* zoom factors */
  71.     } zoom;
  72.   } info;
  73.   struct option *next;
  74. } Option;
  75.  
  76. /* image name and option structure used when processing arguments
  77.  */
  78. typedef struct option_set {
  79.   Option            *options; /* image processing options */
  80.   struct option_set *next;
  81. } OptionSet;
  82.  
  83. /* option information array
  84.  */
  85. typedef struct option_array {
  86.   char     *name;        /* name of the option minus preceeding '-' */
  87.   OptionId  option_id;   /* OptionId of this option */
  88.   char     *args;        /* arguments this option uses or NULL if none */
  89.   char     *description; /* description of this option */
  90. } OptionArray;
  91.  
  92. Option *getOption(); /* options.c */
  93. Option *newOption();
  94. OptionId optionNumber();
  95. int getNextTypeOption();
  96.  
  97. /* imagetypes.c */
  98. Image *loadImage _ArgProto((OptionSet *globalopts, OptionSet *options,
  99.                 char *name, unsigned int verbose));
  100. void   identifyImage _ArgProto((char *name));
  101.