home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / c / xaes_new / mouse.c < prev    next >
C/C++ Source or Header  |  1994-12-04  |  14KB  |  445 lines

  1. /********************************************************************
  2.  *                                                                1.20*
  3.  *    XAES: New mouse driver and creation                                *
  4.  *    Code by Ken Hollis, GNU C Extensions by Sascha Blank            *
  5.  *                                                                    *
  6.  *    Copyright (C) 1994, Bitgate Software                            *
  7.  *                                                                    *
  8.  *    The incredibly, revolutionary mouse routines.  These routines    *
  9.  *    are about 20 times smarter than normal GEM's routines.  They    *
  10.  *    don't flicker the mouse like normal GEM does.  What a concept.    *
  11.  *                                                                    *
  12.  ********************************************************************/
  13.  
  14. #include <aes.h>
  15. #include <stdio.h>
  16. #include <string.h>
  17. #ifdef __GNUC__
  18. #include <stdarg.h>
  19. #endif
  20.  
  21. #include "xaes.h"
  22.  
  23. #ifndef __MOUSE__
  24. #define __MOUSE__
  25. #endif
  26.  
  27. MICE mouseform;    /* forms */
  28. int cur_mouse = 1, cur_mouse_form = BUSYBEE;
  29.  
  30. int init_mouse[37] =
  31. { 8, 8, 1, 0, 1, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
  32.   0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x7FFE, 0xFFFF,
  33.   0xFFFF, 0xFFFF, 0x0000, 0x7FFE, 0x4002, 0x43C2, 0x47E2, 0x47E2,
  34.   0x43C2, 0x4002, 0x43C2, 0x4002, 0x7FFE, 0x1008, 0x2D74, 0x4002,
  35.   0x7FFE, 0x0000 };
  36.  
  37. int loadresource_mouse[37] =
  38. { 8, 8, 1, 0, 1, 0x3FFF, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
  39.   0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
  40.   0xFFFF, 0xFFFF, 0x0000, 0x1FFE, 0x28F2, 0x48F2, 0x48F2, 0x48F2,
  41.   0x4FF2, 0x4002, 0x5DDA, 0x5512, 0x59D2, 0x5452, 0x55DA, 0x4002,
  42.   0x7FFE, 0x0000 };
  43.  
  44. int lrmove_mouse[37] =
  45. { 8, 8, 1, 0, 1, 0x0000, 0x0000, 0x0000, 0x1E78, 0x3E7C, 0x7E7E,
  46.   0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x7E7E, 0x3E7C, 0x1E78, 0x0000,
  47.   0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C30, 0x1C38,
  48.   0x3C3C, 0x7FFE, 0x7FFE, 0x3C3C, 0x1C38, 0x0C30, 0x0000, 0x0000,
  49.   0x0000, 0x0000 };
  50.  
  51. int lrsize_mouse[37] =
  52. { 8, 8, 1, 0, 1, 0x081F, 0x1C1F, 0x3E3F, 0x7F7F, 0xFFFF, 0x7FFF,
  53.   0x3FFF, 0x1FFF, 0x0FFF, 0x1FFF, 0x3FFF, 0xFFFF, 0xFFFF, 0xFFFF,
  54.   0xFFFF, 0xFFFF, 0x0000, 0x080E, 0x1C0E, 0x3E2E, 0x7F6E, 0x3FEE,
  55.   0x1FEE, 0x0FEE, 0x07EE, 0x0FEE, 0x1FEE, 0x000E, 0x7FFE, 0x7FFE,
  56.   0x7FFE, 0x0000 };
  57.  
  58. int llsize_mouse[37] =
  59. { 8, 8, 1, 0, 1, 0xF810, 0xF838, 0xFC7C, 0xFEFE, 0xFFFF, 0xFFFE,
  60.   0xFFFC, 0xFFF8, 0xFFF0, 0xFFF8, 0xFFFC, 0xFFFF, 0xFFFF, 0xFFFF,
  61.   0xFFFF, 0xFFFF, 0x0000, 0x7010, 0x7038, 0x747C, 0x76FE, 0x77FC,
  62.   0x77F8, 0x77F0, 0x77E0, 0x77F0, 0x77F8, 0x7000, 0x7FFE, 0x7FFE,
  63.   0x7FFE, 0x0000 };
  64.  
  65. int ulsize_mouse[37] =
  66. { 8, 8, 1, 0, 1, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC,
  67.   0xFFF8, 0xFFF0, 0xFFF8, 0xFFFC, 0xFFFE, 0xFFFF, 0xFEFE, 0xFC7C,
  68.   0xF838, 0xF810, 0x0000, 0x7FFE, 0x7FFE, 0x7FFE, 0x7000, 0x77F8,
  69.   0x77F0, 0x77E0, 0x77F0, 0x77F8, 0x77FC, 0x76FE, 0x747C, 0x7038,
  70.   0x7010, 0x0000 };
  71.  
  72. int ursize_mouse[37] =
  73. { 8, 8, 1, 0, 1, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x3FFF,
  74.   0x1FFF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0x7F7F, 0x3E3F,
  75.   0x1C1F, 0x081F, 0x0000, 0x7FFE, 0x7FFE, 0x7FFE, 0x000E, 0x1FEE,
  76.   0x0FEE, 0x07EE, 0x0FEE, 0x1FEE, 0x3FEE, 0x7F6E, 0x3E2E, 0x1C0E,
  77.   0x080E, 0x0000 };
  78.  
  79. int udmove_mouse[37] =
  80. { 8, 8, 1, 0, 1, 0x0000, 0x03C0, 0x07E0, 0x0FF0, 0x1FF8, 0x1FF8,
  81.   0x1FF8, 0x03C0, 0x03C0, 0x1FF8, 0x1FF8, 0x1FF8, 0x0FF0, 0x07E0,
  82.   0x03C0, 0x0000, 0x0000, 0x0000, 0x0180, 0x03C0, 0x07E0, 0x0FF0,
  83.   0x0180, 0x0180, 0x0180, 0x0180, 0x0FF0, 0x07E0, 0x03C0, 0x0180,
  84.   0x0000, 0x0000 };
  85.  
  86. int help_mouse[37] =
  87. { 0, 0, 1, 0, 1, 0xC07E, 0xE0FF, 0xF0FF, 0xF8FF, 0xFCFF, 0xFE3F,
  88.   0xFF3E, 0xFFBC, 0xFFFC, 0xFFFC, 0xFE3C, 0xEF3C, 0xCF00, 0x8780,
  89.   0x0780, 0x0780, 0x0000, 0x403C, 0x607E, 0x7066, 0x780E, 0x7C1C,
  90.   0x7E18, 0x7F18, 0x7F80, 0x7C18, 0x6C18, 0x4600, 0x0600, 0x0300,
  91.   0x0300, 0x0000 };
  92.  
  93. int ibarhelp_mouse[37] =
  94. { 8, 8, 1, 0, 1, 0xFFFE, 0xFFFF, 0xFFFF, 0x3FFF, 0x1EFF, 0x1E3F,
  95.   0x1E3E, 0x1E3C, 0x1E3C, 0x1E3C, 0x1E3C, 0x1E3C, 0x3F00, 0xFFC0,
  96.   0xFFC0, 0xFFC0, 0x0000, 0x73BC, 0x1E7E, 0x0C66, 0x0C0E, 0x0C1C,
  97.   0x0C18, 0x0C18, 0x0C00, 0x0C18, 0x0C18, 0x0C00, 0x0C00, 0x1E00,
  98.   0x7380, 0x0000 };
  99.  
  100. int tsizer_mouse[37] =
  101. { 8, 8, 1, 0, 1, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0FF0,
  102.   0x1FF8, 0x3FFC, 0x7FFE, 0xFFFF, 0xFFFF, 0xFFFF, 0x07E0, 0x07E0,
  103.   0x07E0, 0x07E0, 0x0000, 0x7FFE, 0x7FFE, 0x7FFE, 0x0180, 0x03C0,
  104.   0x07E0, 0x0FF0, 0x1FF8, 0x3FFC, 0x7FFE, 0x03C0, 0x03C0, 0x03C0,
  105.   0x03C0, 0x0000 };
  106.  
  107. int lsizer_mouse[37] =
  108. { 8, 8, 1, 0, 1, 0xF870, 0xF8F0, 0xF9F0, 0xFBF0, 0xFFF0, 0xFFFF,
  109.   0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF0, 0xFBF0, 0xF9F0,
  110.   0xF8F0, 0xF870, 0x0000, 0x7020, 0x7060, 0x70E0, 0x71E0, 0x73E0,
  111.   0x77FE, 0x7FFE, 0x7FFE, 0x77FE, 0x73E0, 0x71E0, 0x70E0, 0x7060,
  112.   0x7020, 0x0000 };
  113.  
  114. int rsizer_mouse[37] =
  115. { 8, 8, 1, 0, 1, 0x0E1F, 0x0F1F, 0x0F9F, 0x0FDF, 0x0FFF, 0xFFFF,
  116.   0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0FFF, 0x0FDF, 0x0F9F,
  117.   0x0F1F, 0x0E1F, 0x0000, 0x040E, 0x060E, 0x070E, 0x078E, 0x07CE,
  118.   0x7FEE, 0x7FFE, 0x7FFE, 0x7FEE, 0x07CE, 0x078E, 0x070E, 0x060E,
  119.   0x040E, 0x0000 };
  120.  
  121. int bsizer_mouse[37] =
  122. { 8, 8, 1, 0, 1, 0x07E0, 0x07E0, 0x07E0, 0x07E0, 0xFFFF, 0xFFFF,
  123.   0xFFFF, 0x7FFE, 0x3FFC, 0x1FF8, 0x0FF0, 0xFFFF, 0xFFFF, 0xFFFF,
  124.   0xFFFF, 0xFFFF, 0x0000, 0x03C0, 0x03C0, 0x03C0, 0x03C0, 0x7FFE,
  125.   0x3FFC, 0x1FF8, 0x0FF0, 0x07E0, 0x03C0, 0x0180, 0x7FFE, 0x7FFE,
  126.   0x7FFE, 0x0000 };
  127.  
  128. int mover_mouse[37] =
  129. { 8, 8, 1, 0, 1, 0x0380, 0x07C0, 0x0FE0, 0x0FE0, 0x37D8, 0x7FFC,
  130.   0xFFFE, 0xFFFF, 0xFFFE, 0x7FFC, 0x37D8, 0x0FE0, 0x0FE0, 0x07C0,
  131.   0x0380, 0x0100, 0x0100, 0x0380, 0x07C0, 0x0380, 0x0380, 0x2388,
  132.   0x7FFC, 0xFFFE, 0x7FFC, 0x2388, 0x0380, 0x0380, 0x07C0, 0x0380,
  133.   0x0100, 0x0000 };
  134.  
  135. int nomodal_mouse[37] =
  136. { 8, 8, 1, 0, 1, 0x03C0, 0x0FF0, 0x1FF8, 0x3FFC, 0x7FFE, 0x7FFE,
  137.   0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x7FFE, 0x7FFE, 0x3FFC, 0x1FF8,
  138.   0x0FF0, 0x03C0, 0x0000, 0x03C0, 0x0FF0, 0x1FF8, 0x3E7C, 0x38FC,
  139.   0x79FE, 0x73EE, 0x77CE, 0x7F9E, 0x3F1C, 0x3E7C, 0x1FF8, 0x0FF0,
  140.   0x03C0, 0x0000 };
  141.  
  142. int nowindow_mouse[37] =
  143. { 8, 8, 1, 0, 1, 0x1008, 0x381C, 0x7C3E, 0xFE7F, 0x7FFE, 0x3FFC,
  144.   0x1FF8, 0x0FF0, 0x0FF0, 0x1FF8, 0x3FFC, 0x7FFE, 0xFE7F, 0x7C3E,
  145.   0x381C, 0x1008, 0x0000, 0x1008, 0x381C, 0x7C3E, 0x3E7C, 0x1FF8,
  146.   0x0FF0, 0x07E0, 0x07E0, 0x0FF0, 0x1FF8, 0x3E7C, 0x7C3E, 0x381C,
  147.   0x1008, 0x0000 };
  148.  
  149. /*
  150.  *    Custom mouse routine
  151.  *    by Ken Hollis
  152.  *
  153.  *    Returns: (0) on any type of failure
  154.  *             (-1) on successful custom mouse transaction
  155.  *             (any other number) to report the mouse result or a
  156.  *                                successful AES mouse transaction
  157.  */
  158. GLOBAL int WGrafMouse(int mo_sfield, ...)
  159. {
  160.     va_list    argptr;
  161.     int    mform, store;
  162.  
  163.     switch(mo_sfield) {
  164.         case GET_MOUSE:
  165.             va_start(argptr, mo_sfield);
  166.             mform = va_arg(argptr, int);
  167.             store = va_arg(argptr, int);
  168.             va_end(argptr);
  169.  
  170.             if (mouseform.forms[cur_mouse]!=0) {
  171.                 if (store) cur_mouse_form = (mouseform.forms[cur_mouse] == 0) ? cur_mouse_form : mouseform.forms[cur_mouse];
  172.                 return((mouseform.forms[cur_mouse] == 0) ? 0 : mouseform.forms[cur_mouse]);
  173.             } else
  174.                 return(0);
  175.  
  176.         case SAVE_MOUSE:
  177.             va_start(argptr, mo_sfield);
  178.             mform = va_arg(argptr, int);
  179.             store = va_arg(argptr, int);
  180.             va_end(argptr);
  181.  
  182.             if (cur_mouse==16)
  183.                 return(0);
  184.             else {
  185.                 if (store) cur_mouse_form = mform;
  186.                 mouseform.forms[cur_mouse++] = mform;
  187.             }
  188.  
  189.             return(-1);
  190.  
  191.         case PREV_MOUSE:
  192.             va_start(argptr, mo_sfield);
  193.             mform = va_arg(argptr, int);
  194.             store = va_arg(argptr, int);
  195.             va_end(argptr);
  196.  
  197.             if (cur_mouse==1)
  198.                 return(0);
  199.             else {
  200.                 if (store) cur_mouse_form = (mouseform.forms[(cur_mouse-1)] == 0) ? cur_mouse_form : mouseform.forms[(cur_mouse-1)];
  201.                 return((mouseform.forms[(cur_mouse-1)] == 0) ? 0 : mouseform.forms[(cur_mouse-1)]);
  202.             }
  203.  
  204.         case NEXT_MOUSE:
  205.             va_start(argptr, mo_sfield);
  206.             mform = va_arg(argptr, int);
  207.             store = va_arg(argptr, int);
  208.             va_end(argptr);
  209.  
  210.             if (cur_mouse==16)
  211.                 return(0);
  212.             else {
  213.                 if (store) cur_mouse_form = (mouseform.forms[(cur_mouse+1)] == 0) ? cur_mouse_form : mouseform.forms[(cur_mouse+1)];
  214.                 return((mouseform.forms[(cur_mouse+1)] == 0) ? 0 : mouseform.forms[(cur_mouse+1)]);
  215.             }
  216.  
  217.         case FIRST_MOUSE:
  218.             va_start(argptr, mo_sfield);
  219.             mform = va_arg(argptr, int);
  220.             store = va_arg(argptr, int);
  221.             va_end(argptr);
  222.  
  223.             if (cur_mouse==1) {
  224.                 if (store) cur_mouse_form = (mouseform.forms[cur_mouse] == 0) ? cur_mouse_form : mouseform.forms[cur_mouse];
  225.                 return((mouseform.forms[cur_mouse] == 0) ? 0 : mouseform.forms[cur_mouse]);
  226.             } else {
  227.                 if (store) cur_mouse_form = (mouseform.forms[1] == 0) ? cur_mouse_form : mouseform.forms[1];
  228.                 return((mouseform.forms[1] == 0) ? 0 : mouseform.forms[1]);
  229.             }
  230.  
  231.         case LAST_MOUSE:
  232.             {
  233.                 int pos = 1;
  234.  
  235.                 va_start(argptr, mo_sfield);
  236.                 mform = va_arg(argptr, int);
  237.                 store = va_arg(argptr, int);
  238.                 va_end(argptr);
  239.  
  240.                 do {
  241.                     if(mouseform.forms[pos]!=0) pos++;
  242.                     else {
  243.                         if (store) cur_mouse_form = mouseform.forms[pos];
  244.                         return(mouseform.forms[pos]);
  245.                     }
  246.                 } while(pos<16);
  247.  
  248.                 return(0);
  249.             }
  250.  
  251.         case CLEAR_MOUSE:
  252.             {
  253.                 int pos = 1;
  254.  
  255.                 do {
  256.                     mouseform.forms[pos++] = 0;
  257.                 } while(pos<16);
  258.  
  259.                 return(-1);
  260.             }
  261.  
  262.         case FIND_MOUSE:
  263.             {
  264.                 int pos = 1;
  265.  
  266.                 va_start(argptr, mo_sfield);
  267.                 mform = va_arg(argptr, int);
  268.                 store = va_arg(argptr, int);
  269.                 va_end(argptr);
  270.  
  271.                 do {
  272.                     if(mouseform.forms[pos]==mform) {
  273.                         if (store) cur_mouse_form = mouseform.forms[pos];
  274.                         return(pos);
  275.                     } else pos++;
  276.                 } while(pos<16);
  277.  
  278.                 return(0);
  279.             }
  280.  
  281.         case NEWPOS_MOUSE:
  282.             va_start(argptr, mo_sfield);
  283.             mform = va_arg(argptr, int);
  284.             va_end(argptr);
  285.  
  286.             cur_mouse = mform;
  287.  
  288.             return(-1);
  289.  
  290.         case TEXT_CRSR:
  291.         case BUSYBEE:
  292.         case POINT_HAND:
  293.         case FLAT_HAND:
  294.         case THIN_CROSS:
  295.         case THICK_CROSS:
  296.         case OUTLN_CROSS:
  297.         case M_OFF:
  298.         case M_ON:
  299.             if (cur_mouse_form != mo_sfield) {
  300.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  301.                 return(graf_mouse(mo_sfield, 0L));
  302.             }
  303.             break;
  304.  
  305.         case ARROW:
  306.             if (cur_mouse_form != mo_sfield) {
  307.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  308.                 helpmode = FALSE;
  309.                 if (helpmode)
  310.                     return(graf_mouse(USER_DEF, (MFORM *) help_mouse));
  311.                 else
  312.                     return(graf_mouse(mo_sfield, 0L));
  313.             }
  314.             break;
  315.  
  316.         case INIT_MOUSE:
  317.             if (cur_mouse_form != mo_sfield) {
  318.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  319.                 return(graf_mouse(USER_DEF, (MFORM *) init_mouse));
  320.             }
  321.             break;
  322.  
  323.         case LOAD_MOUSE:
  324.             if (cur_mouse_form != mo_sfield) {
  325.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  326.                 return(graf_mouse(USER_DEF, (MFORM *) loadresource_mouse));
  327.             }
  328.             break;
  329.  
  330.         case LRSLIDE_MOUSE:
  331.             if (cur_mouse_form != mo_sfield) {
  332.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  333.                 return(graf_mouse(USER_DEF, (MFORM *) lrmove_mouse));
  334.             }
  335.             break;
  336.  
  337.         case UDSLIDE_MOUSE:
  338.             if (cur_mouse_form != mo_sfield) {
  339.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  340.                 return(graf_mouse(USER_DEF, (MFORM *) udmove_mouse));
  341.             }
  342.             break;
  343.  
  344.         case URMOVE_MOUSE:
  345.             if (cur_mouse_form != mo_sfield) {
  346.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  347.                 return(graf_mouse(USER_DEF, (MFORM *) ursize_mouse));
  348.             }
  349.             break;
  350.  
  351.         case ULMOVE_MOUSE:
  352.             if (cur_mouse_form != mo_sfield) {
  353.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  354.                 return(graf_mouse(USER_DEF, (MFORM *) ulsize_mouse));
  355.             }
  356.             break;
  357.  
  358.         case LLMOVE_MOUSE:
  359.             if (cur_mouse_form != mo_sfield) {
  360.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  361.                 return(graf_mouse(USER_DEF, (MFORM *) llsize_mouse));
  362.             }
  363.             break;
  364.  
  365.         case LRMOVE_MOUSE:
  366.             if (cur_mouse_form != mo_sfield) {
  367.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  368.                 return(graf_mouse(USER_DEF, (MFORM *) lrsize_mouse));
  369.             }
  370.             break;
  371.  
  372.         case HELP_MOUSE:
  373.             if (cur_mouse_form != mo_sfield) {
  374.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  375.                 helpmode = TRUE;
  376.                 return(graf_mouse(USER_DEF, (MFORM *) help_mouse));
  377.             }
  378.             break;
  379.  
  380.         case IBARHELP_MOUSE:
  381.             if (cur_mouse_form != mo_sfield) {
  382.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  383.                 helpmode = TRUE;
  384.                 return(graf_mouse(USER_DEF, (MFORM *) ibarhelp_mouse));
  385.             }
  386.             break;
  387.  
  388.         case TSIZER_MOUSE:
  389.             if (cur_mouse_form != mo_sfield) {
  390.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  391.                 return(graf_mouse(USER_DEF, (MFORM *) tsizer_mouse));
  392.             }
  393.             break;
  394.  
  395.         case LSIZER_MOUSE:
  396.             if (cur_mouse_form != mo_sfield) {
  397.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  398.                 return(graf_mouse(USER_DEF, (MFORM *) lsizer_mouse));
  399.             }
  400.             break;
  401.  
  402.         case RSIZER_MOUSE:
  403.             if (cur_mouse_form != mo_sfield) {
  404.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  405.                 return(graf_mouse(USER_DEF, (MFORM *) rsizer_mouse));
  406.             }
  407.             break;
  408.  
  409.         case BSIZER_MOUSE:
  410.             if (cur_mouse_form != mo_sfield) {
  411.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  412.                 return(graf_mouse(USER_DEF, (MFORM *) bsizer_mouse));
  413.             }
  414.             break;
  415.  
  416.         case MOVER_MOUSE:
  417.             if (cur_mouse_form != mo_sfield) {
  418.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  419.                 return(graf_mouse(USER_DEF, (MFORM *) mover_mouse));
  420.             }
  421.             break;
  422.  
  423.         case NOMODAL_MOUSE:
  424.             if (cur_mouse_form != mo_sfield) {
  425.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  426.                 return(graf_mouse(USER_DEF, (MFORM *) nomodal_mouse));
  427.             }
  428.             break;
  429.  
  430.         case NOWINDOW_MOUSE:
  431.             if (cur_mouse_form != mo_sfield) {
  432.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  433.                 return(graf_mouse(USER_DEF, (MFORM *) nowindow_mouse));
  434.             }
  435.             break;
  436.  
  437.         default:
  438.             if (cur_mouse_form != mo_sfield) {
  439.                 mouseform.forms[cur_mouse] = cur_mouse_form = mo_sfield;
  440.                 return(graf_mouse(mo_sfield, 0L));
  441.             }
  442.             break;
  443.     }
  444.     return(-1);
  445. }