_fallcGeneric.h 5.1 KB

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