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

- File List
- Globals

# LETypes.h

Go to the documentation of this file.

    00001 /*
    00002  *
    00003  * (C) Copyright IBM Corp. 1998-2009 - 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
    00034 typedef int32_t le_int32;
    00035
    00041 typedef uint32_t le_uint32;
    00042
    00048 typedef int16_t le_int16;
    00049
    00055 typedef uint16_t le_uint16;
    00056
    00062 typedef int8_t le_int8;
    00063
    00069 typedef uint8_t le_uint8;
    00070
    00071
    00077 typedef UBool le_bool;
    00078
    00079 #ifndef NULL
    00080
    00085 #define NULL 0
    00086 #endif
    00087
    00093 typedef le_uint32 LETag;
    00094
    00101 typedef le_uint16 TTGlyphID;
    00102
    00112 typedef le_uint32 LEGlyphID;
    00113
    00120 #define LE_GLYPH_MASK     0x0000FFFF
    00121
    00129 #define LE_GLYPH_SHIFT    0
    00130
    00131
    00138 #define LE_SUB_FONT_MASK  0x00FF0000
    00139
    00147 #define LE_SUB_FONT_SHIFT 16
    00148
    00149
    00156 #define LE_CLIENT_MASK    0xFF000000
    00157
    00165 #define LE_CLIENT_SHIFT   24
    00166
    00167
    00174 #define LE_GET_GLYPH(gid) ((gid & LE_GLYPH_MASK) >> LE_GLYPH_SHIFT)
    00175
    00182 #define LE_GET_SUB_FONT(gid) ((gid & LE_SUB_FONT_MASK) >> LE_SUB_FONT_SHIFT)
    00183
    00190 #define LE_GET_CLIENT(gid) ((gid & LE_CLIENT_MASK) >> LE_CLIENT_SHIFT)
    00191
    00192
    00199 #define LE_SET_GLYPH(gid, glyph) ((gid & ~LE_GLYPH_MASK) | ((glyph << LE_GLYPH_SHIFT) & LE_GLYPH_MASK))
    00200
    00207 #define LE_SET_SUB_FONT(gid, font) ((gid & ~LE_SUB_FONT_MASK) | ((font << LE_SUB_FONT_SHIFT) & LE_SUB_FONT_MASK))
    00208
    00215 #define LE_SET_CLIENT(gid, client) ((gid & ~LE_CLIENT_MASK) | ((client << LE_CLIENT_SHIFT) & LE_CLIENT_MASK))
    00216
    00217
    00223 typedef UChar LEUnicode16;
    00224
    00230 typedef UChar32 LEUnicode32;
    00231
    00237 typedef UChar LEUnicode;
    00238
    00244 struct LEPoint
    00245 {
    00251     float fX;
    00252
    00258     float fY;
    00259 };
    00260
    00261 #ifndef XP_CPLUSPLUS
    00262
    00267 typedef struct LEPoint LEPoint;
    00268 #endif
    00269
    00270
    00276 #define LE_ARRAY_SIZE(array) (sizeof array / sizeof array[0])
    00277
    00278 #ifdef LE_USE_CMEMORY
    00279
    00284 #define LE_ARRAY_COPY(dst, src, count) uprv_memcpy((void *) (dst), (void *) (src), (count) * sizeof (src)[0])
    00285
    00292 #define LE_NEW_ARRAY(type, count) (type *) uprv_malloc((count) * sizeof(type))
    00293
    00300 #define LE_GROW_ARRAY(array, newSize) uprv_realloc((void *) (array), (newSize) * sizeof (array)[0])
    00301
    00308 #define LE_DELETE_ARRAY(array) uprv_free((void *) (array))
    00309 #endif
    00310
    00321 #define LE_MAKE_TAG(a, b, c, d) \
    00322     (((le_uint32)(a) << 24) |   \
    00323      ((le_uint32)(b) << 16) |   \
    00324      ((le_uint32)(c) << 8)  |   \
    00325       (le_uint32)(d))
    00326
    00333 enum LETableTags {
    00334     LE_ACNT_TABLE_TAG = 0x61636E74UL,
    00335     LE_AVAR_TABLE_TAG = 0x61766172UL,
    00336     LE_BASE_TABLE_TAG = 0x42415345UL,
    00337     LE_BDAT_TABLE_TAG = 0x62646174UL,
    00338     LE_BHED_TABLE_TAG = 0x62686564UL,
    00339     LE_BLOC_TABLE_TAG = 0x626C6F63UL,
    00340     LE_BSLN_TABLE_TAG = 0x62736C6EUL,
    00341     LE_CFF__TABLE_TAG = 0x43464620UL,
    00342     LE_CMAP_TABLE_TAG = 0x636D6170UL,
    00343     LE_CVAR_TABLE_TAG = 0x63766172UL,
    00344     LE_CVT__TABLE_TAG = 0x63767420UL,
    00345     LE_DSIG_TABLE_TAG = 0x44534947UL,
    00346     LE_EBDT_TABLE_TAG = 0x45424454UL,
    00347     LE_EBLC_TABLE_TAG = 0x45424C43UL,
    00348     LE_EBSC_TABLE_TAG = 0x45425343UL,
    00349     LE_FDSC_TABLE_TAG = 0x66647363UL,
    00350     LE_FEAT_TABLE_TAG = 0x66656174UL,
    00351     LE_FMTX_TABLE_TAG = 0x666D7478UL,
    00352     LE_FPGM_TABLE_TAG = 0x6670676DUL,
    00353     LE_FVAR_TABLE_TAG = 0x66766172UL,
    00354     LE_GASP_TABLE_TAG = 0x67617370UL,
    00355     LE_GDEF_TABLE_TAG = 0x47444546UL,
    00356     LE_GLYF_TABLE_TAG = 0x676C7966UL,
    00357     LE_GPOS_TABLE_TAG = 0x47504F53UL,
    00358     LE_GSUB_TABLE_TAG = 0x47535542UL,
    00359     LE_GVAR_TABLE_TAG = 0x67766172UL,
    00360     LE_HDMX_TABLE_TAG = 0x68646D78UL,
    00361     LE_HEAD_TABLE_TAG = 0x68656164UL,
    00362     LE_HHEA_TABLE_TAG = 0x68686561UL,
    00363     LE_HMTX_TABLE_TAG = 0x686D7478UL,
    00364     LE_HSTY_TABLE_TAG = 0x68737479UL,
    00365     LE_JUST_TABLE_TAG = 0x6A757374UL,
    00366     LE_JSTF_TABLE_TAG = 0x4A535446UL,
    00367     LE_KERN_TABLE_TAG = 0x6B65726EUL,
    00368     LE_LCAR_TABLE_TAG = 0x6C636172UL,
    00369     LE_LOCA_TABLE_TAG = 0x6C6F6361UL,
    00370     LE_LTSH_TABLE_TAG = 0x4C545348UL,
    00371     LE_MAXP_TABLE_TAG = 0x6D617870UL,
    00372     LE_MORT_TABLE_TAG = 0x6D6F7274UL,
    00373     LE_MORX_TABLE_TAG = 0x6D6F7278UL,
    00374     LE_NAME_TABLE_TAG = 0x6E616D65UL,
    00375     LE_OPBD_TABLE_TAG = 0x6F706264UL,
    00376     LE_OS_2_TABLE_TAG = 0x4F532F32UL,
    00377     LE_PCLT_TABLE_TAG = 0x50434C54UL,
    00378     LE_POST_TABLE_TAG = 0x706F7374UL,
    00379     LE_PREP_TABLE_TAG = 0x70726570UL,
    00380     LE_PROP_TABLE_TAG = 0x70726F70UL,
    00381     LE_TRAK_TABLE_TAG = 0x7472616BUL,
    00382     LE_VDMX_TABLE_TAG = 0x56444D58UL,
    00383     LE_VHEA_TABLE_TAG = 0x76686561UL,
    00384     LE_VMTX_TABLE_TAG = 0x766D7478UL,
    00385     LE_VORG_TABLE_TAG = 0x564F5247UL,
    00386     LE_ZAPF_TABLE_TAG = 0x5A617066UL
    00387 };
    00388
    00395 enum LEFeatureTags {
    00396     LE_AALT_FEATURE_TAG = 0x61616C74UL,
    00397     LE_ABVF_FEATURE_TAG = 0x61627666UL,
    00398     LE_ABVM_FEATURE_TAG = 0x6162766DUL,
    00399     LE_ABVS_FEATURE_TAG = 0x61627673UL,
    00400     LE_AFRC_FEATURE_TAG = 0x61667263UL,
    00401     LE_AKHN_FEATURE_TAG = 0x616B686EUL,
    00402     LE_BLWF_FEATURE_TAG = 0x626C7766UL,
    00403     LE_BLWM_FEATURE_TAG = 0x626C776DUL,
    00404     LE_BLWS_FEATURE_TAG = 0x626C7773UL,
    00405     LE_CALT_FEATURE_TAG = 0x63616C74UL,
    00406     LE_CASE_FEATURE_TAG = 0x63617365UL,
    00407     LE_CCMP_FEATURE_TAG = 0x63636D70UL,
    00408         LE_CJCT_FEATURE_TAG = 0x636A6374UL,
    00409     LE_CLIG_FEATURE_TAG = 0x636C6967UL,
    00410     LE_CPSP_FEATURE_TAG = 0x63707370UL,
    00411     LE_CSWH_FEATURE_TAG = 0x63737768UL,
    00412     LE_CURS_FEATURE_TAG = 0x63757273UL,
    00413     LE_C2SC_FEATURE_TAG = 0x63327363UL,
    00414     LE_C2PC_FEATURE_TAG = 0x63327063UL,
    00415     LE_DIST_FEATURE_TAG = 0x64697374UL,
    00416     LE_DLIG_FEATURE_TAG = 0x646C6967UL,
    00417     LE_DNOM_FEATURE_TAG = 0x646E6F6DUL,
    00418     LE_EXPT_FEATURE_TAG = 0x65787074UL,
    00419     LE_FALT_FEATURE_TAG = 0x66616C74UL,
    00420     LE_FIN2_FEATURE_TAG = 0x66696E32UL,
    00421     LE_FIN3_FEATURE_TAG = 0x66696E33UL,
    00422     LE_FINA_FEATURE_TAG = 0x66696E61UL,
    00423     LE_FRAC_FEATURE_TAG = 0x66726163UL,
    00424     LE_FWID_FEATURE_TAG = 0x66776964UL,
    00425     LE_HALF_FEATURE_TAG = 0x68616C66UL,
    00426     LE_HALN_FEATURE_TAG = 0x68616C6EUL,
    00427     LE_HALT_FEATURE_TAG = 0x68616C74UL,
    00428     LE_HIST_FEATURE_TAG = 0x68697374UL,
    00429     LE_HKNA_FEATURE_TAG = 0x686B6E61UL,
    00430     LE_HLIG_FEATURE_TAG = 0x686C6967UL,
    00431     LE_HNGL_FEATURE_TAG = 0x686E676CUL,
    00432     LE_HWID_FEATURE_TAG = 0x68776964UL,
    00433     LE_INIT_FEATURE_TAG = 0x696E6974UL,
    00434     LE_ISOL_FEATURE_TAG = 0x69736F6CUL,
    00435     LE_ITAL_FEATURE_TAG = 0x6974616CUL,
    00436     LE_JALT_FEATURE_TAG = 0x6A616C74UL,
    00437     LE_JP78_FEATURE_TAG = 0x6A703738UL,
    00438     LE_JP83_FEATURE_TAG = 0x6A703833UL,
    00439     LE_JP90_FEATURE_TAG = 0x6A703930UL,
    00440     LE_KERN_FEATURE_TAG = 0x6B65726EUL,
    00441     LE_LFBD_FEATURE_TAG = 0x6C666264UL,
    00442     LE_LIGA_FEATURE_TAG = 0x6C696761UL,
    00443     LE_LJMO_FEATURE_TAG = 0x6C6A6D6FUL,
    00444     LE_LNUM_FEATURE_TAG = 0x6C6E756DUL,
    00445     LE_LOCL_FEATURE_TAG = 0x6C6F636CUL,
    00446     LE_MARK_FEATURE_TAG = 0x6D61726BUL,
    00447     LE_MED2_FEATURE_TAG = 0x6D656432UL,
    00448     LE_MEDI_FEATURE_TAG = 0x6D656469UL,
    00449     LE_MGRK_FEATURE_TAG = 0x6D67726BUL,
    00450     LE_MKMK_FEATURE_TAG = 0x6D6B6D6BUL,
    00451     LE_MSET_FEATURE_TAG = 0x6D736574UL,
    00452     LE_NALT_FEATURE_TAG = 0x6E616C74UL,
    00453     LE_NLCK_FEATURE_TAG = 0x6E6C636BUL,
    00454     LE_NUKT_FEATURE_TAG = 0x6E756B74UL,
    00455     LE_NUMR_FEATURE_TAG = 0x6E756D72UL,
    00456     LE_ONUM_FEATURE_TAG = 0x6F6E756DUL,
    00457     LE_OPBD_FEATURE_TAG = 0x6F706264UL,
    00458     LE_ORDN_FEATURE_TAG = 0x6F72646EUL,
    00459     LE_ORNM_FEATURE_TAG = 0x6F726E6DUL,
    00460     LE_PALT_FEATURE_TAG = 0x70616C74UL,
    00461     LE_PCAP_FEATURE_TAG = 0x70636170UL,
    00462     LE_PNUM_FEATURE_TAG = 0x706E756DUL,
    00463     LE_PREF_FEATURE_TAG = 0x70726566UL,
    00464     LE_PRES_FEATURE_TAG = 0x70726573UL,
    00465     LE_PSTF_FEATURE_TAG = 0x70737466UL,
    00466     LE_PSTS_FEATURE_TAG = 0x70737473UL,
    00467     LE_PWID_FEATURE_TAG = 0x70776964UL,
    00468     LE_QWID_FEATURE_TAG = 0x71776964UL,
    00469     LE_RAND_FEATURE_TAG = 0x72616E64UL,
    00470     LE_RLIG_FEATURE_TAG = 0x726C6967UL,
    00471     LE_RPHF_FEATURE_TAG = 0x72706866UL,
    00472         LE_RKRF_FEATURE_TAG = 0x726B7266UL,
    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 #endif

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines