Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- DataGridViewCellStyle.cs
- CatalogZoneAutoFormat.cs
- TerminateWorkflow.cs
- ConditionalDesigner.cs
- ClientBase.cs
- ListView.cs
- SqlUserDefinedAggregateAttribute.cs
- _HelperAsyncResults.cs
- BindingExpressionUncommonField.cs
- TextRunTypographyProperties.cs
- Scene3D.cs
- ManagementNamedValueCollection.cs
- TouchesOverProperty.cs
- ParsedAttributeCollection.cs
- DataBoundLiteralControl.cs
- WebPartManager.cs
- Exceptions.cs
- Renderer.cs
- WebPartConnectionsCancelEventArgs.cs
- _Events.cs
- UdpTransportBindingElement.cs
- DummyDataSource.cs
- NamedObject.cs
- ConversionValidationRule.cs
- BooleanProjectedSlot.cs
- QueryStringParameter.cs
- DotExpr.cs
- DataSourceControl.cs
- NamespaceDisplay.xaml.cs
- TdsParserSessionPool.cs
- LinearGradientBrush.cs
- HttpAsyncResult.cs
- ObjectPropertyMapping.cs
- SharedPerformanceCounter.cs
- PassportAuthenticationModule.cs
- WebPartHelpVerb.cs
- WebBrowser.cs
- OracleMonthSpan.cs
- BindingsCollection.cs
- serverconfig.cs
- TypedServiceOperationListItem.cs
- COM2ExtendedBrowsingHandler.cs
- XPathConvert.cs
- ReadOnlyCollection.cs
- HwndSourceParameters.cs
- HMACSHA384.cs
- MissingMethodException.cs
- XmlBaseWriter.cs
- AnnotationResource.cs
- AffineTransform3D.cs
- DataSourceConverter.cs
- ArrayConverter.cs
- XmlDataLoader.cs
- StrokeDescriptor.cs
- BooleanExpr.cs
- ChtmlMobileTextWriter.cs
- TypeDescriptionProvider.cs
- MessageDescriptionCollection.cs
- TypeUtil.cs
- DbConnectionPoolIdentity.cs
- ObjectStateEntryDbDataRecord.cs
- ConfigXmlText.cs
- elementinformation.cs
- SystemWebCachingSectionGroup.cs
- ConnectionManagementElement.cs
- PerformanceCounterPermission.cs
- TableRowCollection.cs
- UIElementPropertyUndoUnit.cs
- FileFormatException.cs
- CodeAttributeDeclarationCollection.cs
- xsdvalidator.cs
- CompositeKey.cs
- RefreshEventArgs.cs
- AsymmetricSecurityBindingElement.cs
- AssertFilter.cs
- CompiledQueryCacheEntry.cs
- ComplexTypeEmitter.cs
- ExpressionsCollectionEditor.cs
- _FtpControlStream.cs
- UnicastIPAddressInformationCollection.cs
- HandlerFactoryWrapper.cs
- ModulesEntry.cs
- KernelTypeValidation.cs
- SizeLimitedCache.cs
- AutomationPropertyInfo.cs
- ConnectionPointCookie.cs
- CompositeTypefaceMetrics.cs
- IndentedWriter.cs
- HotSpotCollection.cs
- HandledEventArgs.cs
- TextEditorMouse.cs
- PenContexts.cs
- TargetParameterCountException.cs
- SecureStringHasher.cs
- WorkflowDesignerMessageFilter.cs
- TextSpanModifier.cs
- ActivityDesignerResources.cs
- BitmapEffectDrawing.cs
- StateManagedCollection.cs
- SlipBehavior.cs