00001
00177 #ifndef INC_MI32_ELEMSTYL_H
00178 #define INC_MI32_ELEMSTYL_H
00179
00180 #ifndef INC_MI32_COLOR_H
00181 #include <mi32/color.h>
00182 #endif
00183
00184 #ifndef INC_MI32_MISTRING_H
00185 #include <mi32/mistring.h>
00186 #endif
00187
00188 #ifndef INC_MI32_STRING_H
00189 #include <mi32/string.h>
00190 #endif
00191
00192 #ifndef INC_MI32_MEMALLOC_H
00193 #include <mi32/memalloc.h>
00194 #endif
00195
00196 #ifndef INC_MEMORY_H
00197 #include <memory.h>
00198 #define INC_MEMORY_H
00199 #endif
00200
00201 #ifndef INC_STDDEF_H
00202 #include <stddef.h>
00203 #define INC_STDDEF_H
00204 #endif
00205
00206
00207 #ifndef GENERATING_DOXYGEN_OUTPUT
00208
00209 namespace MGD {
00210 class DEVICE;
00211 }
00212 #endif
00213
00214
00215 #define STYLEFLAG_Fill (0x00000001)
00216 #define STYLEFLAG_ScaleToMap (0x00000002)
00217 #define STYLEFLAG_UseSymbol (0x00000004)
00218 #define STYLEFLAG_UseLinePatt (0x00000008)
00219 #define STYLEFLAG_UseBitmapPatt (0x00000010)
00220 #define STYLEFLAG_UseHatchPatt (0x00000020)
00221 #define STYLEFLAG_DrawPolyBorder (0x00000040)
00222 #define STYLEFLAG_BorderBitmapPatt (0x00000080)
00223 #define STYLEFLAG_LineJoinBevel (0x00000100)
00224 #define STYLEFLAG_LineJoinMiter (0x00000200)
00225 #define STYLEFLAG_LineJoinRound (0x00000300)
00226 #define STYLEFLAG_PointSymbolBuiltIn (0x00000400)
00227 #define STYLEFLAG_LinePatternBuiltIn (0x00000400)
00228 #define STYLEFLAG_PolyFillPattBuiltIn (0x00000400)
00229 #define STYLEFLAG_PolyBorderPattBuiltIn (0x00000800)
00230 #define STYLEFLAG_TextHTML (0x00002000)
00231 #define STYLEFLAG_TextJustifyLeft (0x00000000)
00232 #define STYLEFLAG_TextJustifyRight (0x00004000)
00233 #define STYLEFLAG_TextJustifyCenter (0x00008000)
00234 #define STYLEFLAG_TextJustifyBoth (0x0000C000)
00235 #define STYLEFLAG_TextCenterVert (0x00010000)
00236 #define STYLEFLAG_TextAboveBaseline (0x00020000)
00237 #define STYLEFLAG_TextBelowBaseline (0x00040000)
00238 #define STYLEFLAG_TextMirrorHorz (0x00080000)
00239 #define STYLEFLAG_TextMirrorVert (0x00100000)
00240 #define STYLEFLAG_TextOrientOutput (0x00200000)
00241 #define STYLEFLAG_TextUseStyleHeight (0x00400000)
00242 #define STYLEFLAG_UseLayoutScale (0x00800000)
00243 #define STYLEFLAG_PointDrawCircle (0x01000000)
00244 #define STYLEFLAG_CenterSymbol (0x02000000)
00245 #define STYLEFLAG_PointNoSymbol (0x04000000)
00246 #define STYLEFLAG_BlockInsert (0x08000000)
00247 #define STYLEFLAG_WordWrap (0x10000000)
00248 #define STYLEFLAG_ScaleIsPatternZoom (0x20000000)
00249 #define STYLEFLAG_UseBilinearInterp (0x40000000)
00250
00251 #define STYLEFLAGMASK_LineJoin (0x00000300)
00252 #define STYLEFLAGMASK_Patt (STYLEFLAG_UseSymbol | STYLEFLAG_UseLinePatt | STYLEFLAG_UseBitmapPatt | STYLEFLAG_UseHatchPatt | STYLEFLAG_BorderBitmapPatt)
00253 #define STYLEFLAGMASK_PattPlus (STYLEFLAGMASK_Patt | STYLEFLAG_Fill | STYLEFLAG_PointDrawCircle | STYLEFLAG_DrawPolyBorder | STYLEFLAG_PointSymbolBuiltIn | STYLEFLAG_PolyBorderPattBuiltIn)
00254 #define STYLEFLAGMASK_Scale (STYLEFLAG_ScaleToMap | STYLEFLAG_UseLayoutScale)
00255 #define STYLEFLAGMASK_Point (STYLEFLAG_UseSymbol | STYLEFLAG_UseBitmapPatt | STYLEFLAG_Fill | STYLEFLAG_PointDrawCircle | STYLEFLAG_PointNoSymbol | STYLEFLAG_PointSymbolBuiltIn)
00256 #define STYLEFLAGMASK_Line (STYLEFLAG_UseLinePatt | STYLEFLAG_UseBitmapPatt)
00257 #define STYLEFLAGMASK_PolyFill (STYLEFLAG_UseBitmapPatt | STYLEFLAG_UseHatchPatt | STYLEFLAG_Fill)
00258 #define STYLEFLAGMASK_PolyBord (STYLEFLAG_UseLinePatt | STYLEFLAG_BorderBitmapPatt | STYLEFLAG_DrawPolyBorder)
00259 #define STYLEFLAGMASK_Poly (STYLEFLAGMASK_PolyFill | STYLEFLAGMASK_PolyBord)
00260 #define STYLEFLAGMASK_TextVertAlign (STYLEFLAG_TextAboveBaseline | STYLEFLAG_TextCenterVert | STYLEFLAG_TextBelowBaseline)
00261 #define STYLEFLAGMASK_TextJustify (STYLEFLAG_TextJustifyRight|STYLEFLAG_TextJustifyCenter)
00262
00264 #define STYLEFLAG_TextJustifyMask STYLEFLAGMASK_TextJustify
00265 #define STYLEFLAG_LineJoinMask STYLEFLAGMASK_LineJoin
00266
00267
00271
00272
00274 struct POINTSTYLE {
00275
00276 UINT32 StyleFlags;
00277 INT32 SymbolNum;
00278 double ScaleX;
00279 double ScaleY;
00280 double Angle;
00281 COLOR DrawColor;
00282 double MapScale;
00283 UINT8 spare[4];
00284 char *Desc;
00285
00287 POINTSTYLE (
00288 ) {
00289 memset(static_cast<void*>(this),0,sizeof(*this));
00290 }
00291
00293 POINTSTYLE (
00294 const POINTSTYLE& rhs
00295 ): Desc(0) {
00296 Copy(rhs);
00297 }
00298
00300 ~POINTSTYLE (
00301 ) {
00302 MmFree(Desc);
00303 }
00304
00306 POINTSTYLE& operator= (
00307 const POINTSTYLE& rhs
00308 ) {
00309 if (this != &rhs) {
00310 Copy(rhs);
00311 }
00312 return (*this);
00313 }
00314
00316 bool operator== (
00317 const POINTSTYLE& rhs
00318 ) const {
00319 if (StyleFlags != rhs.StyleFlags || SymbolNum != rhs.SymbolNum || ScaleX != rhs.ScaleX || ScaleY != rhs.ScaleY || Angle != rhs.Angle || DrawColor != rhs.DrawColor) return (false);
00320 if (MapScale != rhs.MapScale && StyleFlags & STYLEFLAG_ScaleToMap && !(StyleFlags & STYLEFLAG_UseLayoutScale)) return (false);
00321 if (Desc == rhs.Desc) return (true);
00322 if (Desc == 0 || rhs.Desc == 0) return (false);
00323 return (!strcmp(Desc,rhs.Desc));
00324 }
00325
00327 bool operator!= (
00328 const POINTSTYLE& rhs
00329 ) const {
00330 return (!(*this == rhs));
00331 }
00332
00334 void Clear (
00335 ) {
00336 MmFree(Desc);
00337 memset(static_cast<void*>(this), 0, sizeof(*this));
00338 }
00339
00341 void Copy (
00342 const POINTSTYLE& rhs
00343 ) {
00344 MmFree(Desc);
00345 memcpy(static_cast<void*>(this), static_cast<const void*>(&rhs), sizeof(*this));
00346 Desc = 0;
00347 if (rhs.Desc) {
00348 #pragma warning (disable:4996)
00349 Desc = strdup(rhs.Desc);
00350 #pragma warning (default:4996)
00351 }
00352 return;
00353 }
00354
00356 UINT32 GetHashNumber (
00357 ) const {
00358 const UINT8 *ptr = reinterpret_cast<const UINT8*>(this);
00359 UINT8 sum = 0;
00360 int count = offsetof(POINTSTYLE,spare);
00361 while (--count >= 0) sum += (*ptr++);
00362 return (sum);
00363 }
00364
00368 bool UsesTransparency (
00369 ) const {
00370 if (DrawColor.GetTransparency() != 0) return (true);
00371
00372 return (false);
00373 }
00374 };
00375
00377 struct POLYSTYLE {
00378
00379 UINT32 StyleFlags;
00380 INT32 FillPatternNum;
00381 INT32 BorderPatternNum;
00382 double BorderScale;
00383 double MapScale;
00384 COLOR BorderColor;
00385 COLOR FillColor;
00386 double Angle;
00387 char *FillDesc;
00388 char *LineDesc;
00389
00391 POLYSTYLE (
00392 ) { memset(static_cast<void*>(this),0,sizeof(*this)); }
00393
00395 POLYSTYLE (
00396 const POLYSTYLE& rhs
00397 ): FillDesc(0), LineDesc(0) { Copy(rhs); }
00398
00400 ~POLYSTYLE (
00401 ) { MmFree(FillDesc); MmFree(LineDesc); }
00402
00404 POLYSTYLE& operator= (
00405 const POLYSTYLE& rhs
00406 ) { if (this != &rhs) { Copy(rhs); } return (*this); }
00407
00409 bool operator== (
00410 const POLYSTYLE& rhs
00411 ) const {
00412 if (StyleFlags != rhs.StyleFlags || FillPatternNum != rhs.FillPatternNum || BorderPatternNum != rhs.BorderPatternNum || BorderScale != rhs.BorderScale || MapScale != rhs.MapScale || BorderColor != rhs.BorderColor || FillColor != rhs.FillColor) return (false);
00413 if (FillDesc != rhs.FillDesc) {
00414 if (FillDesc == 0 || rhs.FillDesc == 0) return (false);
00415 if (strcmp(FillDesc,rhs.FillDesc) != 0) return (false);
00416 }
00417 if (LineDesc != rhs.LineDesc) {
00418 if (LineDesc == 0 || rhs.LineDesc == 0) return (false);
00419 if (strcmp(LineDesc,rhs.LineDesc) != 0) return (false);
00420 }
00421 return (true);
00422 }
00423
00425 bool operator!= (
00426 const POLYSTYLE& rhs
00427 ) const { return (!(*this == rhs)); }
00428
00430 UINT32 GetHashNumber (
00431 ) const {
00432 const UINT8 *ptr = reinterpret_cast<const UINT8*>(this);
00433 UINT8 sum = 0;
00434 int count = offsetof(POLYSTYLE,FillDesc);
00435 while (--count >= 0) sum += (*ptr++);
00436 return (sum);
00437 }
00438
00440 void Clear (
00441 ) {
00442 MmFree(FillDesc);
00443 MmFree(LineDesc);
00444 memset(static_cast<void*>(this), 0, sizeof(*this));
00445 }
00446
00448 void Copy (
00449 const POLYSTYLE& rhs
00450 ) {
00451 MmFree(FillDesc);
00452 MmFree(LineDesc);
00453 memcpy(static_cast<void*>(this), static_cast<const void*>(&rhs), sizeof(*this));
00454 FillDesc = 0;
00455 LineDesc = 0;
00456 if (rhs.FillDesc) {
00457 #pragma warning (disable:4996)
00458 FillDesc = strdup(rhs.FillDesc);
00459 #pragma warning (default:4996)
00460 }
00461 if (rhs.LineDesc) {
00462 #pragma warning (disable:4996)
00463 LineDesc = strdup(rhs.LineDesc);
00464 #pragma warning (default:4996)
00465 }
00466 return;
00467 }
00468
00472 bool UsesTransparency (
00473 ) const {
00474 if ((StyleFlags & STYLEFLAG_Fill) && FillColor.GetTransparency() != 0) return (true);
00475 if ((StyleFlags & STYLEFLAG_DrawPolyBorder) && BorderColor.GetTransparency() != 0) return (true);
00476 return (false);
00477 }
00478 };
00479
00481 struct LINESTYLE {
00482
00483 UINT32 StyleFlags;
00484 INT32 PatternNum;
00485 double Scale;
00486 COLOR DrawColor;
00487 double MapScale;
00488 UINT8 spare[4];
00489 char *Desc;
00490
00492 LINESTYLE (
00493 ) { memset(static_cast<void*>(this),0,sizeof(*this)); }
00494
00496 LINESTYLE (
00497 const LINESTYLE& rhs
00498 ): Desc(0) { Copy(rhs); }
00499
00500 explicit LINESTYLE (
00501 const POLYSTYLE& rhs
00502 ):
00503 StyleFlags(rhs.StyleFlags & (STYLEFLAG_ScaleToMap | STYLEFLAG_UseLayoutScale | STYLEFLAG_UseLinePatt)),
00504 PatternNum(rhs.BorderPatternNum),
00505 Scale(rhs.BorderScale),
00506 DrawColor(rhs.BorderColor),
00507 MapScale(rhs.MapScale),
00508 Desc(0)
00509 {
00510 if (rhs.StyleFlags & STYLEFLAG_BorderBitmapPatt) StyleFlags |= STYLEFLAG_UseBitmapPatt;
00511 #pragma warning (disable:4996)
00512 if (rhs.LineDesc != 0) Desc = strdup(rhs.LineDesc);
00513 #pragma warning (default:4996)
00514 }
00515
00517 ~LINESTYLE (
00518 ) { MmFree(Desc); }
00519
00521 LINESTYLE& operator= (
00522 const LINESTYLE& rhs
00523 ) { if (this != &rhs) { Copy(rhs); } return (*this); }
00524
00526 LINESTYLE& operator= (
00527 const POLYSTYLE& rhs
00528 ) {
00529 Clear();
00530 StyleFlags = (rhs.StyleFlags & (STYLEFLAG_ScaleToMap | STYLEFLAG_UseLayoutScale | STYLEFLAG_UseLinePatt));
00531 if (rhs.StyleFlags & STYLEFLAG_BorderBitmapPatt) StyleFlags |= STYLEFLAG_UseBitmapPatt;
00532 PatternNum = rhs.BorderPatternNum;
00533 Scale = rhs.BorderScale;
00534 DrawColor = rhs.BorderColor;
00535 MapScale = rhs.MapScale;
00536 #pragma warning (disable:4996)
00537 if (rhs.LineDesc != 0) Desc = strdup(rhs.LineDesc);
00538 #pragma warning (default:4996)
00539 return (*this);
00540 }
00541
00543 bool operator== (
00544 const LINESTYLE& rhs
00545 ) const {
00546 if (StyleFlags != rhs.StyleFlags || PatternNum != rhs.PatternNum || Scale != rhs.Scale || DrawColor != rhs.DrawColor || MapScale != rhs.MapScale) return (false);
00547 if (Desc == rhs.Desc) return (true);
00548 if (Desc == 0 || rhs.Desc == 0) return (false);
00549 return (!strcmp(Desc,rhs.Desc));
00550 }
00551
00553 bool operator!= (
00554 const LINESTYLE& rhs
00555 ) const { return (!(*this == rhs)); }
00556
00558 void Clear (
00559 ) {
00560 MmFree(Desc);
00561 memset(static_cast<void*>(this), 0, sizeof(*this));
00562 }
00563
00565 void Copy (
00566 const LINESTYLE& rhs
00567 ) {
00568 MmFree(Desc);
00569 memcpy(static_cast<void*>(this), static_cast<const void*>(&rhs), sizeof(*this));
00570 Desc = 0;
00571 if (rhs.Desc) {
00572 #pragma warning (disable:4996)
00573 Desc = strdup(rhs.Desc);
00574 #pragma warning (default:4996)
00575 }
00576 return;
00577 }
00578
00580 UINT32 GetHashNumber (
00581 ) const {
00582 const UINT8 *ptr = reinterpret_cast<const UINT8*>(this);
00583 UINT8 sum = 0;
00584 int count = offsetof(LINESTYLE,spare);
00585 while (--count >= 0) sum += (*ptr++);
00586 return (sum);
00587 }
00588
00592 bool UsesTransparency (
00593 ) const {
00594 if (DrawColor.GetTransparency() != 0) return (true);
00595
00596 return (false);
00597 }
00598 };
00599
00600
00601 #define FONTSTYLE_Normal (0x00000000)
00602 #define FONTSTYLE_Bold (0x00000001)
00603 #define FONTSTYLE_Italic (0x00000002)
00604 #define FONTSTYLE_Shadow (0x00000004)
00605 #define FONTSTYLE_Enhanced (0x00000008)
00606 #define FONTSTYLE_Outline (0x00000010)
00607 #define FONTSTYLE_Underline (0x00000020)
00608 #define FONTSTYLE_Boxed (0x00000040)
00609 #define FONTSTYLE_InvertGlyph (0x00000080)
00610 #define FONTSTYLE_Smooth (0x00000100)
00611 #define FONTSTYLE_RoundWidth (0x00000200)
00612 #define FONTSTYLE_Kerning (0x00000400)
00613 #define FONTSTYLE_InvertCRS (0x00000800)
00614 #define FONTSTYLE_DoFontSub (0x00001000)
00615 #define FONTSTYLE_LineThrough (0x00002000)
00616 #define FONTSTYLE_OverLine (0x00004000)
00617 #define FONTSTYLE_HaloSingle (0x00008000)
00618
00619 struct TEXTSTYLE {
00620 UINT32 StyleFlags;
00621 INT32 FontNumber;
00622 COLOR FGColor;
00623 COLOR BGColor;
00624 FLOAT GlyphRotation;
00625 FLOAT GlyphAspect;
00626 FLOAT Shear;
00627 FLOAT Height;
00628 FLOAT LineSpace;
00629 UINT32 FontFlags;
00630 double MapScale;
00631 MISTRING fontname;
00632 UINT16 HeightUnits;
00633 UINT16 SpaceUnits;
00634 UINT16 Predefined;
00635 UINT16 StructSize;
00636 double Width;
00637 double StrokeWidth;
00638 double EnhanceWidth;
00639 double BoldnessWidth;
00640 double UnderlineWidth;
00641 double UnderlineOffset;
00642 double ShadowOffset;
00643 double ShadowAngle;
00644 double ClipWidth;
00645 bool ShadowRelative;
00646 bool m_bInitialized;
00647 UINT16 WidthUnits;
00648
00650 TEXTSTYLE (
00651 ) :
00652 StyleFlags(STYLEFLAG_UseLayoutScale),
00653 FontNumber(0),
00654 GlyphRotation(0.0F),
00655 Height(0.0F),
00656 LineSpace(0.0F),
00657 FontFlags(0),
00658 HeightUnits(0),
00659 SpaceUnits(0),
00660 Predefined(0),
00661 StructSize(sizeof(TEXTSTYLE)),
00662 StrokeWidth(0.0),
00663 EnhanceWidth(0.15),
00664 BoldnessWidth(0.03),
00665 UnderlineWidth(0.0),
00666 UnderlineOffset(0.0),
00667 ShadowOffset(0.1),
00668 ShadowAngle(-PI/4.0),
00669 GlyphAspect(1.0),
00670 Shear(static_cast<float>(20.0 * DEGTORAD)),
00671 ClipWidth(0.2),
00672 MapScale(1.0),
00673 WidthUnits(0),
00674 Width(0.0),
00675 ShadowRelative(false),
00676 m_bInitialized(true)
00677 {
00678 }
00679
00681 TEXTSTYLE(const TEXTSTYLE& rhs) {
00682 Copy(rhs);
00683 }
00684
00686 ~TEXTSTYLE (
00687 ) {}
00688
00690 TEXTSTYLE& operator= (
00691 const TEXTSTYLE& rhs
00692 ) {
00693 if (this != &rhs) {
00694 Copy(rhs);
00695 }
00696 return (*this);
00697 }
00698
00699
00701 bool operator== (
00702 const TEXTSTYLE& rhs
00703 ) const {
00704 return (StyleFlags == rhs.StyleFlags
00705 && FontNumber == rhs.FontNumber
00706 && FGColor == rhs.FGColor
00707 && BGColor == rhs.BGColor
00708 && GlyphRotation == rhs.GlyphRotation
00709 && GlyphAspect == rhs.GlyphAspect
00710 && Shear == rhs.Shear
00711 && Height == rhs.Height
00712 && LineSpace == rhs.LineSpace
00713 && FontFlags == rhs.FontFlags
00714 && MapScale == rhs.MapScale
00715 && fontname == rhs.fontname
00716 && HeightUnits == rhs.HeightUnits
00717 && SpaceUnits == rhs.SpaceUnits
00718 && Predefined == rhs.Predefined
00719 && Width == rhs.Width
00720 && StrokeWidth == rhs.StrokeWidth
00721 && EnhanceWidth == rhs.EnhanceWidth
00722 && BoldnessWidth == rhs.BoldnessWidth
00723 && UnderlineWidth == rhs.UnderlineWidth
00724 && UnderlineOffset == rhs.UnderlineOffset
00725 && ShadowOffset == rhs.ShadowOffset
00726 && ShadowAngle == rhs.ShadowAngle
00727 && ClipWidth == rhs.ClipWidth
00728 && ShadowRelative == rhs.ShadowRelative
00729 && WidthUnits == rhs.WidthUnits);
00730 }
00731
00733 bool operator!= (
00734 const TEXTSTYLE& rhs
00735 ) const {
00736 return (!(*this == rhs));
00737 }
00738
00739
00743 bool UsesTransparency (
00744 const MGD::DEVICE *pDevice = 0
00745 ) const;
00746
00748 bool UsesAntialiasing (
00749 ) const {
00750 return ((FontFlags & FONTSTYLE_Smooth) != 0);
00751 }
00752
00753 private:
00754 #ifndef GENERATING_DOXYGEN_OUTPUT
00755
00756 void Copy (
00757 const TEXTSTYLE& rhs
00758 ) {
00759
00760
00761
00762 StructSize = sizeof(TEXTSTYLE);
00763 StyleFlags = rhs.StyleFlags;
00764 FontNumber = rhs.FontNumber;
00765 FGColor = rhs.FGColor;
00766 BGColor = rhs.BGColor;
00767 GlyphRotation = rhs.GlyphRotation;
00768 GlyphAspect = rhs.GlyphAspect;
00769 Shear = rhs.Shear;
00770 Height = rhs.Height;
00771 LineSpace = rhs.LineSpace;
00772 FontFlags = rhs.FontFlags;
00773 MapScale = rhs.MapScale;
00774 fontname = rhs.fontname;
00775 HeightUnits = rhs.HeightUnits;
00776 SpaceUnits = rhs.SpaceUnits;
00777 Predefined = rhs.Predefined;
00778 Width = rhs.Width;
00779 StrokeWidth = rhs.StrokeWidth;
00780 EnhanceWidth = rhs.EnhanceWidth;
00781 BoldnessWidth = rhs.BoldnessWidth;
00782 UnderlineWidth = rhs.UnderlineWidth;
00783 UnderlineOffset = rhs.UnderlineOffset;
00784 ShadowOffset = rhs.ShadowOffset;
00785 ShadowAngle = rhs.ShadowAngle;
00786 ClipWidth = rhs.ClipWidth;
00787 ShadowRelative = rhs.ShadowRelative;
00788 WidthUnits = rhs.WidthUnits;
00789 m_bInitialized = true;
00790 }
00791
00792 #endif // GENERATING_DOXYGEN_OUTPUT
00793 };
00794
00795 PREVENT_MEMFUNC(TEXTSTYLE);
00796
00797
00798 struct TEXTSTYLEDIFF : public TEXTSTYLE {
00799 enum MEMBERMASK {
00800 MEMBER_NONE = 0x00000000,
00801 MEMBER_StyleFlags = 0x00000001,
00802 MEMBER_FontNumber = 0x00000002,
00803 MEMBER_FGColor = 0x00000004,
00804 MEMBER_BGColor = 0x00000008,
00805 MEMBER_GlyphRotation = 0x00000010,
00806 MEMBER_GlyphAspect = 0x00000020,
00807 MEMBER_Shear = 0x00000040,
00808 MEMBER_Height = 0x00000080,
00809 MEMBER_LineSpace = 0x00000100,
00810 MEMBER_FontFlags = 0x00000200,
00811 MEMBER_MapScale = 0x00000400,
00812 MEMBER_fontname = 0x00000800,
00813 MEMBER_HeightUnits = 0x00001000,
00814 MEMBER_SpaceUnits = 0x00002000,
00815 MEMBER_Predefined = 0x00004000,
00816 MEMBER_Width = 0x00008000,
00817 MEMBER_StrokeWidth = 0x00010000,
00818 MEMBER_EnhanceWidth = 0x00020000,
00819 MEMBER_BoldnessWidth = 0x00040000,
00820 MEMBER_UnderlineWidth = 0x00080000,
00821 MEMBER_UnderlineOffset = 0x00100000,
00822 MEMBER_ShadowOffset = 0x00200000,
00823 MEMBER_ShadowAngle = 0x00400000,
00824 MEMBER_ClipWidth = 0x00800000,
00825 MEMBER_ShadowRelative = 0x01000000,
00826 MEMBER_WidthUnits = 0x02000000,
00827 MEMBER_ALL = 0x03FFFFFF
00828 };
00829
00830 UINT32 StyleFlagMask;
00831 UINT32 FontFlagMask;
00832 MEMBERMASK MemberMask;
00833
00834 TEXTSTYLEDIFF() :
00835 TEXTSTYLE(),
00836 StyleFlagMask(0),
00837 FontFlagMask(0),
00838 MemberMask(MEMBER_NONE)
00839 {
00840 }
00841
00844 TEXTSTYLEDIFF (
00845 const MIUNICODE*
00846 );
00847
00849 TEXTSTYLEDIFF (
00850 const TEXTSTYLE& rhs
00851 ) :
00852 TEXTSTYLE(rhs),
00853 StyleFlagMask(0xFFFFFFFF),
00854 FontFlagMask(0xFFFFFFFF),
00855 MemberMask(MEMBER_ALL)
00856 {
00857 }
00858
00862 TEXTSTYLEDIFF& operator|= (
00863 const TEXTSTYLEDIFF& rhs
00864 );
00865
00867 TEXTSTYLEDIFF& operator+= (
00868 const MIUNICODE* code
00869 );
00870
00876 TEXTSTYLEDIFF& operator&= (
00877 const TEXTSTYLEDIFF& rhs
00878 );
00879
00885 TEXTSTYLEDIFF& operator^= (
00886 const TEXTSTYLEDIFF& rhs
00887 );
00888
00889
00892 void GetTildeCodes (
00893 MISTRING& str,
00894 bool bClearStringFirst = true
00895 ) const;
00896
00899 bool ParseTildeCodes (
00900 const MIUNICODE* commands,
00901 MISTRING* unknowns = 0
00902 );
00903
00907 void ParseCSS (
00908 const MIUNICODE* commands
00909 );
00910
00911 };
00912 #ifndef GENERATING_DOXYGEN_OUTPUT
00913 DEFINE_ENUM_OP_BITWISE(TEXTSTYLEDIFF::MEMBERMASK)
00914 #endif
00915
00916 struct MULTISTYLE {
00917 POINTSTYLE Point;
00918 LINESTYLE Line;
00919 POLYSTYLE Poly;
00920 TEXTSTYLE Text;
00921 };
00922
00923 #ifndef GENERATING_DOXYGEN_OUTPUT
00927 PREVENT_MEMFUNC(TEXTSTYLE)
00928 PREVENT_MEMCMP(TEXTSTYLE)
00929 PREVENT_MEMFUNC(POINTSTYLE)
00930 PREVENT_MEMFUNC(LINESTYLE)
00931 PREVENT_MEMFUNC(POLYSTYLE)
00932 PREVENT_MEMFUNC(MULTISTYLE)
00933 #endif // GENERATING_DOXYGEN_OUTPUT
00934
00935 #define STYLE_BuiltIn_Point_None 0
00936 #define STYLE_BuiltIn_Point_BoxOpen 1
00937 #define STYLE_BuiltIn_Point_BoxFilled 2
00938 #define STYLE_BuiltIn_Point_CircleOpen 3
00939 #define STYLE_BuiltIn_Point_CircleFilled 4
00940 #define STYLE_BuiltIn_Point_Crosshair 5
00941 #define STYLE_BuiltIn_Point_CrosshairHalo 6
00942 #define STYLE_BuiltIn_Point_Last 6
00943
00945 #define TEXTSTYLEPREDEF_None 0
00946 #define TEXTSTYLEPREDEF_NauticalDepth 1
00947
00948
00950
00951
00955
00956 #if defined(__cplusplus)
00957 extern "C" {
00958 #endif
00959
00961 int MxGetSymbolMinMax (
00962 const UINT8 *symbolbuf,
00963 LRECTXY *minmax
00964 );
00965
00967 int MxGetSymbolSize (
00968 const UINT8 *symbolbuf
00969 );
00970
00972 int MxParseSymbol (
00973 const char* const istring,
00974 UINT8 **bufp
00975 );
00976
00978 char *MxSymbolToText (
00979 const UINT8 *buf
00980 );
00981
00982 #if defined(__cplusplus)
00983 }
00984 #endif
00985
00987
00988 #endif // INC_MI32_ELEMSTYL_H