home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xscm105.zip / xscm / x.h < prev    next >
C/C++ Source or Header  |  1992-08-29  |  2KB  |  58 lines

  1. #ifndef X__INCLUDED
  2. #define X__INCLUDED
  3.  
  4. /*
  5.  * $Header: /home/campbell/Languages/Scheme/scm/x-scm/RCS/x.h,v 1.3 1992/08/12 04:23:07 campbell Beta $
  6.  *
  7.  * Author: Larry Campbell (campbell@redsox.bsw.com)
  8.  *
  9.  * Copyright 1992 by The Boston Software Works, Inc.
  10.  * Permission to use for any purpose whatsoever granted, as long
  11.  * as this copyright notice remains intact.  Please send bug fixes
  12.  * or enhancements to the above email address.
  13.  *
  14.  * Xlib interface for scm - common definitions
  15.  */
  16.  
  17. extern SCM mark_no_further();
  18. extern sizet x_free_xevent();        /* free it if we own it */
  19.  
  20. /*
  21.  * Non-ANSI C compilers (shame on vendors still shipping them!)
  22.  * have no token-pasting operator.  Here's a substitute that
  23.  * works for most compilers.
  24.  */
  25.  
  26. #ifdef __STDC__
  27. # define TOKEN_PASTE(a,b) a##b
  28. #else
  29. # define TOKEN_PASTE(a,b) TOKEN_PASTE_(a)b
  30. # define TOKEN_PASTE_(a) a
  31. #endif
  32.  
  33. #define X_SMOBS                        \
  34. XX(xcolormap,    mark_no_further,    free0)        \
  35. XX(xdisplay,    mark_no_further,    free0)         \
  36. XX(xevent,    mark_no_further,    x_free_xevent)    \
  37. XX(xgc,        mark_no_further,    free0)        \
  38. XX(xpixmap,    mark_no_further,    free0)        \
  39. XX(xwindow,    mark_no_further,    free0)
  40.  
  41. #define XX(name, mark, free) extern long TOKEN_PASTE(tc16_,name);
  42. X_SMOBS
  43.  
  44. #define XCOLORMAPP(x) (TYP16(x) == tc16_xcolormap)
  45. #define XCOLORMAP(x) ((Colormap) CDR(x))
  46. #define XDISPLAYP(x) (TYP16(x) == tc16_xdisplay)
  47. #define XDISPLAY(x) ((Display *) CDR(x))
  48. #define XEVENTP(x) (TYP16(x) == tc16_xevent)
  49. #define XEVENT(x) ((XAnyEvent *) CDR(x))
  50. #define XGCP(x) (TYP16(x) == tc16_xgc)
  51. #define XGC(x) ((GC) CDR(x))
  52. #define XPIXMAPP(x) (TYP16(x) == tc16_xpixmap)
  53. #define XPIXMAP(x) ((Pixmap) CDR(x))
  54. #define XWINDOWP(x) (TYP16(x) == tc16_xwindow)
  55. #define XWINDOW(x) ((Window) CDR(x))
  56.  
  57. #endif /* X__INCLUDED */
  58.