Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / MS / Internal / Shaping / CharacterShapingProperties.cs / 1 / CharacterShapingProperties.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: CharacterShapingProperties class // // History: // 10/26/2004: [....] Created the file // 1/25/2004: [....] Move it to internal namespace // //--------------------------------------------------------------------------- using System.Runtime.InteropServices; namespace MS.Internal.Shaping { ////// Properties per character /// [StructLayout(LayoutKind.Sequential)] internal struct CharacterShapingProperties { ////// Constructor /// /// reserved bits used by shaping engine /// flag indicating whether the code point can be glyphed alone internal CharacterShapingProperties(byte engineReserved, bool canGlyphAlone) { _value = (canGlyphAlone ? CanGlyphAloneFlag : (ushort) 0); _value |= engineReserved; } ////// Get or Set CanGlyphAlone flag for the charactrer /// ///internal bool CanGlyphAlone { get { return (_value & CanGlyphAloneFlag) != 0; } set { if (value) { _value |= CanGlyphAloneFlag; } else { _value &= (CanGlyphAloneFlag ^ 0xFFFF); } } } /// /// Get or Set bits reserved for shaping engine use /// ///internal byte EngineReserved { get { return (byte)(_value & EngineReservedValueMask); } set { _value = (ushort)((_value & (EngineReservedValueMask ^ 0xFFFF)) | value); } } /// /// Compares two CharacterShapingProperties for equality. /// ///Returns true if the arguments have identical properties, false if not. public static bool operator ==( CharacterShapingProperties left, CharacterShapingProperties right) { return left._value == right._value; } ////// Compares two CharacterShapingProperties for inequality. /// ///Returns true if the arguments are not equal, false if they are equal. public static bool operator !=( CharacterShapingProperties left, CharacterShapingProperties right) { return !(left == right); } ////// Compares the specified object with this. /// ///Returns true if the specified object is a CharacterShapingProperties with the same /// value as this object. public override bool Equals(object o) { if (o != null && o is CharacterShapingProperties) { return (CharacterShapingProperties)o == this; } else { return false; } } ////// Returns a hash code based on the property flags. /// public override int GetHashCode() { return _value; } private ushort _value; // CanGlyphAloneFlag is store at the 9th bit private const ushort CanGlyphAloneFlag = 0x0100; private const ushort EngineReservedValueMask = 0x00FF; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventLogPermissionAttribute.cs
- MethodInfo.cs
- EventRouteFactory.cs
- MultiTargetingUtil.cs
- ActionFrame.cs
- ServiceModelSecurityTokenTypes.cs
- COAUTHINFO.cs
- UserControlAutomationPeer.cs
- CompModSwitches.cs
- ParameterCollection.cs
- TimeSpanConverter.cs
- XmlTypeAttribute.cs
- ConfigXmlElement.cs
- AnonymousIdentificationSection.cs
- MaxMessageSizeStream.cs
- StrokeCollection.cs
- HandlerWithFactory.cs
- storepermissionattribute.cs
- IconBitmapDecoder.cs
- SqlProfileProvider.cs
- SecurityKeyIdentifierClause.cs
- PeerCredentialElement.cs
- ActivationProxy.cs
- InvokeBase.cs
- Stacktrace.cs
- TraceSection.cs
- PagerSettings.cs
- HttpAsyncResult.cs
- TypeConstant.cs
- SourceInterpreter.cs
- TextServicesPropertyRanges.cs
- IconHelper.cs
- GZipDecoder.cs
- TemplatedWizardStep.cs
- Typography.cs
- Bezier.cs
- XmlWrappingReader.cs
- Nodes.cs
- ChunkedMemoryStream.cs
- MsdtcWrapper.cs
- EventSinkActivity.cs
- RegisteredHiddenField.cs
- WindowsListViewGroup.cs
- DefaultObjectMappingItemCollection.cs
- AmbiguousMatchException.cs
- BatchWriter.cs
- FilterElement.cs
- HtmlElementCollection.cs
- EventProviderWriter.cs
- CatalogPartCollection.cs
- ScriptManager.cs
- TypeConstant.cs
- InfoCardMetadataExchangeClient.cs
- SQlBooleanStorage.cs
- WrapPanel.cs
- CodeAttachEventStatement.cs
- ResourceKey.cs
- BooleanToVisibilityConverter.cs
- CurrencyWrapper.cs
- CachedBitmap.cs
- CallContext.cs
- CatalogPartCollection.cs
- TemplateNameScope.cs
- WebPartsPersonalizationAuthorization.cs
- HttpCacheVaryByContentEncodings.cs
- Highlights.cs
- SectionXmlInfo.cs
- DynamicPropertyReader.cs
- ClientSettingsSection.cs
- ScrollBar.cs
- GroupItemAutomationPeer.cs
- WindowsListViewItemCheckBox.cs
- BindValidationContext.cs
- UrlAuthorizationModule.cs
- PlainXmlSerializer.cs
- String.cs
- ValidationPropertyAttribute.cs
- DataControlButton.cs
- Point3DCollection.cs
- MappingSource.cs
- UrlPropertyAttribute.cs
- linebase.cs
- InstanceData.cs
- CrossContextChannel.cs
- CodeSnippetExpression.cs
- XpsResourceDictionary.cs
- RectangleGeometry.cs
- SymbolType.cs
- ProjectionCamera.cs
- SchemaInfo.cs
- SqlClientFactory.cs
- SqlCacheDependency.cs
- DoubleLink.cs
- ConnectionInterfaceCollection.cs
- LinearQuaternionKeyFrame.cs
- NoPersistHandle.cs
- DataRecord.cs
- BitmapEffectState.cs
- AppLevelCompilationSectionCache.cs
- ComponentResourceManager.cs