Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / MS / Internal / Shaping / CharacterShapingProperties.cs / 1 / CharacterShapingProperties.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: CharacterShapingProperties class // // History: // 10/26/2004: Garyyang Created the file // 1/25/2004: garyyang 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. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: CharacterShapingProperties class // // History: // 10/26/2004: Garyyang Created the file // 1/25/2004: garyyang 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
- DataGridViewSelectedCellCollection.cs
- DesignerCatalogPartChrome.cs
- XmlReflectionImporter.cs
- BadImageFormatException.cs
- TraversalRequest.cs
- XmlJsonReader.cs
- MessageEventSubscriptionService.cs
- DataServiceRequest.cs
- TaskFormBase.cs
- TypeExtensionConverter.cs
- LogReserveAndAppendState.cs
- StrokeCollection.cs
- HttpStaticObjectsCollectionWrapper.cs
- ParentQuery.cs
- LicFileLicenseProvider.cs
- IndexOutOfRangeException.cs
- ResXDataNode.cs
- MergablePropertyAttribute.cs
- Context.cs
- TraceHandlerErrorFormatter.cs
- EventlogProvider.cs
- CommonEndpointBehaviorElement.cs
- SqlCommandSet.cs
- IList.cs
- WaitForChangedResult.cs
- Polyline.cs
- CompilerScopeManager.cs
- SpecialFolderEnumConverter.cs
- ObjectStateManagerMetadata.cs
- X509DefaultServiceCertificateElement.cs
- ZipIOLocalFileHeader.cs
- InvokeMethod.cs
- ExpressionBuilderContext.cs
- EFAssociationProvider.cs
- DocumentGridPage.cs
- OutArgument.cs
- LOSFormatter.cs
- GridViewColumnCollectionChangedEventArgs.cs
- InsufficientMemoryException.cs
- PageCache.cs
- FontStyles.cs
- FieldMetadata.cs
- Ref.cs
- InternalConfigEventArgs.cs
- EncoderFallback.cs
- Activator.cs
- SynchronizedInputHelper.cs
- CursorConverter.cs
- FilteredXmlReader.cs
- ReverseInheritProperty.cs
- ZipPackagePart.cs
- ConsumerConnectionPointCollection.cs
- CodeGenerator.cs
- HtmlLink.cs
- RegexGroup.cs
- ContextInformation.cs
- Baml2006Reader.cs
- SelectionRange.cs
- CriticalFinalizerObject.cs
- PerformanceCounterPermissionEntryCollection.cs
- ListBindingConverter.cs
- HttpCapabilitiesBase.cs
- GenericXmlSecurityToken.cs
- PageAsyncTaskManager.cs
- HttpHandlersInstallComponent.cs
- MenuStrip.cs
- VersionUtil.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- EditingCommands.cs
- HtmlTextArea.cs
- CompareValidator.cs
- Point3D.cs
- ServicesUtilities.cs
- ListView.cs
- MenuStrip.cs
- BuildResultCache.cs
- IgnoreSection.cs
- HtmlInputControl.cs
- XmlArrayItemAttributes.cs
- MetadataArtifactLoaderCompositeResource.cs
- WorkflowControlEndpoint.cs
- TrackingMemoryStream.cs
- URLIdentityPermission.cs
- HandlerBase.cs
- SerializerProvider.cs
- OleCmdHelper.cs
- PackageFilter.cs
- DataContract.cs
- TextEncodedRawTextWriter.cs
- CharacterHit.cs
- NativeMethods.cs
- HttpHeaderCollection.cs
- DocumentSequence.cs
- DataGridViewBand.cs
- SynchronizationContext.cs
- LassoHelper.cs
- AudioFormatConverter.cs
- EncoderParameter.cs
- XmlMtomReader.cs
- DelayedRegex.cs