home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / evbl0627.zip / everblue_20010627.zip / x11 / XlcGeneric.h < prev    next >
C/C++ Source or Header  |  1999-11-02  |  4KB  |  147 lines

  1. /* $XConsortium: XlcGeneric.h /main/7 1996/12/05 10:38:44 swick $ */
  2. /*
  3.  * Copyright 1992, 1993 by TOSHIBA Corp.
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software and its
  6.  * documentation for any purpose and without fee is hereby granted, provided
  7.  * that the above copyright notice appear in all copies and that both that
  8.  * copyright notice and this permission notice appear in supporting
  9.  * documentation, and that the name of TOSHIBA not be used in advertising
  10.  * or publicity pertaining to distribution of the software without specific,
  11.  * written prior permission. TOSHIBA make no representations about the
  12.  * suitability of this software for any purpose.  It is provided "as is"
  13.  * without express or implied warranty.
  14.  *
  15.  * TOSHIBA DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  16.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  17.  * TOSHIBA BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  18.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  19.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  20.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  21.  * SOFTWARE.
  22.  *
  23.  * Author: Katsuhisa Yano    TOSHIBA Corp.
  24.  *                   mopi@osa.ilab.toshiba.co.jp
  25.  */
  26. /*
  27.  * Copyright 1995 by FUJITSU LIMITED
  28.  * This is source code modified by FUJITSU LIMITED under the Joint
  29.  * Development Agreement for the CDE/Motif PST.
  30.  *
  31.  * Modifier: Takanori Tateno   FUJITSU LIMITED
  32.  *
  33.  */
  34.  
  35. #ifndef _XLCGENERIC_H_
  36. #define _XLCGENERIC_H_
  37.  
  38. #include "XlcPubI.h"
  39.  
  40. typedef struct _ByteInfo {
  41.      unsigned char start,end;
  42. } ByteInfoRec, *ByteInfo;
  43.  
  44. typedef struct _ByteInfoList {
  45.     int     M;                          /* 1 <= M <= length */
  46.     int     byteinfo_num;
  47.     ByteInfo     byteinfo;
  48. } ByteInfoListRec, *ByteInfoList;
  49.  
  50. /* conversion_type values */
  51. #define LOCALCONV      1
  52. #define FILECONV       2
  53. #define FUNCTIONCONV   4
  54.  
  55. typedef struct _Conversion {
  56.     unsigned long     conversion_type;
  57.     int               conv_num;
  58.     FontScope         convlist;
  59.     char              *cnv_file;
  60.     XlcConv            cnvfunc;
  61. } ConversionRec, *Conversion;
  62.  
  63. typedef struct _ExtdSegment {
  64.     char        *name;
  65.     XlcSide     side;
  66.     FontScope     area;
  67.     int     area_num;
  68.     XlcCharSet  charset;
  69. } ExtdSegmentRec, *ExtdSegment;
  70.  
  71. typedef struct _SegConvRec {
  72.     int             length;
  73.     char            *source_encoding;
  74.     XlcCharSet        source;
  75.     char            *destination_encoding;
  76.     XlcCharSet        dest;
  77.     FontScopeRec       range;
  78.     int             conv_num;
  79.     FontScope       conv;
  80. } SegConvRec, *SegConv;
  81.  
  82. typedef struct _ParseInfoRec *ParseInfo;
  83.  
  84. typedef struct _CodeSetRec {
  85.     XlcCharSet         *charset_list;
  86.     int         num_charsets;
  87.     int         cs_num;
  88.     XlcSide         side;
  89.     int         length;
  90.     ByteInfoList     byteM;
  91.     Conversion         mbconv;
  92.     Conversion         ctconv;
  93.     ExtdSegment     ctextseg;
  94.     ParseInfo         parse_info;
  95.     unsigned long     wc_encoding;
  96. } CodeSetRec, *CodeSet;
  97.  
  98. typedef enum {
  99.     E_GL,            /* GL encoding */
  100.     E_GR,            /* GR encoding */
  101.     E_SS,            /* single shift */
  102.     E_LSL,            /* locking shift left */
  103.     E_LSR,            /* locking shift right */
  104.     E_LAST
  105. } EncodingType;
  106.  
  107. typedef struct _ParseInfoRec {
  108.     EncodingType     type;
  109.     char         *encoding;
  110.     CodeSet         codeset;
  111. } ParseInfoRec;
  112.  
  113. /*
  114.  * XLCd private data
  115.  */
  116.  
  117. #define XLC_GENERIC(lcd, x)    (((XLCdGeneric) lcd->core)->gen.x)
  118. #define XLC_GENERIC_PART(lcd)    (&(((XLCdGeneric) lcd->core)->gen))
  119.  
  120. typedef struct _XLCdGenericPart {
  121.     int         codeset_num;
  122.     CodeSet         *codeset_list;
  123.     unsigned char     *mb_parse_table;
  124.     int         mb_parse_list_num;
  125.     ParseInfo         *mb_parse_list;
  126.     unsigned long     wc_encode_mask;
  127.     unsigned long     wc_shift_bits;
  128.     CodeSet         initial_state_GL;
  129.     CodeSet         initial_state_GR;
  130.     int          segment_conv_num;  /* UDC */
  131.     SegConv         segment_conv;      /* UDC */
  132. #ifndef X_NOT_STDC_ENV
  133.     Bool         use_stdc_env;
  134.     Bool         force_convert_to_mb;
  135. #endif
  136. } XLCdGenericPart;
  137.  
  138. typedef struct _XLCdGenericRec {
  139.     XLCdCoreRec     core;    
  140.     XLCdPublicPart     pub;
  141.     XLCdGenericPart     gen;    
  142. } XLCdGenericRec, *XLCdGeneric;
  143.  
  144. extern XLCdMethods _XlcGenericMethods;
  145.  
  146. #endif  /* _XLCGENERIC_H_ */
  147.