home *** CD-ROM | disk | FTP | other *** search
/ IRIX Patches 1995 June / SGI IRIX Patches 1995 Jun.iso / 5.3_patches / patchSG0000499 / patchSG0000499.idb / usr / include / abi / X11 / ComposeInt.h.z / ComposeInt.h
Encoding:
C/C++ Source or Header  |  1995-06-12  |  3.0 KB  |  103 lines

  1.  
  2. /************************************************************
  3.  Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
  4.  
  5.  Permission to use, copy, modify, and distribute this
  6.  software and its documentation for any purpose and without
  7.  fee is hereby granted, provided that the above copyright
  8.  notice appear in all copies and that both that copyright
  9.  notice and this permission notice appear in supporting
  10.  documentation, and that the name of Silicon Graphics not be 
  11.  used in advertising or publicity pertaining to distribution 
  12.  of the software without specific prior written permission.
  13.  Silicon Graphics makes no representation about the suitability 
  14.  of this software for any purpose. It is provided "as is"
  15.  without any express or implied warranty.
  16.  
  17.  SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
  18.  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
  19.  AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
  20.  GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  21.  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
  22.  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
  23.  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
  24.  THE USE OR PERFORMANCE OF THIS SOFTWARE.
  25.  
  26.  ********************************************************/
  27.  
  28. #ifndef COMPOSE_INT_H
  29. #define    COMPOSE_INT_H 1
  30.  
  31. #include <X11/Compose.h>
  32.  
  33.     /*
  34.      * values for useFlags in ComposeTbl
  35.      */
  36. #define    COMPOSE_CAN_FREE    (1<<0)
  37. #define    COMPOSE_INACTIVE    (1<<1)
  38.  
  39. /***====================================================================***/
  40.  
  41. typedef struct {
  42.     int    (*proc)(XComposeStatus *,KeySym,ComposeRtrn *);
  43.     XComposeStatus    *sanity;
  44.     ComposeTbl    *table;
  45.     void         *state;
  46. } ComposeState;
  47.  
  48. /***====================================================================***/
  49.  
  50. #define    COMPOSE_TREE    1
  51. #define    COMPOSE_TREE_SHORTCUT    2
  52. #define    COMPOSE_STRING    3
  53.  
  54. #define    NEXT_IS_UNDEFINED 'U'
  55. #define    NEXT_IS_NODE    'N'
  56. #define    NEXT_IS_RESULT    'R'
  57.  
  58. typedef struct _ComposeTreeNode {
  59.     CARD16         back;
  60.     ShortKeySym     sym;
  61.     CARD16         str;
  62.     ShortKeySym    *nextSym;
  63.     CARD32        *next;
  64.     char        *what;
  65. } ComposeTreeNode;
  66.  
  67. typedef struct _ComposeTree {
  68.     ComposeTbl     common;
  69.     ComposeTreeNode    *node;
  70.     int         nNodes;
  71. } ComposeTree;
  72.  
  73. extern    int         CTGetNodeResult(ComposeTreeNode *pNode,
  74.                         int ndx,KeySym *sym,void *str);
  75. extern    int         CTSetNodeResult(ComposeTreeNode *pNode,
  76.                         int ndx,KeySym sym,void *str);
  77.  
  78. #define    CTResultSym(i,n,x)    (ShortKSToKS((n)->next[x]&0xffff,\
  79.                         (i)->common.privateSyms))
  80. #define    CTResultStr(i,n,x)    (&(i)->common.resultStr[((n)->next[x]>>16)&0xffff])
  81.  
  82. #define    CTNextIndex(n,x)    ((n)->next[x]&0xffff)
  83. #define    CTNodeNext(i,n,x)    (&(i)->node[(n)->next[x]&0xffff])
  84. #define    CTNode(i,n)        (&(i)->node[n])
  85. #define    CTNodeIndex(i,n)    ((n)-(i)->node)
  86.  
  87. typedef struct _ComposeTreeShortcut {
  88.     ComposeTbl     common;
  89.     ComposeTree    *tbl;
  90.     ComposeTreeNode    *node;
  91. } ComposeTreeShortcut;
  92.  
  93. typedef struct _ComposeStringTbl {
  94.     ComposeTbl      common;
  95.     int              maxLen;
  96.     int              nSequence;
  97.     ShortKeySym        **sequence;
  98.     CARD32             *yields;
  99.     KeySym              *terminators;
  100. } ComposeStringTbl;
  101.  
  102. #endif /* COMPOSE_INT_H */
  103.