Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- CompModSwitches.cs
- CompilationLock.cs
- IIS7UserPrincipal.cs
- AppSecurityManager.cs
- InvokeHandlers.cs
- fixedPageContentExtractor.cs
- CompiledRegexRunner.cs
- RotationValidation.cs
- StringFunctions.cs
- HyperLinkColumn.cs
- QueryUtil.cs
- RoutedEventArgs.cs
- NetCodeGroup.cs
- IdleTimeoutMonitor.cs
- HyperLink.cs
- HtmlInputPassword.cs
- DataServices.cs
- WebBaseEventKeyComparer.cs
- ExpressionBuilder.cs
- BevelBitmapEffect.cs
- SafeCertificateStore.cs
- SqlFacetAttribute.cs
- MobileUITypeEditor.cs
- DownloadProgressEventArgs.cs
- CollaborationHelperFunctions.cs
- TextBlockAutomationPeer.cs
- ClientData.cs
- Pens.cs
- ErrorHandler.cs
- HttpConfigurationContext.cs
- NamespaceExpr.cs
- XmlUtf8RawTextWriter.cs
- SoapAttributeAttribute.cs
- RealProxy.cs
- SocketInformation.cs
- ConfigurationPropertyAttribute.cs
- XPathScanner.cs
- FragmentQueryKB.cs
- RightsManagementInformation.cs
- NavigationProgressEventArgs.cs
- TimeIntervalCollection.cs
- PagesSection.cs
- MetadataPropertyAttribute.cs
- HttpDateParse.cs
- SrgsElementFactoryCompiler.cs
- Matrix3DConverter.cs
- XmlValidatingReaderImpl.cs
- CommandLineParser.cs
- DLinqColumnProvider.cs
- GlyphCache.cs
- SettingsAttributes.cs
- TableItemProviderWrapper.cs
- RoleService.cs
- CustomAttributeFormatException.cs
- oledbconnectionstring.cs
- ListViewItemSelectionChangedEvent.cs
- Expr.cs
- ObjectDataSourceDesigner.cs
- SqlDataAdapter.cs
- AsyncResult.cs
- Events.cs
- ServiceRoute.cs
- HtmlContainerControl.cs
- SecurityPolicySection.cs
- FixedSOMContainer.cs
- _KerberosClient.cs
- XmlException.cs
- TypeSystem.cs
- BooleanFacetDescriptionElement.cs
- SelectorItemAutomationPeer.cs
- XmlObjectSerializerReadContextComplexJson.cs
- ImageIndexConverter.cs
- ArraySubsetEnumerator.cs
- HtmlHistory.cs
- WebControl.cs
- DiscardableAttribute.cs
- PageAsyncTask.cs
- CharacterMetrics.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- JsonFormatReaderGenerator.cs
- TagMapCollection.cs
- FlowLayoutSettings.cs
- UnsafeNativeMethods.cs
- GenerateTemporaryTargetAssembly.cs
- BadImageFormatException.cs
- SqlExpressionNullability.cs
- OdbcInfoMessageEvent.cs
- WebPartConnectionsDisconnectVerb.cs
- InputMethod.cs
- SqlMetaData.cs
- HttpCacheParams.cs
- PersonalizationStateInfo.cs
- BitStack.cs
- UpdateException.cs
- CommandBinding.cs
- ComboBoxItem.cs
- RC2CryptoServiceProvider.cs
- MinMaxParagraphWidth.cs
- EndpointInfo.cs
- ActivityContext.cs