home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 1 / FFMCD01.bin / bbs / libdisks / d700t799 / disk793.lha / Snap / src.lha / src / openclose.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-15  |  14.9 KB  |  580 lines

  1. /* Auto: make "CCEXTRA=-wq -qf"
  2. */
  3.  
  4. IMPORT BOOL Kick36;
  5.  
  6. IMPORT LONGBITS startsignal, insertsignal, cancelsignal;
  7. IMPORT LONGBITS donesignal, movesignal, clicksignal;
  8. IMPORT LONGBITS timersignal, initsignal, cwsignal, ticksignal;
  9. IMPORT ULONG startsignum, insertsignum, cancelsignum;
  10. IMPORT ULONG donesignum, movesignum, clicksignum;
  11. IMPORT ULONG initsignum, cwsignum, ticksignum;
  12.  
  13. /* program */
  14. IMPORT struct SnapRsrc *SnapRsrc;
  15. IMPORT struct Task *MyTask;
  16.  
  17. /* Snap state machine */
  18. IMPORT WORD action;
  19. IMPORT WORD state;
  20.  
  21. /* clipboard */
  22. IMPORT struct IOClipReq *ClipReq;
  23. IMPORT struct MsgPort *ClipPort;
  24.  
  25. /* timer device */
  26. IMPORT struct MsgPort *TimerPort;
  27. IMPORT struct timerequest MyTR;
  28.  
  29. /* input device */
  30. IMPORT struct MsgPort *inputDevPort;
  31. IMPORT struct Interrupt handlerStuff;
  32. IMPORT struct IOStdReq *inputRequestBlock;
  33.  
  34. IMPORT UBYTE *CharData;
  35.  
  36. /* console */
  37. IMPORT struct MsgPort *ConPort;
  38. IMPORT struct IOStdReq *ConIOR;
  39. IMPORT struct KeyMap keymap;
  40.  
  41. /* windows */
  42. #ifdef SNAPGFX
  43. IMPORT struct MsgPort *Sharedport;
  44. IMPORT SHORT Sharedrefs;
  45. #endif SNAPGFX
  46.  
  47. /* libraries */
  48. IMPORT struct IntuitionBase *IntuitionBase;
  49. IMPORT struct GfxBase       *GfxBase;
  50. IMPORT struct LayersBase    *LayersBase;
  51. IMPORT struct DiskFontBase  *DiskfontBase;
  52. IMPORT struct Library       *IconBase;
  53. #ifdef SNAPGFX
  54. #ifdef REQLIB
  55. IMPORT struct ReqBase       *ReqBase;
  56. #endif REQLIB
  57. #ifdef ASLLIB
  58. IMPORT struct Library *AslBase;
  59. #endif ASLLIB
  60. #endif SNAPGFX
  61.  
  62. /* graphics */
  63. IMPORT struct RastPort TempRp;
  64. IMPORT struct BitMap TempBM;
  65. IMPORT UBYTE *TempRaster;
  66.  
  67. #ifdef SNAPGFX
  68. #ifdef REQLIB
  69. IMPORT struct ReqFileRequester *NameFR;
  70. #endif REQLIB
  71. #ifdef ASLLIB
  72. #define SetTag(t,i,v) { (t).ti_Tag = i; (t).ti_Data = (ULONG)(v); }
  73. IMPORT struct FileRequester *AslNameFR;
  74. #endif ASLLIB
  75.  
  76. IMPORT struct Image ActiveDiskImage;
  77. IMPORT struct Image InactiveDiskImage;
  78. IMPORT struct Image SelDiskImage;
  79. IMPORT struct Image ActiveClipImage;
  80. IMPORT struct Image InactiveClipImage;
  81. IMPORT struct Image SelClipImage;
  82. IMPORT struct Gadget DiskGad;
  83. IMPORT struct Gadget ClipGad;
  84.  
  85. UWORD DiskImData36[144] = {
  86.     /* Inactive */
  87.     0x0000, 0x0000,
  88.     0x0000, 0x4000,
  89.     0x07f8, 0x4000,
  90.     0x0408, 0x4000,
  91.     0x05E8, 0x4000,
  92.     0x0408, 0x4000,
  93.     0x07F8, 0x4000,
  94.     0x0618, 0x4000,
  95.     0x0698, 0x4000,
  96.     0x0698, 0x4000,
  97.     0x0000, 0x4000,
  98.     0x7FFF, 0xC000,
  99.  
  100.     0xFFFF, 0xC000,
  101.     0x8000, 0x0000,
  102.     0x8000, 0x0000,
  103.     0x8000, 0x0000,
  104.     0x8000, 0x0000,
  105.     0x8000, 0x0000,
  106.     0x8000, 0x0000,
  107.     0x8000, 0x0000,
  108.     0x8000, 0x0000,
  109.     0x8000, 0x0000,
  110.     0x8000, 0x0000,
  111.     0x8000, 0x0000,
  112.  
  113.     /* Active */
  114.     0x0000, 0x0000,
  115.     0x7FFF, 0xC000,
  116.     0x7FFF, 0xC000,
  117.     0x7C0F, 0xC000,
  118.     0x7DEF, 0xC000,
  119.     0x7C0F, 0xC000,
  120.     0x7FFF, 0xC000,
  121.     0x7E1F, 0xC000,
  122.     0x7E9F, 0xC000,
  123.     0x7E9F, 0xC000,
  124.     0x7FFF, 0xC000,
  125.     0x7FFF, 0xC000,
  126.  
  127.     0xFFFF, 0xC000,
  128.     0xFFFF, 0x8000,
  129.     0xF807, 0x8000,
  130.     0xFBF7, 0x8000,
  131.     0xFA17, 0x8000,
  132.     0xFBF7, 0x8000,
  133.     0xF807, 0x8000,
  134.     0xF9E7, 0x8000,
  135.     0xF967, 0x8000,
  136.     0xF967, 0x8000,
  137.     0xFFFF, 0x8000,
  138.     0x8000, 0x0000,
  139.  
  140.     /* Selected */
  141.     0xFFFF, 0xC000,
  142.     0xFFFF, 0x8000,
  143.     0xFFFF, 0x8000,
  144.     0xFC0F, 0x8000,
  145.     0xFDEF, 0x8000,
  146.     0xFC0F, 0x8000,
  147.     0xFFFF, 0x8000,
  148.     0xFE1F, 0x8000,
  149.     0xFE9F, 0x8000,
  150.     0xFE9F, 0x8000,
  151.     0xFFFF, 0x8000,
  152.     0x8000, 0x0000,
  153.  
  154.     0x0000, 0x0000,
  155.     0x7FFF, 0xC000,
  156.     0x7807, 0xC000,
  157.     0x7BF7, 0xC000,
  158.     0x7A17, 0xC000,
  159.     0x7BF7, 0xC000,
  160.     0x7807, 0xC000,
  161.     0x79E7, 0xC000,
  162.     0x7967, 0xC000,
  163.     0x7967, 0xC000,
  164.     0x7FFF, 0xC000,
  165.     0x7FFF, 0xC000
  166. };
  167.  
  168. UWORD DiskImData[13] = {
  169.     /* BitPlane 0 */
  170.     0xFFFF,
  171.     0xFFFF,
  172.     0xFFFF,
  173.     0xF00F,
  174.     0xF7EF,
  175.     0xF42F,
  176.     0xF7EF,
  177.     0xF00F,
  178.     0xF3CF,
  179.     0xF2CF,
  180.     0xF2CF,
  181.     0xFFFF,
  182.     0xFFFF
  183. };
  184.  
  185. UWORD ClipImData36[156] = {
  186.     /* Inactive */
  187.     0x0000, 0x0000,
  188.     0x0000, 0x4000,
  189.     0x0C00, 0x4000,
  190.     0x120E, 0x4000,
  191.     0x1A38, 0x4000,
  192.     0x0EE0, 0x4000,
  193.     0x0380, 0x4000,
  194.     0x0EE0, 0x4000,
  195.     0x1A38, 0x4000,
  196.     0x120E, 0x4000,
  197.     0x0C00, 0x4000,
  198.     0x0000, 0x4000,
  199.     0x7FFF, 0xC000,
  200.  
  201.     0xFFFF, 0xC000,
  202.     0x8000, 0x0000,
  203.     0x8000, 0x0000,
  204.     0x8000, 0x0000,
  205.     0x8000, 0x0000,
  206.     0x8000, 0x0000,
  207.     0x8000, 0x0000,
  208.     0x8000, 0x0000,
  209.     0x8000, 0x0000,
  210.     0x8000, 0x0000,
  211.     0x8000, 0x0000,
  212.     0x8000, 0x0000,
  213.     0x8000, 0x0000,
  214.  
  215.     /* Active */
  216.     0x0000, 0x0000,
  217.     0x7FFF, 0xC000,
  218.     0x7FFF, 0xC000,
  219.     0x7FFF, 0xC000,
  220.     0x7FFF, 0xC000,
  221.     0x7FFF, 0xC000,
  222.     0x7FFF, 0xC000,
  223.     0x7FFF, 0xC000,
  224.     0x7FFF, 0xC000,
  225.     0x7FFF, 0xC000,
  226.     0x7FFF, 0xC000,
  227.     0x7FFF, 0xC000,
  228.     0x7FFF, 0xC000,
  229.  
  230.     0xFFFF, 0xC000,
  231.     0xFFFF, 0x8000,
  232.     0xF3FF, 0x8000,
  233.     0xEDF1, 0x8000,
  234.     0xE5C7, 0x8000,
  235.     0xF11F, 0x8000,
  236.     0xFC7F, 0x8000,
  237.     0xF11F, 0x8000,
  238.     0xE5C7, 0x8000,
  239.     0xEDF1, 0x8000,
  240.     0xF3FF, 0x8000,
  241.     0xFFFF, 0x8000,
  242.     0x8000, 0x0000,
  243.  
  244.     /* Selected */
  245.     0xFFFF, 0xC000,
  246.     0xFFFF, 0x8000,
  247.     0xFFFF, 0x8000,
  248.     0xFFFF, 0x8000,
  249.     0xFFFF, 0x8000,
  250.     0xFFFF, 0x8000,
  251.     0xFFFF, 0x8000,
  252.     0xFFFF, 0x8000,
  253.     0xFFFF, 0x8000,
  254.     0xFFFF, 0x8000,
  255.     0xFFFF, 0x8000,
  256.     0xFFFF, 0x8000,
  257.     0x8000, 0x0000,
  258.  
  259.     0x0000, 0x0000,
  260.     0x7FFF, 0xC000,
  261.     0x73FF, 0xC000,
  262.     0x6DF1, 0xC000,
  263.     0x65C7, 0xC000,
  264.     0x711F, 0xC000,
  265.     0x7C7F, 0xC000,
  266.     0x711F, 0xC000,
  267.     0x65C7, 0xC000,
  268.     0x6DF1, 0xC000,
  269.     0x73FF, 0xC000,
  270.     0x7FFF, 0xC000,
  271.     0x7FFF, 0xC000
  272. };
  273.  
  274. UWORD ClipImData[14] = {
  275.     /* BitPlane 0 */
  276.     0xFFFF,
  277.     0xFFFF,
  278.     0xE7FF,
  279.     0xDBE3,
  280.     0xCB8F,
  281.     0xE23F,
  282.     0xF8FF,
  283.     0xE23F,
  284.     0xCB8F,
  285.     0xDBE3,
  286.     0xE7FF,
  287.     0xFFFF,
  288.     0xFFFF,
  289.     0xFFFF
  290. };
  291. #endif SNAPGFX
  292.  
  293. VOID CloseStuff()
  294. {
  295.     SafeRestore();
  296.     if (SnapRsrc) {
  297.         KILLLIST(&SnapRsrc->CachedWindows, struct CacheWindow);
  298.         if (SnapRsrc->AlternateFont) {
  299.             CloseFont(SnapRsrc->AlternateFont);
  300.         }
  301.     }
  302. #ifdef SNAPGFX
  303.     if (InactiveDiskImage.ImageData) {
  304.         FreeMem(InactiveDiskImage.ImageData,
  305.                 Kick36 ? sizeof(DiskImData36) : sizeof(DiskImData));
  306.     }
  307.     if (InactiveClipImage.ImageData) {
  308.         FreeMem(InactiveClipImage.ImageData,
  309.                 Kick36 ? sizeof(ClipImData36) : sizeof(ClipImData));
  310.     }
  311. #endif SNAPGFX
  312.     if (TempRaster)             FreeRaster(TempRaster, 16L, CHEIGHT);
  313.     if (CharData)               FreeRaster(CharData, 16L, 256L * CHEIGHT);
  314.     if (inputRequestBlock) {
  315.         if (inputRequestBlock->io_Device) {
  316.             inputRequestBlock->io_Command = IND_REMHANDLER;  /* Remove handler */
  317.             inputRequestBlock->io_Data    = (APTR)&handlerStuff;
  318.             DoIO((struct IORequest *)inputRequestBlock);
  319.             CloseDevice((struct IORequest *)inputRequestBlock);
  320.         }
  321.         DeleteExtIO((struct IORequest *)inputRequestBlock);
  322.     }
  323.     if (inputDevPort)           DeletePort(inputDevPort);
  324.     if (TimerPort) {
  325.         DeletePort(TimerPort);
  326.         CloseDevice((struct IORequest *)&MyTR);
  327.     }
  328.     if (ConIOR) {
  329.         CloseDevice((struct IORequest *)ConIOR);
  330.         DeleteExtIO((struct IORequest *)ConIOR);
  331.     }
  332.     if (ConPort)                DeletePort(ConPort);
  333.     if (ClipReq) {
  334.         if (ClipReq->io_Device) {
  335.             CloseDevice((struct IORequest *)ClipReq);
  336.         }
  337.         DeleteExtIO((struct IORequest *)ClipReq);
  338.     }
  339.     if (ClipPort)               DeletePort(ClipPort);
  340.     if (startsignum != -1)      FreeSignal(startsignum);
  341.     if (donesignum != -1)       FreeSignal(donesignum);
  342.     if (cancelsignum != -1)     FreeSignal(cancelsignum);
  343.     if (movesignum != -1)       FreeSignal(movesignum);
  344.     if (insertsignum != -1)     FreeSignal(insertsignum);
  345.     if (clicksignum != -1)      FreeSignal(clicksignum);
  346.     if (initsignum != -1)       FreeSignal(initsignum);
  347.     if (cwsignum != -1)         FreeSignal(cwsignum);
  348.     if (ticksignum != -1)       FreeSignal(ticksignum);
  349.     if (SnapRsrc) {
  350.         RemResource((struct MiscResource *)SnapRsrc);
  351.         Kill(SnapRsrc);
  352.     }
  353. #ifdef SNAPGFX
  354. #ifdef ASLLIB
  355.     if (AslBase && AslNameFR)   FreeFileRequest(AslNameFR);
  356. #endif ASLLIB
  357. #ifdef REQLIB
  358.     if (ReqBase && NameFR)      Delete(NameFR);
  359. #endif REQLIB
  360. #endif SNAPGFX
  361. }
  362.  
  363. VOID CloseLibs()
  364. {
  365. #ifdef SNAPGFX
  366. #ifdef ASLLIB
  367.     if (AslBase)            CloseLibrary(AslBase);
  368. #endif ASLLIB
  369. #ifdef REQLIB
  370.     if (ReqBase)            CloseLibrary((struct Library *)ReqBase);
  371. #endif REQLIB
  372. #endif SNAPGFX
  373.     if (IconBase)           CloseLibrary(IconBase);
  374.     if (DiskfontBase)       CloseLibrary((struct Library *)DiskfontBase);
  375.     if (IntuitionBase)      CloseLibrary((struct Library *)IntuitionBase);
  376.     if (GfxBase)            CloseLibrary((struct Library *)GfxBase);
  377.     if (LayersBase)         CloseLibrary((struct Library *)LayersBase);
  378. }
  379.  
  380. WORD OpenLibs()
  381. {
  382.     /* libraries */
  383.  
  384.     if (!(GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 0L)))
  385.         return 0;
  386.     if (!(IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 0L)))
  387.         return 0;
  388.     if (!(LayersBase = (struct LayersBase *)OpenLibrary("layers.library", 0L)))
  389.         return 0;
  390.     DiskfontBase = (struct DiskFontBase *)OpenLibrary("diskfont.library", 0L);
  391.     IconBase = OpenLibrary(ICONNAME, 0L);
  392. #ifdef SNAPGFX
  393. #ifdef REQLIB
  394.     ReqBase = (struct ReqBase *)OpenLibrary("req.library", 0L);
  395. #endif REQLIB
  396. #ifdef ASLLIB
  397.     AslBase = OpenLibrary(AslName, 0L);
  398. #endif ASLLIB
  399. #endif
  400.     return 1;
  401. }
  402.  
  403. WORD OpenStuff()
  404. {
  405.     action = noaction;
  406.     state  = waiting;
  407.     inputRequestBlock = NULL;
  408.  
  409. #ifdef SNAPGFX
  410.     Sharedrefs = 0;
  411.     Sharedport = NULL;
  412. #endif SNAPGFX
  413.  
  414.     /* Set up everything we need. */
  415.  
  416. #ifdef SNAPGFX
  417. #ifdef REQLIB
  418.     if (ReqBase) {
  419.         NameFR = Create(ReqFileRequester);
  420.     }
  421. #endif REQLIB
  422. #ifdef ASLLIB
  423.     if (AslBase) {
  424.         struct TagItem FRTags[4];
  425.  
  426.         SetTag(FRTags[0], ASL_Hail, "Save Picture As...");
  427.         SetTag(FRTags[1], ASL_Dir,  "t:");
  428.         SetTag(FRTags[2], ASL_File, "Snap.pic");
  429.         SetTag(FRTags[3], TAG_END,  NULL);
  430.         AslNameFR = AllocAslRequest(ASL_FileRequest, FRTags);
  431.     }
  432. #endif ASLLIB
  433. #endif SNAPGFX
  434.  
  435.     /* signals */
  436.  
  437.     if ((startsignum = AllocSignal(-1L)) == -1L)
  438.         return 0;
  439.     if ((insertsignum = AllocSignal(-1L)) == -1L)
  440.         return 0;
  441.     if ((cancelsignum = AllocSignal(-1L)) == -1L)
  442.         return 0;
  443.     if ((donesignum = AllocSignal(-1L)) == -1L)
  444.         return 0;
  445.     if ((movesignum = AllocSignal(-1L)) == -1L)
  446.         return 0;
  447.     if ((clicksignum = AllocSignal(-1L)) == -1L)
  448.         return 0;
  449.     if ((initsignum = AllocSignal(-1L)) == -1L)
  450.         return 0;
  451.     if ((cwsignum = AllocSignal(-1L)) == -1L)
  452.         return 0;
  453.     if ((ticksignum = AllocSignal(-1L)) == -1L)
  454.         return 0;
  455.     MyTask = FindTask(NULL);                  /* Find myself to Signal me.  */
  456.     startsignal  = 1L << startsignum;         /* No good to use bit numbers */
  457.     insertsignal = 1L << insertsignum;
  458.     cancelsignal = 1L << cancelsignum;
  459.     donesignal   = 1L << donesignum;
  460.     movesignal   = 1L << movesignum;
  461.     clicksignal  = 1L << clicksignum;
  462.     initsignal   = 1L << initsignum;
  463.     cwsignal     = 1L << cwsignum;
  464.     ticksignal   = 1L << ticksignum;
  465.  
  466.     /* clipboard device */
  467.  
  468.     if (!(ClipPort = CreatePort(0L, 0L)))
  469.         return 0;
  470.     if (!(ClipReq = (struct IOClipReq *)CreateExtIO(ClipPort, (LONG)sizeof(*ClipReq))))
  471.         return 0;
  472.     if (OpenDevice("clipboard.device", 0L, (struct IORequest *)ClipReq, 0L))
  473.         return 0;
  474.     ClipReq->io_ClipID = 0L;
  475.  
  476.     /* console device */
  477.  
  478.     if (!(ConPort = CreatePort(0L, 0L)))
  479.         return 0;
  480.     if (!(ConIOR = (struct IOStdReq *)CreateExtIO(ConPort, (LONG)sizeof(struct IOStdReq))))
  481.         return 0;
  482.     if (OpenDevice("console.device", -1L, (struct IORequest *)ConIOR, 0L))
  483.         return 0;
  484.  
  485.     /* timer device */
  486.     if (!(TimerPort = CreatePort(NULL, 0L)))
  487.         return 0;
  488.     timersignal = 1L << TimerPort->mp_SigBit;
  489.     if (OpenDevice(TIMERNAME, UNIT_VBLANK, (struct IORequest *)&MyTR, 0))
  490.         return 0;
  491.     MyTR.tr_node.io_Message.mn_ReplyPort = TimerPort;
  492.     MyTR.tr_node.io_Error = 0;
  493.  
  494.     /* input device */
  495.  
  496.     if (!(inputDevPort = CreatePort(0L, 0L)))
  497.         return 0;
  498.     if (!(inputRequestBlock = (struct IOStdReq *)CreateExtIO(inputDevPort, (LONG)sizeof(struct IOStdReq))))
  499.         return 0;
  500.     if (OpenDevice("input.device", 0L, (struct IORequest *)inputRequestBlock, 0L))
  501.         return 0;
  502.  
  503.     /* input handler */
  504.  
  505.     handlerStuff.is_Data = (APTR)0x534E4150; /* Set up for installation of */
  506.     handlerStuff.is_Code = myhandler;        /* myhandler.                 */
  507.     handlerStuff.is_Node.ln_Pri = SnapRsrc->Priority;
  508.                                              /* Ahead of intuition, please */
  509.     handlerStuff.is_Node.ln_Name = "Snap Input Handler";
  510.  
  511.     inputRequestBlock->io_Command = IND_ADDHANDLER;
  512.     inputRequestBlock->io_Data    = (APTR)&handlerStuff;
  513.  
  514.     DoIO((struct IORequest *)inputRequestBlock);  /* Add me. */
  515.  
  516.  
  517.     /* Aligned font bitmap to use when matching */
  518.  
  519.     if (!(CharData = AllocRaster(16L, 256L * CHEIGHT))) {
  520.         return 0;
  521.     }
  522.  
  523.     /* temporary raster */
  524.  
  525.     if (!(TempRaster = AllocRaster(16L, CHEIGHT)))
  526.         return 0;
  527.     InitRastPort(&TempRp);                   /* Init RastPort used for */
  528.     InitBitMap(&TempBM, 1L, 16L, CHEIGHT);   /* Locating position of   */
  529.     TempBM.Planes[0] = TempRaster;           /* first character.       */
  530.     TempRp.BitMap = &TempBM;
  531.  
  532. #ifdef SNAPGFX
  533.     {
  534.         WORD i;
  535.         UWORD *DiskImageData;
  536.         UWORD *ClipImageData;
  537.         LONG DiskImageSize;
  538.         LONG ClipImageSize;
  539.  
  540.         if (Kick36) {
  541.             ActiveDiskImage = SelDiskImage = InactiveDiskImage;
  542.             ActiveClipImage = SelClipImage = InactiveClipImage;
  543.             DiskImageData = DiskImData36;
  544.             ClipImageData = ClipImData36;
  545.             DiskImageSize = sizeof(DiskImData36);
  546.             ClipImageSize = sizeof(ClipImData36);
  547.             DiskGad.Flags |= GADGHIMAGE;
  548.             ClipGad.Flags |= GADGHIMAGE;
  549.         } else {
  550.             InactiveDiskImage = SelDiskImage = ActiveDiskImage;
  551.             InactiveClipImage = SelClipImage = ActiveClipImage;
  552.             DiskImageData = DiskImData;
  553.             ClipImageData = ClipImData;
  554.             DiskImageSize = sizeof(DiskImData);
  555.             ClipImageSize = sizeof(ClipImData);
  556.             DiskGad.Flags |= GADGHCOMP;
  557.             ClipGad.Flags |= GADGHCOMP;
  558.         }
  559.         if (!(InactiveDiskImage.ImageData = AllocMem(DiskImageSize, MEMF_CHIP))) {
  560.             return 0;
  561.         }
  562.         ActiveDiskImage.ImageData = &InactiveDiskImage.ImageData[Kick36 ? 48 : 0];
  563.         SelDiskImage.ImageData    = &InactiveDiskImage.ImageData[Kick36 ? 96 : 0];
  564.         for (i = 0; i < (DiskImageSize / sizeof(UWORD)); i++) {
  565.             InactiveDiskImage.ImageData[i] = DiskImageData[i];
  566.         }
  567.         if (!(InactiveClipImage.ImageData = AllocMem(ClipImageSize, MEMF_CHIP))) {
  568.             return 0;
  569.         }
  570.         ActiveClipImage.ImageData = &InactiveClipImage.ImageData[Kick36 ? 52 : 0];
  571.         SelClipImage.ImageData    = &InactiveClipImage.ImageData[Kick36 ? 104 : 0];
  572.         for (i = 0; i < (ClipImageSize / sizeof(UWORD)); i++) {
  573.             InactiveClipImage.ImageData[i] = ClipImageData[i];
  574.         }
  575.     }
  576. #endif SNAPGFX
  577.  
  578.     return 1;
  579. }
  580.