home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / misc / imagefx_sdk / include / scan / previnfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-19  |  6.0 KB  |  193 lines

  1. /*
  2.  * ImageFX Development Header File
  3.  * Copyright © 1991-1995 Nova Design, Inc.
  4.  * Written by Thomas Krehbiel
  5.  *
  6.  * Thumbnail Preview Window Definitions.
  7.  *
  8.  */
  9.  
  10. #ifndef SCAN_PREVINFO_H
  11.  
  12.  
  13. /*
  14.  * Tags passed to DoPreviewWindow() function:
  15.  *
  16.  */
  17. enum
  18. {
  19.  
  20.    DPW_Title = 1,             /* Title of requester */
  21.    DPW_HelpNode,              /* Help text node */
  22.  
  23.    DPW_OkayGadget,            /* Provide Okay gadget */
  24.    DPW_CancelGadget,          /* Provide Cancel gadget */
  25.    DPW_LoadGadget,            /* Provide Load gadget */
  26.    DPW_SaveGadget,            /* Provide Save gadget */
  27.    DPW_DefaultsGadget,        /* Provide "Defaults" gadget */
  28.  
  29.    DPW_Activate,              /* ID of first string gadget to activate */
  30.    DPW_NewGads,               /* Caller's NewGads */
  31.    DPW_Text,                  /* Text array for caller's gadgets */
  32.  
  33.    DPW_MainBuf,               /* Buffer user is working on */
  34.  
  35.    DPW_TopPreview,            /* Called to make preview for top area */
  36.    DPW_BottomPreview,         /* Called to make preview for bottom area */
  37.    DPW_Affect,                /* Called to do operation on the buffer */
  38.  
  39.    DPW_Init,                  /* Caller's initialize function */
  40.    DPW_Cleanup,               /* Caller's cleanup function */
  41.    DPW_Load,                  /* Called when Load hit */
  42.    DPW_Save,                  /* Called when Save hit */
  43.    DPW_Defaults,              /* Called when Defaults hit */
  44.    DPW_PreInit,               /* Called before gadgets added */
  45.  
  46.    DPW_MouseMove,             /* Function to call on MOUSEMOVE's */
  47.    DPW_MouseButton,           /* Function to call on MOUSEBUTTON's */
  48.  
  49.    DPW_Dimensions,            /* Struct to fill in with window dimensions */
  50.    DPW_UserWidth,             /* User requires this much width */
  51.    DPW_UserHeight,            /* User requires this much height */
  52.  
  53.    DPW_PrevInfo,              /* Request pointer to the PrevInfo struct */
  54.  
  55.    /* These must be specified AFTER a DPW_Text tag: */
  56.    DPW_OkayGadgetID,          /* Provide Okay gadget */
  57.    DPW_CancelGadgetID,        /* Provide Cancel gadget */
  58.    DPW_LoadGadgetID,          /* Provide Load gadget */
  59.    DPW_SaveGadgetID,          /* Provide Save gadget */
  60.    DPW_DefaultsGadgetID,      /* Provide "Defaults" gadget */
  61.    DPW_TitleID,               /* Index of title into TextArray */
  62.  
  63.    DPW_Separation,            /* Pixels to put between the thumbnails */
  64.  
  65.    DPW_Noisy,                 /* Receive input from preview screen */
  66.  
  67.    DPW_PreviewInit,           /* Called after top preview is rendered:
  68.           __stdargs (*)(struct Window *, struct PrevInfo *, int, int); */
  69.  
  70. };
  71.  
  72. #define DPW_Seperation  DPW_Separation
  73.  
  74. /*
  75.  * Gadget ID's for the standard gadgets:
  76.  */
  77. #define ID_POkay     (9001)
  78. #define ID_PCancel   (9002)
  79. #define ID_PPreview  (9003)
  80. #define ID_PLoad     (9004)
  81. #define ID_PSave     (9005)
  82. #define ID_PDefaults (9006)
  83.  
  84.  
  85. /*
  86.  * PrevDimensions:
  87.  *
  88.  * Structure that is filled out with a DPW_Dimensions tag.
  89.  */
  90. struct PrevDimensions
  91. {
  92.  
  93.    WORD              Width, Height;    /* Window width/height */
  94.  
  95.    WORD              BeforeBLE,        /* Size of area set aside for */
  96.                      BeforeBTE,        /*  the "before" thumbnail */
  97.                      BeforeBW,         /* The "Border" */
  98.                      BeforeBH;
  99.  
  100.    WORD              BeforeLE,         /* Actual position of the */
  101.                      BeforeTE,         /*  "before" thumbnail */
  102.                      BeforeW,
  103.                      BeforeH;
  104.  
  105.    WORD              AfterBLE,         /* Size of area set aside for */
  106.                      AfterBTE,         /*  the "after" thumbnail */
  107.                      AfterBW,          /* The "Border" */
  108.                      AfterBH;
  109.  
  110.    WORD              AfterLE,          /* Actual position of the */
  111.                      AfterTE,          /*  "after" thumbnail */
  112.                      AfterW,
  113.                      AfterH;
  114.  
  115.    WORD              UWidth, UHeight;  /* User area width/height */
  116.    WORD              ULeft, UTop;      /* User area left/top */
  117.  
  118.    LONG              reserved[8];
  119.  
  120. };
  121.  
  122.  
  123. /*
  124.  * PrevInfo:
  125.  *
  126.  * Information about a preview thumbnail.  All of this information
  127.  * should be considered READ ONLY.
  128.  *
  129.  */
  130. struct PrevInfo
  131. {
  132.  
  133.    struct Buffer    *Buffer;           /* Small representation of the
  134.                                           original buffer to preview */
  135.    UBYTE            *Rendered;         /* 8-bit chunky rendered image of
  136.                                           the original buffer, for writing
  137.                                           to the display */
  138.    WORD              RWidth,           /* Rendered pixel width/height */
  139.                      RHeight;
  140.    UBYTE             Palette[768];     /* Palette for the 8-bit chunky
  141.                                           rendering, and for the subsequent
  142.                                           "after" image rendering */
  143.    UWORD             Colors;           /* Total number of colors in the palette */
  144.    UWORD             Offset;           /* Offset to start of palette */
  145.  
  146.    struct BitMap    *BM;               /* Temp BM/RP for WritePixelArray */
  147.    struct RastPort   RP;
  148.  
  149.    WORD              NWidth,           /* Size of area dedicated to thumbnail */
  150.                      NHeight;          /* (actual nail may be smaller) */
  151.  
  152.    UBYTE             pad1;
  153.    UBYTE             pad2[3];
  154.    ULONG             pad3[2];
  155.    ULONG             pad4[2];
  156.  
  157.    ULONG             pad5[8];
  158.    ULONG             pad6[8];
  159.  
  160.    int             (*AffectCode)(struct Buffer *);
  161.  
  162.    APTR              PreviewSpecific;  /* Preview-specific information */
  163.  
  164.    ULONG             reserved[15];
  165.  
  166. };
  167.  
  168.  
  169. /*
  170.  * Flags for CreatePreview() function:
  171.  */
  172. #define PIF_NORENDER    (0x0001)       /* Don't render in CreatePreview */
  173. #define PIF_NOPALETTE   (0x0002)       /* Don't render a palette */
  174.  
  175.  
  176. #ifdef SCANPRIVATE
  177.  
  178. /*
  179.  * Tags passed to CreatePreviewTags():  (NOT IMPLEMENTED, SPECULATIVE)
  180.  */
  181. enum {
  182.  
  183.    CRP_Width = 1,                      /* Thumbnail width */
  184.    CRP_Height,                         /* Thumbnail height */
  185.    CRP_SourceBuffer,                   /* Source Buffer struct */
  186.  
  187. };
  188.  
  189. #endif
  190.  
  191. #define SCAN_PREVINFO_H
  192. #endif
  193.