vrshoot
diff libs/ft2static/freetype/fttypes.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/ft2static/freetype/fttypes.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,588 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* fttypes.h */ 1.7 +/* */ 1.8 +/* FreeType simple types definitions (specification only). */ 1.9 +/* */ 1.10 +/* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 +#ifndef __FTTYPES_H__ 1.23 +#define __FTTYPES_H__ 1.24 + 1.25 + 1.26 +#include <ft2build.h> 1.27 +#include FT_CONFIG_CONFIG_H 1.28 +#include FT_SYSTEM_H 1.29 +#include FT_IMAGE_H 1.30 + 1.31 +#include <stddef.h> 1.32 + 1.33 + 1.34 +FT_BEGIN_HEADER 1.35 + 1.36 + 1.37 + /*************************************************************************/ 1.38 + /* */ 1.39 + /* <Section> */ 1.40 + /* basic_types */ 1.41 + /* */ 1.42 + /* <Title> */ 1.43 + /* Basic Data Types */ 1.44 + /* */ 1.45 + /* <Abstract> */ 1.46 + /* The basic data types defined by the library. */ 1.47 + /* */ 1.48 + /* <Description> */ 1.49 + /* This section contains the basic data types defined by FreeType~2, */ 1.50 + /* ranging from simple scalar types to bitmap descriptors. More */ 1.51 + /* font-specific structures are defined in a different section. */ 1.52 + /* */ 1.53 + /* <Order> */ 1.54 + /* FT_Byte */ 1.55 + /* FT_Bytes */ 1.56 + /* FT_Char */ 1.57 + /* FT_Int */ 1.58 + /* FT_UInt */ 1.59 + /* FT_Int16 */ 1.60 + /* FT_UInt16 */ 1.61 + /* FT_Int32 */ 1.62 + /* FT_UInt32 */ 1.63 + /* FT_Short */ 1.64 + /* FT_UShort */ 1.65 + /* FT_Long */ 1.66 + /* FT_ULong */ 1.67 + /* FT_Bool */ 1.68 + /* FT_Offset */ 1.69 + /* FT_PtrDist */ 1.70 + /* FT_String */ 1.71 + /* FT_Tag */ 1.72 + /* FT_Error */ 1.73 + /* FT_Fixed */ 1.74 + /* FT_Pointer */ 1.75 + /* FT_Pos */ 1.76 + /* FT_Vector */ 1.77 + /* FT_BBox */ 1.78 + /* FT_Matrix */ 1.79 + /* FT_FWord */ 1.80 + /* FT_UFWord */ 1.81 + /* FT_F2Dot14 */ 1.82 + /* FT_UnitVector */ 1.83 + /* FT_F26Dot6 */ 1.84 + /* */ 1.85 + /* */ 1.86 + /* FT_Generic */ 1.87 + /* FT_Generic_Finalizer */ 1.88 + /* */ 1.89 + /* FT_Bitmap */ 1.90 + /* FT_Pixel_Mode */ 1.91 + /* FT_Palette_Mode */ 1.92 + /* FT_Glyph_Format */ 1.93 + /* FT_IMAGE_TAG */ 1.94 + /* */ 1.95 + /*************************************************************************/ 1.96 + 1.97 + 1.98 + /*************************************************************************/ 1.99 + /* */ 1.100 + /* <Type> */ 1.101 + /* FT_Bool */ 1.102 + /* */ 1.103 + /* <Description> */ 1.104 + /* A typedef of unsigned char, used for simple booleans. As usual, */ 1.105 + /* values 1 and~0 represent true and false, respectively. */ 1.106 + /* */ 1.107 + typedef unsigned char FT_Bool; 1.108 + 1.109 + 1.110 + /*************************************************************************/ 1.111 + /* */ 1.112 + /* <Type> */ 1.113 + /* FT_FWord */ 1.114 + /* */ 1.115 + /* <Description> */ 1.116 + /* A signed 16-bit integer used to store a distance in original font */ 1.117 + /* units. */ 1.118 + /* */ 1.119 + typedef signed short FT_FWord; /* distance in FUnits */ 1.120 + 1.121 + 1.122 + /*************************************************************************/ 1.123 + /* */ 1.124 + /* <Type> */ 1.125 + /* FT_UFWord */ 1.126 + /* */ 1.127 + /* <Description> */ 1.128 + /* An unsigned 16-bit integer used to store a distance in original */ 1.129 + /* font units. */ 1.130 + /* */ 1.131 + typedef unsigned short FT_UFWord; /* unsigned distance */ 1.132 + 1.133 + 1.134 + /*************************************************************************/ 1.135 + /* */ 1.136 + /* <Type> */ 1.137 + /* FT_Char */ 1.138 + /* */ 1.139 + /* <Description> */ 1.140 + /* A simple typedef for the _signed_ char type. */ 1.141 + /* */ 1.142 + typedef signed char FT_Char; 1.143 + 1.144 + 1.145 + /*************************************************************************/ 1.146 + /* */ 1.147 + /* <Type> */ 1.148 + /* FT_Byte */ 1.149 + /* */ 1.150 + /* <Description> */ 1.151 + /* A simple typedef for the _unsigned_ char type. */ 1.152 + /* */ 1.153 + typedef unsigned char FT_Byte; 1.154 + 1.155 + 1.156 + /*************************************************************************/ 1.157 + /* */ 1.158 + /* <Type> */ 1.159 + /* FT_Bytes */ 1.160 + /* */ 1.161 + /* <Description> */ 1.162 + /* A typedef for constant memory areas. */ 1.163 + /* */ 1.164 + typedef const FT_Byte* FT_Bytes; 1.165 + 1.166 + 1.167 + /*************************************************************************/ 1.168 + /* */ 1.169 + /* <Type> */ 1.170 + /* FT_Tag */ 1.171 + /* */ 1.172 + /* <Description> */ 1.173 + /* A typedef for 32-bit tags (as used in the SFNT format). */ 1.174 + /* */ 1.175 + typedef FT_UInt32 FT_Tag; 1.176 + 1.177 + 1.178 + /*************************************************************************/ 1.179 + /* */ 1.180 + /* <Type> */ 1.181 + /* FT_String */ 1.182 + /* */ 1.183 + /* <Description> */ 1.184 + /* A simple typedef for the char type, usually used for strings. */ 1.185 + /* */ 1.186 + typedef char FT_String; 1.187 + 1.188 + 1.189 + /*************************************************************************/ 1.190 + /* */ 1.191 + /* <Type> */ 1.192 + /* FT_Short */ 1.193 + /* */ 1.194 + /* <Description> */ 1.195 + /* A typedef for signed short. */ 1.196 + /* */ 1.197 + typedef signed short FT_Short; 1.198 + 1.199 + 1.200 + /*************************************************************************/ 1.201 + /* */ 1.202 + /* <Type> */ 1.203 + /* FT_UShort */ 1.204 + /* */ 1.205 + /* <Description> */ 1.206 + /* A typedef for unsigned short. */ 1.207 + /* */ 1.208 + typedef unsigned short FT_UShort; 1.209 + 1.210 + 1.211 + /*************************************************************************/ 1.212 + /* */ 1.213 + /* <Type> */ 1.214 + /* FT_Int */ 1.215 + /* */ 1.216 + /* <Description> */ 1.217 + /* A typedef for the int type. */ 1.218 + /* */ 1.219 + typedef signed int FT_Int; 1.220 + 1.221 + 1.222 + /*************************************************************************/ 1.223 + /* */ 1.224 + /* <Type> */ 1.225 + /* FT_UInt */ 1.226 + /* */ 1.227 + /* <Description> */ 1.228 + /* A typedef for the unsigned int type. */ 1.229 + /* */ 1.230 + typedef unsigned int FT_UInt; 1.231 + 1.232 + 1.233 + /*************************************************************************/ 1.234 + /* */ 1.235 + /* <Type> */ 1.236 + /* FT_Long */ 1.237 + /* */ 1.238 + /* <Description> */ 1.239 + /* A typedef for signed long. */ 1.240 + /* */ 1.241 + typedef signed long FT_Long; 1.242 + 1.243 + 1.244 + /*************************************************************************/ 1.245 + /* */ 1.246 + /* <Type> */ 1.247 + /* FT_ULong */ 1.248 + /* */ 1.249 + /* <Description> */ 1.250 + /* A typedef for unsigned long. */ 1.251 + /* */ 1.252 + typedef unsigned long FT_ULong; 1.253 + 1.254 + 1.255 + /*************************************************************************/ 1.256 + /* */ 1.257 + /* <Type> */ 1.258 + /* FT_F2Dot14 */ 1.259 + /* */ 1.260 + /* <Description> */ 1.261 + /* A signed 2.14 fixed float type used for unit vectors. */ 1.262 + /* */ 1.263 + typedef signed short FT_F2Dot14; 1.264 + 1.265 + 1.266 + /*************************************************************************/ 1.267 + /* */ 1.268 + /* <Type> */ 1.269 + /* FT_F26Dot6 */ 1.270 + /* */ 1.271 + /* <Description> */ 1.272 + /* A signed 26.6 fixed float type used for vectorial pixel */ 1.273 + /* coordinates. */ 1.274 + /* */ 1.275 + typedef signed long FT_F26Dot6; 1.276 + 1.277 + 1.278 + /*************************************************************************/ 1.279 + /* */ 1.280 + /* <Type> */ 1.281 + /* FT_Fixed */ 1.282 + /* */ 1.283 + /* <Description> */ 1.284 + /* This type is used to store 16.16 fixed float values, like scaling */ 1.285 + /* values or matrix coefficients. */ 1.286 + /* */ 1.287 + typedef signed long FT_Fixed; 1.288 + 1.289 + 1.290 + /*************************************************************************/ 1.291 + /* */ 1.292 + /* <Type> */ 1.293 + /* FT_Error */ 1.294 + /* */ 1.295 + /* <Description> */ 1.296 + /* The FreeType error code type. A value of~0 is always interpreted */ 1.297 + /* as a successful operation. */ 1.298 + /* */ 1.299 + typedef int FT_Error; 1.300 + 1.301 + 1.302 + /*************************************************************************/ 1.303 + /* */ 1.304 + /* <Type> */ 1.305 + /* FT_Pointer */ 1.306 + /* */ 1.307 + /* <Description> */ 1.308 + /* A simple typedef for a typeless pointer. */ 1.309 + /* */ 1.310 + typedef void* FT_Pointer; 1.311 + 1.312 + 1.313 + /*************************************************************************/ 1.314 + /* */ 1.315 + /* <Type> */ 1.316 + /* FT_Offset */ 1.317 + /* */ 1.318 + /* <Description> */ 1.319 + /* This is equivalent to the ANSI~C `size_t' type, i.e., the largest */ 1.320 + /* _unsigned_ integer type used to express a file size or position, */ 1.321 + /* or a memory block size. */ 1.322 + /* */ 1.323 + typedef size_t FT_Offset; 1.324 + 1.325 + 1.326 + /*************************************************************************/ 1.327 + /* */ 1.328 + /* <Type> */ 1.329 + /* FT_PtrDist */ 1.330 + /* */ 1.331 + /* <Description> */ 1.332 + /* This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the */ 1.333 + /* largest _signed_ integer type used to express the distance */ 1.334 + /* between two pointers. */ 1.335 + /* */ 1.336 + typedef ft_ptrdiff_t FT_PtrDist; 1.337 + 1.338 + 1.339 + /*************************************************************************/ 1.340 + /* */ 1.341 + /* <Struct> */ 1.342 + /* FT_UnitVector */ 1.343 + /* */ 1.344 + /* <Description> */ 1.345 + /* A simple structure used to store a 2D vector unit vector. Uses */ 1.346 + /* FT_F2Dot14 types. */ 1.347 + /* */ 1.348 + /* <Fields> */ 1.349 + /* x :: Horizontal coordinate. */ 1.350 + /* */ 1.351 + /* y :: Vertical coordinate. */ 1.352 + /* */ 1.353 + typedef struct FT_UnitVector_ 1.354 + { 1.355 + FT_F2Dot14 x; 1.356 + FT_F2Dot14 y; 1.357 + 1.358 + } FT_UnitVector; 1.359 + 1.360 + 1.361 + /*************************************************************************/ 1.362 + /* */ 1.363 + /* <Struct> */ 1.364 + /* FT_Matrix */ 1.365 + /* */ 1.366 + /* <Description> */ 1.367 + /* A simple structure used to store a 2x2 matrix. Coefficients are */ 1.368 + /* in 16.16 fixed float format. The computation performed is: */ 1.369 + /* */ 1.370 + /* { */ 1.371 + /* x' = x*xx + y*xy */ 1.372 + /* y' = x*yx + y*yy */ 1.373 + /* } */ 1.374 + /* */ 1.375 + /* <Fields> */ 1.376 + /* xx :: Matrix coefficient. */ 1.377 + /* */ 1.378 + /* xy :: Matrix coefficient. */ 1.379 + /* */ 1.380 + /* yx :: Matrix coefficient. */ 1.381 + /* */ 1.382 + /* yy :: Matrix coefficient. */ 1.383 + /* */ 1.384 + typedef struct FT_Matrix_ 1.385 + { 1.386 + FT_Fixed xx, xy; 1.387 + FT_Fixed yx, yy; 1.388 + 1.389 + } FT_Matrix; 1.390 + 1.391 + 1.392 + /*************************************************************************/ 1.393 + /* */ 1.394 + /* <Struct> */ 1.395 + /* FT_Data */ 1.396 + /* */ 1.397 + /* <Description> */ 1.398 + /* Read-only binary data represented as a pointer and a length. */ 1.399 + /* */ 1.400 + /* <Fields> */ 1.401 + /* pointer :: The data. */ 1.402 + /* */ 1.403 + /* length :: The length of the data in bytes. */ 1.404 + /* */ 1.405 + typedef struct FT_Data_ 1.406 + { 1.407 + const FT_Byte* pointer; 1.408 + FT_Int length; 1.409 + 1.410 + } FT_Data; 1.411 + 1.412 + 1.413 + /*************************************************************************/ 1.414 + /* */ 1.415 + /* <FuncType> */ 1.416 + /* FT_Generic_Finalizer */ 1.417 + /* */ 1.418 + /* <Description> */ 1.419 + /* Describe a function used to destroy the `client' data of any */ 1.420 + /* FreeType object. See the description of the @FT_Generic type for */ 1.421 + /* details of usage. */ 1.422 + /* */ 1.423 + /* <Input> */ 1.424 + /* The address of the FreeType object which is under finalization. */ 1.425 + /* Its client data is accessed through its `generic' field. */ 1.426 + /* */ 1.427 + typedef void (*FT_Generic_Finalizer)(void* object); 1.428 + 1.429 + 1.430 + /*************************************************************************/ 1.431 + /* */ 1.432 + /* <Struct> */ 1.433 + /* FT_Generic */ 1.434 + /* */ 1.435 + /* <Description> */ 1.436 + /* Client applications often need to associate their own data to a */ 1.437 + /* variety of FreeType core objects. For example, a text layout API */ 1.438 + /* might want to associate a glyph cache to a given size object. */ 1.439 + /* */ 1.440 + /* Most FreeType object contains a `generic' field, of type */ 1.441 + /* FT_Generic, which usage is left to client applications and font */ 1.442 + /* servers. */ 1.443 + /* */ 1.444 + /* It can be used to store a pointer to client-specific data, as well */ 1.445 + /* as the address of a `finalizer' function, which will be called by */ 1.446 + /* FreeType when the object is destroyed (for example, the previous */ 1.447 + /* client example would put the address of the glyph cache destructor */ 1.448 + /* in the `finalizer' field). */ 1.449 + /* */ 1.450 + /* <Fields> */ 1.451 + /* data :: A typeless pointer to any client-specified data. This */ 1.452 + /* field is completely ignored by the FreeType library. */ 1.453 + /* */ 1.454 + /* finalizer :: A pointer to a `generic finalizer' function, which */ 1.455 + /* will be called when the object is destroyed. If this */ 1.456 + /* field is set to NULL, no code will be called. */ 1.457 + /* */ 1.458 + typedef struct FT_Generic_ 1.459 + { 1.460 + void* data; 1.461 + FT_Generic_Finalizer finalizer; 1.462 + 1.463 + } FT_Generic; 1.464 + 1.465 + 1.466 + /*************************************************************************/ 1.467 + /* */ 1.468 + /* <Macro> */ 1.469 + /* FT_MAKE_TAG */ 1.470 + /* */ 1.471 + /* <Description> */ 1.472 + /* This macro converts four-letter tags which are used to label */ 1.473 + /* TrueType tables into an unsigned long to be used within FreeType. */ 1.474 + /* */ 1.475 + /* <Note> */ 1.476 + /* The produced values *must* be 32-bit integers. Don't redefine */ 1.477 + /* this macro. */ 1.478 + /* */ 1.479 +#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \ 1.480 + (FT_Tag) \ 1.481 + ( ( (FT_ULong)_x1 << 24 ) | \ 1.482 + ( (FT_ULong)_x2 << 16 ) | \ 1.483 + ( (FT_ULong)_x3 << 8 ) | \ 1.484 + (FT_ULong)_x4 ) 1.485 + 1.486 + 1.487 + /*************************************************************************/ 1.488 + /*************************************************************************/ 1.489 + /* */ 1.490 + /* L I S T M A N A G E M E N T */ 1.491 + /* */ 1.492 + /*************************************************************************/ 1.493 + /*************************************************************************/ 1.494 + 1.495 + 1.496 + /*************************************************************************/ 1.497 + /* */ 1.498 + /* <Section> */ 1.499 + /* list_processing */ 1.500 + /* */ 1.501 + /*************************************************************************/ 1.502 + 1.503 + 1.504 + /*************************************************************************/ 1.505 + /* */ 1.506 + /* <Type> */ 1.507 + /* FT_ListNode */ 1.508 + /* */ 1.509 + /* <Description> */ 1.510 + /* Many elements and objects in FreeType are listed through an */ 1.511 + /* @FT_List record (see @FT_ListRec). As its name suggests, an */ 1.512 + /* FT_ListNode is a handle to a single list element. */ 1.513 + /* */ 1.514 + typedef struct FT_ListNodeRec_* FT_ListNode; 1.515 + 1.516 + 1.517 + /*************************************************************************/ 1.518 + /* */ 1.519 + /* <Type> */ 1.520 + /* FT_List */ 1.521 + /* */ 1.522 + /* <Description> */ 1.523 + /* A handle to a list record (see @FT_ListRec). */ 1.524 + /* */ 1.525 + typedef struct FT_ListRec_* FT_List; 1.526 + 1.527 + 1.528 + /*************************************************************************/ 1.529 + /* */ 1.530 + /* <Struct> */ 1.531 + /* FT_ListNodeRec */ 1.532 + /* */ 1.533 + /* <Description> */ 1.534 + /* A structure used to hold a single list element. */ 1.535 + /* */ 1.536 + /* <Fields> */ 1.537 + /* prev :: The previous element in the list. NULL if first. */ 1.538 + /* */ 1.539 + /* next :: The next element in the list. NULL if last. */ 1.540 + /* */ 1.541 + /* data :: A typeless pointer to the listed object. */ 1.542 + /* */ 1.543 + typedef struct FT_ListNodeRec_ 1.544 + { 1.545 + FT_ListNode prev; 1.546 + FT_ListNode next; 1.547 + void* data; 1.548 + 1.549 + } FT_ListNodeRec; 1.550 + 1.551 + 1.552 + /*************************************************************************/ 1.553 + /* */ 1.554 + /* <Struct> */ 1.555 + /* FT_ListRec */ 1.556 + /* */ 1.557 + /* <Description> */ 1.558 + /* A structure used to hold a simple doubly-linked list. These are */ 1.559 + /* used in many parts of FreeType. */ 1.560 + /* */ 1.561 + /* <Fields> */ 1.562 + /* head :: The head (first element) of doubly-linked list. */ 1.563 + /* */ 1.564 + /* tail :: The tail (last element) of doubly-linked list. */ 1.565 + /* */ 1.566 + typedef struct FT_ListRec_ 1.567 + { 1.568 + FT_ListNode head; 1.569 + FT_ListNode tail; 1.570 + 1.571 + } FT_ListRec; 1.572 + 1.573 + 1.574 + /* */ 1.575 + 1.576 +#define FT_IS_EMPTY( list ) ( (list).head == 0 ) 1.577 + 1.578 + /* return base error code (without module-specific prefix) */ 1.579 +#define FT_ERROR_BASE( x ) ( (x) & 0xFF ) 1.580 + 1.581 + /* return module error code */ 1.582 +#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U ) 1.583 + 1.584 +#define FT_BOOL( x ) ( (FT_Bool)( x ) ) 1.585 + 1.586 +FT_END_HEADER 1.587 + 1.588 +#endif /* __FTTYPES_H__ */ 1.589 + 1.590 + 1.591 +/* END */