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