home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / ibm / AIX / AIXext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-16  |  7.5 KB  |  229 lines

  1. /*
  2.  * $XConsortium: AIXext.h,v 1.2 91/07/16 12:56:01 jap Exp $
  3.  *
  4.  * Copyright IBM Corporation 1987,1988,1989,1990,1991
  5.  *
  6.  * All Rights Reserved
  7.  *
  8.  * License to use, copy, modify, and distribute this software and its
  9.  * documentation for any purpose and without fee is hereby granted,
  10.  * provided that the above copyright notice appear in all copies and that
  11.  * both that copyright notice and this permission notice appear in
  12.  * supporting documentation, and that the name of IBM not be
  13.  * used in advertising or publicity pertaining to distribution of the
  14.  * software without specific, written prior permission.
  15.  *
  16.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  17.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS, AND 
  18.  * NONINFRINGEMENT OF THIRD PARTY RIGHTS, IN NO EVENT SHALL
  19.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  20.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23.  * SOFTWARE.
  24.  *
  25. */
  26.  
  27. #ifndef _AIXEXT_H
  28. #define _AIXEXT_H
  29.  
  30. #include "pixmapstr.h"
  31. #include "miscstruct.h"
  32.  
  33. typedef struct _AIXInfoRec {
  34. int kbdid;
  35. int dpsid;
  36. int displayid;
  37. int autoloadmode ;
  38. int inputfd ;
  39. int kbdiodn  ;
  40. int lociodn  ;
  41. #ifdef AIXTABLET
  42. int mouseiodn ;
  43. int tabletiodn ;
  44. #endif AIXTABLET
  45. int dialiodn ;
  46. int lpfkiodn ;
  47. int loctype  ;
  48. int whatelse[5]  ;
  49. } AIXInfoRec , *AIXInfoPtr ;
  50.  
  51. /* copy long from src to dst byteswapping on the way */
  52.  
  53. #define cpswapl(src, dst) \
  54.                  ((char *)&(dst))[0] = ((char *) &(src))[3];\
  55.                  ((char *)&(dst))[1] = ((char *) &(src))[2];\
  56.                  ((char *)&(dst))[2] = ((char *) &(src))[1];\
  57.                  ((char *)&(dst))[3] = ((char *) &(src))[0];
  58.  
  59. /* copy short from src to dst byteswapping on the way */
  60.  
  61. #define cpswaps(src, dst)\
  62.          ((char *) &(dst))[0] = ((char *) &(src))[1];\
  63.          ((char *) &(dst))[1] = ((char *) &(src))[0];
  64.  
  65. #define LengthRestB(stuff) \
  66.     (((unsigned long)stuff->length << 2) - sizeof(*stuff))
  67.  
  68. #define LengthRestS(stuff) \
  69.     (((unsigned long)stuff->length << 1) - (sizeof(*stuff) >> 1))
  70.  
  71. #define LengthRestL(stuff) \
  72.     ((unsigned long)stuff->length - (sizeof(*stuff) >> 2))
  73.  
  74. #define SwapRestS(stuff) \
  75.     SwapShorts((short *)(stuff + 1), LengthRestS(stuff))
  76.  
  77. #define SwapRestL(stuff) \
  78.     SwapLongs((long *)(stuff + 1), LengthRestL(stuff))
  79.  
  80. #define PropagateMask ( \
  81.     KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \
  82.     MotionMask )
  83.  
  84. #define WriteAIXReplyToClient(pClient, size, pReply) \
  85.    if (pClient->swapped) \
  86.       (*ReplySwapVector[((xReq *)pClient->requestBuffer)->reqType]) \
  87.            (pClient, size, pReply); \
  88.       else WriteToClient(pClient, size, (char *) pReply);
  89.  
  90. #define WriteAIXSwappedDataToClient(pClient, size, pbuf) \
  91.    if (pClient->swapped) \
  92.       (*pClient->pSwapReplyFunc)(pClient, size, pbuf); \
  93.    else WriteToClient (pClient, size, (char *) pbuf);
  94.  
  95. typedef struct _PolyMarkerState {
  96.     short int xhot, yhot;
  97.     short int  width, height;
  98.     unsigned char  *marker;
  99.     int  version;
  100.     void  (*DrawPolyMarker)();
  101.     void  (*SetPolyMarker)();
  102.     void  (*PolyMarkerDelete)();
  103.     void  (*DrawPolyMarkers)();
  104. } PolyMarkerStateRec, *PolyMarkerStatePtr;
  105.  
  106. #ifdef AIXEXTSAMPLE
  107. typedef struct _GeoTextState {
  108.     short int xhot, yhot;
  109.     void (*DrawGeoText)();
  110. } GeoTextStateRec, *GeoTextStatePtr;
  111. #endif
  112.  
  113. typedef struct _DialState {
  114.     unsigned    int     devmask ;    /* dev selection */
  115.     unsigned    int     dialmask ;    /* dial control */
  116.     char         dialmap[16] ;
  117.     unsigned    int     eventMask ;
  118.     unsigned    int    dontPropagateMask;
  119.     unsigned    int     allEventMasks ;
  120.     unsigned    int    deliverableEvents;
  121. } DialStateRec, *DialStatePtr;
  122.  
  123. typedef struct _LpfkState {
  124.     unsigned    int     devlpfkmask ;     /* dev selection */
  125.     unsigned    int     devlightmask ;    /* dev selection */
  126.     unsigned    int    lpfkmask ;        /* input control */
  127.     unsigned    int    lightmask ;       /* output control */
  128.     unsigned    int     eventMask ;
  129.     unsigned    int    dontPropagateMask;
  130.     unsigned    int     allEventMasks ;
  131.     unsigned    int    deliverableEvents;
  132. } LpfkStateRec, *LpfkStatePtr;
  133.  
  134. #ifdef AIXTABLET
  135. typedef struct _TabletState {
  136.     unsigned    int     devmask ;       /* dev selection */
  137.     unsigned    int     mode ;          /* tablet conversion mode */
  138.     unsigned    int     resolution ;    /* tablet resolution */
  139.     unsigned    int     origin ;        /* tablet coordinate origin */
  140.     unsigned    int     rate ;          /* tablet sampling rate */
  141.     unsigned    int     eventMask ;
  142.     unsigned    int     dontPropagateMask;
  143.     unsigned    int     allEventMasks ;
  144.     unsigned    int     deliverableEvents;
  145. } TabletStateRec, *TabletStatePtr;
  146. #endif AIXTABLET
  147.  
  148. typedef struct _WInterest {
  149.     struct _WInterest    *pNextWInterest;
  150.     struct _WInterest    *pLastWInterest;
  151.     int            length;        /* size */
  152.     unsigned long    owner;        /* extension id of owning extension */
  153.     unsigned long    ValInterestMask;  /* you tell me what this is for */
  154.     unsigned long    ChangeInterestMask;  /* you tell me what this is for */
  155.     Bool        (* ValidateWindow) ();
  156.     Bool        (* ChangeExtWindowAttributes) ();
  157.     Bool        (* MapWindow) (); /* give a chance to people who */
  158.     Bool        (* UnmapWindow) (); /* like to do something when */
  159.     Bool        (* CreateWindow) ();  /*  these routines got */
  160.     Bool        (* DestroyWindow) (); /* called , might be redundant */
  161.     Bool        (* PositionWindow) ();
  162.     void        (* WIProc) ();
  163.     unsigned char       *extPriv; /* aix X server internal private data */
  164. } WInterestRec;
  165.  
  166. typedef WInterestRec *WInterestPtr ;
  167.  
  168. #define    InsertWI(pWin, pWI, order, pPrevWI)    \
  169.        order(pWin,pWI,pPrevWI)
  170.  
  171. #define WI_FIRST(pWin,pWI,dummy)\
  172.     {                   \
  173.     pWI->pNextWInterest = ((aixPrivWinPtr)(pWin->devPrivate))->pNextWInterest;\
  174.     pWI->pLastWInterest = (WInterestPtr)\
  175.     &((aixPrivWinPtr)(pWin->devPrivate))->pNextWInterest ; \
  176.     ((aixPrivWinPtr)(pWin->devPrivate))->pNextWInterest->pLastWInterest = pWI; \
  177.     ((aixPrivWinPtr)(pWin->devPrivate))->pNextWInterest=pWI;            \
  178.     }                        
  179.  
  180. #define WI_MIDDLE(pWin,pWI,pPrevWI)\
  181.     {                        \
  182.     pWI->pNextWInterest = pPrevWI->pNextWInterest;\
  183.     pWI->pLastWInterest = (WInterestPtr)&pPrevWI->pNextWInterest; \
  184.     pPrevWI->pNextWInterest->pLastWInterest = pWI; \
  185.     pPrevWI->pNextWInterest=pWI;            \
  186.     }
  187.  
  188. #define WI_LAST(pWin,pWI,dummy)\
  189.     {                        \
  190.     pWI->pNextWInterest = (WInterestPtr)&((aixPrivWinPtr)\
  191.     (pWin->devPrivate))->pNextWInterest;\
  192.     pWI->pLastWInterest = ((aixPrivWinPtr)(pWin->devPrivate))->pLastWInterest;\
  193.     ((aixPrivWinPtr)(pWin->devPrivate))->pLastWInterest->pNextWInterest = pWI;\
  194.     ((aixPrivWinPtr)(pWin->devPrivate))->pLastWInterest = pWI;     \
  195.     }
  196.  
  197. #define RemoveWI(pWI) \
  198.     pWI->pNextWInterest->pLastWInterest = pWI->pLastWInterest;\
  199.     pWI->pLastWInterest->pNextWInterest = pWI->pNextWInterest;\
  200.     pWI->pNextWInterest = 0;\
  201.     pWI->pLastWInterest = 0;
  202.  
  203. #define    NUM_GAIDEV    1
  204.  
  205. typedef struct {
  206.     int                 fastBorder;
  207.     int                 fastBackground;
  208.     DDXPointRec        oldRotate;
  209.     PixmapPtr          pRotatedBackground;
  210.     PixmapPtr            pRotatedBorder;
  211.     struct _WInterest    *pNextWInterest;
  212.     struct _WInterest    *pLastWInterest;
  213.     unsigned    int     eventMask ;
  214.     unsigned    int     dontPropagateMask;
  215.     unsigned    int     allEventMasks ;
  216.     unsigned    int     deliverableEvents;
  217.     pointer        pGaiWin     ;    /* gWindowPtr  */
  218.    pointer        pGaiWinGeom     ;    /* gWinGeomPtr */
  219. } aixPrivWin;
  220.  
  221. typedef aixPrivWin *aixPrivWinPtr ;
  222.  
  223. extern void  ValidateWindow();
  224. extern void  SetWIMask();
  225. extern WInterestPtr GetWI();
  226. extern void  FreeWI();
  227.  
  228. #endif /* _AIXEXT_H */
  229.