- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- Search for |

- File List
- Globals

# LETypes.h

Go to the documentation of this file.

    00001 /*
    00002  *
    00003  * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
    00004  *
    00005  */
    00006
    00007 #ifndef __LETYPES_H
    00008 #define __LETYPES_H
    00009
    00010 #if !defined(LE_USE_CMEMORY) && (defined(U_LAYOUT_IMPLEMENTATION) || defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_STATIC_IMPLEMENTATION) || defined(U_COMBINED_IMPLEMENTATION))
    00011 #define LE_USE_CMEMORY
    00012 #endif
    00013
    00014 #include "unicode/utypes.h"
    00015
    00016 #ifdef XP_CPLUSPLUS
    00017 #include "unicode/uobject.h"
    00018 #endif
    00019
    00020 #ifdef LE_USE_CMEMORY
    00021 #include "cmemory.h"
    00022 #endif
    00023
    00024 U_NAMESPACE_BEGIN
    00025
    00036 typedef int32_t le_int32;
    00037
    00043 typedef uint32_t le_uint32;
    00044
    00050 typedef int16_t le_int16;
    00051
    00057 typedef uint16_t le_uint16;
    00058
    00064 typedef int8_t le_int8;
    00065
    00071 typedef uint8_t le_uint8;
    00072
    00073
    00079 typedef UBool le_bool;
    00080
    00081 #ifndef NULL
    00082
    00087 #define NULL 0
    00088 #endif
    00089
    00095 typedef le_uint32 LETag;
    00096
    00103 typedef le_uint16 TTGlyphID;
    00104
    00114 typedef le_uint32 LEGlyphID;
    00115
    00122 #define LE_GLYPH_MASK     0x0000FFFF
    00123
    00131 #define LE_GLYPH_SHIFT    0
    00132
    00133
    00140 #define LE_SUB_FONT_MASK  0x00FF0000
    00141
    00149 #define LE_SUB_FONT_SHIFT 16
    00150
    00151
    00158 #define LE_CLIENT_MASK    0xFF000000
    00159
    00167 #define LE_CLIENT_SHIFT   24
    00168
    00169
    00176 #define LE_GET_GLYPH(gid) ((gid & LE_GLYPH_MASK) >> LE_GLYPH_SHIFT)
    00177
    00184 #define LE_GET_SUB_FONT(gid) ((gid & LE_SUB_FONT_MASK) >> LE_SUB_FONT_SHIFT)
    00185
    00192 #define LE_GET_CLIENT(gid) ((gid & LE_CLIENT_MASK) >> LE_CLIENT_SHIFT)
    00193
    00194
    00201 #define LE_SET_GLYPH(gid, glyph) ((gid & ~LE_GLYPH_MASK) | ((glyph << LE_GLYPH_SHIFT) & LE_GLYPH_MASK))
    00202
    00209 #define LE_SET_SUB_FONT(gid, font) ((gid & ~LE_SUB_FONT_MASK) | ((font << LE_SUB_FONT_SHIFT) & LE_SUB_FONT_MASK))
    00210
    00217 #define LE_SET_CLIENT(gid, client) ((gid & ~LE_CLIENT_MASK) | ((client << LE_CLIENT_SHIFT) & LE_CLIENT_MASK))
    00218
    00219
    00225 typedef UChar LEUnicode16;
    00226
    00232 typedef UChar32 LEUnicode32;
    00233
    00239 typedef UChar LEUnicode;
    00240
    00246 struct LEPoint
    00247 {
    00253     float fX;
    00254
    00260     float fY;
    00261 };
    00262
    00263 #ifndef XP_CPLUSPLUS
    00264
    00269 typedef struct LEPoint LEPoint;
    00270 #endif
    00271
    00272
    00278 #define LE_ARRAY_SIZE(array) (sizeof array / sizeof array[0])
    00279
    00280 #ifdef LE_USE_CMEMORY
    00281
    00286 #define LE_ARRAY_COPY(dst, src, count) uprv_memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0])
    00287
    00294 #define LE_NEW_ARRAY(type, count) (type *) uprv_malloc((count) * sizeof(type))
    00295
    00302 #define LE_GROW_ARRAY(array, newSize) uprv_realloc((void *) (array), (newSize) * sizeof (array)[0])
    00303
    00310 #define LE_DELETE_ARRAY(array) uprv_free((void *) (array))
    00311 #endif
    00312
    00323 #define LE_MAKE_TAG(a, b, c, d) \
    00324     (((le_uint32)(a) << 24) |   \
    00325      ((le_uint32)(b) << 16) |   \
    00326      ((le_uint32)(c) << 8)  |   \
    00327       (le_uint32)(d))
    00328
    00335 enum LETableTags {
    00336     LE_ACNT_TABLE_TAG = 0x61636E74UL,
    00337     LE_AVAR_TABLE_TAG = 0x61766172UL,
    00338     LE_BASE_TABLE_TAG = 0x42415345UL,
    00339     LE_BDAT_TABLE_TAG = 0x62646174UL,
    00340     LE_BHED_TABLE_TAG = 0x62686564UL,
    00341     LE_BLOC_TABLE_TAG = 0x626C6F63UL,
    00342     LE_BSLN_TABLE_TAG = 0x62736C6EUL,
    00343     LE_CFF__TABLE_TAG = 0x43464620UL,
    00344     LE_CMAP_TABLE_TAG = 0x636D6170UL,
    00345     LE_CVAR_TABLE_TAG = 0x63766172UL,
    00346     LE_CVT__TABLE_TAG = 0x63767420UL,
    00347     LE_DSIG_TABLE_TAG = 0x44534947UL,
    00348     LE_EBDT_TABLE_TAG = 0x45424454UL,
    00349     LE_EBLC_TABLE_TAG = 0x45424C43UL,
    00350     LE_EBSC_TABLE_TAG = 0x45425343UL,
    00351     LE_FDSC_TABLE_TAG = 0x66647363UL,
    00352     LE_FEAT_TABLE_TAG = 0x66656174UL,
    00353     LE_FMTX_TABLE_TAG = 0x666D7478UL,
    00354     LE_FPGM_TABLE_TAG = 0x6670676DUL,
    00355     LE_FVAR_TABLE_TAG = 0x66766172UL,
    00356     LE_GASP_TABLE_TAG = 0x67617370UL,
    00357     LE_GDEF_TABLE_TAG = 0x47444546UL,
    00358     LE_GLYF_TABLE_TAG = 0x676C7966UL,
    00359     LE_GPOS_TABLE_TAG = 0x47504F53UL,
    00360     LE_GSUB_TABLE_TAG = 0x47535542UL,
    00361     LE_GVAR_TABLE_TAG = 0x67766172UL,
    00362     LE_HDMX_TABLE_TAG = 0x68646D78UL,
    00363     LE_HEAD_TABLE_TAG = 0x68656164UL,
    00364     LE_HHEA_TABLE_TAG = 0x68686561UL,
    00365     LE_HMTX_TABLE_TAG = 0x686D7478UL,
    00366     LE_HSTY_TABLE_TAG = 0x68737479UL,
    00367     LE_JUST_TABLE_TAG = 0x6A757374UL,
    00368     LE_JSTF_TABLE_TAG = 0x4A535446UL,
    00369     LE_KERN_TABLE_TAG = 0x6B65726EUL,
    00370     LE_LCAR_TABLE_TAG = 0x6C636172UL,
    00371     LE_LOCA_TABLE_TAG = 0x6C6F6361UL,
    00372     LE_LTSH_TABLE_TAG = 0x4C545348UL,
    00373     LE_MAXP_TABLE_TAG = 0x6D617870UL,
    00374     LE_MORT_TABLE_TAG = 0x6D6F7274UL,
    00375     LE_MORX_TABLE_TAG = 0x6D6F7278UL,
    00376     LE_NAME_TABLE_TAG = 0x6E616D65UL,
    00377     LE_OPBD_TABLE_TAG = 0x6F706264UL,
    00378     LE_OS_2_TABLE_TAG = 0x4F532F32UL,
    00379     LE_PCLT_TABLE_TAG = 0x50434C54UL,
    00380     LE_POST_TABLE_TAG = 0x706F7374UL,
    00381     LE_PREP_TABLE_TAG = 0x70726570UL,
    00382     LE_PROP_TABLE_TAG = 0x70726F70UL,
    00383     LE_TRAK_TABLE_TAG = 0x7472616BUL,
    00384     LE_VDMX_TABLE_TAG = 0x56444D58UL,
    00385     LE_VHEA_TABLE_TAG = 0x76686561UL,
    00386     LE_VMTX_TABLE_TAG = 0x766D7478UL,
    00387     LE_VORG_TABLE_TAG = 0x564F5247UL,
    00388     LE_ZAPF_TABLE_TAG = 0x5A617066UL
    00389 };
    00390
    00397 enum LEFeatureTags {
    00398     LE_AALT_FEATURE_TAG = 0x61616C74UL,
    00399     LE_ABVF_FEATURE_TAG = 0x61627666UL,
    00400     LE_ABVM_FEATURE_TAG = 0x6162766DUL,
    00401     LE_ABVS_FEATURE_TAG = 0x61627673UL,
    00402     LE_AFRC_FEATURE_TAG = 0x61667263UL,
    00403     LE_AKHN_FEATURE_TAG = 0x616B686EUL,
    00404     LE_BLWF_FEATURE_TAG = 0x626C7766UL,
    00405     LE_BLWM_FEATURE_TAG = 0x626C776DUL,
    00406     LE_BLWS_FEATURE_TAG = 0x626C7773UL,
    00407     LE_CALT_FEATURE_TAG = 0x63616C74UL,
    00408     LE_CASE_FEATURE_TAG = 0x63617365UL,
    00409     LE_CCMP_FEATURE_TAG = 0x63636D70UL,
    00410     LE_CLIG_FEATURE_TAG = 0x636C6967UL,
    00411     LE_CPSP_FEATURE_TAG = 0x63707370UL,
    00412     LE_CSWH_FEATURE_TAG = 0x63737768UL,
    00413     LE_CURS_FEATURE_TAG = 0x63757273UL,
    00414     LE_C2SC_FEATURE_TAG = 0x63327363UL,
    00415     LE_C2PC_FEATURE_TAG = 0x63327063UL,
    00416     LE_DIST_FEATURE_TAG = 0x64697374UL,
    00417     LE_DLIG_FEATURE_TAG = 0x646C6967UL,
    00418     LE_DNOM_FEATURE_TAG = 0x646E6F6DUL,
    00419     LE_EXPT_FEATURE_TAG = 0x65787074UL,
    00420     LE_FALT_FEATURE_TAG = 0x66616C74UL,
    00421     LE_FIN2_FEATURE_TAG = 0x66696E32UL,
    00422     LE_FIN3_FEATURE_TAG = 0x66696E33UL,
    00423     LE_FINA_FEATURE_TAG = 0x66696E61UL,
    00424     LE_FRAC_FEATURE_TAG = 0x66726163UL,
    00425     LE_FWID_FEATURE_TAG = 0x66776964UL,
    00426     LE_HALF_FEATURE_TAG = 0x68616C66UL,
    00427     LE_HALN_FEATURE_TAG = 0x68616C6EUL,
    00428     LE_HALT_FEATURE_TAG = 0x68616C74UL,
    00429     LE_HIST_FEATURE_TAG = 0x68697374UL,
    00430     LE_HKNA_FEATURE_TAG = 0x686B6E61UL,
    00431     LE_HLIG_FEATURE_TAG = 0x686C6967UL,
    00432     LE_HNGL_FEATURE_TAG = 0x686E676CUL,
    00433     LE_HWID_FEATURE_TAG = 0x68776964UL,
    00434     LE_INIT_FEATURE_TAG = 0x696E6974UL,
    00435     LE_ISOL_FEATURE_TAG = 0x69736F6CUL,
    00436     LE_ITAL_FEATURE_TAG = 0x6974616CUL,
    00437     LE_JALT_FEATURE_TAG = 0x6A616C74UL,
    00438     LE_JP78_FEATURE_TAG = 0x6A703738UL,
    00439     LE_JP83_FEATURE_TAG = 0x6A703833UL,
    00440     LE_JP90_FEATURE_TAG = 0x6A703930UL,
    00441     LE_KERN_FEATURE_TAG = 0x6B65726EUL,
    00442     LE_LFBD_FEATURE_TAG = 0x6C666264UL,
    00443     LE_LIGA_FEATURE_TAG = 0x6C696761UL,
    00444     LE_LJMO_FEATURE_TAG = 0x6C6A6D6FUL,
    00445     LE_LNUM_FEATURE_TAG = 0x6C6E756DUL,
    00446     LE_LOCL_FEATURE_TAG = 0x6C6F636CUL,
    00447     LE_MARK_FEATURE_TAG = 0x6D61726BUL,
    00448     LE_MED2_FEATURE_TAG = 0x6D656432UL,
    00449     LE_MEDI_FEATURE_TAG = 0x6D656469UL,
    00450     LE_MGRK_FEATURE_TAG = 0x6D67726BUL,
    00451     LE_MKMK_FEATURE_TAG = 0x6D6B6D6BUL,
    00452     LE_MSET_FEATURE_TAG = 0x6D736574UL,
    00453     LE_NALT_FEATURE_TAG = 0x6E616C74UL,
    00454     LE_NLCK_FEATURE_TAG = 0x6E6C636BUL,
    00455     LE_NUKT_FEATURE_TAG = 0x6E756B74UL,
    00456     LE_NUMR_FEATURE_TAG = 0x6E756D72UL,
    00457     LE_ONUM_FEATURE_TAG = 0x6F6E756DUL,
    00458     LE_OPBD_FEATURE_TAG = 0x6F706264UL,
    00459     LE_ORDN_FEATURE_TAG = 0x6F72646EUL,
    00460     LE_ORNM_FEATURE_TAG = 0x6F726E6DUL,
    00461     LE_PALT_FEATURE_TAG = 0x70616C74UL,
    00462     LE_PCAP_FEATURE_TAG = 0x70636170UL,
    00463     LE_PNUM_FEATURE_TAG = 0x706E756DUL,
    00464     LE_PREF_FEATURE_TAG = 0x70726566UL,
    00465     LE_PRES_FEATURE_TAG = 0x70726573UL,
    00466     LE_PSTF_FEATURE_TAG = 0x70737466UL,
    00467     LE_PSTS_FEATURE_TAG = 0x70737473UL,
    00468     LE_PWID_FEATURE_TAG = 0x70776964UL,
    00469     LE_QWID_FEATURE_TAG = 0x71776964UL,
    00470     LE_RAND_FEATURE_TAG = 0x72616E64UL,
    00471     LE_RLIG_FEATURE_TAG = 0x726C6967UL,
    00472     LE_RPHF_FEATURE_TAG = 0x72706866UL,
    00473     LE_RTBD_FEATURE_TAG = 0x72746264UL,
    00474     LE_RTLA_FEATURE_TAG = 0x72746C61UL,
    00475     LE_RUBY_FEATURE_TAG = 0x72756279UL,
    00476     LE_SALT_FEATURE_TAG = 0x73616C74UL,
    00477     LE_SINF_FEATURE_TAG = 0x73696E66UL,
    00478     LE_SIZE_FEATURE_TAG = 0x73697A65UL,
    00479     LE_SMCP_FEATURE_TAG = 0x736D6370UL,
    00480     LE_SMPL_FEATURE_TAG = 0x736D706CUL,
    00481     LE_SS01_FEATURE_TAG = 0x73733031UL,
    00482     LE_SS02_FEATURE_TAG = 0x73733032UL,
    00483     LE_SS03_FEATURE_TAG = 0x73733033UL,
    00484     LE_SS04_FEATURE_TAG = 0x73733034UL,
    00485     LE_SS05_FEATURE_TAG = 0x73733035UL,
    00486     LE_SS06_FEATURE_TAG = 0x73733036UL,
    00487     LE_SS07_FEATURE_TAG = 0x73733037UL,
    00488     LE_SS08_FEATURE_TAG = 0x73733038UL,
    00489     LE_SS09_FEATURE_TAG = 0x73733039UL,
    00490     LE_SS10_FEATURE_TAG = 0x73733130UL,
    00491     LE_SS11_FEATURE_TAG = 0x73733131UL,
    00492     LE_SS12_FEATURE_TAG = 0x73733132UL,
    00493     LE_SS13_FEATURE_TAG = 0x73733133UL,
    00494     LE_SS14_FEATURE_TAG = 0x73733134UL,
    00495     LE_SS15_FEATURE_TAG = 0x73733135UL,
    00496     LE_SS16_FEATURE_TAG = 0x73733136UL,
    00497     LE_SS17_FEATURE_TAG = 0x73733137UL,
    00498     LE_SS18_FEATURE_TAG = 0x73733138UL,
    00499     LE_SS19_FEATURE_TAG = 0x73733139UL,
    00500     LE_SS20_FEATURE_TAG = 0x73733230UL,
    00501     LE_SUBS_FEATURE_TAG = 0x73756273UL,
    00502     LE_SUPS_FEATURE_TAG = 0x73757073UL,
    00503     LE_SWSH_FEATURE_TAG = 0x73777368UL,
    00504     LE_TITL_FEATURE_TAG = 0x7469746CUL,
    00505     LE_TJMO_FEATURE_TAG = 0x746A6D6FUL,
    00506     LE_TNAM_FEATURE_TAG = 0x746E616DUL,
    00507     LE_TNUM_FEATURE_TAG = 0x746E756DUL,
    00508     LE_TRAD_FEATURE_TAG = 0x74726164UL,
    00509     LE_TWID_FEATURE_TAG = 0x74776964UL,
    00510     LE_UNIC_FEATURE_TAG = 0x756E6963UL,
    00511     LE_VALT_FEATURE_TAG = 0x76616C74UL,
    00512     LE_VATU_FEATURE_TAG = 0x76617475UL,
    00513     LE_VERT_FEATURE_TAG = 0x76657274UL,
    00514     LE_VHAL_FEATURE_TAG = 0x7668616CUL,
    00515     LE_VJMO_FEATURE_TAG = 0x766A6D6FUL,
    00516     LE_VKNA_FEATURE_TAG = 0x766B6E61UL,
    00517     LE_VKRN_FEATURE_TAG = 0x766B726EUL,
    00518     LE_VPAL_FEATURE_TAG = 0x7670616CUL,
    00519     LE_VRT2_FEATURE_TAG = 0x76727432UL,
    00520     LE_ZERO_FEATURE_TAG = 0x7A65726FUL
    00521 };
    00522
    00528 enum LEErrorCode {
    00529     /* informational */
    00530     LE_NO_SUBFONT_WARNING          = U_USING_DEFAULT_WARNING,
    00532     /* success */
    00533     LE_NO_ERROR                     = U_ZERO_ERROR,
    00535     /* failures */
    00536     LE_ILLEGAL_ARGUMENT_ERROR       = U_ILLEGAL_ARGUMENT_ERROR,
    00537     LE_MEMORY_ALLOCATION_ERROR      = U_MEMORY_ALLOCATION_ERROR,
    00538     LE_INDEX_OUT_OF_BOUNDS_ERROR    = U_INDEX_OUTOFBOUNDS_ERROR,
    00539     LE_NO_LAYOUT_ERROR              = U_UNSUPPORTED_ERROR,
    00540     LE_INTERNAL_ERROR               = U_INTERNAL_PROGRAM_ERROR,
    00541     LE_FONT_FILE_NOT_FOUND_ERROR    = U_FILE_ACCESS_ERROR,
    00542     LE_MISSING_FONT_TABLE_ERROR     = U_MISSING_RESOURCE_ERROR
    00543 };
    00544
    00545 #ifndef XP_CPLUSPLUS
    00546
    00551 typedef enum LEErrorCode LEErrorCode;
    00552 #endif
    00553
    00559 #define LE_SUCCESS(code) (U_SUCCESS((UErrorCode)code))
    00560
    00566 #define LE_FAILURE(code) (U_FAILURE((UErrorCode)code))
    00567
    00568 U_NAMESPACE_END
    00569 #endif
    00570
    00571