home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / wl_active.h < prev    next >
C/C++ Source or Header  |  1995-07-03  |  2KB  |  79 lines

  1. /* Copyright 1989 GROUPE BULL -- See license conditions in file COPYRIGHT
  2.  * Copyright 1989 Massachusetts Institute of Technology
  3.  */
  4. /************************\
  5. *              *
  6. *  WOOL_OBJECT  Active     *
  7. *  DEFINITIONS         *
  8. *              *
  9. \************************/
  10.  
  11. #ifndef INCLUDE_WL_ACTIVE_H
  12. #define INCLUDE_WL_ACTIVE_H
  13.  
  14. /* type */
  15.  
  16. typedef struct _WOOL_Active {
  17.     WOOL_HEADER;
  18.     WOOL_METHOD  get;        /* function called when got */
  19.     char            p_name[1];    /* same as for atoms */
  20. }              *WOOL_Active;
  21.  
  22. /* we need to store the set object without perturbing the name homogeneity */
  23.  
  24. typedef struct _WOOL_Active_internal {
  25.     WOOL_METHOD  set;        /* function called when set */
  26.     WOOL_HEADER;
  27.     WOOL_METHOD  get;        /* function called when got */
  28.     char            p_name[1];    /* same as for atoms */
  29. }              *WOOL_Active_internal;
  30.  
  31. /* macro to access the set field */
  32.  
  33. #define ActiveSet(a) \
  34.     (((WOOL_Active_internal) (((char *) a) - \
  35.     (sizeof(struct _WOOL_Active_internal) - \
  36.     sizeof(struct _WOOL_Active)))) -> set)
  37.  
  38. /* exported functions */
  39.  
  40. EXT WOOL_Active wool_active_make();
  41. EXT WOOL_Active wool_func_active_make();
  42. EXT WOOL_OBJECT  WLActive_eval();
  43. EXT WOOL_OBJECT  WLActive_execute();
  44. EXT WOOL_OBJECT  WLActive_set();
  45. EXT WOOL_OBJECT  WLActive_setq();
  46. EXT WOOL_OBJECT  WLActive_get_C_value();
  47.  
  48. /* methods */
  49.  
  50. EXT WOOL_METHOD WLActive[]
  51. #ifdef DO_INIT
  52. = {
  53.    (WOOL_METHOD) 0,        /* METHODS_ARRAY */
  54.    WLActive_eval,        /* WOOL_eval 1 */
  55.    WLAtom_print,        /* WOOL_print 2 */
  56.    WLAtom_free,            /* same error as to free an atom */
  57.    WLActive_execute,        /* WOOL_execute 4 */
  58.    WLActive_set,        /* WOOL_set 5 */
  59.    WLActive_get_C_value,    /* WOOL_get_C_value 6 */
  60.    wool_undefined_method_1,    /* WOOL_open 7 */
  61.    wool_undefined_method_1,    /* WOOL_close 8 */
  62.    wool_undefined_method_2,    /* WOOL_process_event 9 */
  63.    wool_undefined_method_1,    /* WOOL_copy 10 */
  64.    wool_undefined_method_2,    /* WOOL_get_dimensions 11 */
  65.    wool_undefined_method_2,    /* WOOL_draw 12 */
  66.    WLAtom_equal,        /* WOOL_equal 13 */
  67.    wool_undefined_method_2,
  68.    WLActive_setq,               /* WOOL_setq 15 */
  69.    wool_undefined_method_1,
  70.    WLActive_eval,
  71.    wool_undefined_method_1,
  72.    wool_undefined_method_1,
  73.    wool_undefined_method_1
  74. }
  75. #endif /* DO_INIT */
  76.                ;
  77.  
  78. #endif /* INCLUDE_WL_ACTIVE_H */
  79.