home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / mpegplay.zip / XSTUB.H < prev   
C/C++ Source or Header  |  1994-02-16  |  4KB  |  156 lines

  1. /*
  2.  
  3. xstub.h - Interface to stub of XWindows
  4.  
  5. */
  6.  
  7. #ifndef XSTUB_H
  8. #define XSTUB_H
  9.  
  10. /* @@@ See comment accompanying definition of pixel array */
  11. #ifdef OS2
  12. #define PIXEL(p) p
  13. #else
  14. #define PIXEL(p) pixel[p]
  15. #endif
  16.  
  17. /* Bits from TCP/IP headers */
  18. unsigned long lswap(unsigned long);
  19. #define htonl(x)   (lswap(x))
  20. #define bzero(x,y) memset((x),'\0',(y))
  21.  
  22. typedef unsigned long unknown_t;
  23.  
  24. typedef unsigned long Display;
  25. #define    MSBFirst 1
  26. typedef struct { int byte_order, bitmap_bit_order, width, height; char *data; } XImage;
  27. typedef unsigned long Colormap;
  28. typedef unsigned long Window;
  29. typedef unsigned long Visual;
  30. typedef unsigned long XErrorEvent;
  31. typedef unsigned long GC;
  32. #define TrueColor 1
  33. #define VisualClassMask 0xff
  34. typedef struct { int class, depth; Visual *visual; } XVisualInfo;
  35. typedef struct { Colormap colormap; int background_pixel, border_pixel; } XSetWindowAttributes;
  36.  
  37. #define InputOutput 1
  38.  
  39. #define DoRed   0x01
  40. #define DoGreen 0x02
  41. #define DoBlue  0x04
  42. typedef struct { int red,green,blue,flags,pixel; } XColor;
  43.  
  44. typedef struct { Visual *visual; } XWindowAttributes;
  45.  
  46. #define PPosition 0x0001
  47. #define PSize     0x0002
  48. typedef struct { int x,y,width,height,flags; } XSizeHints;
  49.  
  50. typedef struct { int background,foreground; } XGCValues;
  51.  
  52. void XSetErrorHandler(
  53.     int (*handler)(Display *dpy, XErrorEvent *event)
  54.     );
  55.  
  56. Display *XOpenDisplay(char *name);
  57.  
  58. void XResizeWindow(Display *dpy, Window window, int w, int h);
  59.  
  60. void XFlush(Display *dpy);
  61.  
  62. Window XCreateSimpleWindow(
  63.     Display *dpy,
  64.     Window root,
  65.     int x, int y, int width, int height, int n,
  66.     unsigned int fg, unsigned int bg
  67.     );
  68.  
  69. #define    PseudoColor 1
  70. #define GrayScale   2
  71. int XMatchVisualInfo(
  72.     Display *dpy, int screen, int bpp,
  73.     int type,
  74.     XVisualInfo *vinfo
  75.     );
  76.  
  77. Colormap XDefaultColormap(Display *dpy, int screen);
  78.  
  79. int XAllocColor(Display *display, Colormap cmap, XColor *xcolor);
  80.  
  81. void XGetWindowAttributes(
  82.     Display *display, Window window,
  83.     XWindowAttributes *xwa
  84.     );
  85.  
  86. #define    AllocNone 1
  87. Colormap XCreateColormap(
  88.     Display *display, Window window,
  89.     Visual *visual, int flags
  90.     );
  91.  
  92. void XSetWindowColormap(Display *display, Window window, Colormap cmap);
  93.  
  94. #define    GCForeground 1
  95. #define GCBackground 2
  96. GC XCreateGC(
  97.     Display *display, Window window,
  98.     unknown_t flags, XGCValues *xgcv
  99.     );
  100.  
  101. #define ZPixmap 1
  102. #define    XYBitmap 2
  103. #define None ((Visual *) 0)
  104. XImage *XCreateImage(
  105.     Display *display, Visual *visual,
  106.     int depth, int flag1, int flag2, char *dummy,
  107.     int w, int h, int bpp, int zero
  108.     );
  109.  
  110. XVisualInfo *XGetVisualInfo(
  111.     Display *dpy,
  112.     int visualclassmask, XVisualInfo *vinfo, int *numitems
  113.     );
  114.  
  115. #define CWBackPixel   0x01 /* for use in mask */
  116. #define CWColormap    0x02 /* for use in mask */
  117. #define CWBorderPixel 0x04 /* for use in mask */
  118. Window XCreateWindow(
  119.     Display *dpy,
  120.     Window window,
  121.     int x, int y, int w, int h,
  122.     int one, int depth,
  123.     unsigned int class,
  124.     Visual *visual,
  125.     unsigned int mask,
  126.     XSetWindowAttributes *wswa
  127.     );
  128.  
  129. void XFreeColors(
  130.     Display *display,
  131.     Colormap cmap,
  132.     long *pixel,
  133.     int one,
  134.     int zero
  135.     );
  136.  
  137. #define XRootWindow(dpy, screen) ((Window) 0)
  138. #define RootWindow(dpy, screen) XRootWindow(dpy, screen)
  139. #define XDefaultScreen(display) 0
  140. #define    DefaultScreen(display) XDefaultScreen(display)
  141. #define DefaultRootWindow(display) RootWindow(display, DefaultScreen(display))
  142.  
  143. #define    WhitePixel(dpy, screen) 255
  144. #define BlackPixel(dpy, screen) 0
  145.  
  146. void XFree(void *ptr);
  147.  
  148. void XPutImage(
  149.     Display *display, Window window, GC gc,
  150.     XImage *ximage,
  151.     int zero1, int zero2, int zero3, int zero4,
  152.     int width, int height
  153.     );
  154.  
  155. #endif
  156.