home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / misc / imagefx_sdk / sas / examples / xdraw / skeleton.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-02  |  4.0 KB  |  189 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.  
  10. /**********************************************************************\
  11.  
  12.                                 Library Vectors
  13.  
  14. \**********************************************************************/
  15.  
  16. /*
  17.  * XDM_Attr:
  18.  *
  19.  * Return to ImageFX some information about the Drawing Mode (eg.
  20.  * whether Options are needed, whether we work on greyscale or
  21.  * color, etc.).  Called when ImageFX first scans the drawing
  22.  * mode directory.
  23.  *
  24.  */
  25. ULONG __saveds __asm XDM_Attr (register __a0 struct XDrawAttr *da)
  26. {
  27.    da->Flags      = 0;
  28.    da->Priority   = 0;
  29.    return(0);
  30. }
  31.  
  32. /*
  33.  * XDM_Init:
  34.  *
  35.  * Initialize the drawing mode.
  36.  *
  37.  */
  38. int __saveds __asm XDM_Init (void)
  39. {
  40.    return(1);
  41. }
  42.  
  43. /*
  44.  * XDM_Cleanup:
  45.  *
  46.  * Cleanup the drawing mode.
  47.  *
  48.  */
  49. void __saveds __asm XDM_Cleanup (void)
  50. {
  51. }
  52.  
  53. /*
  54.  * XDM_Begin:
  55.  *
  56.  * Prepare before a pixel affecting operation.
  57.  *
  58.  */
  59. int __saveds __asm XDM_Begin (register __a0 struct IDrawInfo *di)
  60. {
  61.    return(1);
  62. }
  63.  
  64. /*
  65.  * XDM_End:
  66.  *
  67.  * Cleanup after a pixel affecting operation.
  68.  *
  69.  */
  70. void __saveds __asm XDM_End (register __a0 struct IDrawInfo *di)
  71. {
  72. }
  73.  
  74. /*
  75.  * XDM_Affect:
  76.  *
  77.  * Affect a block of pixels.  We may also affect some of the
  78.  * parameters of the IDrawInfo structure, such as the X & Y
  79.  * location of the block of pixels.
  80.  *
  81.  */
  82. void __saveds __asm XDM_Affect (register __a0 struct IDrawInfo *di)
  83. {
  84. }
  85.  
  86. /*
  87.  * XDM_Options:
  88.  *
  89.  * Present a window to the user allowing him to adjust drawing mode
  90.  * options.  Arguments may optionally be passed from an Arexx command.
  91.  * This function will only be called if the flag XDMF_AreOptions is
  92.  * returned from XDM_Attr().
  93.  *
  94.  */
  95. int __saveds __asm XDM_Options (register __a0 LONG *args)
  96. {
  97.    return(0);
  98. }
  99.  
  100. /*
  101.  * XDM_LoadPrefs:
  102.  *
  103.  * Set preferences according to information loaded from disk.
  104.  *
  105.  */
  106. int __saveds __asm XDM_LoadPrefs (register __a0 void *prefs)
  107. {
  108.    return(1);
  109. }
  110.  
  111. /*
  112.  * XDM_SavePrefs:
  113.  *
  114.  * Request preferences settings that are about to be saved to disk.
  115.  *
  116.  */
  117. int __saveds __asm XDM_SavePrefs (register __a0 void *prefs)
  118. {
  119.    return(1);
  120. }
  121.  
  122.  
  123. /**********************************************************************\
  124.  
  125.                          Library Initialization Stuff
  126.  
  127. \**********************************************************************/
  128.  
  129. /*
  130.  * This is the table of all the functions that can be called in this
  131.  * module.  The first four (Open, Close, Expunge, and Null) are reserved
  132.  * for system use and MUST be specified in the order shown.  The actual
  133.  * functions are in the standard module startup code.
  134.  */
  135. ULONG FuncTable[] = {
  136.    /* These four MUST be present in this order */
  137.    (ULONG) LibOpen,
  138.    (ULONG) LibClose,
  139.    (ULONG) LibExpunge,
  140.    (ULONG) LibNull,
  141.  
  142.    /* Specific to the module */
  143.    (ULONG) XDM_Attr,
  144.    (ULONG) XDM_Begin,
  145.    (ULONG) XDM_End,
  146.    (ULONG) XDM_Affect,
  147.    (ULONG) XDM_Options,
  148.    (ULONG) XDM_LoadPrefs,
  149.    (ULONG) XDM_SavePrefs,
  150.    (ULONG) 0,
  151.    (ULONG) 0,
  152.    (ULONG) XDM_Init,
  153.    (ULONG) XDM_Cleanup,
  154.  
  155.    /* End with -1L */
  156.    (ULONG) -1L
  157. };
  158.  
  159. /*
  160.  * These are used by the standard module startup code.
  161.  * LibraryName is the name of the library, and LibraryID is a short
  162.  * description of the library.  Both of these are largely irrelavent,
  163.  * but they are included just for completeness.
  164.  */
  165. UBYTE LibraryID[]    = "$VER: Skeleton Extended Drawing Mode 2.0.0 (13.2.94)";
  166. UBYTE LibraryType    = NT_XDRAWMODE;
  167.  
  168. /*
  169.  * This is called by the standard module startup code when Image Scan
  170.  * first opens the module.  Here we should fill in the NumGads,
  171.  * NewGad, Language, and LangCount fields of the provided ModuleBase
  172.  * structure if necessary.
  173.  */
  174. long  __asm UserOpen (register __a6 struct ModuleBase *modbase)
  175. {
  176.    return(TRUE);
  177. }
  178.  
  179. /*
  180.  * This is called by the standard module startup code when Image Scan
  181.  * closes the module.  It should cleanup anything allocated or obtained
  182.  * in the UserOpen() function.
  183.  */
  184. long  __asm UserClose (register __a6 struct ModuleBase *modbase)
  185. {
  186.    return(TRUE);
  187. }
  188.  
  189.