home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / c / xaes_new / routines.c < prev    next >
C/C++ Source or Header  |  1994-10-26  |  1KB  |  48 lines

  1. /********************************************************************
  2.  *                                                                0.01*
  3.  *    XAES: Special EXTINFO routines (attachment, settings, etc.)        *
  4.  *    by Ken Hollis                                                    *
  5.  *                                                                    *
  6.  *    Copyright (C) 1994, Bitgate Software.                            *
  7.  *                                                                    *
  8.  *    These are the routines that are called only if you attach a        *
  9.  *    routine to an object.  These are the very first preliminaries    *
  10.  *    for the Windows-type Object Oriented routines.  At least they    *
  11.  *    work!  Unfortunately, though, they only work for EXTINFO-type    *
  12.  *    objects.  This will change soon, I hope...                        *
  13.  *                                                                    *
  14.  ********************************************************************/
  15.  
  16. #include <string.h>
  17. #include <stddef.h>
  18. #include <stdlib.h>
  19. #include <stdio.h>
  20. #include <stdarg.h>
  21. #include "xaes.h"
  22.  
  23. GLOBAL BOOL WAttachCode(int typ, OBJECT *obj, int object, void *rout)
  24. {
  25.     if ((obj[object].ob_type & 0xFF) == G_USERDEF) {
  26.         EXTINFO *ex = (EXTINFO *)(obj[object].ob_spec.userblk->ub_parm);
  27.  
  28.         switch(typ) {
  29.             case MOUSE_DOWN:
  30.                 ex->te_routines.mouse_down = rout;
  31.                 break;
  32.  
  33.             case MOUSE_UP:
  34.                 ex->te_routines.mouse_up = rout;
  35.                 break;
  36.  
  37.             case MOUSE_MOVE:
  38.                 ex->te_routines.mouse_move = rout;
  39.                 break;
  40.  
  41.             case MOUSE_CLICK:
  42.                 ex->te_routines.mouse_click = rout;
  43.                 break;
  44.         }
  45.         return TRUE;
  46.     } else
  47.         return FALSE;
  48. }