diff --git a/include/lgi/common/Css.h b/include/lgi/common/Css.h --- a/include/lgi/common/Css.h +++ b/include/lgi/common/Css.h @@ -1,1298 +1,1304 @@ /// \file /// \author Matthew Allen #pragma once /// I've using the American spelling for 'color' as opposed to the English 'colour' /// because the CSS spec is written with 'color' as the spelling. #include "LgiInc.h" #include "LgiOsDefs.h" #include "lgi/common/Mem.h" #include "lgi/common/Gdc2.h" #include "lgi/common/AutoPtr.h" #include "lgi/common/LgiString.h" #include "lgi/common/HashTable.h" #ifndef LINUX #pragma pack(push, 1) #endif /// Css property container class LgiClass LCss { bool ReadOnly; public: enum ParsingStyle { ParseStrict, ParseRelaxed, }; enum PropTypes { TypeEnum = 1, TypeLen, TypeGRect, TypeColor, TypeBackground, TypeImage, TypeBorder, TypeStrings, }; /// These are all the types of CSS properties catagorised by their data type. /// The enum value of the prop is encoded in the bottom 8 bits, the data type of /// the property is encoding in the top remaining top bits. enum PropType { PropNull = 0, // Enum based props PropDisplay = TypeEnum << 8,// DisplayType PropFloat, // FloatType PropPosition, // PositionType PropOverflow, // OverflowType PropVisibility, // VisibilityType PropFontStyle, // FontStyleType PropFontVariant, // FontVariantType PropFontWeight, // FontWeightType PropBackgroundRepeat, // RepeatType PropBackgroundAttachment, // AttachmentType PropTextDecoration, // TextDecorType PropWordWrap, // WordWraptype PropListStyleType, // ListStyleTypes PropLetterSpacing, PropFont, PropListStyle, PropBorderCollapse, // BorderCollapseType PropBorderTopStyle, PropBorderRightStyle, PropBorderBottomStyle, PropBorderLeftStyle, // Length based props PropZIndex = TypeLen << 8, PropWidth, PropMinWidth, PropMaxWidth, PropHeight, PropMinHeight, PropMaxHeight, PropTop, PropRight, PropBottom, PropLeft, PropMargin, PropMarginTop, PropMarginRight, PropMarginBottom, PropMarginLeft, PropPadding, PropPaddingTop, PropPaddingRight, PropPaddingBottom, PropPaddingLeft, PropLineHeight, PropVerticalAlign, PropFontSize, PropBackgroundX, PropBackgroundY, PropBackgroundPos, PropTextAlign, PropBorderSpacing, PropBorderLeftWidth, PropBorderTopWidth, PropBorderRightWidth, PropBorderBottomWidth, PropBorderRadius, Prop_CellPadding, // not real CSS, but used by LHtml2 to store 'cellpadding' // LRect based props PropClip = TypeGRect<<8, PropXSubRect, // Background meta style PropBackground = TypeBackground << 8, // ColorDef based PropColor = TypeColor << 8, PropBackgroundColor, PropNoPaintColor, PropBorderTopColor, PropBorderRightColor, PropBorderBottomColor, PropBorderLeftColor, // ImageDef based PropBackgroundImage = TypeImage << 8, // BorderDef based PropBorder = TypeBorder << 8, PropBorderStyle, PropBorderColor, PropBorderTop, PropBorderRight, PropBorderBottom, PropBorderLeft, // StringsDef based PropFontFamily = TypeStrings << 8, }; PropTypes GetType(PropType p) { return (PropTypes) ((int)p >> 8); } enum BorderCollapseType { CollapseInherit, CollapseCollapse, CollapseSeparate, }; enum WordWrapType { WrapNormal, WrapBreakWord, WrapNone, // Not in the CSS standard but useful for apps anyway. }; enum DisplayType { DispInherit, DispBlock, DispInline, DispInlineBlock, DispListItem, DispNone, }; enum PositionType { PosInherit, PosStatic, PosRelative, PosAbsolute, PosFixed, }; enum LengthType { // Standard length types LenInherit, LenAuto, LenPx, LenPt, LenEm, LenEx, LenCm, LenPercent, LenNormal, LenMinContent, LenMaxContent, // Horizontal alignment types AlignLeft, AlignRight, AlignCenter, AlignJustify, // Vertical alignment types VerticalBaseline, VerticalSub, VerticalSuper, VerticalTop, VerticalTextTop, VerticalMiddle, VerticalBottom, VerticalTextBottom, // Absolute font sizes SizeXXSmall, SizeXSmall, SizeSmall, SizeMedium, SizeLarge, SizeXLarge, SizeXXLarge, // Relitive font sizes, SizeSmaller, SizeLarger, }; enum FloatType { FloatInherit, FloatLeft, FloatRight, FloatNone, }; enum OverflowType { OverflowInherit, OverflowVisible, OverflowHidden, OverflowScroll, OverflowAuto, }; enum VisibilityType { VisibilityInherit, VisibilityVisible, VisibilityHidden, VisibilityCollapse }; enum ListStyleTypes { ListInherit, ListNone, ListDisc, ListCircle, ListSquare, ListDecimal, ListDecimalLeadingZero, ListLowerRoman, ListUpperRoman, ListLowerGreek, ListUpperGreek, ListLowerAlpha, ListUpperAlpha, ListArmenian, ListGeorgian, }; enum FontStyleType { FontStyleInherit, FontStyleNormal, FontStyleItalic, FontStyleOblique, }; enum FontVariantType { FontVariantInherit, FontVariantNormal, FontVariantSmallCaps, }; enum FontWeightType { FontWeightInherit, FontWeightNormal, FontWeightBold, FontWeightBolder, FontWeightLighter, FontWeight100, FontWeight200, FontWeight300, FontWeight400, FontWeight500, FontWeight600, FontWeight700, FontWeight800, FontWeight900, }; enum TextDecorType { TextDecorInherit, TextDecorNone, TextDecorUnderline, TextDecorOverline, TextDecorLineThrough, TextDecorSquiggle, // for spelling errors }; enum ColorType { ColorInherit, ColorTransparent, ColorRgb, ColorLinearGradient, ColorRadialGradient, }; enum RepeatType { RepeatInherit, RepeatBoth, RepeatX, RepeatY, RepeatNone, }; enum AttachmentType { AttachmentInherit, AttachmentScroll, AttachmentFixed, }; static float FontSizeTable[7]; // SizeXSmall etc #define _FloatAbs(a) \ (((a) < 0.0f) ? -(a) : (a)) #define FloatIsEqual(a, b) \ (_FloatAbs(a - b) < 0.0001) struct LgiClass Len { LengthType Type; float Value; Len(const char *init = NULL, ParsingStyle ParseType = ParseRelaxed) { Type = LenInherit; Value = 0.0; if (init) Parse(init, PropNull, ParseType); } Len(LengthType t, float v = 0.0) { Type = t; Value = v; } Len(LengthType t, int v) { Type = t; Value = (float)v; } Len(LengthType t, int64_t v) { Type = t; Value = (float)v; } Len &operator =(const Len &l) { Type = l.Type; Value = l.Value; return *this; } bool Parse(const char *&s, PropType Prop = PropNull, ParsingStyle Type = ParseStrict); bool IsValid() const { return Type != LenInherit; } bool IsDynamic() const { return Type == LenPercent || Type == LenInherit || Type == LenAuto || Type == SizeSmaller || Type == SizeLarger; } bool operator ==(const Len &l) const { return Type == l.Type && FloatIsEqual(Value, l.Value); } bool operator !=(const Len &l) const { return !(*this == l); } bool ToString(LStream &p) const; /// Convert the length to pixels int ToPx ( /// The size of the parent box if known, or -1 if unknown. int Box = 0, /// Any relevant font LFont *Font = 0, /// The DPI of the relevant device if known, or -1 if unknown int Dpi = -1 ); Len operator *(const Len &l) const; }; struct LgiClass ColorStop { float Pos; uint32_t Rgb32; bool operator ==(const ColorStop &c) { return FloatIsEqual(Pos, c.Pos) && Rgb32 == c.Rgb32; } bool operator !=(const ColorStop &c) { return !(*this == c); } }; struct LgiClass ColorDef { ColorType Type; uint32_t Rgb32; LArray Stops; ColorDef(ColorType ct = ColorInherit, uint32_t rgb32 = 0) { Type = ct; Rgb32 = rgb32; } ColorDef(const LColour &col) { Type = ColorRgb; Rgb32 = col.c32(); } ColorDef(const char *init) { Type = ColorInherit; Parse(init); } ColorDef(COLOUR col) { Type = ColorRgb; Rgb32 = Rgb24To32(col); } + + ColorDef(LSystemColour sys) + { + Type = ColorRgb; + Rgb32 = LColour(sys).c32(); + } operator LColour() { LColour c; if (Type == ColorRgb) c.Set(Rgb32, 32); return c; } bool IsValid() { return Type != ColorInherit; } bool Parse(const char *&s); ColorDef &operator =(const ColorDef &c) { Type = c.Type; Rgb32 = c.Rgb32; Stops = c.Stops; return *this; } bool operator ==(const ColorDef &c) { if (Type != c.Type) return false; if (Type == ColorRgb) return Rgb32 == c.Rgb32; if (Stops.Length() != c.Stops.Length()) return false; for (uint32_t i=0; i { public: StringsDef(const char *init = 0) { if (ValidStr(init)) *this = init; else LAssert(init == 0); } StringsDef(const StringsDef &c) { *this = c; } ~StringsDef() { Empty(); } StringsDef &operator =(const char *s) { Parse(s); return *this; } void Empty() { DeleteArrays(); } StringsDef &operator =(const StringsDef &s) { Empty(); for (unsigned i=0; i Start) { LAutoString n(NewStr(Start, s-Start)); if (ValidStr(n)) { if (_stricmp(n, "inherit")) Add(n.Release()); } else LAssert(!"Not a valid string."); } if (s) s++; } else { const char *Start = s; while (*s && !strchr(Delimiters, *s)) s++; if (s > Start) { LAutoString n(NewStr(Start, s-Start)); if (ValidStr(n)) { if (_stricmp(n, "inherit")) Add(n.Release()); } else LAssert(!"Not a valid string."); } } } return true; } }; class Store; /// This class parses and stores a selector. The job of matching selectors and /// hashing them is still the responsibility of the calling library. If an application /// needs some code to do that it can optionally use LCss::Store to do that. class LgiClass Selector { public: enum PartType { SelNull, SelType, SelUniversal, SelAttrib, SelClass, SelMedia, SelID, SelPseudo, SelFontFace, SelPage, SelList, SelImport, SelKeyFrames, SelIgnored, CombDesc, CombChild, CombAdjacent, }; enum MediaType { MediaNull = 0x0, MediaPrint = 0x1, MediaScreen = 0x2, }; struct Part { PartType Type; LAutoString Value; LAutoString Param; int Media; Part() { Type = SelNull; Media = MediaNull; } bool IsSel() { return Type == SelType || Type == SelUniversal || Type == SelAttrib || Type == SelClass || Type == SelMedia || Type == SelID || Type == SelPseudo; } Part &operator =(const Part &s) { Type = s.Type; Value.Reset(NewStr(s.Value)); Param.Reset(NewStr(s.Param)); return *this; } }; LArray Parts; LArray Combs; char *Style; int SourceIndex; LAutoString Raw; LAutoPtr Children; Selector() { Style = NULL; SourceIndex = 0; } bool TokString(LAutoString &a, const char *&s); const char *PartTypeToString(PartType p); LAutoString Print(); bool Parse(const char *&s); size_t GetSimpleIndex() { return Combs.Length() ? Combs[Combs.Length()-1] + 1 : 0; } bool IsAtMedia(); bool ToString(LStream &p); uint32_t GetSpecificity(); Selector &operator =(const Selector &s); }; /// This hash table stores arrays of selectors by name. typedef LArray SelArray; typedef LHashTbl,SelArray*> SelMap; class SelectorMap : public SelMap { public: ~SelectorMap() { Empty(); } void Empty() { // for (SelArray *s = First(); s; s = Next()) for (auto s : *this) { s.value->DeleteObjects(); delete s.value; } SelMap::Empty(); } SelArray *Get(const char *s) { SelArray *a = Find(s); if (!a) Add(s, a = new SelArray); return a; } }; template struct ElementCallback { public: /// Returns the element name virtual const char *GetElement(T *obj) = 0; /// Returns the document unque element ID virtual const char *GetAttr(T *obj, const char *Attr) = 0; /// Returns the class virtual bool GetClasses(LString::Array &Classes, T *obj) = 0; /// Returns the parent object virtual T *GetParent(T *obj) = 0; /// Returns an array of child objects virtual LArray GetChildren(T *obj) = 0; }; /// This class parses and stores the CSS selectors and styles. class LgiClass Store { protected: /// This code matches a simple part of a selector, i.e. no combinatorial operators involved. template bool MatchSimpleSelector ( /// The full selector. LCss::Selector *Sel, /// The start index of the simple selector parts. Stop at the first comb operator or the end of the parts. ssize_t PartIdx, /// Our context callback to get properties of the object ElementCallback *Context, /// The object to match T *Obj ) { const char *Element = Context->GetElement(Obj); for (size_t n = PartIdx; nParts.Length(); n++) { LCss::Selector::Part &p = Sel->Parts[n]; switch (p.Type) { case LCss::Selector::SelType: { const char *Tag = Context->GetElement(Obj); if (!Tag || _stricmp(Tag, p.Value)) return false; break; } case LCss::Selector::SelUniversal: { // Match everything break; } case LCss::Selector::SelAttrib: { if (!p.Value) return false; char *e = strchr(p.Value, '='); if (!e) return false; LAutoString Var(NewStr(p.Value, e - p.Value)); const char *TagVal = Context->GetAttr(Obj, Var); if (!TagVal) return false; LAutoString Val(NewStr(e + 1)); if (_stricmp(Val, TagVal)) return false; break; } case LCss::Selector::SelClass: { // Check the class matches LString::Array Class; if (!Context->GetClasses(Class, Obj)) return false; if (Class.Length() == 0) return false; bool Match = false; for (unsigned i=0; iGetAttr(Obj, "id"); if (!Id || _stricmp(Id, p.Value)) return false; break; } case LCss::Selector::SelPseudo: { const char *Href = NULL; if ( ( Element != NULL && !_stricmp(Element, "a") && p.Value && !_stricmp(p.Value, "link") && (Href = Context->GetAttr(Obj, "href")) != NULL ) || ( p.Value && *p.Value == '-' ) ) break; return false; break; } default: { // Comb operator, so return the current match value return true; } } } return true; } /// This code matches a all the parts of a selector. template bool MatchFullSelector(LCss::Selector *Sel, ElementCallback *Context, T *Obj) { bool Complex = Sel->Combs.Length() > 0; ssize_t CombIdx = Complex ? (ssize_t)Sel->Combs.Length() - 1 : 0; ssize_t StartIdx = (Complex) ? Sel->Combs[CombIdx] + 1 : 0; bool Match = MatchSimpleSelector(Sel, StartIdx, Context, Obj); if (!Match) return false; if (Complex) { T *CurrentParent = Context->GetParent(Obj); for (; CombIdx >= 0; CombIdx--) { if (CombIdx >= (int)Sel->Combs.Length()) break; StartIdx = Sel->Combs[CombIdx]; LAssert(StartIdx > 0); if (StartIdx >= (ssize_t)Sel->Parts.Length()) break; LCss::Selector::Part &p = Sel->Parts[StartIdx]; switch (p.Type) { case LCss::Selector::CombChild: { // LAssert(!"Not impl."); return false; break; } case LCss::Selector::CombAdjacent: { // LAssert(!"Not impl."); return false; break; } case LCss::Selector::CombDesc: { // Does the parent match the previous simple selector ssize_t PrevIdx = StartIdx - 1; while (PrevIdx > 0 && Sel->Parts[PrevIdx-1].IsSel()) { PrevIdx--; } bool ParMatch = false; for (; !ParMatch && CurrentParent; CurrentParent = Context->GetParent(CurrentParent)) { ParMatch = MatchSimpleSelector(Sel, PrevIdx, Context, CurrentParent); } if (!ParMatch) return false; break; } default: { LAssert(!"This must be a comb."); return false; break; } } } } return Match; } // This stores the unparsed style strings. More than one selector // may reference this memory. LArray Styles; // Sort the styles into less specific to more specific order void SortStyles(LCss::SelArray &Styles); public: SelectorMap TypeMap, ClassMap, IdMap; SelArray Other; LString Error; ~Store() { Empty(); } /// Empty the data store void Empty() { TypeMap.Empty(); ClassMap.Empty(); IdMap.Empty(); Other.DeleteObjects(); Error.Empty(); Styles.DeleteArrays(); } /// Parse general CSS into selectors. bool Parse(const char *&s, int Depth = 0); /// Converts store back into string form bool ToString(LStream &p); /// Use to finding matching selectors for an element. template bool Match(LCss::SelArray &Styles, ElementCallback *Context, T *Obj) { SelArray *s; if (!Context || !Obj) return false; // An array of potential selector matches... LArray Maps; // Check element type const char *Type = Context->GetElement(Obj); if (Type && (s = TypeMap.Find(Type))) Maps.Add(s); // Check the ID const char *Id = Context->GetAttr(Obj, "id"); if (Id && (s = IdMap.Find(Id))) Maps.Add(s); // Check all the classes LString::Array Classes; if (Context->GetClasses(Classes, Obj)) { for (unsigned i=0; iLength(); i++) { LCss::Selector *Sel = (*s)[i]; if (!Styles.HasItem(Sel) && MatchFullSelector(Sel, Context, Obj)) { // Output the matching selector Styles.Add(Sel); } } } // Sort the selectors into less specific -> more specific order. SortStyles(Styles); return true; } /// For debugging: dumps a description of the store to a stream bool Dump(LStream &out); }; ////////////////////////////////////////////////////////////////////////////////////////////////////////// LCss(); LCss(const LCss &c); void Init(); virtual ~LCss(); #define Accessor(PropName, Type, Default, BaseProp) \ Type PropName() { Type *Member = (Type*)Props.Find(Prop##PropName); \ if (Member) return *Member; \ else if ((Member = (Type*)Props.Find(BaseProp))) return *Member; \ return Default; } \ void PropName(Type t) { LAssert(!ReadOnly); \ Type *Member = (Type*)Props.Find(Prop##PropName); \ if (Member) *Member = t; \ else { Props.Add(Prop##PropName, Member = new Type); \ *Member = t; } \ OnChange(Prop##PropName); } Accessor(Display, DisplayType, DispInherit, PropNull); Accessor(Float, FloatType, FloatInherit, PropNull); Accessor(Position, PositionType, PosInherit, PropNull); Accessor(ZIndex, Len, Len(), PropNull); Accessor(TextAlign, Len, Len(), PropNull); Accessor(VerticalAlign, Len, Len(), PropNull); Accessor(Width, Len, Len(), PropNull); Accessor(MinWidth, Len, Len(), PropNull); Accessor(MaxWidth, Len, Len(), PropNull); Accessor(Height, Len, Len(), PropNull); Accessor(MinHeight, Len, Len(), PropNull); Accessor(MaxHeight, Len, Len(), PropNull); Accessor(LineHeight, Len, Len(), PropNull); Accessor(Top, Len, Len(), PropNull); Accessor(Right, Len, Len(), PropNull); Accessor(Bottom, Len, Len(), PropNull); Accessor(Left, Len, Len(), PropNull); Accessor(Margin, Len, Len(), PropNull); Accessor(MarginTop, Len, Len(), PropNull); Accessor(MarginRight, Len, Len(), PropNull); Accessor(MarginBottom, Len, Len(), PropNull); Accessor(MarginLeft, Len, Len(), PropNull); Accessor(Padding, Len, Len(), PropNull); Accessor(PaddingTop, Len, Len(), PropPadding); Accessor(PaddingRight, Len, Len(), PropPadding); Accessor(PaddingBottom, Len, Len(), PropPadding); Accessor(PaddingLeft, Len, Len(), PropPadding); Accessor(Border, BorderDef, BorderDef(), PropNull); Accessor(BorderTop, BorderDef, BorderDef(), PropBorder); Accessor(BorderRight, BorderDef, BorderDef(), PropBorder); Accessor(BorderBottom, BorderDef, BorderDef(), PropBorder); Accessor(BorderLeft, BorderDef, BorderDef(), PropBorder); Accessor(BorderSpacing, Len, Len(), PropNull); // 'cellspacing' Accessor(BorderRadius, Len, Len(), PropNull); Accessor(BorderCollapse, BorderCollapseType, CollapseInherit, PropBorderCollapse); Accessor(_CellPadding, Len, Len(), PropNull); // 'cellpadding' (not CSS) Accessor(Overflow, OverflowType, OverflowInherit, PropNull); Accessor(Clip, LRect, LRect(0, 0, -1, -1), PropNull); Accessor(XSubRect, LRect, LRect(0, 0, -1, -1), PropNull); Accessor(Visibility, VisibilityType, VisibilityInherit, PropNull); Accessor(ListStyleType, ListStyleTypes, ListInherit, PropNull); Accessor(FontFamily, StringsDef, StringsDef(), PropNull); Accessor(FontSize, Len, Len(), PropNull); Accessor(FontStyle, FontStyleType, FontStyleInherit, PropNull); Accessor(FontVariant, FontVariantType, FontVariantInherit, PropNull); Accessor(FontWeight, FontWeightType, FontWeightInherit, PropNull); Accessor(TextDecoration, TextDecorType, TextDecorInherit, PropNull); Accessor(WordWrap, WordWrapType, WrapNormal, PropNull); Accessor(Color, ColorDef, ColorDef(), PropNull); Accessor(NoPaintColor, ColorDef, ColorDef(), PropNull); Accessor(BackgroundColor, ColorDef, ColorDef(), PropNull); Accessor(BackgroundImage, ImageDef, ImageDef(), PropNull); Accessor(BackgroundRepeat, RepeatType, RepeatInherit, PropNull); Accessor(BackgroundAttachment, AttachmentType, AttachmentInherit, PropNull); Accessor(BackgroundX, Len, Len(), PropNull); Accessor(BackgroundY, Len, Len(), PropNull); Accessor(BackgroundPos, Len, Len(), PropNull); bool GetReadOnly() { return ReadOnly; } void SetReadOnly(bool b) { ReadOnly = b; }; void Empty(); void DeleteProp(PropType p); size_t Length() { return Props.Length(); } virtual void OnChange(PropType Prop); bool CopyStyle(const LCss &c); bool operator ==(LCss &c); bool operator !=(LCss &c) { return !(*this == c); } LCss &operator =(const LCss &c) { Empty(); CopyStyle(c); return *this; } LCss &operator +=(const LCss &c) { CopyStyle(c); return *this; } LCss &operator -=(const LCss &c); void *PropAddress(PropType p) { return Props.Find(p); } LAutoString ToString(); const char *ToString(DisplayType dt); bool HasFontStyle(); void FontBold(bool b) { FontWeight(b ? FontWeightBold : FontWeightNormal); } // Parsing virtual bool Parse(const char *&Defs, ParsingStyle Type = ParseStrict); bool ParseDisplayType(const char *&s); void ParsePositionType(const char *&s); bool ParseFontStyle(PropType p, const char *&s); bool ParseFontVariant(PropType p, const char *&s); bool ParseFontWeight(PropType p, const char *&s); bool ParseBackgroundRepeat(const char *&s); template T *GetOrCreate(T *&ptr, PropType PropId) { ptr = (T*)Props.Find(PropId); if (!ptr) Props.Add(PropId, ptr = new T); return ptr; } // Inheritance calculation typedef LArray PropArray; typedef LHashTbl, PropArray*> PropMap; /// Copies valid properties from the node 'c' into the property collection 'Contrib'. /// Usually called for each node up the parent chain until the function returns false; bool InheritCollect(LCss &c, PropMap &Contrib); /// After calling InheritCollect on all the parent nodes, this method works out the final /// value of each property. e.g. multiplying percentages together etc. bool InheritResolve(PropMap &Map); /* Code sample: LCss::PropMap Map; Map.Add(PropFontFamily, new LCss::PropArray); Map.Add(PropFontSize, new LCss::PropArray); Map.Add(PropFontStyle, new LCss::PropArray); for (LTag *t = Parent; t; t = t->Parent) { if (!c.InheritCollect(*t, Map)) break; } LCss c; // Container for final values c.InheritResolve(Map); Map.DeleteObjects(); */ protected: inline void DeleteProp(PropType p, void *Ptr); LHashTbl, void*> Props; static LHashTbl, PropType> Lut; static LHashTbl, PropType> ParentProp; static const char *PropName(PropType p); virtual bool OnUnhandledColor(ColorDef *def, const char *&s) { return false; } template void StoreProp(PropType id, T *obj, bool own) { T *e = (T*)Props.Find(id); if (e) { *e = *obj; if (own) delete obj; } else if (own) { Props.Add(id, obj); } else { Props.Add(id, new T(*obj)); } } }; #ifndef LINUX #pragma pack(pop) #endif diff --git a/test/HtmlEditor/win/HtmlEdit.sln b/test/HtmlEditor/win/HtmlEdit.sln --- a/test/HtmlEditor/win/HtmlEdit.sln +++ b/test/HtmlEditor/win/HtmlEdit.sln @@ -1,33 +1,33 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.33027.164 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HtmlEdit", "HtmlEdit.vcxproj", "{EE2A92B6-8D28-4216-AE64-E226BCACB0B7}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lgi", "..\..\win\Lgi_vs2019.vcxproj", "{95DF9CA4-6D37-4A85-A648-80C2712E0DA1}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lgi", "..\..\..\win\Lgi_vs2019.vcxproj", "{95DF9CA4-6D37-4A85-A648-80C2712E0DA1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 Release|x64 = Release|x64 ReleaseNoOptimize|x64 = ReleaseNoOptimize|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {EE2A92B6-8D28-4216-AE64-E226BCACB0B7}.Debug|x64.ActiveCfg = Debug|x64 {EE2A92B6-8D28-4216-AE64-E226BCACB0B7}.Debug|x64.Build.0 = Debug|x64 {EE2A92B6-8D28-4216-AE64-E226BCACB0B7}.Release|x64.ActiveCfg = Release|x64 {EE2A92B6-8D28-4216-AE64-E226BCACB0B7}.Release|x64.Build.0 = Release|x64 {EE2A92B6-8D28-4216-AE64-E226BCACB0B7}.ReleaseNoOptimize|x64.ActiveCfg = Release|x64 {95DF9CA4-6D37-4A85-A648-80C2712E0DA1}.Debug|x64.ActiveCfg = Debug|x64 {95DF9CA4-6D37-4A85-A648-80C2712E0DA1}.Debug|x64.Build.0 = Debug|x64 {95DF9CA4-6D37-4A85-A648-80C2712E0DA1}.Release|x64.ActiveCfg = Release|x64 {95DF9CA4-6D37-4A85-A648-80C2712E0DA1}.Release|x64.Build.0 = Release|x64 {95DF9CA4-6D37-4A85-A648-80C2712E0DA1}.ReleaseNoOptimize|x64.ActiveCfg = ReleaseNoOptimize|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7901726F-0C61-4CB5-9C9C-2F35722BA79E} EndGlobalSection EndGlobal diff --git a/test/HtmlEditor/win/HtmlEdit.vcxproj b/test/HtmlEditor/win/HtmlEdit.vcxproj --- a/test/HtmlEditor/win/HtmlEdit.vcxproj +++ b/test/HtmlEditor/win/HtmlEdit.vcxproj @@ -1,324 +1,324 @@  Debug Win32 Debug x64 Release Win32 Release x64 HtmlEdit {EE2A92B6-8D28-4216-AE64-E226BCACB0B7} Rich Application v142 false MultiByte Application v142 false MultiByte Application v142 false MultiByte Application v142 false MultiByte <_ProjectFileVersion>12.0.30501.0 $(Platform)$(Configuration)12\ $(Platform)$(Configuration)12\ true - ..\..\..\..\..\CodeLib\libpng-1.6.26;..\..\..\..\..\CodeLib\zlib-1.2.8;$(VC_IncludePath);$(WindowsSDK_IncludePath) + ..\..\..\..\..\..\CodeLib\libpng-1.6.26;..\..\..\..\..\..\CodeLib\zlib-1.2.8;$(VC_IncludePath);$(WindowsSDK_IncludePath) $(Platform)$(Configuration)\ $(Platform)$(Configuration)\ true - ..\..\..\..\..\CodeLib\libpng-1.6.26;..\..\..\..\..\CodeLib\zlib-1.2.8;$(IncludePath) + ..\..\..\..\..\..\CodeLib\libpng-1.6.26;..\..\..\..\..\..\CodeLib\zlib-1.2.8;$(IncludePath) $(Platform)$(Configuration)12\ $(Platform)$(Configuration)12\ false - ..\..\..\..\..\CodeLib\libpng-1.6.26;..\..\..\..\..\CodeLib\zlib-1.2.8;$(VC_IncludePath);$(WindowsSDK_IncludePath) + ..\..\..\..\..\..\CodeLib\libpng-1.6.26;..\..\..\..\..\..\CodeLib\zlib-1.2.8;$(VC_IncludePath);$(WindowsSDK_IncludePath) $(Platform)$(Configuration)\ $(Platform)$(Configuration)\ false - ..\..\..\..\..\CodeLib\libpng-1.6.26;..\..\..\..\..\CodeLib\zlib-1.2.8;$(IncludePath) + ..\..\..\..\..\..\CodeLib\libpng-1.6.26;..\..\..\..\..\..\CodeLib\zlib-1.2.8;$(IncludePath) _DEBUG;%(PreprocessorDefinitions) true true Win32 .\Debug/Rich.tlb Disabled - ..\..\include;..\..\private\common;..\..\include\lgi\win;..\..\..\..\..\CodeLib\libjpeg-9a;..\..\..\..\..\CodeLib\libpng;..\..\..\..\..\CodeLib\libpng\build32;..\..\..\..\..\CodeLib\libpng\build32\zlib_dir;..\..\..\..\..\CodeLib\zlib;c:\Program Files (x86)\OpenSSL-win32\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\private\common;..\..\..\include\lgi\win;..\..\..\..\..\..\CodeLib\libjpeg-9a;..\..\..\..\..\..\CodeLib\libpng;..\..\..\..\..\..\CodeLib\libpng\build32;..\..\..\..\..\..\CodeLib\libpng\build32\zlib_dir;..\..\..\..\..\..\CodeLib\zlib;c:\Program Files (x86)\OpenSSL-win32\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;WINDOWS;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL true $(IntDir)Rich.pch $(IntDir) $(IntDir) $(IntDir) true ProgramDatabase _DEBUG;%(PreprocessorDefinitions) 0x0c09 odbc32.lib;odbccp32.lib;imm32.lib;%(AdditionalDependencies) $(IntDir)$(TargetFileName) true true $(IntDir)Rich.pdb Windows false MachineX86 true $(IntDir)Rich.bsc _DEBUG;%(PreprocessorDefinitions) true true .\Debug/Rich.tlb Disabled - ..\..\include;..\..\private\common;..\..\include\lgi\win;..\..\..\..\..\CodeLib\libjpeg-9a;..\..\..\..\..\CodeLib\libpng;..\..\..\..\..\CodeLib\zlib;..\..\..\..\..\CodeLib\libpng\build64;..\..\..\..\..\CodeLib\libpng\build64\zlib_dir;c:\Program Files\OpenSSL-win64\include;%(AdditionalIncludeDirectories) + ..\src;..\resources;..\..\..\include;..\..\..\private\common;..\..\..\include\lgi\win;..\..\..\..\..\..\CodeLib\libjpeg-9a;..\..\..\..\..\..\CodeLib\libpng;..\..\..\..\..\..\CodeLib\zlib;..\..\..\..\..\..\CodeLib\libpng\build64;..\..\..\..\..\..\CodeLib\libpng\build64\zlib_dir;c:\Program Files\OpenSSL-win64\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;WINDOWS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL true $(IntDir)Rich.pch $(IntDir) $(IntDir) $(IntDir) true ProgramDatabase _DEBUG;%(PreprocessorDefinitions) 0x0c09 odbc32.lib;odbccp32.lib;imm32.lib;%(AdditionalDependencies) $(IntDir)$(TargetFileName) true true $(IntDir)Rich.pdb Windows false true $(IntDir)Rich.bsc NDEBUG;%(PreprocessorDefinitions) true true Win32 .\Release/Rich.tlb MinSpace OnlyExplicitInline - ..\..\include;..\..\private\common;..\..\include\lgi\win;..\..\..\..\..\CodeLib\libjpeg-9a;..\..\..\..\..\CodeLib\libpng;..\..\..\..\..\CodeLib\libpng\build32;..\..\..\..\..\CodeLib\libpng\build32\zlib_dir;..\..\..\..\..\CodeLib\zlib;c:\Program Files (x86)\OpenSSL-win32\include;%(AdditionalIncludeDirectories) + ..\..\..\include;..\..\..\private\common;..\..\..\include\lgi\win;..\..\..\..\..\..\CodeLib\libjpeg-9a;..\..\..\..\..\..\CodeLib\libpng;..\..\..\..\..\..\CodeLib\libpng\build32;..\..\..\..\..\..\CodeLib\libpng\build32\zlib_dir;..\..\..\..\..\..\CodeLib\zlib;c:\Program Files (x86)\OpenSSL-win32\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;WINDOWS;%(PreprocessorDefinitions) true MultiThreadedDLL true true $(IntDir)Rich.pch $(IntDir) $(IntDir) $(IntDir) true NDEBUG;%(PreprocessorDefinitions) 0x0c09 odbc32.lib;odbccp32.lib;imm32.lib;%(AdditionalDependencies) $(IntDir)$(TargetFileName) true true $(IntDir)Rich.pdb Windows false MachineX86 true $(IntDir)Rich.bsc NDEBUG;%(PreprocessorDefinitions) true true .\Release/Rich.tlb MinSpace OnlyExplicitInline - ..\..\include;..\..\private\common;..\..\include\lgi\win;..\..\..\..\..\CodeLib\libjpeg-9a;..\..\..\..\..\CodeLib\libpng;..\..\..\..\..\CodeLib\zlib;..\..\..\..\..\CodeLib\libpng\build64;..\..\..\..\..\CodeLib\libpng\build64\zlib_dir;c:\Program Files\OpenSSL-win64\include;%(AdditionalIncludeDirectories) + ..\src;..\resources;..\..\..\include;..\..\..\private\common;..\..\..\include\lgi\win;..\..\..\..\..\..\CodeLib\libjpeg-9a;..\..\..\..\..\..\CodeLib\libpng;..\..\..\..\..\..\CodeLib\zlib;..\..\..\..\..\..\CodeLib\libpng\build64;..\..\..\..\..\..\CodeLib\libpng\build64\zlib_dir;c:\Program Files\OpenSSL-win64\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;WINDOWS;%(PreprocessorDefinitions) true MultiThreadedDLL true true $(IntDir)Rich.pch $(IntDir) $(IntDir) $(IntDir) true NDEBUG;%(PreprocessorDefinitions) 0x0c09 odbc32.lib;odbccp32.lib;imm32.lib;%(AdditionalDependencies) $(IntDir)$(TargetFileName) true true $(IntDir)Rich.pdb Windows false true $(IntDir)Rich.bsc - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - + - + - + {95df9ca4-6d37-4a85-a648-80c2712e0da1} false - - - + + + \ No newline at end of file diff --git a/test/HtmlEditor/win/HtmlEdit.vcxproj.filters b/test/HtmlEditor/win/HtmlEdit.vcxproj.filters --- a/test/HtmlEditor/win/HtmlEdit.vcxproj.filters +++ b/test/HtmlEditor/win/HtmlEdit.vcxproj.filters @@ -1,140 +1,140 @@  {7985b591-4530-4e8d-9c6d-548d0b89a19c} cpp;c;cxx;rc;def;r;odl;idl;hpj;bat {a4c991b0-729e-474a-88df-86ee58479274} h;hpp;hxx;hm;inl {42d83401-80f5-44e4-9c26-e91423d5f214} {ca6ef51c-f1e1-4fa9-9eb1-592f10a617b0} {102281d9-5fed-495e-8ce7-d4232c9afda4} {666d6b50-f5fb-48b3-8e73-d8a90741e5ee} {62a1d4c6-9ce5-466d-a6a2-65e26f62c288} {579fa028-117b-44f0-8f9d-bf0cc8ac9187} {d072fbae-b32a-44a9-9f14-9aae81a47698} - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - - Lgi - - + Controls\RichTextEdit - + + Lgi + + Lgi - + Lgi - + Lgi - + Lgi - + Resources - + Resources - + Test Files - + Test Files - + Test Files \ No newline at end of file