00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106 #ifndef INC_CDRFORM
00107 #define INC_CDRFORM
00108
00109 #include "cdrdata.h"
00110
00111 #pragma pack(push, 1) // set the compiler to pack to byte alignment - most handy!
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125 #define cdrT_CDR 0x20524443
00126 #define cdrT_CDR5 0x35524443
00127 #define cdrT_CDR4 0x34524443
00128 #define cdrT_doc 0x20636f64
00129 #define cdrT_mcfg 0x6766636d
00130 #define cdrT_page 0x65676170
00131 #define cdrT_layr 0x7279616c
00132 #define cdrT_lgob 0x626f676c
00133 #define cdrT_loda 0x61646f6c
00134 #define cdrT_obj 0x206a626f
00135 #define cdrT_grp 0x20707267
00136 #define cdrT_trfl 0x6c667274
00137 #define cdrT_trfd 0x64667274
00138 #define cdrT_filt 0x746c6966
00139 #define cdrT_fill 0x6c6c6966
00140 #define cdrT_lnkg 0x676b6e6c
00141 #define cdrT_otlt 0x746c746f
00142 #define cdrT_outl 0x6c74756f
00143 #define cdrT_arrt 0x74727261
00144 #define cdrT_arrw 0x77727261
00145 #define cdrT_lobj 0x6a626f6c
00146 #define cdrT_bpft 0x74667062
00147 #define cdrT_bmpf 0x66706d62
00148 #define cdrT_bmpt 0x74706d62
00149 #define cdrT_bmp 0x20706d62
00150 #define cdrT_stlt 0x746c7473
00151 #define cdrT_styl 0x6c797473
00152 #define cdrT_styd 0x64797473
00153 #define cdrT_vect 0x74636576
00154 #define cdrT_spnd 0x646e7073
00155 #define cdrT_bbox 0x786f6262
00156 #define cdrT_flgs 0x73676c66
00157 #define cdrT_fntt 0x74746e66
00158 #define cdrT_font 0x746e6f66
00159 #define cdrT_txsm 0x6d737874
00160 #define cdrT_tspc 0x63707374
00161 #define cdrT_ftbl 0x6c627466
00162 #define cdrT_lnkt 0x746b6e6c
00163 #define cdrT_btxt 0x74787462
00164 #define cdrT_strl 0x6c727473
00165 #define cdrT_btid 0x64697462
00166 #define cdrT_parl 0x6c726170
00167 #define cdrT_para 0x61726170
00168 #define cdrT_bnch 0x68636e62
00169 #define cdrT_bsch 0x68637362
00170 #define cdrT_envd 0x64766e65
00171 #define cdrT_CDST 0x54534443
00172 #define cdrT_CDT5 0x35544443
00173
00174 #define DEFFOURCC(n, v) n = (((v&0xff)<<24)|((v&0xff00)<<8)|((v&0xff0000)>>8)|((v&0xff000000)>>24))
00175
00176 enum {
00177 DEFFOURCC(cdrT_CDR6, 'CDR6'),
00178 DEFFOURCC(cdrT_CDT6, 'CDT6'),
00179 DEFFOURCC(cdrT_cmx1, 'cmx1')
00180 };
00181
00182
00183
00184 #define CDRCOORDS_TO_MILLIPOINTS 72
00185
00186 typedef struct {
00187 WORD PageX;
00188 WORD PageY;
00189 WORD unknown1;
00190 WORD Orientation;
00191 BYTE unknown2[48];
00192 } cdrfPageInfo;
00193
00194 typedef struct {
00195 WORD unknown[2];
00196 WORD PageY;
00197 WORD PageX;
00198 } cdrfPageInfoV3;
00199
00200 #define cdrf_ORIENTATION_LANDSCAPE 1
00201 #define cdrf_ORIENTATION_PORTRAIT 0
00202
00203 typedef struct {
00204 WORD Size;
00205 WORD unknown[15];
00206 BYTE Name[32];
00207 } cdrfMasterLayerInfo;
00208
00209 #define cdrfLAYERFLAGS_INVISIBLE 0x0100
00210 #define cdrfLAYERFLAGS_LOCKED 0x0010
00211
00212 typedef struct {
00213 WORD Size;
00214 BYTE unknown[23];
00215 BYTE Name[32];
00216 } cdrfMasterLayerInfoV3;
00217
00218 typedef struct {
00219 SWORD X, Y;
00220 } cdrfCoord;
00221
00222 typedef struct {
00223 SWORD x0, y0, x1, y1;
00224 } cdrfBBox;
00225
00226
00227
00228 typedef struct {
00229 WORD Size;
00230 WORD NOffsets;
00231 WORD OffsetsOffset;
00232 WORD TypesOffset;
00233 WORD ObjectType;
00234 } cdrfOffsetHeader;
00235
00236
00237 #define cdrfOBJOFFSETTYPE_COORDS 0x001e
00238 #define cdrfOBJOFFSETTYPE_FILL 0x0014
00239 #define cdrfOBJOFFSETTYPE_LINE 0x000a
00240 #define cdrfOBJOFFSETTYPE_TRANSFORM_V3 0x0064
00241 #define cdrfOBJOFFSETTYPE_STYLE 0x00c8
00242 #define cdrfOBJOFFSETTYPE_LENS 0x1f40 // only in version 5
00243
00244 #define cdrfOBJOFFSETTYPE_PATHTEXT1 0x0bb8
00245 #define cdrfOBJOFFSETTYPE_PATHTEXT2 0x0bc2
00246 #define cdrfOBJOFFSETTYPE_POWERCLIP 0x1f45
00247
00248
00249
00250 typedef struct {
00251 WORD Size;
00252 WORD NTransforms;
00253 WORD unknown[3];
00254 WORD TransformOffsets[4];
00255 } cdrfTransform;
00256
00257 typedef struct {
00258 WORD Type;
00259 } cdrfTransformHeader;
00260
00261 #define cdrfTRANSFORMTYPE_ENVELOPE 1
00262 #define cdrfTRANSFORMTYPE_PERSPECTIVE 2
00263 #define cdrfTRANSFORMTYPE_EXTRUDE 4
00264 #define cdrfTRANSFORMTYPE_MATRIX 8
00265
00266 typedef struct {
00267 WORD Type;
00268 BYTE Transform[8*6];
00269
00270 } cdrfTransformMatrix;
00271
00272 typedef struct {
00273 WORD unknown[2];
00274 SWORD Ox0, Oy1, Ox1, Oy0;
00275 cdrfCoord NewCorners[4];
00276 } cdrfPerspectiveTransform;
00277
00278 typedef struct {
00279 WORD Type;
00280 cdrfPerspectiveTransform Trans;
00281 } cdrfPerspectiveEntry;
00282
00283 typedef struct {
00284 WORD Size;
00285 WORD NTransforms;
00286 WORD OffsetsStart;
00287 } cdrfTransformV4;
00288
00289 typedef struct {
00290 WORD Type;
00291 WORD Transform[2*6];
00292
00293 } cdrfTransformMatrixV4;
00294
00295 typedef struct {
00296 WORD unknown;
00297 WORD NTransforms;
00298 } cdrfTransformV3;
00299
00300 typedef struct {
00301 WORD Type;
00302 WORD unknown[2];
00303 WORD Offset;
00304 WORD unknown2;
00305 } cdrfTransformEntryV3;
00306
00307 typedef struct {
00308 WORD Transform[2*6];
00309 } cdrfTransformMatrixV3;
00310
00311 typedef struct {
00312 WORD unknown[2];
00313 SWORD Ox0, Oy0, Ox1, Oy1;
00314 WORD unknown2[4];
00315 WORD NCoords;
00316 cdrfCoord Coords[25];
00317 } cdrfTransformEnvelopeV3;
00318
00319 #define cdrfTRANSFORMTYPE_MATRIX_V3 0x8c
00320 #define cdrfTRANSFORMTYPE_EXTRUDE_V3 0x3c
00321 #define cdrfTRANSFORMTYPE_PERSPECTIVE_V3 0x28
00322 #define cdrfTRANSFORMTYPE_ENVELOPE_V3 0x14
00323
00324
00325
00326 typedef struct {
00327 WORD Type;
00328 WORD unknown[2];
00329 WORD Ox0, Oy0, Ox1, Oy1;
00330 WORD Corners[4];
00331 } cdrfTransformEnvelope;
00332
00333
00334 #define cdrfENVELOPEOFFSETTYPE_COORDS 0x001e
00335 #define cdrfENVELOPEOFFSETTYPE_TYPES 0x0028
00336
00337 typedef struct
00338 {
00339 WORD cf11a;
00340 SWORD cf11b;
00341 WORD cf21a;
00342 SWORD cf21b;
00343 WORD cf31a;
00344 SWORD cf31b;
00345 FLOAT4 f41;
00346 WORD cf12a;
00347 SWORD cf12b;
00348 WORD cf22a;
00349 SWORD cf22b;
00350 WORD cf32a;
00351 SWORD cf32b;
00352 FLOAT4 f42;
00353 WORD cf13a;
00354 SWORD cf13b;
00355 WORD cf23a;
00356 SWORD cf23b;
00357 WORD cf33a;
00358 SWORD cf33b;
00359 FLOAT4 f43;
00360
00361 SWORD nXRotation;
00362 SWORD nYRotation;
00363 SWORD nZRotation;
00364 SWORD Cx,Cy;
00365 SDWORD Cz;
00366 } cdrfTransformExtrudeV3;
00367
00368 typedef struct
00369 {
00370 WORD Type;
00371 WORD cf11a;
00372 SWORD cf11b;
00373 WORD cf21a;
00374 SWORD cf21b;
00375 WORD cf31a;
00376 SWORD cf31b;
00377 SDWORD f41;
00378 WORD cf12a;
00379 SWORD cf12b;
00380 WORD cf22a;
00381 SWORD cf22b;
00382 WORD cf32a;
00383 SWORD cf32b;
00384 SDWORD f42;
00385 WORD cf13a;
00386 SWORD cf13b;
00387 WORD cf23a;
00388 SWORD cf23b;
00389 WORD cf33a;
00390 SWORD cf33b;
00391 SDWORD f43;
00392
00393 SWORD nXRotation;
00394 SWORD nYRotation;
00395 SWORD nZRotation;
00396 SWORD Cx,Cy;
00397 SDWORD Cz;
00398 } cdrfTransformExtrude;
00399
00400
00401
00402 #define cdrfLINKTYPE_EXTRUDE 0x8
00403 #define cdrfLINKTYPE_CONTOUR 0xf
00404 #define cdrfLINKTYPE_POWERLINE 0xd
00405 #define cdrfLINKTYPE_BLEND 0x7
00406
00407
00408
00409
00410 #define cdrfOBJTYPE_V3ADD 1
00411
00412 #define cdrfOBJTYPE_RECTANGLE 1
00413 #define cdrfOBJTYPE_ELLIPSE 2
00414 #define cdrfOBJTYPE_PATH 3
00415 #define cdrfOBJTYPE_TEXT 4
00416 #define cdrfOBJTYPE_BITMAP 5
00417 #define cdrfOBJTYPE_TEXTSTORY 6
00418
00419
00420
00421 #define cdrfCOLOURTYPE_PANTONE_SPOT 0x0001
00422 #define cdrfCOLOURTYPE_CMYK 0x0002
00423 #define cdrfCOLOURTYPE_CMYK255 0x0003
00424 #define cdrfCOLOURTYPE_CMY 0x0004
00425 #define cdrfCOLOURTYPE_RGB 0x0005
00426 #define cdrfCOLOURTYPE_HSV 0x0006
00427 #define cdrfCOLOURTYPE_GREYSCALE 0x0009
00428 #define cdrfCOLOURTYPE_LAB 0x000C
00429
00430 #define cdrfCOLOURSUBTYPE_FOCOLTONE 0x0008
00431 #define cdrfCOLOURSUBTYPE_PANTONE_PROC 0x0002
00432 #define cdrfCOLOURSUBTYPE_TRUMATCH 0x0001
00433
00434 #define cdrfCOLOURTYPEV4_PANTONE_SPOT 0x0000
00435 #define cdrfCOLOURTYPEV4_CMYK 0x0001
00436
00437 #define cdrfCOLOURTYPEV3_PANTONE 0x0000
00438 #define cdrfCOLOURTYPEV3_CMYK 0x0001
00439
00440 typedef struct {
00441 BYTE Type;
00442 union {
00443 struct {
00444 BYTE C, M, Y, K;
00445 } CMYK;
00446 struct {
00447 WORD ColourNumber;
00448 WORD Tint;
00449 } Pantone;
00450 } Data;
00451 } cdrfColourV3;
00452
00453 typedef struct {
00454 union {
00455 struct {
00456 WORD type;
00457 WORD subtype;
00458 WORD unknown[2];
00459 union {
00460 struct {
00461 BYTE c, m, y, k;
00462 } cmyk;
00463 struct {
00464 BYTE b, g, r;
00465 } rgb;
00466 struct {
00467 WORD h;
00468 BYTE s, v;
00469 } hsv;
00470 struct {
00471 BYTE i;
00472 } greyscale;
00473 struct {
00474 WORD colournumber;
00475 WORD tint;
00476 } pantone_spot;
00477 } data;
00478 } v5;
00479 struct {
00480 WORD type;
00481 union {
00482 struct {
00483 WORD c, m, y, k;
00484 } cmyk;
00485 struct {
00486 WORD colournumber;
00487 WORD tint;
00488 } pantone_spot;
00489 } data;
00490 } v4;
00491 cdrfColourV3 v3;
00492 } data;
00493 } cdrfColour;
00494
00495
00496
00497
00498 typedef struct {
00499 DWORD FillReference;
00500 WORD FillType;
00501 WORD unknown;
00502 } cdrfFillHeader;
00503
00504 #define cdrfFILLTYPE_NONE 0x0000
00505 #define cdrfFILLTYPE_FLAT 0x0001
00506 #define cdrfFILLTYPE_GRADUATED 0x0002
00507 #define cdrfFILLTYPE_PATTERN 0x0007
00508 #define cdrfFILLTYPE_VECTOR 0x000a
00509 #define cdrfFILLTYPE_TEXTURE 0x000b
00510
00511 typedef struct {
00512 cdrfFillHeader Header;
00513 cdrfColour Colour;
00514 WORD unknown2[5];
00515 } cdrfFillFlat;
00516
00517 typedef struct {
00518 cdrfFillHeader Header;
00519 WORD GradFillType;
00520 WORD unknown[5];
00521 SWORD Pad;
00522 SWORD Angle;
00523 SWORD HorizontalCentreOffset;
00524 SWORD VerticalCentreOffset;
00525 WORD unknown2;
00526 WORD ColourType;
00527 WORD NColours;
00528 } cdrfFillGraduated;
00529
00530 #define cdrfGRADFILLTYPE_LINEAR 1
00531 #define cdrfGRADFILLTYPE_RADIAL 2
00532 #define cdrfGRADFILLTYPE_CONICAL 3
00533 #define cdrfGRADFILLTYPE_SQUARE 4
00534
00535 #define cdrfGRADFILLCOLOURTYPE_DIRECT 0
00536 #define cdrfGRADFILLCOLOURTYPE_RAINBOW_CLOCKWISE 1
00537 #define cdrfGRADFILLCOLOURTYPE_RAINBOW_ANTICLOCKWISE 2
00538 #define cdrfGRADFILLCOLOURTYPE_CUSTOM 3
00539
00540 typedef struct {
00541 cdrfColour Colour;
00542 WORD Percentage;
00543 } cdrfFillGradColour;
00544
00545 #define cdrfFILLTYPEV3_NONE 0x00
00546 #define cdrfFILLTYPEV3_FLAT 0x01
00547 #define cdrfFILLTYPEV3_LINEAR 0x02
00548 #define cdrfFILLTYPEV3_RADIAL 0x04
00549 #define cdrfFILLTYPEV3_PATTERN 0x07
00550 #define cdrfFILLTYPEV3_VECTOR 0x0a
00551
00552 typedef struct {
00553 BYTE Type;
00554 union {
00555 struct {
00556 cdrfColourV3 Colour;
00557 } Flat;
00558 struct {
00559 SWORD Angle;
00560 cdrfColourV3 Colour1;
00561 cdrfColourV3 Colour2;
00562 BYTE unknown[7];
00563 SWORD Pad;
00564 SWORD HorizontalCentreOffset;
00565 SWORD VerticalCentreOffset;
00566 } Grad;
00567 struct {
00568 DWORD Reference;
00569 SWORD SizeX;
00570 SWORD SizeY;
00571 SWORD OffsetX;
00572 SWORD OffsetY;
00573 BYTE unknown[3];
00574 cdrfColourV3 Colour1;
00575 cdrfColourV3 Colour2;
00576 } Pattern;
00577 struct {
00578 WORD Reference;
00579 SWORD SizeX;
00580 SWORD SizeY;
00581 SWORD OffsetX;
00582 SWORD OffsetY;
00583 } Vector;
00584 } Data;
00585 } cdrfFillV3;
00586
00587 typedef struct {
00588 cdrfFillHeader Header;
00589 DWORD Reference;
00590 WORD SizeX, SizeY;
00591 SWORD OffsetX, OffsetY;
00592 SWORD TileOffsets;
00593 WORD TileOffsetType;
00594 cdrfColour Colour1;
00595 cdrfColour Colour2;
00596 } cdrfFillPattern;
00597
00598 #define cdrfTILEOFFSETTYPE_ROW 0
00599 #define cdrfTILEOFFSETTYPE_COLUMN 1
00600
00601 typedef struct {
00602 cdrfFillHeader Header;
00603 WORD VectorReference;
00604
00605
00606 } cdrfFillTexture;
00607
00608 typedef struct {
00609 cdrfFillHeader Header;
00610 WORD VectorReference;
00611 SWORD SizeX;
00612 SWORD SizeY;
00613 SWORD OffsetX;
00614 SWORD OffsetY;
00615 SWORD TileOffsets;
00616 } cdrfFillVector;
00617
00618
00619
00620 typedef struct {
00621 BYTE Type;
00622 BYTE unknown[4];
00623 BYTE SubType;
00624 WORD Percent;
00625 } cdrfLensDefn;
00626
00627 #define cdrfLENSTYPE_TRANSPARENT 0x01
00628
00629 #define cdrfTRANSPARENTTYPE_MIX 0
00630 #define cdrfTRANSPARENTTYPE_STAINED 1
00631 #define cdrfTRANSPARENTTYPE_BLEACH 2
00632 #define cdrfTRANSPARENTTYPE_CONTRAST 13
00633 #define cdrfTRANSPARENTTYPE_SATURATE 16
00634 #define cdrfTRANSPARENTTYPE_DARKEN 19
00635 #define cdrfTRANSPARENTTYPE_LIGHTEN 22
00636 #define cdrfTRANSPARENTTYPE_BRIGHTNESS 25
00637 #define cdrfTRANSPARENTTYPE_LUMINOSITY 28
00638
00639
00640
00641 typedef struct {
00642 DWORD OutlineReference;
00643 WORD Flags;
00644 WORD EndStyle;
00645 WORD JoinStyle;
00646 WORD LineThickness;
00647 WORD NibStrech;
00648 WORD NibAngle;
00649 cdrfColour Colour;
00650 WORD unknown[5];
00651 WORD NDashSegments;
00652 WORD DashSegments[10];
00653 DWORD StartArrowReference;
00654 DWORD EndArrowReference;
00655 } cdrfOutline;
00656
00657 #define cdrfOUTLINE_NO_ARROWHEAD 0
00658
00659 #define cdrfOUTLINE_DEFAULT_WIDTH (3*72)
00660
00661 #define cdrfOUTLINEFLAGS_NOOUTLINE 0x01
00662 #define cdrfOUTLINEFLAGS_NODASH 0x02
00663 #define cdrfOUTLINEFLAGS_BEHINDFILL 0x10
00664 #define cdrfOUTLINEFLAGS_SCALEWITHOBJ 0x20
00665
00666 #define cdrfENDSTYLE_BUTT 0
00667 #define cdrfENDSTYLE_ROUNDED 1
00668 #define cdrfENDSTYLE_SQUARE 2
00669
00670 #define cdrfJOINSTYLE_SQUARE 0
00671 #define cdrfJOINSTYLE_ROUNDED 1
00672 #define cdrfJOINSTYLE_BEVEL 2
00673
00674 #define cdrfOUTLINEFLAGSV3_STROKED 0x01
00675 #define cdrfOUTLINEFLAGSV3_SCALEWITHOBJECT 0x80
00676
00677 #define cdrfMAX_DASH_ELEMENTS 10
00678
00679 typedef struct {
00680 BYTE Flags;
00681 SWORD LineThickness;
00682 SWORD NibStrech;
00683 SWORD NibAngle;
00684 cdrfColourV3 Colour;
00685 BYTE unknown[7];
00686 BYTE NDashSegments;
00687 BYTE DashSegments[10];
00688 WORD JoinStyle;
00689 BYTE EndStyle;
00690 BYTE EndStyle2;
00691 DWORD StartArrowReference;
00692 DWORD EndArrowReference;
00693 } cdrfOutlineV3;
00694
00695
00696
00697
00698
00699
00700
00701
00702 typedef struct {
00703 DWORD ArrowheadReference;
00704 WORD Distance;
00705 WORD NNodes;
00706 WORD CoordsOffset;
00707 WORD unknown;
00708 BYTE NodeTypes[4];
00709 } cdrfArrowhead;
00710
00711
00712
00713 #define cdrfARROWHEAD_COORDOFF_CORRECT 6
00714
00715 #define cdrfARROWHEAD_LINEWIDTH 500
00716
00717
00718
00719 typedef struct {
00720 WORD NCoords;
00721 WORD unknown2;
00722 } cdrfPathCoordHeader;
00723
00724 #define cdrfPATHCOORDTYPE_MASK 0xc0
00725
00726 #define cdrfPATHCOORDTYPE_MOVE 0x00
00727 #define cdrfPATHCOORDTYPE_LINETO 0x40
00728 #define cdrfPATHCOORDTYPE_CURVE 0x80
00729 #define cdrfPATHCOORDTYPE_CONTROL 0xc0
00730
00731 #define cdrfPATHCOORDATTR_SMOOTH 0x10
00732 #define cdrfPATHCOORDATTR_CLOSE 0x08
00733
00734
00735
00736 typedef struct {
00737 SWORD Width;
00738 SWORD Height;
00739 SWORD CornerRadius;
00740 } cdrfRectangleData;
00741
00742
00743
00744 typedef struct {
00745 SWORD Width;
00746 SWORD Height;
00747 } cdrfEllipseData;
00748
00749
00750
00751 typedef struct {
00752 SWORD SizeX;
00753 SWORD SizeY;
00754 WORD unknown[2];
00755 WORD PixelsX;
00756 WORD PixelsY;
00757 WORD BitmapReference;
00758 WORD unknown2[10];
00759 SWORD Left;
00760 SWORD Bottom;
00761 SWORD Right;
00762 SWORD Top;
00763 } cdrfBitmapData;
00764
00765
00766 typedef struct {
00767 SWORD SizeX;
00768 SWORD SizeY;
00769 WORD unknown[2];
00770 WORD PixelsX;
00771 WORD PixelsY;
00772 WORD unknown2;
00773 WORD BitmapReference;
00774 WORD unknown3[6];
00775 SWORD Left;
00776 SWORD Bottom;
00777 SWORD Right;
00778 SWORD Top;
00779 } cdrfBitmapData3;
00780
00781
00782
00783
00784
00785
00786 typedef struct {
00787 DWORD Reference;
00788 DWORD DataOffset;
00789 DWORD SizeX;
00790 DWORD SizeY;
00791 WORD unknown[4];
00792 DWORD DataSize;
00793 } cdrfPatternBitmapHeader;
00794
00795 typedef struct {
00796 WORD Reference;
00797 WORD unknown[5];
00798 WORD ImageOffset;
00799 WORD unknown2;
00800 WORD ImageType;
00801 WORD unknown3[3];
00802 DWORD SizeX;
00803 DWORD SizeY;
00804 WORD unknown4[2];
00805 DWORD Depth;
00806 WORD unknown5[21];
00807 WORD NPaletteEntries;
00808 } cdrfBitmapHeader;
00809
00810
00811 #define cdrfBitmapHeaderImageOffsetCorrect 82 // add this to ImageOffset
00812
00813 #define cdrfBitmapGreyscaleImageStart 0x50
00814
00815 #define cdrfBITMAPTYPE_COLOUR 0x0008
00816 #define cdrfBITMAPTYPE_GREYSCALE 0x0005
00817
00818 typedef struct {
00819 BYTE Blue, Green, Red;
00820 } cdrfBitmapPaletteEntry;
00821
00822 typedef struct {
00823 WORD Reference;
00824 WORD unknown[5];
00825 WORD ImageOffset;
00826 WORD unknown2[3];
00827 DWORD SizeX;
00828 DWORD SizeY;
00829 WORD unknown4[1];
00830 WORD Depth;
00831 WORD unknown5[8];
00832 WORD NPaletteEntries;
00833 WORD unknown6[3];
00834 } cdrfBitmapHeader4;
00835
00836
00837 typedef struct {
00838 BYTE Blue, Green, Red, unused;
00839 } cdrfBitmapPaletteEntry4;
00840
00841
00842
00843 typedef struct {
00844 WORD Reference;
00845 } cdrfStyleReference;
00846
00847 typedef struct {
00848 WORD Reference;
00849 cdrfOffsetHeader Header;
00850 } cdrfStyle;
00851
00852 #define cdrfSTYLEOFFSETTYPE_FILL 0xcd
00853 #define cdrfSTYLEOFFSETTYPE_OUTLINE 0xd2
00854
00855
00856
00857 typedef struct {
00858 WORD unknown[8];
00859 WORD Position;
00860 WORD unknown2[2];
00861 WORD Alignment;
00862 } cdrfTextOnPathInfo;
00863
00864 #define cdrfTEXTONPATHPOS_BOTTOM 1
00865 #define cdrfTEXTONPATHPOS_TOP 2
00866 #define cdrfTEXTONPATHPOS_CENTRE 3
00867 #define cdrfTEXTONPATHPOS_BASELINE 4
00868
00869 #define cdrfTEXTONPATHALIGN_LEFT 1
00870 #define cdrfTEXTONPATHALIGN_RIGHT 2
00871 #define cdrfTEXTONPATHALIGN_CENTRE 3
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883 typedef struct {
00884 WORD Type;
00885 WORD unknown[3];
00886 WORD NParagraphs;
00887 } cdrfTextInfoHdr;
00888
00889 typedef struct {
00890 WORD Style;
00891 WORD NFontDefns;
00892 } cdrfTextInfoParaHdr;
00893
00894 typedef struct {
00895 WORD Changes;
00896 WORD FontRef;
00897 WORD FontType;
00898 WORD unknown2;
00899 struct {
00900 WORD Underline : 3;
00901 WORD Overline : 3;
00902 WORD StrikeOut : 3;
00903 WORD Placement : 3;
00904 } FontAttr;
00905 WORD FontSize;
00906 WORD Angle;
00907 WORD unknown3[4];
00908 WORD HorizontalShift;
00909 WORD VerticalShift;
00910 WORD unknown4[5];
00911 } cdrfTextInfoFontDefn;
00912
00913 #define cdrfLINETYPE_NONE 0
00914 #define cdrfLINETYPE_SINGLE_THIN 1
00915 #define cdrfLINETYPE_SINGLE_THIN_WORD 2
00916 #define cdrfLINETYPE_SINGLE_THICK 3
00917 #define cdrfLINETYPE_SINGLE_THICK_WORD 4
00918 #define cdrfLINETYPE_DOUBLE_THIN 5
00919 #define cdrfLINETYPE_DOUBLE_THIN_WORD 6
00920
00921 #define cdrfPLACEMENTTYPE_NONE 0
00922 #define cdrfPLACEMENTTYPE_SUPERSCRIPT 1
00923 #define cdrfPLACEMENTTYPE_SUBSCRIPT 2
00924
00925 #define cdrfTEXTINFODEFNCHANGES_FONT 0x0001
00926 #define cdrfTEXTINFODEFNCHANGES_SIZE 0x0004
00927 #define cdrfTEXTINFODEFNCHANGES_ATTR 0x0002
00928
00929 typedef struct {
00930 WORD NChars;
00931 } cdrfTextInfoParaInfo;
00932
00933 typedef struct {
00934 SWORD XSize;
00935 WORD unknown;
00936 WORD Code;
00937 WORD Info;
00938 } cdrfTextInfoChar;
00939
00940 #define cdrfTEXTINFOCHAR_INFO_DEFNMASK 0x0ff0
00941 #define cdrfTEXTINFOCHAR_INFO_DEFNMASKSBY 4 // number of bits to shift right
00942
00943 typedef struct {
00944 WORD unknown;
00945 WORD XSize;
00946 WORD YSize;
00947
00948 } cdrfTextStoryCoordData;
00949
00950 #define cdrfTEXTSTYLE_OFFSETTYPE_FONT 0xdc
00951 #define cdrfTEXTSTYLE_OFFSETTYPE_SPACING 0xeb
00952 #define cdrfTEXTSTYLE_OFFSETTYPE_ALIGNMENT 0xe1
00953
00954 typedef struct {
00955 WORD Reference;
00956 cdrfOffsetHeader Hdr;
00957 } cdrfTextStyleHdr;
00958
00959 typedef struct {
00960 WORD FontRef;
00961 WORD FontSize;
00962 WORD FontType;
00963 } cdrfTextStyleFont;
00964
00965 typedef struct {
00966 SWORD CharacterSpacing;
00967 SWORD WordSpacing;
00968 SWORD LineSpacing;
00969 WORD unknown;
00970 WORD SpacingSpecified;
00971 } cdrfTextStyleSpacing;
00972
00973 typedef struct {
00974 WORD Alignment;
00975 } cdrfTextStyleAlignment;
00976
00977 #define cdrfALIGNMENT_LEFT 1
00978 #define cdrfALIGNMENT_CENTRE 2
00979 #define cdrfALIGNMENT_RIGHT 3
00980 #define cdrfALIGNMENT_FULL 4
00981
00982 typedef struct {
00983 WORD Reference;
00984 WORD unknown[8];
00985 TCHAR Name[4];
00986 } cdrfFontDefn;
00987
00988 #define cdrfFONTTYPE_NORMAL 0x0040
00989 #define cdrfFONTTYPE_ITALIC 0x0080
00990 #define cdrfFONTTYPE_BOLD 0x1000
00991 #define cdrfFONTTYPE_BOLDITALIC 0x2000
00992
00993 #define cdrfTEXT_NEWLINE 13
00994
00995
00996
00997
00998
00999
01000 typedef struct {
01001 WORD Size;
01002 WORD Entries;
01003 WORD OffsetsOffset;
01004 } cdrfLinkTableHdr;
01005
01006
01007
01008 #define cdrfLINKTABLEENTRYV4_TEXT 0x0061
01009 #define cdrfLINKTABLEENTRYV4_BLEND 0x0010
01010
01011 #define cdrfLINKTABLEENTRY_TEXTONPATH 0x0040
01012
01013 typedef struct {
01014 WORD Type;
01015 WORD Unknown;
01016 WORD TextSerialNumber;
01017 WORD PathSerialNumber;
01018 } cdrfLinkTableEntryTextOnPath;
01019
01020
01021
01022 #define cdrfLINKTABLEENTRYV3_TEXTONPATH 0x8a68
01023
01024 typedef struct {
01025 WORD TextSerialNumber;
01026 WORD Type;
01027 WORD PathSerialNumber;
01028 WORD TextSerialNumber2;
01029 } cdrfLinkTableEntryTextOnPathV3;
01030
01031
01032
01033 typedef struct {
01034 WORD Type;
01035 WORD unknown[6];
01036 WORD TextID;
01037 WORD ObjectSerial;
01038 } cdrfLinkTableEntryTextV4;
01039
01040 typedef struct {
01041 WORD Reference;
01042 TCHAR Name[4];
01043 } cdrfFontDefnV4;
01044
01045
01046
01047 typedef struct {
01048 WORD unknown;
01049 WORD FrameX;
01050 WORD FrameY;
01051 } cdrfParaTextHeaderV4;
01052
01053
01054
01055
01056 typedef struct {
01057 WORD unknown;
01058 WORD NCharacters;
01059 BYTE unknown2;
01060 } cdrfTextHeaderV4;
01061
01062
01063
01064 typedef struct {
01065 BYTE unknown;
01066 BYTE Info;
01067 BYTE Code;
01068 } cdrfTextCharV4;
01069
01070 typedef struct {
01071 BYTE unknown;
01072 BYTE Info;
01073 BYTE Code;
01074 BYTE unknown2;
01075 WORD Changes;
01076 WORD FontRef;
01077 WORD FontSize;
01078 WORD FontType;
01079 BYTE unknown3[13];
01080 } cdrfTextCharStyledV4;
01081
01082 #define cdrfSTYLECHANGEV4_FONTNAME 0x0008
01083 #define cdrfSTYLECHANGEV4_FONTSIZE 0x0010
01084 #define cdrfSTYLECHANGEV4_WEIGHT 0x0020
01085
01086 #define cdrfFONTTYPEV4_NORMAL 0x1
01087 #define cdrfFONTTYPEV4_ITALIC 0x4
01088 #define cdrfFONTTYPEV4_BOLD 0x2
01089 #define cdrfFONTTYPEV4_BOLDITALIC 0x8
01090
01091
01092 typedef struct {
01093 WORD Info;
01094 WORD Char;
01095 } cdrfTextListCharV4;
01096
01097 typedef struct {
01098 WORD Info;
01099 WORD Char;
01100 WORD FontRef;
01101 WORD FontSize;
01102 struct {
01103 WORD Weight : 4;
01104 WORD Placement : 4;
01105 };
01106 WORD unknown[7];
01107 } cdrfTextListCharStyledV4;
01108
01109 #define cdrfPLACEMENTV4_NONE 0x0
01110 #define cdrfPLACEMENTV4_SUPER 0x1
01111 #define cdrfPLACEMENTV4_SUB 0x2
01112
01113 typedef struct {
01114 WORD Style;
01115 WORD unknown[2];
01116 } cdrfParaDefnV4;
01117
01118
01119
01120
01121
01122 typedef struct {
01123 WORD Reference;
01124 BYTE Name[34];
01125 } cdrfFontTableEntryV3;
01126
01127
01128
01129 typedef struct {
01130 WORD Size;
01131 WORD NOffsets;
01132 WORD unknown;
01133 WORD Offsets[4];
01134 } cdrfFontStyleTableHeaderV3;
01135
01136 typedef struct {
01137 WORD unknown;
01138 WORD FontRef;
01139 WORD FontSize;
01140 WORD FontStyle;
01141 WORD unknown2[2];
01142 } cdrfFontStyleTableEntryV3;
01143
01144 #define cdrfFONTSTYLEV3_WEIGHT_MASK 0x0f
01145 #define cdrfFONTSTYLEV3_WEIGHT_NORMAL 0x01
01146 #define cdrfFONTSTYLEV3_WEIGHT_BOLD 0x02
01147 #define cdrfFONTSTYLEV3_WEIGHT_ITALIC 0x04
01148 #define cdrfFONTSTYLEV3_WEIGHT_BOLDITALIC 0x08
01149 #define cdrfFONTSTYLEV3_FLAG_SUPERSCRIPT 0x10
01150 #define cdrfFONTSTYLEV3_FLAG_SUBSCRIPT 0x20
01151
01152
01153
01154 typedef struct {
01155 BYTE unknown[3];
01156 WORD FrameX;
01157 WORD FrameY;
01158 BYTE unknown2[4];
01159 WORD NCharacters;
01160 WORD unknown3;
01161 WORD BaseFontStyle;
01162 WORD unknown4[4];
01163 BYTE Justification;
01164 BYTE unknown5[105];
01165 } cdrfTextHeaderV3;
01166
01167 #define cdrfJUSTIFICATIONV3_LEFT 1
01168 #define cdrfJUSTIFICATIONV3_CENTRE 2
01169 #define cdrfJUSTIFICATIONV3_RIGHT 3
01170
01171 typedef struct {
01172 BYTE unknown;
01173 BYTE Info;
01174 BYTE Code;
01175 } cdrfTextCharV3;
01176
01177 typedef struct {
01178 BYTE unknown;
01179 BYTE Info;
01180 BYTE Code;
01181 WORD unknown2;
01182 WORD Style;
01183 BYTE unknown3[9];
01184 } cdrfTextCharStyledV3;
01185
01186
01187
01188
01189
01190 #pragma pack(pop)
01191
01192 #endif // INC_CDRFORM
01193
01194