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

  1. /*
  2.  * A Skeleton Enhanced Drawing Mode for ImageFX 2.0
  3.  *
  4.  */
  5.  
  6. #include <exec/types.h>
  7. #include <scan/modall.h>
  8. #include <scan/drawinfo.h>
  9. #include <string.h>
  10. #include "common.h"
  11.  
  12. /**********************************************************************\
  13.  
  14.                                 Library Vectors
  15.  
  16. \**********************************************************************/
  17.  
  18. /*
  19.  * XDM_Attr:
  20.  *
  21.  * Return to ImageFX some information about the Drawing Style (eg.
  22.  * whether Options are needed, whether we work on greyscale or
  23.  * color, etc.).  Called when ImageFX first scans the drawing
  24.  * style directory.
  25.  *
  26.  */
  27. ULONG __saveds __asm XDS_Attr (register __a0 struct XDrawAttr *attr)
  28. {
  29.    attr->Flags = XDMF_UndoSwap;
  30.    attr->Priority = 124;
  31.    return(0);
  32. }
  33.  
  34. /*
  35.  * XDS_Begin:
  36.  *
  37.  * Prepare before a pixel affecting operation.
  38.  *
  39.  */
  40. int __saveds __asm XDS_Begin (register __a0 struct IDrawInfo *di)
  41. {
  42.    di->SPrivate = (APTR)ScanBase->SwapBuffer;
  43.    return(1);
  44. }
  45.  
  46. /*
  47.  * XDS_End:
  48.  *
  49.  * Cleanup after a pixel affecting operation.
  50.  *
  51.  */
  52. void __saveds __asm XDS_End (register __a0 struct IDrawInfo *di)
  53. {
  54. }
  55.  
  56. /*
  57.  * XDS_Get:
  58.  *
  59.  *
  60.  */
  61. int __saveds __asm XDS_Get (register __a0 struct IDrawInfo *di)
  62. {
  63.    struct Buffer *buf = (struct Buffer *)di->SPrivate;
  64.  
  65.    GetFromBuf(buf, di);
  66.  
  67.    return(1);
  68. }
  69.  
  70. /*
  71.  * XDS_Put:
  72.  *
  73.  *
  74.  */
  75. int __saveds __asm XDS_Put (register __a0 struct IDrawInfo *di)
  76. {
  77.    struct Buffer *buf = (struct Buffer *)di->SPrivate;
  78.  
  79.    PutToBuf(buf, di);
  80.  
  81.    return(1);
  82. }
  83.  
  84. /*
  85.  * XDS_Options:
  86.  *
  87.  * Present a window to the user allowing him to adjust drawing style
  88.  * options.  Arguments may optionally be passed from an Arexx command.
  89.  *
  90.  */
  91. int __saveds __asm XDS_Options (register __a0 LONG *args)
  92. {
  93.    return(0);
  94. }
  95.  
  96. /*
  97.  * XDS_LoadPrefs:
  98.  *
  99.  * Set preferences according to information loaded from disk.
  100.  *
  101.  */
  102. int __saveds __asm XDS_LoadPrefs (register __a0 void *prefs)
  103. {
  104.    return(1);
  105. }
  106.  
  107. /*
  108.  * XDS_SavePrefs:
  109.  *
  110.  * Request preferences settings that are about to be saved to disk.
  111.  *
  112.  */
  113. int __saveds __asm XDS_SavePrefs (register __a0 void *prefs)
  114. {
  115.    return(1);
  116. }
  117.  
  118. int __saveds __asm XDS_Init (void)
  119. {
  120.    return(1);
  121. }
  122.  
  123. void __saveds __asm XDS_Cleanup (void)
  124. {
  125. }
  126.  
  127.  
  128. /**********************************************************************\
  129.  
  130.                          Library Initialization Stuff
  131.  
  132. \**********************************************************************/
  133.  
  134. /*
  135.  * This is the table of all the functions that can be called in this
  136.  * module.  The first four (Open, Close, Expunge, and Null) are reserved
  137.  * for system use and MUST be specified in the order shown.  The actual
  138.  * functions are in the standard module startup code.
  139.  */
  140. ULONG FuncTable[] = {
  141.    /* These four MUST be present in this order */
  142.    (ULONG) LibOpen,
  143.    (ULONG) LibClose,
  144.    (ULONG) LibExpunge,
  145.    (ULONG) LibNull,
  146.  
  147.    /* Specific to the module */
  148.    (ULONG) XDS_Attr,
  149.    (ULONG) XDS_Begin,
  150.    (ULONG) XDS_End,
  151.    (ULONG) XDS_Get,
  152.    (ULONG) XDS_Put,
  153.    (ULONG) XDS_Options,
  154.    (ULONG) XDS_LoadPrefs,
  155.    (ULONG) XDS_SavePrefs,
  156.    (ULONG) 0,
  157.    (ULONG) 0,
  158.    (ULONG) XDS_Init,
  159.    (ULONG) XDS_Cleanup,
  160.  
  161.    /* End with -1L */
  162.    (ULONG) -1L
  163. };
  164.  
  165. /*
  166.  * These are used by the standard module startup code.
  167.  * LibraryName is the name of the library, and LibraryID is a short
  168.  * description of the library.  Both of these are largely irrelavent,
  169.  * but they are included just for completeness.
  170.  */
  171. UBYTE LibraryID[]    = "$VER: TraceThrough Drawing Style 2.0.9 (15.2.95)";
  172. UBYTE LibraryType    = NT_XDRAWSTYLE;
  173.  
  174. /*
  175.  * This is called by the standard module startup code when Image Scan
  176.  * first opens the module.  Here we should fill in the NumGads,
  177.  * NewGad, Language, and LangCount fields of the provided ModuleBase
  178.  * structure if necessary.
  179.  */
  180. long  __asm UserOpen (register __a6 struct ModuleBase *modbase)
  181. {
  182.    return(TRUE);
  183. }
  184.  
  185. /*
  186.  * This is called by the standard module startup code when Image Scan
  187.  * closes the module.  It should cleanup anything allocated or obtained
  188.  * in the UserOpen() function.
  189.  */
  190. long  __asm UserClose (register __a6 struct ModuleBase *modbase)
  191. {
  192.    return(TRUE);
  193. }
  194.  
  195.