home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / misc / imagefx_sdk / sas / examples / xstyle / fadein.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-15  |  5.2 KB  |  247 lines

  1. /*
  2.  * FadeOut drawing style.
  3.  *
  4.  */
  5.  
  6. #include <exec/types.h>
  7. #include <scan/modall.h>
  8. #include <scan/drawinfo.h>
  9. #include "common.h"
  10.  
  11. /**********************************************************************\
  12.  
  13.                                 Library Vectors
  14.  
  15. \**********************************************************************/
  16.  
  17. /*
  18.  * XDM_Attr:
  19.  *
  20.  * Return to ImageFX some information about the Drawing Style (eg.
  21.  * whether Options are needed, whether we work on greyscale or
  22.  * color, etc.).  Called when ImageFX first scans the drawing
  23.  * style directory.
  24.  *
  25.  */
  26. ULONG __saveds __asm XDS_Attr (register __a0 struct XDrawAttr *attr)
  27. {
  28.    attr->Flags = XDMF_ChangeMask;
  29.    attr->Priority = 120;
  30.    return(0);
  31. }
  32.  
  33. /*
  34.  * XDS_Begin:
  35.  *
  36.  * Prepare before a pixel affecting operation.
  37.  *
  38.  */
  39. int __saveds __asm XDS_Begin (register __a0 struct IDrawInfo *di)
  40. {
  41.    return(1);
  42. }
  43.  
  44. /*
  45.  * XDS_End:
  46.  *
  47.  * Cleanup after a pixel affecting operation.
  48.  *
  49.  */
  50. void __saveds __asm XDS_End (register __a0 struct IDrawInfo *di)
  51. {
  52. }
  53.  
  54. /*
  55.  * XDS_Get:
  56.  *
  57.  *
  58.  */
  59. int __saveds __asm XDS_Get (register __a0 struct IDrawInfo *di)
  60. {
  61.    struct Buffer *buf = ScanBase->MainBuffer;
  62.  
  63.    GetFromBuf(buf, di);
  64.  
  65.    return(1);
  66. }
  67.  
  68. /*
  69.  * XDS_Put:
  70.  *
  71.  *
  72.  */
  73. int __saveds __asm XDS_Put (register __a0 struct IDrawInfo *di)
  74. {
  75.    struct Buffer *buf = ScanBase->MainBuffer;
  76.    UBYTE *mask;
  77.    int i, j;
  78.  
  79.    if (di->NodeMax > 1)
  80.    {
  81.       for (j = 0; j < di->Height; j++)
  82.       {
  83.          GetBufLine(di->BMask, &mask, NULL, NULL, j);
  84.          for (i = 0; i < di->Width; i++, mask++)
  85.          {
  86.             *mask = (*mask) * di->NodeCur / (di->NodeMax-1);
  87.          }
  88.       }
  89.    }
  90.  
  91.    PutToBuf(buf, di);
  92.  
  93.    return(1);
  94. }
  95.  
  96. /*
  97.  * XDS_Options:
  98.  *
  99.  * Present a window to the user allowing him to adjust drawing style
  100.  * options.  Arguments may optionally be passed from an Arexx command.
  101.  *
  102.  */
  103. int __saveds __asm XDS_Options (register __a0 LONG *args)
  104. {
  105.    return(0);
  106. }
  107.  
  108. /*
  109.  * XDS_LoadPrefs:
  110.  *
  111.  * Set preferences according to information loaded from disk.
  112.  *
  113.  */
  114. int __saveds __asm XDS_LoadPrefs (register __a0 void *prefs)
  115. {
  116.    return(1);
  117. }
  118.  
  119. /*
  120.  * XDS_SavePrefs:
  121.  *
  122.  * Request preferences settings that are about to be saved to disk.
  123.  *
  124.  */
  125. int __saveds __asm XDS_SavePrefs (register __a0 void *prefs)
  126. {
  127.    return(1);
  128. }
  129.  
  130. /*
  131.  * XDS_HandleMButton:
  132.  *
  133.  * Handle a mousebutton event from the main window.
  134.  *
  135.  */
  136. int __saveds __asm XDS_HandleMButton (register __a0 struct IntuiMessage *msg)
  137. {
  138.    return(0);
  139. }
  140.  
  141. /*
  142.  * XDS_HandleMMove:
  143.  *
  144.  * Handle a mousemove event from the main window.
  145.  *
  146.  */
  147. int __saveds __asm XDS_HandleMMove (register __a0 struct IntuiMessage *msg)
  148. {
  149.    return(0);
  150. }
  151.  
  152. int __saveds __asm XDS_Init (void)
  153. {
  154.    return(1);
  155. }
  156.  
  157. void __saveds __asm XDS_Cleanup (void)
  158. {
  159. }
  160.  
  161. void __saveds __asm XDS_Redraw (register __d0 int left,
  162.                                 register __d1 int top,
  163.                                 register __d2 int right,
  164.                                 register __d3 int bottom)
  165. {
  166. }
  167.  
  168. BOOL __saveds __asm XDS_SaveUndo (register __a0 struct Buffer *buf,
  169.                                   register __d0 int left,
  170.                                   register __d1 int top,
  171.                                   register __d2 int w,
  172.                                   register __d3 int h)
  173. {
  174.    return(FALSE);
  175. }
  176.  
  177.  
  178. /**********************************************************************\
  179.  
  180.                          Library Initialization Stuff
  181.  
  182. \**********************************************************************/
  183.  
  184. /*
  185.  * This is the table of all the functions that can be called in this
  186.  * module.  The first four (Open, Close, Expunge, and Null) are reserved
  187.  * for system use and MUST be specified in the order shown.  The actual
  188.  * functions are in the standard module startup code.
  189.  */
  190. ULONG FuncTable[] = {
  191.    /* These four MUST be present in this order */
  192.    (ULONG) LibOpen,
  193.    (ULONG) LibClose,
  194.    (ULONG) LibExpunge,
  195.    (ULONG) LibNull,
  196.  
  197.    /* Specific to the module */
  198.    (ULONG) XDS_Attr,
  199.    (ULONG) XDS_Begin,
  200.    (ULONG) XDS_End,
  201.    (ULONG) XDS_Get,
  202.    (ULONG) XDS_Put,
  203.    (ULONG) XDS_Options,
  204.    (ULONG) XDS_LoadPrefs,
  205.    (ULONG) XDS_SavePrefs,
  206.    (ULONG) XDS_HandleMButton,
  207.    (ULONG) XDS_HandleMMove,
  208.    (ULONG) XDS_Init,
  209.    (ULONG) XDS_Cleanup,
  210.    (ULONG) XDS_Redraw,
  211.    (ULONG) XDS_SaveUndo,
  212.  
  213.    /* End with -1L */
  214.    (ULONG) -1L
  215. };
  216.  
  217. /*
  218.  * These are used by the standard module startup code.
  219.  * LibraryName is the name of the library, and LibraryID is a short
  220.  * description of the library.  Both of these are largely irrelavent,
  221.  * but they are included just for completeness.
  222.  */
  223. UBYTE LibraryID[]    = "$VER: FadeIn Extended Drawing Style 2.0.7 (15.2.95)";
  224. UBYTE LibraryType    = NT_XDRAWSTYLE;
  225.  
  226. /*
  227.  * This is called by the standard module startup code when Image Scan
  228.  * first opens the module.  Here we should fill in the NumGads,
  229.  * NewGad, Language, and LangCount fields of the provided ModuleBase
  230.  * structure if necessary.
  231.  */
  232. long  __asm UserOpen (register __a6 struct ModuleBase *modbase)
  233. {
  234.    return(TRUE);
  235. }
  236.  
  237. /*
  238.  * This is called by the standard module startup code when Image Scan
  239.  * closes the module.  It should cleanup anything allocated or obtained
  240.  * in the UserOpen() function.
  241.  */
  242. long  __asm UserClose (register __a6 struct ModuleBase *modbase)
  243. {
  244.    return(TRUE);
  245. }
  246.  
  247.