home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 20 / AACD20.BIN / AACD / Programming / AmiSlate-Source / AmiSource-c / drawrexx_rxif.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-05  |  44.6 KB  |  1,999 lines

  1. /*
  2.  * Source generated with ARexxBox 1.12 (May 18 1993)
  3.  * which is Copyright (c) 1992,1993 Michael Balzer
  4.  */
  5.  
  6. #include <exec/types.h>
  7. #include <exec/memory.h>
  8. #include <dos/dos.h>
  9. #include <rexx/storage.h>
  10. #include <rexx/rxslib.h>
  11.  
  12. #ifdef __GNUC__
  13. /* GCC needs all struct defs */
  14. #include <dos/exall.h>
  15. #include <graphics/graphint.h>
  16. #include <intuition/classes.h>
  17. #include <devices/keymap.h>
  18. #include <exec/semaphores.h>
  19. #endif
  20.  
  21. #include <clib/alib_protos.h>
  22. #include <clib/exec_protos.h>
  23. #include <clib/dos_protos.h>
  24. #include <clib/rexxsyslib_protos.h>
  25.  
  26. #ifndef __NO_PRAGMAS
  27.  
  28. #ifdef AZTEC_C
  29. #include <pragmas/exec_lib.h>
  30. #include <pragmas/dos_lib.h>
  31. #include <pragmas/rexxsyslib_lib.h>
  32. #endif
  33.  
  34. #ifdef LATTICE
  35. #include <pragmas/exec_pragmas.h>
  36. #include <pragmas/dos_pragmas.h>
  37. #include <pragmas/rexxsyslib_pragmas.h>
  38. #endif
  39.  
  40. #endif /* __NO_PRAGMAS */
  41.  
  42. #include <stdlib.h>
  43. #include <stdio.h>
  44. #include <string.h>
  45. #include <ctype.h>
  46.  
  47. #ifdef LATTICE
  48. #undef toupper
  49. #define inline __inline
  50. #endif
  51.  
  52. #ifdef __GNUC__
  53. #undef toupper
  54. static inline char toupper( char c )
  55. {
  56.     return( islower(c) ? c - 'a' + 'A' : c );
  57. }
  58. #endif
  59.  
  60. #ifdef AZTEC_C
  61. #define inline
  62. #endif
  63.  
  64. #include "drawrexx.h"
  65. #include "drawrexx_aux.h"
  66. #include "drawrexx_rxif_aux.h"
  67.  
  68. extern struct ExecBase *SysBase;
  69. extern struct DosLibrary *DOSBase;
  70. extern struct RxsLib *RexxSysBase;
  71.  
  72.  
  73. /* $ARB: I 790338933 */
  74.  
  75.  
  76. /* $ARB: B 1 SETFCOLOR */
  77. void rx_setfcolor( struct RexxHost *host, struct rxd_setfcolor **rxd, long action, struct RexxMsg *rexxmsg )
  78. {
  79.     struct rxd_setfcolor *rd = *rxd;
  80.  
  81.     switch( action )
  82.     {
  83.         case RXIF_INIT:
  84.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  85.             if( rd = *rxd )
  86.             {
  87.                 /* set your DEFAULTS here */
  88.             }
  89.             break;
  90.             
  91.         case RXIF_ACTION:
  92.             /* Insert your CODE here */
  93.             PState.uwRexxFColor = MatchPalette(*rd->arg.red,
  94.                                                *rd->arg.green,
  95.                                                *rd->arg.blue,
  96.                                                (rd->arg.notbackground != FALSE),NULL, NULL);
  97.             rd->rc2 = PState.uwRexxFColor;
  98.             rd->rc = 1;  /* causes errors on high pens : PState.uwRexxFColor; */
  99.             break;
  100.         
  101.         case RXIF_FREE:
  102.             /* FREE your local data here */
  103.             FreeVec( rd );
  104.             break;
  105.     }
  106.     return;
  107. }
  108. /* $ARB: E 1 SETFCOLOR */
  109.  
  110. /* $ARB: B 2 SETFPEN */
  111. void rx_setfpen( struct RexxHost *host, struct rxd_setfpen **rxd, long action, struct RexxMsg *rexxmsg )
  112. {
  113.     struct rxd_setfpen *rd = *rxd;
  114.  
  115.     switch( action )
  116.     {
  117.         case RXIF_INIT:
  118.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  119.             if( rd = *rxd )
  120.             {
  121.                 /* set your DEFAULTS here */
  122.             }
  123.             break;
  124.             
  125.         case RXIF_ACTION:
  126.             /* Insert your CODE here */
  127.             if ((*rd->arg.pen < 0)||(*rd->arg.pen >= 1<<PState.ubDepth))
  128.             {
  129.                 rd->rc = 0;
  130.             }
  131.             else
  132.             {
  133.                 PState.uwRexxFColor = *rd->arg.pen;                                                     
  134.                 rd->rc = 1;
  135.             }
  136.             break;
  137.         
  138.         case RXIF_FREE:
  139.             /* FREE your local data here */
  140.             FreeVec( rd );
  141.             break;
  142.     }
  143.     return;
  144. }
  145. /* $ARB: E 2 SETFPEN */
  146.  
  147. /* $ARB: B 3 SETBCOLOR */
  148. void rx_setbcolor( struct RexxHost *host, struct rxd_setbcolor **rxd, long action, struct RexxMsg *rexxmsg )
  149. {
  150.     struct rxd_setbcolor *rd = *rxd;
  151.  
  152.     switch( action )
  153.     {
  154.         case RXIF_INIT:
  155.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  156.             if( rd = *rxd )
  157.             {
  158.                 /* set your DEFAULTS here */
  159.             }
  160.             break;
  161.             
  162.         case RXIF_ACTION:
  163.             /* Insert your CODE here */
  164.             PState.uwRexxBColor = MatchPalette(*rd->arg.red,
  165.                                                *rd->arg.green,
  166.                                                *rd->arg.blue,
  167.                                                (rd->arg.notbackground != FALSE),NULL, NULL);
  168.             rd->rc = 1; /* PState.uwRexxBColor; */
  169.             break;
  170.         
  171.         case RXIF_FREE:
  172.             /* FREE your local data here */
  173.             FreeVec( rd );
  174.             break;
  175.     }
  176.     return;
  177. }
  178. /* $ARB: E 3 SETBCOLOR */
  179.  
  180. /* $ARB: B 4 SETBPEN */
  181. void rx_setbpen( struct RexxHost *host, struct rxd_setbpen **rxd, long action, struct RexxMsg *rexxmsg )
  182. {
  183.     struct rxd_setbpen *rd = *rxd;
  184.  
  185.     switch( action )
  186.     {
  187.         case RXIF_INIT:
  188.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  189.             if( rd = *rxd )
  190.             {
  191.                 /* set your DEFAULTS here */
  192.             }
  193.             break;
  194.             
  195.         case RXIF_ACTION:
  196.             /* Insert your CODE here */
  197.             if ((*rd->arg.pen < 0)||(*rd->arg.pen >= 1<<PState.ubDepth))
  198.                 rd->rc = 0;
  199.             else
  200.             {
  201.                 PState.uwRexxBColor = *rd->arg.pen;
  202.                 rd->rc = 1;
  203.             }
  204.             break;
  205.         
  206.         case RXIF_FREE:
  207.             /* FREE your local data here */
  208.             FreeVec( rd );
  209.             break;
  210.     }
  211.     return;
  212. }
  213. /* $ARB: E 4 SETBPEN */
  214.  
  215. /* $ARB: B 5 POINT */
  216. void rx_point( struct RexxHost *host, struct rxd_point **rxd, long action, struct RexxMsg *rexxmsg )
  217. {
  218.     struct rxd_point *rd = *rxd;
  219.     int x, y;
  220.     
  221.     switch( action )
  222.     {
  223.         case RXIF_INIT:
  224.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  225.             if( rd = *rxd )
  226.             {
  227.                 /* set your DEFAULTS here */
  228.             }
  229.             break;
  230.             
  231.         case RXIF_ACTION:
  232.             /* Insert your CODE here */
  233.             x = *rd->arg.x;
  234.             y = *rd->arg.y;
  235.             FixCoords(&x, &y);
  236.             rd->rc = FixPos(&x, &y);
  237.             if (rd->rc == TRUE)
  238.             {
  239.                 if (rd->arg.xor)
  240.                     SetDrMd(DrawWindow->RPort, COMPLEMENT);
  241.                 else                
  242.                     SetAPen(DrawWindow->RPort, PState.uwRexxFColor);
  243.                     
  244.                 WritePixel(DrawWindow->RPort, x, y);
  245.                 SetDrMd(DrawWindow->RPort, JAM1);
  246.  
  247.                 OutputAction(FROM_REXX, MODE_DOT | (MODE_XOR * (rd->arg.xor != 0)), x, y, NOP_PAD, NOP_PAD, DEST_PEER|DEST_FILE);
  248.             }
  249.             break;
  250.  
  251.         case RXIF_FREE:
  252.             /* FREE your local data here */
  253.             FreeVec(rd);
  254.             break;
  255.     }
  256.     return;
  257. }
  258. /* $ARB: E 5 POINT */
  259.  
  260. /* $ARB: B 6 PENRESET */
  261. void rx_penreset( struct RexxHost *host, struct rxd_penreset **rxd, long action, struct RexxMsg *rexxmsg )
  262. {
  263.     struct rxd_penreset *rd = *rxd;
  264.  
  265.     switch( action )
  266.     {
  267.         case RXIF_INIT:
  268.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  269.             break;
  270.             
  271.         case RXIF_ACTION:
  272.             /* Insert your CODE here */
  273.             XRexxPen = -1;
  274.             YRexxPen = -1;
  275.             rd->rc = 1;
  276.             break;
  277.         
  278.         case RXIF_FREE:
  279.             /* FREE your local data here */
  280.             FreeVec( rd );
  281.             break;
  282.     }
  283.     return;
  284. }
  285. /* $ARB: E 6 PENRESET */
  286.  
  287. /* $ARB: B 7 PEN */
  288. void rx_pen( struct RexxHost *host, struct rxd_pen **rxd, long action, struct RexxMsg *rexxmsg )
  289. {
  290.     struct rxd_pen *rd = *rxd;
  291.     int x,y;
  292.     
  293.     switch( action )
  294.     {
  295.         case RXIF_INIT:
  296.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  297.             if( rd = *rxd )
  298.             {
  299.                 /* set your DEFAULTS here */
  300.             }
  301.             break;
  302.             
  303.         case RXIF_ACTION:
  304.             /* Insert your CODE here */
  305.             if ((XRexxPen == -1)&&(YRexxPen == -1))
  306.             {
  307.                 XRexxPen = *rd->arg.x;
  308.                 YRexxPen = *rd->arg.y;
  309.                 FixCoords(&XRexxPen, &YRexxPen);
  310.                 rd->rc = FixPos(&XRexxPen, &YRexxPen);
  311.             }
  312.             else
  313.             {
  314.                 Move(DrawWindow->RPort, XRexxPen, YRexxPen);
  315.                 x = *rd->arg.x;
  316.                 y = *rd->arg.y;
  317.                 FixCoords(&x, &y);
  318.                 rd->rc = FixPos(&x, &y);
  319.                 if (rd->arg.xor)
  320.                     SetDrMd(DrawWindow->RPort, COMPLEMENT);
  321.                 else
  322.                     SetAPen(DrawWindow->RPort, PState.uwRexxFColor);
  323.                 
  324.                 Draw(DrawWindow->RPort, x, y);
  325.                 SetDrMd(DrawWindow->RPort, JAM1);  /* Restore regular mode */
  326.  
  327.                 OutputAction(FROM_REXX, MODE_LINE | (MODE_XOR * (rd->arg.xor != 0)), XRexxPen, YRexxPen, x, y, DEST_PEER|DEST_FILE);
  328.                 XRexxPen = x;
  329.                 YRexxPen = y;
  330.             }
  331.             break;
  332.                 
  333.         case RXIF_FREE:
  334.             /* FREE your local data here */
  335.             FreeVec( rd );
  336.             break;
  337.     }
  338.     return;
  339. }
  340. /* $ARB: E 7 PEN */
  341.  
  342. /* $ARB: B 8 LINE */
  343. void rx_line( struct RexxHost *host, struct rxd_line **rxd, long action, struct RexxMsg *rexxmsg )
  344. {
  345.     struct rxd_line *rd = *rxd;
  346.     int x1, y1, x2, y2;
  347.     
  348.     switch( action )
  349.     {
  350.         case RXIF_INIT:
  351.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  352.             if( rd = *rxd )
  353.             {
  354.                 /* set your DEFAULTS here */
  355.             }
  356.             break;
  357.             
  358.         case RXIF_ACTION:
  359.             /* Insert your CODE here */
  360.             x1 = *rd->arg.x1; y1 = *rd->arg.y1;
  361.             x2 = *rd->arg.x2; y2 = *rd->arg.y2;
  362.             FixCoords(&x1, &y1);
  363.             FixCoords(&x2, &y2);
  364.             rd->rc = (FixPos(&x1, &y1) && FixPos(&x2, &y2));
  365.             if (rd->rc == FALSE) FixPos(&x2, &y2);    /* avoid the short-circuit! */
  366.             
  367.             if (rd->arg.xor)
  368.                 SetDrMd(DrawWindow->RPort, COMPLEMENT);
  369.             else
  370.                 SetAPen(DrawWindow->RPort, PState.uwRexxFColor);
  371.  
  372.             Move(DrawWindow->RPort, x1, y1);
  373.             Draw(DrawWindow->RPort, x2, y2);
  374.             SetDrMd(DrawWindow->RPort, JAM1);
  375.             
  376.             OutputAction(FROM_REXX, MODE_LINE | (MODE_XOR * (rd->arg.xor != 0)), x1, y1, x2, y2, DEST_PEER|DEST_FILE);
  377.             break;
  378.         
  379.         case RXIF_FREE:
  380.             /* FREE your local data here */
  381.             FreeVec( rd );
  382.             break;
  383.     }
  384.     return;
  385. }
  386. /* $ARB: E 8 LINE */
  387.  
  388. /* $ARB: B 9 CIRCLE */
  389. void rx_circle( struct RexxHost *host, struct rxd_circle **rxd, long action, struct RexxMsg *rexxmsg )
  390. {
  391.     struct rxd_circle *rd = *rxd;
  392.     int xCenter, yCenter, yTop, xLeft, yBottom, xRight, xR, yR;
  393.     ULONG ulMode = MODE_CIRCLE;
  394.     
  395.     switch( action )
  396.     {
  397.         case RXIF_INIT:
  398.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  399.             if( rd = *rxd )
  400.             {
  401.                 /* set your DEFAULTS here */
  402.             }
  403.             break;
  404.             
  405.         case RXIF_ACTION:
  406.             /* Insert your CODE here */
  407.             xCenter = *rd->arg.x;
  408.             yCenter = *rd->arg.y;
  409.             FixCoords(&xCenter, &yCenter);
  410.             
  411.             xR = *rd->arg.rx;
  412.             yR = *rd->arg.ry;
  413.             
  414.             yTop   = yCenter - yR;
  415.             xLeft  = xCenter - xR;
  416.             xRight = xCenter + xR;
  417.             yBottom= yCenter + yR;
  418.             
  419.             FixPos(&xCenter, &yCenter);
  420.             
  421.             /* Make sure edges of circle are within canvas */
  422.             if (FixPos(&xLeft, &yCenter)   == FALSE) xR = (xCenter - xLeft);
  423.             if ((FixPos(&xRight, &yCenter)  == FALSE)&&(xR > (xRight - xCenter))) xR = (xRight  - xCenter);
  424.                 
  425.             if (FixPos(&xCenter, &yTop)    == FALSE) yR = (yTop    - yCenter);
  426.             if ((FixPos(&xCenter, &yBottom) == FALSE)&&(yR > (yBottom - yCenter))) 
  427.             {
  428.                 yR = (yBottom - yCenter);
  429.             
  430.             }
  431.                 
  432.             FixPos(&xRight,  &yBottom);
  433.             
  434.             
  435.             if (rd->arg.xor)
  436.                 SetDrMd(DrawWindow->RPort, COMPLEMENT);
  437.             else
  438.                 SetAPen(DrawWindow->RPort,PState.uwRexxFColor);
  439.                 
  440.             Ellipse(xCenter, yCenter, xR, yR, (rd->arg.fill != FALSE));
  441.             SetDrMd(DrawWindow->RPort, JAM1);
  442.             
  443.             if (rd->arg.fill) ulMode |= MODE_FILLED;
  444.             if (rd->arg.xor)  ulMode |= MODE_XOR;
  445.             
  446.             OutputAction(FROM_REXX, ulMode, xCenter, yCenter, 
  447.                     xR, yR, DEST_PEER|DEST_FILE);
  448.             rd->rc = 1;
  449.             break;
  450.         
  451.         case RXIF_FREE:
  452.             /* FREE your local data here */
  453.             FreeVec( rd );
  454.             break;
  455.     }
  456.     return;
  457. }
  458. /* $ARB: E 9 CIRCLE */
  459.  
  460. /* $ARB: B 10 SQUARE */
  461. void rx_square( struct RexxHost *host, struct rxd_square **rxd, long action, struct RexxMsg *rexxmsg )
  462. {
  463.     struct rxd_square *rd = *rxd;
  464.     int x1, x2, y1, y2;
  465.     ULONG ulMode = MODE_SQUARE;
  466.     BOOL BTemp;
  467.     
  468.     switch( action )
  469.     {
  470.         case RXIF_INIT:
  471.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  472.             if( rd = *rxd )
  473.             {
  474.                 /* set your DEFAULTS here */
  475.             }
  476.             break;
  477.             
  478.         case RXIF_ACTION:
  479.             /* Insert your CODE here */
  480.             x1 = *rd->arg.x1;
  481.             y1 = *rd->arg.y1;
  482.             x2 = *rd->arg.x2;
  483.             y2 = *rd->arg.y2;
  484.             FixCoords(&x1, &y1);
  485.             FixCoords(&x2, &y2);
  486.             
  487.             BTemp = FixPos(&x1, &y1);
  488.             BTemp |= FixPos(&x2, &y2);
  489.             
  490.             if (BTemp)
  491.             {
  492.                 if (rd->arg.xor)
  493.                     SetDrMd(DrawWindow->RPort, COMPLEMENT);
  494.                 else
  495.                     SetAPen(DrawWindow->RPort,PState.uwRexxFColor);     
  496.                 
  497.                 Rectangle(x1, y1, x2, y2, (rd->arg.fill != 0)); 
  498.                 
  499.                 /* Reset draw mode */
  500.                 SetDrMd(DrawWindow->RPort, JAM1);
  501.  
  502.                 if (rd->arg.fill) ulMode |= MODE_FILLED;
  503.                 if (rd->arg.xor)  ulMode |= MODE_XOR;
  504.             
  505.                 OutputAction(FROM_REXX, ulMode, x1, y1, x2, y2, DEST_PEER|DEST_FILE);
  506.                 rd->rc = 1;
  507.             }
  508.             else
  509.                 rd->rc = 0;
  510.             break;
  511.         
  512.         case RXIF_FREE:
  513.             /* FREE your local data here */
  514.             FreeVec( rd );
  515.             break;
  516.     }
  517.     return;
  518. }
  519. /* $ARB: E 10 SQUARE */
  520.  
  521. /* $ARB: B 13 FLOOD */
  522. void rx_flood( struct RexxHost *host, struct rxd_flood **rxd, long action, struct RexxMsg *rexxmsg )
  523. {
  524.     struct rxd_flood *rd = *rxd;
  525.     int x,y, ulFillThisColor;
  526.     
  527.     switch( action )
  528.     {
  529.         case RXIF_INIT:
  530.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  531.             if( rd = *rxd )
  532.             {
  533.                 /* set your DEFAULTS here */
  534.             }
  535.             break;
  536.             
  537.         case RXIF_ACTION:
  538.             /* Insert your CODE here */
  539.             x = *rd->arg.x;
  540.             y = *rd->arg.y;
  541.             FixCoords(&x, &y);
  542.             rd->rc = FixPos(&x, &y);
  543.             if (rd->rc == 0) return;        /* No offscreen flooding! */
  544.             
  545.             ulFillThisColor = ReadPixel(DrawWindow->RPort, x, y);
  546.             
  547.             if (ulFillThisColor == PState.uwRexxFColor)
  548.             {
  549.                 /* fill same color pixel--trivial accept */
  550.                 rd->rc = 1;
  551.             }
  552.             else
  553.             {            
  554.                   SetPointer(DrawWindow, (UWORD *)waitPointer, 16, 16, -6, 0);       
  555.                 if (BSafeFloods == TRUE)
  556.                         {
  557.                             /* Send flood info as a series of horizontal lines */
  558.                      SetAPen(DrawWindow->RPort, PState.uwRexxFColor);
  559.                             bFloodFromCode = FROM_REXX;        /* Set Flag */
  560.                             FloodFill(x, y, ReadPixel(DrawWindow->RPort,x,y), 0, 0, 0, DEST_PEER|DEST_FILE);
  561.                     bFloodFromCode = FROM_IDCMP;    /* Reset flag */
  562.                         }
  563.                         else
  564.                         {
  565.                             /* Send flood info as simple co-ordinates */
  566.                               OutputAction(FROM_REXX, MODE_FLOOD, x, y, PState.uwRexxFColor, NOP_PAD, DEST_PEER|DEST_FILE);
  567.                      SetAPen(DrawWindow->RPort, PState.uwRexxFColor);
  568.                             FloodFill(x, y, ReadPixel(DrawWindow->RPort,x,y), 0, 0, 0, 0L);
  569.                         }
  570.                     ClearPointer(DrawWindow);
  571.                 }                
  572.             break;
  573.         
  574.         case RXIF_FREE:
  575.             /* FREE your local data here */
  576.             FreeVec( rd );
  577.             break;
  578.     }
  579.     return;
  580. }
  581. /* $ARB: E 13 FLOOD */
  582.  
  583. /* $ARB: B 14 CLEAR */
  584. void rx_clear( struct RexxHost *host, struct rxd_clear **rxd, long action, struct RexxMsg *rexxmsg )
  585. {
  586.     struct rxd_clear *rd = *rxd;
  587.  
  588.     switch( action )
  589.     {
  590.         case RXIF_INIT:
  591.             *rxd = AllocVec(sizeof *rd, MEMF_CLEAR);
  592.             break;
  593.  
  594.         case RXIF_ACTION:
  595.             /* Insert your CODE here */
  596.             ClearWindow();
  597.             OutputAction(FROM_REXX, COMMAND, COMMAND_CLEAR, NOP_PAD, NOP_PAD, NOP_PAD, DEST_PEER|DEST_FILE);
  598.             rd->rc = 1;
  599.             break;
  600.         
  601.         case RXIF_FREE:
  602.             /* FREE your local data here */
  603.             FreeVec( rd );
  604.             break;
  605.     }
  606.     return;
  607. }
  608. /* $ARB: E 14 CLEAR */
  609.  
  610. /* $ARB: B 15 TYPEKEYS */
  611. void rx_typekeys( struct RexxHost *host, struct rxd_typekeys **rxd, long action, struct RexxMsg *rexxmsg )
  612. {
  613.     struct rxd_typekeys *rd = *rxd;
  614.  
  615.     switch( action )
  616.     {
  617.         case RXIF_INIT:
  618.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  619.             if( rd = *rxd )
  620.             {
  621.                 /* set your DEFAULTS here */
  622.             }
  623.             break;
  624.             
  625.         case RXIF_ACTION:
  626.             /* Insert your CODE here */
  627.             while(*rd->arg.message != '\0') 
  628.             {
  629.                 DisplayKeyPress(*rd->arg.message, TRUE);
  630.                 rd->arg.message++;
  631.             }
  632.             rd->rc = 1;
  633.             break;
  634.         
  635.         case RXIF_FREE:
  636.             /* FREE your local data here */
  637.             FreeVec( rd );
  638.             break;
  639.     }
  640.     return;
  641. }
  642. /* $ARB: E 15 TYPEKEYS */
  643.  
  644. /* $ARB: B 16 EASYREQUEST */
  645. void rx_easyrequest( struct RexxHost *host, struct rxd_easyrequest **rxd, long action, struct RexxMsg *rexxmsg )
  646. {
  647.     struct rxd_easyrequest *rd = *rxd;
  648.  
  649.     switch( action )
  650.     {
  651.         case RXIF_INIT:
  652.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  653.             if( rd = *rxd )
  654.             {
  655.                 /* set your DEFAULTS here */
  656.             }
  657.             break;
  658.             
  659.         case RXIF_ACTION:
  660.             /* Insert your CODE here */
  661.             rd->rc = MakeReq(rd->arg.title,rd->arg.message,rd->arg.gadgets);
  662.             break;
  663.         
  664.         case RXIF_FREE:
  665.             /* FREE your local data here */
  666.             FreeVec( rd );
  667.             break;
  668.     }
  669.     return;
  670. }
  671. /* $ARB: E 16 EASYREQUEST */
  672.  
  673. /* $ARB: B 17 STRINGREQUEST */
  674. void rx_stringrequest( struct RexxHost *host, struct rxd_stringrequest **rxd, long action, struct RexxMsg *rexxmsg )
  675. {
  676.     struct rxd_stringrequest *rd = *rxd;
  677.     static char szUserStringBuf[200] = "";
  678.     
  679.     switch( action )
  680.     {
  681.         case RXIF_INIT:
  682.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  683.             if( rd = *rxd )
  684.             {
  685.                 /* set your DEFAULTS here */
  686.             }
  687.             break;
  688.             
  689.         case RXIF_ACTION:
  690.             /* Insert your CODE here */
  691.             strncpy(szUserStringBuf, rd->arg.defaultstring, sizeof(szUserStringBuf));
  692.             if (GetUserString(szUserStringBuf, rd->arg.title, rd->arg.message, sizeof(szUserStringBuf)) == TRUE)
  693.                 rd->res.message = szUserStringBuf; 
  694.                 else
  695.                 rd->res.message = "(User aborted)";
  696.             break;
  697.         
  698.         case RXIF_FREE:
  699.             /* FREE your local data here */
  700.             FreeVec( rd );
  701.             break;
  702.     }
  703.     return;
  704. }
  705. /* $ARB: E 17 STRINGREQUEST */
  706.  
  707. /* $ARB: B 18 FILEREQUEST */
  708. void rx_filerequest( struct RexxHost *host, struct rxd_filerequest **rxd, long action, struct RexxMsg *rexxmsg )
  709. {
  710.     struct rxd_filerequest *rd = *rxd;
  711.     static char szFileBuf[500];
  712.     
  713.     switch( action )
  714.     {
  715.         case RXIF_INIT:
  716.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  717.             if( rd = *rxd )
  718.             {
  719.                 /* set your DEFAULTS here */
  720.             }
  721.             break;
  722.             
  723.         case RXIF_ACTION:
  724.             /* Insert your CODE here */
  725.             *szFileBuf = '\0';
  726.             if (FileRequest(rd->arg.title, szFileBuf, NULL,
  727.                      rd->arg.dir, rd->arg.file, (rd->arg.save != 0)) == FALSE)
  728.                      rd->res.file = "(User Aborted)";
  729.             else
  730.                 rd->res.file = szFileBuf;
  731.             break;
  732.         
  733.         case RXIF_FREE:
  734.             /* FREE your local data here */
  735.             FreeVec( rd );
  736.             break;
  737.     }
  738.     return;
  739. }
  740. /* $ARB: E 18 FILEREQUEST */
  741.  
  742. /* $ARB: B 19 CONNECT */
  743. void rx_connect( struct RexxHost *host, struct rxd_connect **rxd, long action, struct RexxMsg *rexxmsg )
  744. {
  745.     struct rxd_connect *rd = *rxd;
  746.  
  747.     switch( action )
  748.     {
  749.         case RXIF_INIT:
  750.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  751.             if( rd = *rxd )
  752.             {
  753.                 /* set your DEFAULTS here */
  754.             }
  755.             break;
  756.             
  757.         case RXIF_ACTION:
  758.             /* Insert your CODE here */
  759.             rd->rc = 0;
  760.             if (BNetConnect == TRUE) return;
  761.             strncpy(targethost,rd->arg.hostname, sizeof(targethost));
  762.             rd->rc = ConnectDrawSocket(FALSE);
  763.             if (rd->rc) Synch();
  764.             break;
  765.         
  766.         case RXIF_FREE:
  767.             /* FREE your local data here */
  768.             FreeVec( rd );
  769.             break;
  770.     }
  771.     return;
  772. }
  773. /* $ARB: E 19 CONNECT */
  774.  
  775. /* $ARB: B 20 DISCONNECT */
  776. void rx_disconnect( struct RexxHost *host, struct rxd_disconnect **rxd, long action, struct RexxMsg *rexxmsg )
  777. {
  778.     struct rxd_disconnect *rd = *rxd;
  779.  
  780.     switch( action )
  781.     {
  782.         case RXIF_INIT:
  783.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  784.             break;
  785.             
  786.         case RXIF_ACTION:
  787.             /* Insert your CODE here */
  788.             if (BNetConnect == FALSE) 
  789.                 rd->rc = 0;
  790.             else
  791.             {
  792.                 CloseDrawSocket();
  793.                 rd->rc = 1;
  794.             }
  795.             break;
  796.         
  797.         case RXIF_FREE:
  798.             /* FREE your local data here */
  799.             FreeVec( rd );
  800.             break;
  801.     }
  802.     return;
  803. }
  804. /* $ARB: E 20 DISCONNECT */
  805.  
  806. /* $ARB: B 21 PLAYSCRIPT */
  807. void rx_playscript( struct RexxHost *host, struct rxd_playscript **rxd, long action, struct RexxMsg *rexxmsg )
  808. {
  809.     struct rxd_playscript *rd = *rxd;
  810.     UWORD uwSaveRemoteMode   = PState.uwRemoteMode;
  811.     UWORD uwSaveRemoteFColor = PState.uwRemoteFColor;
  812.     UWORD uwSaveRemoteBColor = PState.uwRemoteBColor;
  813.     FILE *fpScript;
  814.     
  815.     switch( action )
  816.     {
  817.         case RXIF_INIT:
  818.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  819.             if( rd = *rxd )
  820.             {
  821.                 /* set your DEFAULTS here */
  822.             }
  823.             break;
  824.             
  825.         case RXIF_ACTION:
  826.             /* Insert your CODE here */
  827.             if ((fpScript = fopen(rd->arg.file, "rb")) == NULL)
  828.             {
  829.                 rd->rc = 0;
  830.             }
  831.             else
  832.             {
  833.                 SetPointer(DrawWindow, (UWORD *)waitPointer, 16, 16, -6, 0);
  834.                 /* playback script file */
  835.                 while (RemoteHandler(fpScript, TRUE) == TRUE);
  836.                 fclose(fpScript);
  837.                 
  838.                 /* Restore remote state */
  839.                 PState.uwRemoteMode   = uwSaveRemoteMode;
  840.                 PState.uwRemoteFColor = uwSaveRemoteFColor;
  841.                 PState.uwRemoteBColor = uwSaveRemoteBColor;
  842.                 ClearPointer(DrawWindow);
  843.                 
  844.                 rd->rc = 1;
  845.             }
  846.             break;
  847.         
  848.         case RXIF_FREE:
  849.             /* FREE your local data here */
  850.             FreeVec( rd );
  851.             break;
  852.     }
  853.     return;
  854. }
  855. /* $ARB: E 21 PLAYSCRIPT */
  856.  
  857. /* $ARB: B 22 RECORDSCRIPT */
  858. void rx_recordscript( struct RexxHost *host, struct rxd_recordscript **rxd, long action, struct RexxMsg *rexxmsg )
  859. {
  860.     struct rxd_recordscript *rd = *rxd;
  861.  
  862.     switch( action )
  863.     {
  864.         case RXIF_INIT:
  865.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  866.             if( rd = *rxd )
  867.             {
  868.                 /* set your DEFAULTS here */
  869.             }
  870.             break;
  871.             
  872.         case RXIF_ACTION:
  873.             /* Insert your CODE here */
  874.             if ((rd->arg.stop) && (fpOut != NULL))
  875.             {
  876.                 fclose(fpOut);
  877.                 fpOut = NULL;
  878.                 SetWindowTitle("Recording complete.");
  879.                 rd->rc = 1;
  880.                 SetMenuValues();
  881.             }
  882.             else
  883.             {
  884.                 if ((rd->arg.start) && (fpOut == NULL) && 
  885.                     ((fpOut = fopen(rd->arg.file,"a+b")) != NULL))
  886.                 {
  887.                     /* Save basic state information to disk */
  888.                     OutputAction(FROM_REXX, COMMAND, COMMAND_RGB,   PState.uwFColor, PState.uwBColor, NOP_PAD, DEST_FILE);
  889.                     OutputAction(FROM_REXX, MODE_CHANGE, PState.uwMode, NOP_PAD, NOP_PAD, NOP_PAD, DEST_FILE);
  890.                     SetWindowTitle("Now recording actions.");
  891.                     rd->rc = 1;
  892.                     SetMenuValues();
  893.                 }
  894.                 else
  895.                     rd->rc = 0;
  896.             }
  897.             break;
  898.             
  899.         case RXIF_FREE:
  900.             /* FREE your local data here */
  901.             FreeVec( rd );
  902.             break;
  903.     }
  904.     return;
  905. }
  906. /* $ARB: E 22 RECORDSCRIPT */
  907.  
  908. /* $ARB: B 23 LOCK */
  909. void rx_lock( struct RexxHost *host, struct rxd_lock **rxd, long action, struct RexxMsg *rexxmsg )
  910. {
  911.     struct rxd_lock *rd = *rxd;
  912.  
  913.     switch( action )
  914.     {
  915.         case RXIF_INIT:
  916.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  917.             if( rd = *rxd )
  918.             {
  919.                 /* set your DEFAULTS here */
  920.             }
  921.             break;
  922.             
  923.         case RXIF_ACTION:
  924.             /* Insert your CODE here */
  925.             if (rd->arg.off) EnableDraw(TRUE); else EnableDraw(FALSE);
  926.             rd->rc = 1;
  927.             break;
  928.         
  929.         case RXIF_FREE:
  930.             /* FREE your local data here */
  931.             FreeVec( rd );
  932.             break;
  933.     }
  934.     return;
  935. }
  936. /* $ARB: E 23 LOCK */
  937.  
  938. /* $ARB: B 25 LOCKPALETTE */
  939. void rx_lockpalette( struct RexxHost *host, struct rxd_lockpalette **rxd, long action, struct RexxMsg *rexxmsg )
  940. {
  941.     struct rxd_lockpalette *rd = *rxd;
  942.  
  943.     switch( action )
  944.     {
  945.         case RXIF_INIT:
  946.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  947.             if( rd = *rxd )
  948.             {
  949.                 /* set your DEFAULTS here */
  950.             }
  951.             break;
  952.             
  953.         case RXIF_ACTION:
  954.             /* Insert your CODE here */
  955.             
  956.             /* We can only toggle ON if our palette >= their palette */
  957.             if ((BPalettesLocked == FALSE)&&
  958.                 (PState.ubDepth < PState.ubRemoteDepth))
  959.             {
  960.                     rd->rc = 0;
  961.             }
  962.             else
  963.             {
  964.                 if ((BNetConnect == TRUE) && 
  965.                     (((BPalettesLocked == TRUE)&&(rd->arg.off)&&(PState.ubDepth >= PState.ubRemoteDepth)) ||
  966.                      ((BPalettesLocked == FALSE)&&(rd->arg.on))))
  967.                 {
  968.                         ToggleLockPalettes();
  969.                         rd->rc = 1;
  970.                 }
  971.                 else
  972.                     rd->rc = 0;            
  973.             }
  974.             break;
  975.         
  976.         case RXIF_FREE:
  977.             /* FREE your local data here */
  978.             FreeVec( rd );
  979.             break;
  980.     }
  981.     return;
  982. }
  983. /* $ARB: E 25 LOCKPALETTE */
  984.  
  985. /* $ARB: B 29 SIZEWINDOW */
  986. void rx_sizewindow( struct RexxHost *host, struct rxd_sizewindow **rxd, long action, struct RexxMsg *rexxmsg )
  987. {
  988.     struct rxd_sizewindow *rd = *rxd;
  989.  
  990.     switch( action )
  991.     {
  992.         case RXIF_INIT:
  993.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  994.             if( rd = *rxd )
  995.             {
  996.                 /* set your DEFAULTS here */
  997.             }
  998.             break;
  999.             
  1000.         case RXIF_ACTION:
  1001.             /* Insert your CODE here */
  1002.             rd->rc = ReSizeWindow(*rd->arg.width, *rd->arg.height, TRUE);
  1003.             break;
  1004.         
  1005.         case RXIF_FREE:
  1006.             /* FREE your local data here */
  1007.             FreeVec( rd );
  1008.             break;
  1009.     }
  1010.     return;
  1011. }
  1012. /* $ARB: E 29 SIZEWINDOW */
  1013.  
  1014. /* $ARB: B 30 QUIT */
  1015. void rx_quit( struct RexxHost *host, struct rxd_quit **rxd, long action, struct RexxMsg *rexxmsg )
  1016. {
  1017.     struct rxd_quit *rd = *rxd;
  1018.  
  1019.     switch( action )
  1020.     {
  1021.         case RXIF_INIT:
  1022.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1023.             if( rd = *rxd )
  1024.             {
  1025.                 /* set your DEFAULTS here */
  1026.             }
  1027.             break;
  1028.             
  1029.         case RXIF_ACTION:
  1030.             /* Insert your CODE here */
  1031.             rd->rc = 1;
  1032.             BProgramDone = TRUE;
  1033.             break;
  1034.         
  1035.         case RXIF_FREE:
  1036.             /* FREE your local data here */
  1037.             FreeVec( rd );
  1038.             break;
  1039.     }
  1040.     return;
  1041. }
  1042. /* $ARB: E 30 QUIT */
  1043.  
  1044. /* $ARB: B 31 GETWINDOWATTRS */
  1045. void rx_getwindowattrs( struct RexxHost *host, struct rxd_getwindowattrs **rxd, long action, struct RexxMsg *rexxmsg )
  1046. {
  1047.     struct rxd_getwindowattrs *rd = *rxd;
  1048.     static LONG lWintop, lWinleft, lWinwidth, lWinheight, lWindepth, lWinmaxwidth, lWinmaxheight;
  1049.  
  1050.     switch( action )
  1051.     {
  1052.         case RXIF_INIT:
  1053.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1054.             break;
  1055.             
  1056.         case RXIF_ACTION:
  1057.             /* Insert your CODE here */
  1058.             
  1059.             lWintop       = DrawWindow->TopEdge;
  1060.             lWinleft      = DrawWindow->LeftEdge;
  1061.             lWinwidth     = DrawWindow->Width;
  1062.             lWinheight    = DrawWindow->Height;
  1063.             lWindepth     = PState.ubDepth;
  1064.             lWinmaxwidth  = DrawWindow->MaxWidth;
  1065.             lWinmaxheight = DrawWindow->MaxHeight;
  1066.         
  1067.             if (lWinmaxwidth  >= 65535) lWinmaxwidth  = Scr->Width;
  1068.             if (lWinmaxheight >= 65535) lWinmaxheight = Scr->Height;
  1069.                 
  1070.             rd->res.top       = &lWintop;
  1071.             rd->res.left      = &lWinleft;
  1072.             rd->res.width     = &lWinwidth;
  1073.             rd->res.height    = &lWinheight;
  1074.             rd->res.depth     = &lWindepth;
  1075.             rd->res.maxwidth  = &lWinmaxwidth;
  1076.             rd->res.maxheight = &lWinmaxheight;
  1077.             break;
  1078.         
  1079.         case RXIF_FREE:
  1080.             /* FREE your local data here */
  1081.             FreeVec( rd );
  1082.             break;
  1083.     }
  1084.     return;
  1085. }
  1086. /* $ARB: E 31 GETWINDOWATTRS */
  1087.  
  1088. /* $ARB: B 32 GETSTATEATTRS */
  1089. void rx_getstateattrs( struct RexxHost *host, struct rxd_getstateattrs **rxd, long action, struct RexxMsg *rexxmsg )
  1090. {
  1091.     struct rxd_getstateattrs *rd = *rxd;
  1092.     static LONG lMode, lPendown, lLocked, lFpen, lBpen, lFred, lFgreen,
  1093.                 lFblue, lBred, lBgreen, lBblue;
  1094.     UWORD uwThisColor;
  1095.             
  1096.     switch( action )
  1097.     {
  1098.         case RXIF_INIT:
  1099.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1100.             break;
  1101.             
  1102.         case RXIF_ACTION:
  1103.             /* Insert your CODE here */
  1104.             lMode     = PState.uwMode;
  1105.             lPendown  = PState.BPenDown;
  1106.             lLocked   = Not[PState.BDrawEnabled];
  1107.             lFpen     = PState.uwFColor;
  1108.             lBpen      = PState.uwBColor;
  1109.  
  1110.             /* Extract R, G, B for FColor from return value */
  1111.             uwThisColor = RGBComponents(lFpen);
  1112.             lFblue  = (uwThisColor      & 0x000F); /* Right 4 bits */
  1113.             lFgreen = ((uwThisColor>>4) & 0x000F); /* 2nd 4 bits from right */
  1114.             lFred   = ((uwThisColor>>8) & 0x000F); /* 3rd 4 bits from right */
  1115.  
  1116.             /* Extract R, G, B for BColor from return value */
  1117.             uwThisColor = RGBComponents(lBpen);
  1118.             lBblue  = (uwThisColor      & 0x000F); /* Right 4 bits */
  1119.             lBgreen = ((uwThisColor>>4) & 0x000F); /* 2nd 4 bits from right */
  1120.             lBred   = ((uwThisColor>>8) & 0x000F); /* 3rd 4 bits from right */
  1121.  
  1122.             rd->res.mode    = &lMode;
  1123.             rd->res.pendown = &lPendown;
  1124.             rd->res.locked  = &lLocked;
  1125.             rd->res.fpen    = &lFpen;
  1126.             rd->res.bpen    = &lBpen;
  1127.             rd->res.fred    = &lFred;
  1128.             rd->res.fgreen  = &lFgreen;
  1129.             rd->res.fblue   = &lFblue;
  1130.             rd->res.bred    = &lBred;
  1131.             rd->res.bgreen  = &lBgreen;
  1132.             rd->res.bblue   = &lBblue;
  1133.             
  1134.             break;
  1135.         
  1136.         case RXIF_FREE:
  1137.             /* FREE your local data here */
  1138.             FreeVec( rd );
  1139.             break;
  1140.     }
  1141.     return;
  1142. }
  1143. /* $ARB: E 32 GETSTATEATTRS */
  1144.  
  1145. /* $ARB: B 33 GETREMOTESTATEATTRS */
  1146. void rx_getremotestateattrs( struct RexxHost *host, struct rxd_getremotestateattrs **rxd, long action, struct RexxMsg *rexxmsg )
  1147. {
  1148.     struct rxd_getremotestateattrs *rd = *rxd;
  1149.     static LONG lMode, lFpen, lBpen, lFred, lFgreen,
  1150.                 lFblue, lBred, lBgreen, lBblue;
  1151.     UWORD uwThisColor;
  1152.     static char szTempRemoteString[256];
  1153.     
  1154.     switch( action )
  1155.     {
  1156.         case RXIF_INIT:
  1157.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1158.             break;
  1159.             
  1160.         case RXIF_ACTION:
  1161.             /* Insert your CODE here */
  1162.             /* Insert your CODE here */
  1163.             
  1164.             if (BNetConnect == TRUE)
  1165.             {
  1166.                 lMode     = PState.uwRemoteMode;
  1167.                 lFpen     = PState.uwRemoteFColor;
  1168.                 lBpen      = PState.uwRemoteBColor;
  1169.     
  1170.                 /* Extract R, G, B for FColor from return value */
  1171.                 uwThisColor = RGBComponents(lFpen);
  1172.                 lFblue  = (uwThisColor      & 0x000F); /* Right 4 bits */
  1173.                 lFgreen = ((uwThisColor>>4) & 0x000F); /* 2nd 4 bits from right */
  1174.                 lFred   = ((uwThisColor>>8) & 0x000F); /* 3rd 4 bits from right */
  1175.     
  1176.                 /* Extract R, G, B for BColor from return value */
  1177.                 uwThisColor = RGBComponents(lBpen);
  1178.                 lBblue  = (uwThisColor      & 0x000F); /* Right 4 bits */
  1179.                 lBgreen = ((uwThisColor>>4) & 0x000F); /* 2nd 4 bits from right */
  1180.                 lBred   = ((uwThisColor>>8) & 0x000F); /* 3rd 4 bits from right */
  1181.             }
  1182.             else
  1183.             {
  1184.                 lMode   = -1L;
  1185.                 lFpen   = -1L;
  1186.                 lBpen   = -1L;
  1187.                 lFblue  = -1L;
  1188.                 lFgreen = -1L;
  1189.                 lFred   = -1L;
  1190.                 lBblue  = -1L;
  1191.                 lBgreen = -1L;
  1192.                 lBred   = -1L;
  1193.             }
  1194.             
  1195.             strncpy(szTempRemoteString,szReceiveString,sizeof(szTempRemoteString));
  1196.             rd->res.mode    = &lMode;
  1197.             rd->res.fpen    = &lFpen;
  1198.             rd->res.bpen    = &lBpen;
  1199.             rd->res.fred    = &lFred;
  1200.             rd->res.fgreen  = &lFgreen;
  1201.             rd->res.fblue   = &lFblue;
  1202.             rd->res.bred    = &lBred;
  1203.             rd->res.bgreen  = &lBgreen;
  1204.             rd->res.bblue   = &lBblue;
  1205.             break;
  1206.         
  1207.         case RXIF_FREE:
  1208.             /* FREE your local data here */
  1209.             FreeVec( rd );
  1210.  
  1211.             /* Reset szReceiveString so as not to send this out again */
  1212.             szReceiveString[0] = '\0';
  1213.             break;
  1214.     }
  1215.     return;
  1216. }
  1217. /* $ARB: E 33 GETREMOTESTATEATTRS */
  1218.  
  1219. /* $ARB: B 34 SETWINDOWTITLE */
  1220. void rx_setwindowtitle( struct RexxHost *host, struct rxd_setwindowtitle **rxd, long action, struct RexxMsg *rexxmsg )
  1221. {
  1222.     struct rxd_setwindowtitle *rd = *rxd;
  1223.  
  1224.     switch( action )
  1225.     {
  1226.         case RXIF_INIT:
  1227.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1228.             if( rd = *rxd )
  1229.             {
  1230.                 /* set your DEFAULTS here */
  1231.             }
  1232.             break;
  1233.             
  1234.         case RXIF_ACTION:
  1235.             /* Insert your CODE here */
  1236.             SetWindowTitle(rd->arg.message);
  1237.             rd->rc = 1;
  1238.             break;
  1239.         
  1240.         case RXIF_FREE:
  1241.             /* FREE your local data here */
  1242.             FreeVec( rd );
  1243.             break;
  1244.     }
  1245.     return;
  1246. }
  1247. /* $ARB: E 34 SETWINDOWTITLE */
  1248.  
  1249. /* $ARB: B 35 SETREMOTEWINDOWTITLE */
  1250. void rx_setremotewindowtitle( struct RexxHost *host, struct rxd_setremotewindowtitle **rxd, long action, struct RexxMsg *rexxmsg )
  1251. {
  1252.     struct rxd_setremotewindowtitle *rd = *rxd;
  1253.  
  1254.     switch( action )
  1255.     {
  1256.         case RXIF_INIT:
  1257.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1258.             if( rd = *rxd )
  1259.             {
  1260.                 /* set your DEFAULTS here */
  1261.             }
  1262.             break;
  1263.             
  1264.         case RXIF_ACTION:
  1265.             /* Insert your CODE here */
  1266.             if (BNetConnect == FALSE)
  1267.                 rd->rc = 0;
  1268.             else
  1269.             {
  1270.                 strncpy(szSendString,rd->arg.message, sizeof(szSendString));
  1271.                 OutputAction(FROM_REXX, COMMAND, COMMAND_SENDSTRING, STRING_SETWINTITLE, NOP_PAD, NOP_PAD, DEST_PEER);
  1272.                 rd->rc = 1;
  1273.             }
  1274.             break;
  1275.         
  1276.         case RXIF_FREE:
  1277.             /* FREE your local data here */
  1278.             FreeVec( rd );
  1279.             break;
  1280.     }
  1281.     return;
  1282. }
  1283. /* $ARB: E 35 SETREMOTEWINDOWTITLE */
  1284.  
  1285. /* $ARB: B 36 REMOTEEASYREQUEST */
  1286. void rx_remoteeasyrequest( struct RexxHost *host, struct rxd_remoteeasyrequest **rxd, long action, struct RexxMsg *rexxmsg )
  1287. {
  1288.     struct rxd_remoteeasyrequest *rd = *rxd;
  1289.  
  1290.     switch( action )
  1291.     {
  1292.         case RXIF_INIT:
  1293.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1294.             if( rd = *rxd )
  1295.             {
  1296.                 /* set your DEFAULTS here */
  1297.             }
  1298.             break;
  1299.             
  1300.         case RXIF_ACTION:
  1301.             /* Insert your CODE here */
  1302.             if ((BNetConnect == FALSE) || ((strlen(rd->arg.title)+strlen(rd->arg.message)+strlen(rd->arg.gadgets)) > 250))
  1303.                 rd->rc = 0;
  1304.             else
  1305.             {
  1306.                 rd->rc = 1;
  1307.                       sprintf(szSendString,"%sÈ%sÈ%s", rd->arg.title, rd->arg.message, rd->arg.gadgets);
  1308.                 OutputAction(FROM_REXX, COMMAND, COMMAND_SENDSTRING, STRING_EASYREQ, NOP_PAD, NOP_PAD, DEST_PEER);
  1309.             }
  1310.             break;
  1311.         
  1312.         case RXIF_FREE:
  1313.             /* FREE your local data here */
  1314.             FreeVec( rd );
  1315.             break;
  1316.     }
  1317.     return;
  1318. }
  1319. /* $ARB: E 36 REMOTEEASYREQUEST */
  1320.  
  1321. /* $ARB: B 38 SENDMESSAGE */
  1322. void rx_sendmessage( struct RexxHost *host, struct rxd_sendmessage **rxd, long action, struct RexxMsg *rexxmsg )
  1323. {
  1324.     struct rxd_sendmessage *rd = *rxd;
  1325.  
  1326.     switch( action )
  1327.     {
  1328.         case RXIF_INIT:
  1329.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1330.             if( rd = *rxd )
  1331.             {
  1332.                 /* set your DEFAULTS here */
  1333.             }
  1334.             break;
  1335.             
  1336.         case RXIF_ACTION:
  1337.             /* Insert your CODE here */
  1338.             if (BNetConnect == FALSE) 
  1339.                 rd->rc = 0;
  1340.             else
  1341.             {
  1342.                 strncpy(szSendString, rd->arg.message, sizeof(szSendString));
  1343.                 OutputAction(FROM_REXX, COMMAND, COMMAND_SENDSTRING, STRING_USER, NOP_PAD, NOP_PAD, DEST_PEER);
  1344.                 rd->rc = 1;
  1345.             }
  1346.             break;
  1347.         
  1348.         case RXIF_FREE:
  1349.             /* FREE your local data here */
  1350.             FreeVec( rd );
  1351.             break;
  1352.     }
  1353.     return;
  1354. }
  1355. /* $ARB: E 38 SENDMESSAGE */
  1356.  
  1357. /* $ARB: B 39 WAITEVENT */
  1358. void rx_waitevent( struct RexxHost *host, struct rxd_waitevent **rxd, long action, struct RexxMsg *rexxmsg )
  1359. {
  1360.     struct rxd_waitevent *rd = *rxd;
  1361.  
  1362.     switch( action )
  1363.     {
  1364.         case RXIF_INIT:
  1365.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1366.             if( rd = *rxd )
  1367.             {
  1368.                 /* set your DEFAULTS here */
  1369.             }
  1370.             break;
  1371.             
  1372.         case RXIF_ACTION:
  1373.             /* Insert your CODE here */
  1374.             PState.uwRexxWaitMask = 0;
  1375.             if (rd->arg.message)     PState.uwRexxWaitMask |= REXX_REPLY_MESSAGE;
  1376.             if (rd->arg.mousedown)   PState.uwRexxWaitMask |= REXX_REPLY_MOUSEDOWN;
  1377.             if (rd->arg.mouseup)     PState.uwRexxWaitMask |= REXX_REPLY_MOUSEUP;
  1378.             if (rd->arg.resize)      PState.uwRexxWaitMask |= REXX_REPLY_RESIZE;
  1379.             if (rd->arg.quit)        PState.uwRexxWaitMask |= REXX_REPLY_QUIT;
  1380.             if (rd->arg.connect)     PState.uwRexxWaitMask |= REXX_REPLY_CONNECT;
  1381.             if (rd->arg.disconnect)  PState.uwRexxWaitMask |= REXX_REPLY_DISCONNECT;
  1382.             if (rd->arg.toolselect)  PState.uwRexxWaitMask |= REXX_REPLY_TOOLSELECT;
  1383.             if (rd->arg.colorselect) PState.uwRexxWaitMask |= REXX_REPLY_COLORSELECT;
  1384.             if (rd->arg.keypress)    PState.uwRexxWaitMask |= REXX_REPLY_KEYPRESS;
  1385.             if (rd->arg.mousemove)   PState.uwRexxWaitMask |= REXX_REPLY_MOUSEMOVE;
  1386.             if (rd->arg.timeout != NULL)
  1387.             {    
  1388.                 if (*rd->arg.timeout > 0)
  1389.                 {            
  1390.                     /* First make sure there is no previous timer pending */
  1391.                     if (!(CheckIO((struct IORequest *) TimerIO)))
  1392.                     {
  1393.                         AbortIO((struct IORequest *) TimerIO);
  1394.                         WaitIO((struct IORequest *) TimerIO);
  1395.                     }    
  1396.                     TimerIO->tr_time.tv_secs = *rd->arg.timeout/10;
  1397.                     *rd->arg.timeout -= TimerIO->tr_time.tv_secs*10;
  1398.                     
  1399.                     TimerIO->tr_time.tv_micro = (*rd->arg.timeout)*100000L;   /* There are 1,000,000 micros/sec, so 100,000 is 1/10th of a sec */
  1400.     
  1401.                     /* Start ze timer */
  1402.                     SendIO((struct IORequest *)TimerIO);
  1403.                 
  1404.                     PState.uwRexxWaitMask |= REXX_REPLY_TIMEOUT;
  1405.                 }
  1406.                 else
  1407.                 {
  1408.                     /* Reply this request immediately! */
  1409.                     PState.uwRexxWaitMask |= REXX_REPLY_IMMEDIATE;
  1410.                 }
  1411.             }
  1412.             break;
  1413.         
  1414.         case RXIF_FREE:
  1415.             /* FREE your local data here */
  1416.             FreeVec( rd );
  1417.             break;
  1418.     }
  1419.     return;
  1420. }
  1421. /* $ARB: E 39 WAITEVENT */
  1422.  
  1423. /* $ARB: B 40 REMOTESTRINGREQUEST */
  1424. void rx_remotestringrequest( struct RexxHost *host, struct rxd_remotestringrequest **rxd, long action, struct RexxMsg *rexxmsg )
  1425. {
  1426.     struct rxd_remotestringrequest *rd = *rxd;
  1427.     
  1428.     switch( action )
  1429.     {
  1430.         case RXIF_INIT:
  1431.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1432.             if( rd = *rxd )
  1433.             {
  1434.                 /* set your DEFAULTS here */
  1435.             }
  1436.             break;
  1437.             
  1438.         case RXIF_ACTION:
  1439.             /* Insert your CODE here */
  1440.             if ((BNetConnect == FALSE) || ((strlen(rd->arg.title)+strlen(rd->arg.message)+strlen(rd->arg.defaultstring)) > 250))
  1441.             rd->rc = 0;
  1442.             else
  1443.             {
  1444.                 rd->rc = 1;
  1445.                     sprintf(szSendString,"%sÈ%sÈ%s", rd->arg.title, rd->arg.defaultstring, rd->arg.message);
  1446.                 OutputAction(FROM_REXX, COMMAND, COMMAND_SENDSTRING, STRING_STRINGREQ, NOP_PAD, NOP_PAD, DEST_PEER);
  1447.             }
  1448.             break;
  1449.         
  1450.         case RXIF_FREE:
  1451.             /* FREE your local data here */
  1452.             FreeVec( rd );
  1453.             break;
  1454.     }
  1455.     return;
  1456. }
  1457. /* $ARB: E 40 REMOTESTRINGREQUEST */
  1458.  
  1459. /* $ARB: B 41 SETUSERFCOLOR */
  1460. void rx_setuserfcolor( struct RexxHost *host, struct rxd_setuserfcolor **rxd, long action, struct RexxMsg *rexxmsg )
  1461. {
  1462.     struct rxd_setuserfcolor *rd = *rxd;
  1463.     
  1464.     switch( action )
  1465.     {
  1466.         case RXIF_INIT:
  1467.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1468.             if( rd = *rxd )
  1469.             {
  1470.                 /* set your DEFAULTS here */
  1471.             }
  1472.             break;
  1473.             
  1474.         case RXIF_ACTION:
  1475.             /* Insert your CODE here */
  1476.             rd->rc = 1;
  1477.             rd->rc2 = MatchPalette(*rd->arg.red,
  1478.                                       *rd->arg.green,
  1479.                                       *rd->arg.blue,
  1480.                                       (rd->arg.notbackground != FALSE),NULL, NULL);
  1481.             HandleToolBox(rd->rc2 + 100);
  1482.             break;
  1483.         
  1484.         case RXIF_FREE:
  1485.             /* FREE your local data here */
  1486.             FreeVec( rd );
  1487.             break;
  1488.     }
  1489.     return;
  1490. }
  1491. /* $ARB: E 41 SETUSERFCOLOR */
  1492.  
  1493. /* $ARB: B 42 SETUSERBCOLOR */
  1494. void rx_setuserbcolor( struct RexxHost *host, struct rxd_setuserbcolor **rxd, long action, struct RexxMsg *rexxmsg )
  1495. {
  1496.     struct rxd_setuserbcolor *rd = *rxd;
  1497.  
  1498.     switch( action )
  1499.     {
  1500.         case RXIF_INIT:
  1501.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1502.             if( rd = *rxd )
  1503.             {
  1504.                 /* set your DEFAULTS here */
  1505.             }
  1506.             break;
  1507.             
  1508.         case RXIF_ACTION:
  1509.             /* Insert your CODE here */
  1510.             rd->rc = PState.uwBColor;
  1511.             break;
  1512.         
  1513.         case RXIF_FREE:
  1514.             /* FREE your local data here */
  1515.             FreeVec( rd );
  1516.             break;
  1517.     }
  1518.     return;
  1519. }
  1520. /* $ARB: E 42 SETUSERBCOLOR */
  1521.  
  1522. /* $ARB: B 43 REMOTEREXXCOMMAND */
  1523. void rx_remoterexxcommand( struct RexxHost *host, struct rxd_remoterexxcommand **rxd, long action, struct RexxMsg *rexxmsg )
  1524. {
  1525.     struct rxd_remoterexxcommand *rd = *rxd;
  1526.  
  1527.     switch( action )
  1528.     {
  1529.         case RXIF_INIT:
  1530.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1531.             if( rd = *rxd )
  1532.             {
  1533.                 /* set your DEFAULTS here */
  1534.             }
  1535.             break;
  1536.             
  1537.         case RXIF_ACTION:
  1538.             /* Insert your CODE here */
  1539.             if ((BNetConnect == FALSE) || ((strlen(rd->arg.message)+strlen(rd->arg.file)) > 250))
  1540.                 rd->rc = 0;
  1541.             else
  1542.             {
  1543.                 rd->rc = 1;
  1544.                       sprintf(szSendString,"%sÈ%s", rd->arg.message, rd->arg.file);
  1545.                 OutputAction(FROM_REXX, COMMAND, COMMAND_SENDSTRING, STRING_REXXCOMMAND, NOP_PAD, NOP_PAD, DEST_PEER);
  1546.             }
  1547.             break;
  1548.         
  1549.         case RXIF_FREE:
  1550.             /* FREE your local data here */
  1551.             FreeVec( rd );
  1552.             break;
  1553.     }
  1554.     return;
  1555. }
  1556. /* $ARB: E 43 REMOTEREXXCOMMAND */
  1557.  
  1558. /* $ARB: B 44 SETUSERFPEN */
  1559. void rx_setuserfpen( struct RexxHost *host, struct rxd_setuserfpen **rxd, long action, struct RexxMsg *rexxmsg )
  1560. {
  1561.     struct rxd_setuserfpen *rd = *rxd;
  1562.  
  1563.     switch( action )
  1564.     {
  1565.         case RXIF_INIT:
  1566.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1567.             if( rd = *rxd )
  1568.             {
  1569.                 /* set your DEFAULTS here */
  1570.             }
  1571.             break;
  1572.             
  1573.         case RXIF_ACTION:
  1574.             /* Insert your CODE here */
  1575.             if ((*rd->arg.pen >= 0)&&(*rd->arg.pen < (1<<PState.ubDepth)))
  1576.             {
  1577.                 HandleToolBox(*rd->arg.pen + 100);
  1578.                 rd->rc = 1;
  1579.             }
  1580.             else
  1581.                 rd->rc = 0;
  1582.             break;
  1583.         
  1584.         case RXIF_FREE:
  1585.             /* FREE your local data here */
  1586.             FreeVec( rd );
  1587.             break;
  1588.     }
  1589.     return;
  1590. }
  1591. /* $ARB: E 44 SETUSERFPEN */
  1592.  
  1593. /* $ARB: B 45 SETUSERBPEN */
  1594. void rx_setuserbpen( struct RexxHost *host, struct rxd_setuserbpen **rxd, long action, struct RexxMsg *rexxmsg )
  1595. {
  1596.     struct rxd_setuserbpen *rd = *rxd;
  1597.  
  1598.     switch( action )
  1599.     {
  1600.         case RXIF_INIT:
  1601.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1602.             if( rd = *rxd )
  1603.             {
  1604.                 /* set your DEFAULTS here */
  1605.             }
  1606.             break;
  1607.             
  1608.         case RXIF_ACTION:
  1609.             /* Insert your CODE here */
  1610.             rd->rc = 0;
  1611.             break;
  1612.         
  1613.         case RXIF_FREE:
  1614.             /* FREE your local data here */
  1615.             FreeVec( rd );
  1616.             break;
  1617.     }
  1618.     return;
  1619. }
  1620. /* $ARB: E 45 SETUSERBPEN */
  1621.  
  1622. /* $ARB: B 46 SETUSERTOOL */
  1623. void rx_setusertool( struct RexxHost *host, struct rxd_setusertool **rxd, long action, struct RexxMsg *rexxmsg )
  1624. {
  1625.     struct rxd_setusertool *rd = *rxd;
  1626.  
  1627.     switch( action )
  1628.     {
  1629.         case RXIF_INIT:
  1630.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1631.             if( rd = *rxd )
  1632.             {
  1633.                 /* set your DEFAULTS here */
  1634.             }
  1635.             break;
  1636.             
  1637.         case RXIF_ACTION:
  1638.             /* Insert your CODE here */
  1639.             if (((*rd->arg.tool >= 0)&&(*rd->arg.tool <= 6)) ||
  1640.                 ((*rd->arg.tool == 13)||(*rd->arg.tool == 14)))
  1641.             {
  1642.                 rd->rc = 1;
  1643.                 HandleToolBox(*rd->arg.tool);
  1644.             }
  1645.             else
  1646.                 rd->rc = 0;
  1647.             break;
  1648.         
  1649.         case RXIF_FREE:
  1650.             /* FREE your local data here */
  1651.             FreeVec( rd );
  1652.             break;
  1653.     }
  1654.     return;
  1655. }
  1656. /* $ARB: E 46 SETUSERTOOL */
  1657.  
  1658. /* $ARB: B 47 SETTOOLBEHAVIOR */
  1659. void rx_settoolbehavior( struct RexxHost *host, struct rxd_settoolbehavior **rxd, long action, struct RexxMsg *rexxmsg )
  1660. {
  1661.     struct rxd_settoolbehavior *rd = *rxd;
  1662.  
  1663.     switch( action )
  1664.     {
  1665.         case RXIF_INIT:
  1666.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1667.             if( rd = *rxd )
  1668.             {
  1669.                 /* set your DEFAULTS here */
  1670.             }
  1671.             break;
  1672.             
  1673.         case RXIF_ACTION:
  1674.             /* Insert your CODE here */
  1675.             rd->rc = 0;
  1676.             break;
  1677.         
  1678.         case RXIF_FREE:
  1679.             /* FREE your local data here */
  1680.             FreeVec( rd );
  1681.             break;
  1682.     }
  1683.     return;
  1684. }
  1685. /* $ARB: E 47 SETTOOLBEHAVIOR */
  1686.  
  1687. /* $ARB: B 48 GETVERSION */
  1688. void rx_getversion( struct RexxHost *host, struct rxd_getversion **rxd, long action, struct RexxMsg *rexxmsg )
  1689. {
  1690.     struct rxd_getversion *rd = *rxd;
  1691.  
  1692.     switch( action )
  1693.     {
  1694.         case RXIF_INIT:
  1695.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1696.             break;
  1697.             
  1698.         case RXIF_ACTION:
  1699.             /* Insert your CODE here */
  1700.             rd->res.version = szVersionString+5;
  1701.             break;
  1702.         
  1703.         case RXIF_FREE:
  1704.             /* FREE your local data here */
  1705.             FreeVec( rd );
  1706.             break;
  1707.     }
  1708.     return;
  1709. }
  1710. /* $ARB: E 48 GETVERSION */
  1711.  
  1712. /* $ARB: B 51 DISPLAYBEEP */
  1713. void rx_displaybeep( struct RexxHost *host, struct rxd_displaybeep **rxd, long action, struct RexxMsg *rexxmsg )
  1714. {
  1715.     struct rxd_displaybeep *rd = *rxd;
  1716.  
  1717.     switch( action )
  1718.     {
  1719.         case RXIF_INIT:
  1720.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1721.             if( rd = *rxd )
  1722.             {
  1723.                 /* set your DEFAULTS here */
  1724.             }
  1725.             break;
  1726.             
  1727.         case RXIF_ACTION:
  1728.             /* Insert your CODE here */
  1729.             
  1730.             /* Default is local only */
  1731.             if ((rd->arg.local == 0)&&(rd->arg.remote == 0)) rd->arg.local = 1;
  1732.             
  1733.             if (rd->arg.remote != 0)
  1734.                 OutputAction(FROM_REXX, COMMAND, COMMAND_BEEP, NOP_PAD, NOP_PAD, NOP_PAD, DEST_PEER);
  1735.  
  1736.             if (rd->arg.local != 0) DisplayBeep(Scr);
  1737.             
  1738.             rd->rc = 0;
  1739.             break;
  1740.         
  1741.         case RXIF_FREE:
  1742.             /* FREE your local data here */
  1743.             FreeVec( rd );
  1744.             break;
  1745.     }
  1746.     return;
  1747. }
  1748. /* $ARB: E 51 DISPLAYBEEP */
  1749.  
  1750. /* $ARB: B 53 GETPIXEL */
  1751. void rx_getpixel( struct RexxHost *host, struct rxd_getpixel **rxd, long action, struct RexxMsg *rexxmsg )
  1752. {
  1753.     struct rxd_getpixel *rd = *rxd;
  1754.     int x,y;
  1755.     
  1756.     switch( action )
  1757.     {
  1758.         case RXIF_INIT:
  1759.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1760.             if( rd = *rxd )
  1761.             {
  1762.                 /* set your DEFAULTS here */
  1763.             }
  1764.             break;
  1765.             
  1766.         case RXIF_ACTION:
  1767.             /* Insert your CODE here */
  1768.             x = *rd->arg.x;
  1769.             y = *rd->arg.y;
  1770.             FixCoords(&x, &y);
  1771.             if (FixPos(&x, &y) == TRUE)
  1772.             {
  1773.                 rd->rc2 = ReadPixel(DrawWindow->RPort, x, y);
  1774.                 rd->rc = 1;
  1775.             }
  1776.             else
  1777.             {
  1778.                 rd->rc = 0;
  1779.                 rd->rc2 = -1;
  1780.             }
  1781.             break;
  1782.         
  1783.         case RXIF_FREE:
  1784.             /* FREE your local data here */
  1785.             FreeVec( rd );
  1786.             break;
  1787.     }
  1788.     return;
  1789. }
  1790. /* $ARB: E 53 GETPIXEL */
  1791.  
  1792. /* $ARB: B 54 BREAKAREXXSCRIPTS */
  1793. void rx_breakarexxscripts( struct RexxHost *host, struct rxd_breakarexxscripts **rxd, long action, struct RexxMsg *rexxmsg )
  1794. {
  1795.     struct rxd_breakarexxscripts *rd = *rxd;
  1796.  
  1797.     switch( action )
  1798.     {
  1799.         case RXIF_INIT:
  1800.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1801.             break;
  1802.             
  1803.         case RXIF_ACTION:
  1804.             /* Insert your CODE here */
  1805.             BreakRexxScripts();        
  1806.             rd->rc = 1;
  1807.             break;
  1808.         
  1809.         case RXIF_FREE:
  1810.             /* FREE your local data here */
  1811.             FreeVec( rd );
  1812.             break;
  1813.     }
  1814.     return;
  1815. }
  1816. /* $ARB: E 54 BREAKAREXXSCRIPTS */
  1817.  
  1818. /* $ARB: B 55 SETRASTER */
  1819. void rx_setraster( struct RexxHost *host, struct rxd_setraster **rxd, long action, struct RexxMsg *rexxmsg )
  1820. {
  1821.     struct rxd_setraster *rd = *rxd;
  1822.     int x,y;
  1823.     
  1824.     switch( action )
  1825.     {
  1826.         case RXIF_INIT:
  1827.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1828.             if( rd = *rxd )
  1829.             {
  1830.                 /* set your DEFAULTS here */
  1831.             }
  1832.             break;
  1833.             
  1834.         case RXIF_ACTION:
  1835.             /* Insert your CODE here */
  1836.             x = *rd->arg.x;
  1837.             y = *rd->arg.y;
  1838.             FixCoords(&x, &y);
  1839.             PState.RexxRaster.nRX                 = x;
  1840.             PState.RexxRaster.nRY                 = y;
  1841.             PState.RexxRaster.nRWidth         = *rd->arg.width;
  1842.             PState.RexxRaster.nRHeight         = *rd->arg.height;
  1843.             PState.RexxRaster.nRCurrentOffset   = *rd->arg.offset;
  1844.             
  1845.             /* See if raster is entirely on screen */
  1846.             rd->rc = FixPos(&x, &y);
  1847.             
  1848.             /* check lower right corner */
  1849.             x = PState.RexxRaster.nRX + *rd->arg.width - 1;
  1850.             y = PState.RexxRaster.nRY + *rd->arg.height - 1;
  1851.             rd->rc &= FixPos(&x, &y);            
  1852.                 
  1853.             /* We'll have to hack the OutputAction command to automatically use RexxRaster info */
  1854.             OutputAction(FROM_REXX, COMMAND, COMMAND_SETRASTER, NOP_PAD, NOP_PAD, NOP_PAD, DEST_PEER|DEST_FILE);
  1855.             break;
  1856.             
  1857.         case RXIF_FREE:
  1858.             /* FREE your local data here */
  1859.             FreeVec( rd );
  1860.             break;
  1861.     }
  1862.     return;
  1863. }
  1864. /* $ARB: E 55 SETRASTER */
  1865.  
  1866. /* $ARB: B 57 PUTRASTERPIXELS */
  1867. void rx_putrasterpixels( struct RexxHost *host, struct rxd_putrasterpixels **rxd, long action, struct RexxMsg *rexxmsg )
  1868. {
  1869.     struct rxd_putrasterpixels *rd = *rxd;
  1870.     UWORD uwColorCode;
  1871.     int nTempColor;
  1872.         
  1873.     switch( action )
  1874.     {
  1875.         case RXIF_INIT:
  1876.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1877.             if( rd = *rxd )
  1878.             {
  1879.                 /* set your DEFAULTS here */
  1880.             }
  1881.             break;
  1882.             
  1883.         case RXIF_ACTION:
  1884.             /* Insert your CODE here */
  1885.             if (rd->arg.pen == NULL)
  1886.             {
  1887.                 /* no pen?  Then just use the RGB values */
  1888.                 if ((rd->arg.red != NULL)&&(rd->arg.green != NULL)&&(rd->arg.blue != NULL))
  1889.                     uwColorCode = (*rd->arg.red << 8) | (*rd->arg.green << 4) | (*rd->arg.blue);
  1890.                 else
  1891.                     /* no RGB values?  Use current rexx foreground color */
  1892.                     uwColorCode = RGBComponents(PState.uwRexxFColor);
  1893.             }
  1894.             else
  1895.             uwColorCode = RGBComponents(*rd->arg.pen);
  1896.  
  1897.             if (PState.RexxRaster.nRX >= 0)
  1898.             {
  1899.                 nTempColor = (int) PState.uwRexxFColor;
  1900.                 DrawRasterChunk((UWORD)*rd->arg.length, uwColorCode, &PState.RexxRaster, &nTempColor);
  1901.                 PState.uwRexxFColor = nTempColor;
  1902.                 rd->rc = 1;
  1903.             }
  1904.             else rd->rc = 0;
  1905.             break;
  1906.         
  1907.         case RXIF_FREE:
  1908.             /* FREE your local data here */
  1909.             FreeVec( rd );
  1910.             break;
  1911.     }
  1912.     return;
  1913. }
  1914. /* $ARB: E 57 PUTRASTERPIXELS */
  1915.  
  1916. /* $ARB: B 58 LOADIFF */
  1917. void rx_loadiff( struct RexxHost *host, struct rxd_loadiff **rxd, long action, struct RexxMsg *rexxmsg )
  1918. {
  1919.     struct rxd_loadiff *rd = *rxd;
  1920.  
  1921.     switch( action )
  1922.     {
  1923.         case RXIF_INIT:
  1924.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1925.             if( rd = *rxd )
  1926.             {
  1927.                 /* set your DEFAULTS here */
  1928.             }
  1929.             break;
  1930.             
  1931.         case RXIF_ACTION:
  1932.             /* Insert your CODE here */
  1933.             rd->rc = 0;
  1934.             BRexxExpand       = (rd->arg.expand      != NULL);
  1935.             BRexxProtectInter = (rd->arg.protectgui  != NULL);
  1936.             BRexxLoadPalette  = (rd->arg.loadpalette != NULL);
  1937.  
  1938.             if ((rd->arg.file != NULL)&&(LoadUserIFFNamed(FROM_REXX,rd->arg.file) == TRUE))
  1939.             {
  1940.                 if (BIFFLoadPending == TRUE)
  1941.                 {            
  1942.                     /* hold off reply until we hear back */
  1943.                     PState.uwRexxWaitMask |= REXX_REPLY_IFFLOAD;
  1944.                 }
  1945.             }    
  1946.             break;
  1947.         
  1948.         case RXIF_FREE:
  1949.             /* FREE your local data here */
  1950.             FreeVec( rd );
  1951.             break;
  1952.     }
  1953.     return;
  1954. }
  1955. /* $ARB: E 58 LOADIFF */
  1956.  
  1957. /* $ARB: B 59 SAVEIFF */
  1958. void rx_saveiff( struct RexxHost *host, struct rxd_saveiff **rxd, long action, struct RexxMsg *rexxmsg )
  1959. {
  1960.     struct rxd_saveiff *rd = *rxd;
  1961.  
  1962.     switch( action )
  1963.     {
  1964.         case RXIF_INIT:
  1965.             *rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
  1966.             if( rd = *rxd )
  1967.             {
  1968.                 /* set your DEFAULTS here */
  1969.             }
  1970.             break;
  1971.             
  1972.         case RXIF_ACTION:
  1973.             /* Insert your CODE here */
  1974.             rd->rc = 0;
  1975.             if (rd->arg.file != NULL)
  1976.             {
  1977.                 rd->rc = SaveUserIFFNamed(rd->arg.file);
  1978.             }
  1979.             break;
  1980.         
  1981.         case RXIF_FREE:
  1982.             /* FREE your local data here */
  1983.             FreeVec( rd );
  1984.             break;
  1985.     }
  1986.     return;
  1987. }
  1988. /* $ARB: E 59 SAVEIFF */
  1989.  
  1990.  
  1991. #ifndef RX_ALIAS_C
  1992. char *ExpandRXCommand( struct RexxHost *host, char *command )
  1993. {
  1994.     /* Insert your ALIAS-HANDLER here */
  1995.     return( NULL );
  1996. }
  1997. #endif
  1998.  
  1999.