#ifndef _XTTCCONVP_H_
#define _XTTCCONVP_H_ 1
#include <X11/Xdefs.h>
typedef struct {
char const *charsetStdName;
char const *charsetYear;
char const *charsetEncoding;
TT_Face hFace;
int numberOfCharMaps;
SRefPropRecValList *refListPropRecVal;
} CharSetSelectionHints;
typedef struct {
char const *charsetStdName;
char const *charsetYear;
char const *charsetEncoding;
int magicNumber;
CharSetInfo charSetInfo;
} CharSetRelation;
typedef
Bool
(*mod_entrypoint_ptr_t)(CharSetSelectionHints const *charSetHints,
CodeConverterInfo *refCodeConverterInfo ,
int *refMapID );
enum {
EPlfmUnicode = 0,
EPlfmApple = 1,
EPlfmISO = 2,
EPlfmMS = 3,
EPlfmAny = -1
};
enum {
EEncUnicodeAny = -1,
EEncAppleRoman = 0,
EEncAppleJapanese = 1,
EEncAppleCenteuro = 29,
EEncAppleCyrillic = 7,
EEncISOASCII = 0,
EEncISO10646 = 1,
EEncISO8859_1 = 2,
EEncMSSymbol = 0,
EEncMSUnicode = 1,
EEncMSShiftJIS = 2,
EEncMSBig5WGL4 = 3,
EEncMSGB2312 = 4,
EEncMSWansung = 5,
EEncAny = -1
};
typedef struct {
int magicNumber;
int platform, encoding;
ft_code_converter_ptr_t ptrCodeConverter;
void (*callback)(CharSetSelectionHints const *charSetHints,
CodeConverterInfo *refCodeConverterInfo ,
int *refMapID );
} MapIDRelation;
#define CODE_CONV_ONE_OCTET_TO_UCS2(funcName, tableName,\
begin, end,\
altChar)\
ft_char_code_t \
funcName(ft_char_code_t codeSrc)\
{\
ucs2_t codeDst;\
\
if (codeSrc>=begin && codeSrc<=end)\
codeDst = tableName[codeSrc-begin];\
else\
codeDst = altChar;\
\
return codeDst;\
}
#define CODE_CONV_ONE_OCTET_TO_UCS2_ALL(funcName, tableName)\
ft_char_code_t \
funcName(ft_char_code_t codeSrc)\
{\
return tableName[codeSrc];\
}
#define CODE_CONV_TWO_OCTET_TO_UCS2(funcName, tableName,\
beginHigh, endHigh,\
beginLow, endLow,\
altChar)\
ft_char_code_t \
funcName(ft_char_code_t codeSrc)\
{\
ucs2_t codeDst;\
int high = codeSrc >> 8;\
int low = codeSrc & 0xff;\
\
if (high>=beginHigh && high<=endHigh && low>=beginLow && low<=endLow)\
codeDst =\
tableName[(high-beginHigh)*(endLow-beginLow+1)+(low-beginLow)];\
else\
codeDst = altChar;\
\
return codeDst;\
}
#define CODE_CONV_ISO8859_TO_UCS2(funcName, tableName, altChar)\
ft_char_code_t \
funcName(ft_char_code_t codeSrc)\
{\
ucs2_t codeDst = 0;\
\
if (codeSrc>=0xa0)\
codeDst = tableName[codeSrc-0xa0];\
else if (codeSrc<0x80)\
codeDst = codeSrc;\
\
return codeDst;\
}
#define CODE_CONV_CP_TO_UCS2(funcName, tableName)\
ft_char_code_t \
funcName(ft_char_code_t codeSrc)\
{\
ucs2_t codeDst = 0;\
\
if (codeSrc>=0x80)\
codeDst = tableName[codeSrc-0x80];\
else if (codeSrc<0x80)\
codeDst = codeSrc;\
\
return codeDst;\
}
#define CODECONV_TEMPLATE(funcName)\
ft_char_code_t \
funcName(ft_char_code_t codeSrc)
#define ENTRYFUNC_PROTO_TEMPLATE(funcName) \
Bool \
funcName(CharSetSelectionHints const *charSetHints,\
CodeConverterInfo *refCodeConverterInfo ,\
int *refMapID )
#define ENTRYFUNC_TEMPLATE(funcName) \
ENTRYFUNC_PROTO_TEMPLATE(funcName); \
CCONV_MODULE_SETUP \
ENTRYFUNC_PROTO_TEMPLATE(funcName) \
#define STD_ENTRYFUNC_TEMPLATE(funcName) \
ENTRYFUNC_TEMPLATE(funcName) \
{\
return codeconv_search_map_id(charSetHints,\
charSetRelations,\
mapIDRelations,\
refCodeConverterInfo,\
refMapID);\
}
#define CODECONV_CALLBACK_TEMPLATE(funcName)\
void funcName(CharSetSelectionHints const *charSetHints,\
CodeConverterInfo *refCodeConverterInfo ,\
int *refMapID )
Bool
codeconv_search_charset(CharSetRelation const *charSetRelations,
char const *charsetStdName,
char const *charsetYear,
char const *charsetEncoding,
int *refMagicNumber ,
CharSetInfo const **refRefCharSetInfo );
Bool
codeconv_search_map_id(CharSetSelectionHints const *charSetHints,
CharSetRelation const *refCharSetRelations,
MapIDRelation const *refMapIDRelations,
CodeConverterInfo *refCodeConverterInfo ,
int *refMapID );
#endif
#ifdef FONTMODULE
#if 0
#include "xf86Module.h"
#endif
#include "xttversion.h"
#include "cconvversion.h"
#else
#define CCONV_MODULE_SETUP
#endif