home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / include / x11 / extensions / xshm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-17  |  4.3 KB  |  166 lines

  1. /************************************************************
  2.  
  3. Copyright (c) 1989  X Consortium
  4.  
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11.  
  12. The above copyright notice and this permission notice shall be included in
  13. all copies or substantial portions of the Software.
  14.  
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  18. X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  19. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  20. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21.  
  22. Except as contained in this notice, the name of the X Consortium shall not be
  23. used in advertising or otherwise to promote the sale, use or other dealings
  24. in this Software without prior written authorization from the X Consortium.
  25.  
  26. ********************************************************/
  27.  
  28. /* THIS IS NOT AN X CONSORTIUM STANDARD */
  29.  
  30. /* $XConsortium: XShm.h,v 1.7 94/09/22 21:25:20 dpw Exp $ */
  31.  
  32. #ifndef _XSHM_H_
  33. #define _XSHM_H_
  34.  
  35. #include <X11/Xfuncproto.h>
  36.  
  37. #define X_ShmQueryVersion        0
  38. #define X_ShmAttach            1
  39. #define X_ShmDetach            2
  40. #define X_ShmPutImage            3
  41. #define X_ShmGetImage            4
  42. #define X_ShmCreatePixmap        5
  43.  
  44. #define ShmCompletion            0
  45. #define ShmNumberEvents            (ShmCompletion + 1)
  46.  
  47. #define BadShmSeg            0
  48. #define ShmNumberErrors            (BadShmSeg + 1)
  49.  
  50. typedef unsigned long ShmSeg;
  51.  
  52. #ifndef _XSHM_SERVER_
  53. typedef struct {
  54.     int    type;            /* of event */
  55.     unsigned long serial;   /* # of last request processed by server */
  56.     Bool send_event;        /* true if this came frome a SendEvent request */
  57.     Display *display;        /* Display the event was read from */
  58.     Drawable drawable;        /* drawable of request */
  59.     int major_code;        /* ShmReqCode */
  60.     int minor_code;        /* X_ShmPutImage */
  61.     ShmSeg shmseg;        /* the ShmSeg used in the request */
  62.     unsigned long offset;   /* the offset into ShmSeg used in the request */
  63. } XShmCompletionEvent;
  64.  
  65. typedef struct {
  66.     ShmSeg shmseg;    /* resource id */
  67.     int shmid;        /* kernel id */
  68.     char *shmaddr;    /* address in client */
  69.     Bool readOnly;    /* how the server should attach it */
  70. } XShmSegmentInfo;
  71.  
  72. _XFUNCPROTOBEGIN
  73.  
  74. Bool XShmQueryExtension(
  75. #if NeedFunctionPrototypes
  76.     Display*            /* dpy */
  77. #endif
  78. );
  79.  
  80. Bool XShmQueryVersion(
  81. #if NeedFunctionPrototypes
  82.     Display*        /* dpy */,
  83.     int*        /* majorVersion */,
  84.     int*        /* minorVersion */,
  85.     Bool*        /* sharedPixmaps */
  86. #endif
  87. );
  88.  
  89. int XShmPixmapFormat(
  90. #if NeedFunctionPrototypes
  91.     Display*        /* dpy */
  92. #endif
  93. );
  94.  
  95. Status XShmAttach(
  96. #if NeedFunctionPrototypes
  97.     Display*        /* dpy */,
  98.     XShmSegmentInfo*    /* shminfo */
  99. #endif
  100. );
  101.  
  102. Status XShmDetach(
  103. #if NeedFunctionPrototypes
  104.     Display*        /* dpy */,
  105.     XShmSegmentInfo*    /* shminfo */
  106. #endif
  107. );
  108.  
  109. Status XShmPutImage(
  110. #if NeedFunctionPrototypes
  111.     Display*        /* dpy */,
  112.     Drawable        /* d */,
  113.     GC            /* gc */,
  114.     XImage*        /* image */,
  115.     int            /* src_x */,
  116.     int            /* src_y */,
  117.     int            /* dst_x */,
  118.     int            /* dst_y */,
  119.     unsigned int    /* src_width */,
  120.     unsigned int    /* src_height */,
  121.     Bool        /* send_event */
  122. #endif
  123. );
  124.  
  125. Status XShmGetImage(
  126. #if NeedFunctionPrototypes
  127.     Display*        /* dpy */,
  128.     Drawable        /* d */,
  129.     XImage*        /* image */,
  130.     int            /* x */,
  131.     int            /* y */,
  132.     unsigned long    /* plane_mask */
  133. #endif
  134. );
  135.  
  136. XImage *XShmCreateImage(
  137. #if NeedFunctionPrototypes
  138.     Display*        /* dpy */,
  139.     Visual*        /* visual */,
  140.     unsigned int    /* depth */,
  141.     int            /* format */,
  142.     char*        /* data */,
  143.     XShmSegmentInfo*    /* shminfo */,
  144.     unsigned int    /* width */,
  145.     unsigned int    /* height */
  146. #endif
  147. );
  148.  
  149. Pixmap XShmCreatePixmap(
  150. #if NeedFunctionPrototypes
  151.     Display*        /* dpy */,
  152.     Drawable        /* d */,
  153.     char*        /* data */,
  154.     XShmSegmentInfo*    /* shminfo */,
  155.     unsigned int    /* width */,
  156.     unsigned int    /* height */,
  157.     unsigned int    /* depth */
  158. #endif
  159. );
  160.  
  161. _XFUNCPROTOEND
  162.  
  163. #endif
  164.  
  165. #endif
  166.