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