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 / GlyphShapingProperties.cs / 1 / GlyphShapingProperties.cs
//------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2004 // // File: GlyphShapingProperties.cs // // Contents: Definition of glyph properties // // Created: 1-2-2004 Worachai Chaoweeraprasit (wchao) // // 10-27-2004 garyyang Move to System.Windows.Media.TextFormatting // namespace // // 1-20-2005 garyyang Move to MS.Internal.Shaping //----------------------------------------------------------------------- using System; namespace MS.Internal.Shaping { ////// Properties indicating glyph characteristics /// internal struct GlyphShapingProperties { ////// Construct a glyph properties value from multiple values from shaping /// /// shaping engine glyph flags /// bits reserved for shaping engine use internal GlyphShapingProperties( ushort glyphFlags, ushort engineReserved ) { _value = glyphFlags; _value |= ((uint)engineReserved) << 16; } ////// Get or Set bits reserved for shaping engine use /// internal ushort GlyphFlags { get { return (ushort)(_value & GlyphFlagsMask); } set { _value = (_value & ~EngineReservedValueMask) | (uint)value; } } ////// Get or Set bits reserved for shaping engine use /// internal ushort EngineReserved { get { return (ushort)(_value >> 16); } set { _value = (_value & ~EngineReservedValueMask) | (uint)(value << 16); } } ////// Explicitly convert this value type to integer /// public static explicit operator int(GlyphShapingProperties props) { return (int)props._value; } ////// Compares two GlyphShapingProperties for equality. /// ///Returns true if the arguments have identical properties, false if not. public static bool operator ==( GlyphShapingProperties left, GlyphShapingProperties right) { return left._value == right._value; } ////// Compares two GlyphShapingProperties for inequality. /// ///Returns true if the arguments are not equal, false if they are equal. public static bool operator !=( GlyphShapingProperties left, GlyphShapingProperties right) { return !(left == right); } ////// Compares the specified object with this. /// ///Returns true if the specified object is a GlyphShapingProperties with the same /// value as this object. public override bool Equals( object o) { if (o != null && o is GlyphShapingProperties) { return (GlyphShapingProperties)o == this; } else { return false; } } ////// Returns a hash code based on the property flags. /// public override int GetHashCode() { return (int)_value; } private uint _value; private const uint GlyphFlagsMask = 0x0000FFFF; private const uint EngineReservedValueMask = 0xFFFF0000; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2004 // // File: GlyphShapingProperties.cs // // Contents: Definition of glyph properties // // Created: 1-2-2004 Worachai Chaoweeraprasit (wchao) // // 10-27-2004 garyyang Move to System.Windows.Media.TextFormatting // namespace // // 1-20-2005 garyyang Move to MS.Internal.Shaping //----------------------------------------------------------------------- using System; namespace MS.Internal.Shaping { ////// Properties indicating glyph characteristics /// internal struct GlyphShapingProperties { ////// Construct a glyph properties value from multiple values from shaping /// /// shaping engine glyph flags /// bits reserved for shaping engine use internal GlyphShapingProperties( ushort glyphFlags, ushort engineReserved ) { _value = glyphFlags; _value |= ((uint)engineReserved) << 16; } ////// Get or Set bits reserved for shaping engine use /// internal ushort GlyphFlags { get { return (ushort)(_value & GlyphFlagsMask); } set { _value = (_value & ~EngineReservedValueMask) | (uint)value; } } ////// Get or Set bits reserved for shaping engine use /// internal ushort EngineReserved { get { return (ushort)(_value >> 16); } set { _value = (_value & ~EngineReservedValueMask) | (uint)(value << 16); } } ////// Explicitly convert this value type to integer /// public static explicit operator int(GlyphShapingProperties props) { return (int)props._value; } ////// Compares two GlyphShapingProperties for equality. /// ///Returns true if the arguments have identical properties, false if not. public static bool operator ==( GlyphShapingProperties left, GlyphShapingProperties right) { return left._value == right._value; } ////// Compares two GlyphShapingProperties for inequality. /// ///Returns true if the arguments are not equal, false if they are equal. public static bool operator !=( GlyphShapingProperties left, GlyphShapingProperties right) { return !(left == right); } ////// Compares the specified object with this. /// ///Returns true if the specified object is a GlyphShapingProperties with the same /// value as this object. public override bool Equals( object o) { if (o != null && o is GlyphShapingProperties) { return (GlyphShapingProperties)o == this; } else { return false; } } ////// Returns a hash code based on the property flags. /// public override int GetHashCode() { return (int)_value; } private uint _value; private const uint GlyphFlagsMask = 0x0000FFFF; private const uint EngineReservedValueMask = 0xFFFF0000; } } // 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
- RegisteredExpandoAttribute.cs
- NoPersistProperty.cs
- activationcontext.cs
- CompiledQuery.cs
- IIS7WorkerRequest.cs
- HttpHandlerAction.cs
- PropertyDescriptorCollection.cs
- RadioButtonBaseAdapter.cs
- CloudCollection.cs
- ConfigurationElementCollection.cs
- OdbcConnectionString.cs
- HtmlTableRowCollection.cs
- EpmContentSerializerBase.cs
- EvidenceBase.cs
- InternalsVisibleToAttribute.cs
- HiddenField.cs
- StrokeDescriptor.cs
- RankException.cs
- DataSourceControlBuilder.cs
- XmlReflectionMember.cs
- DataGridViewColumnEventArgs.cs
- TimeSpanConverter.cs
- DiscoveryServiceExtension.cs
- FontUnitConverter.cs
- DragEvent.cs
- EncoderNLS.cs
- ListenDesigner.cs
- CategoryAttribute.cs
- ToolStripDropDownItem.cs
- ConfigurationErrorsException.cs
- CustomAttributeSerializer.cs
- AuthenticodeSignatureInformation.cs
- ContainerParaClient.cs
- VBCodeProvider.cs
- StateMachineTimers.cs
- _BaseOverlappedAsyncResult.cs
- ByteRangeDownloader.cs
- EventDescriptorCollection.cs
- PageScaling.cs
- ConfigurationLocationCollection.cs
- TextTreeTextElementNode.cs
- MenuItemBindingCollection.cs
- TimeSpanOrInfiniteConverter.cs
- TextServicesProperty.cs
- ValidationRule.cs
- PeerNameRecordCollection.cs
- PopupControlService.cs
- File.cs
- CollectionsUtil.cs
- StreamUpdate.cs
- PlainXmlSerializer.cs
- Keyboard.cs
- DispatchOperationRuntime.cs
- SecurityMessageProperty.cs
- HtmlEncodedRawTextWriter.cs
- ISessionStateStore.cs
- DummyDataSource.cs
- Paragraph.cs
- TextTrailingWordEllipsis.cs
- Viewport3DAutomationPeer.cs
- AssemblyCache.cs
- WebMessageBodyStyleHelper.cs
- BaseValidator.cs
- CompilationRelaxations.cs
- StreamGeometry.cs
- HttpPostedFileBase.cs
- TypeDescriptionProvider.cs
- HttpWrapper.cs
- PropertyReferenceExtension.cs
- TypeSystem.cs
- ObjectStateEntry.cs
- MdiWindowListStrip.cs
- IpcClientChannel.cs
- XappLauncher.cs
- CodeGenerationManager.cs
- ItemMap.cs
- ConsoleCancelEventArgs.cs
- LineSegment.cs
- CompileLiteralTextParser.cs
- PermissionListSet.cs
- BuiltInExpr.cs
- Style.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- PartialTrustVisibleAssembly.cs
- UInt32.cs
- RenderContext.cs
- Lease.cs
- SqlFlattener.cs
- Mapping.cs
- ActivityTypeResolver.xaml.cs
- DataGridViewControlCollection.cs
- ContentFileHelper.cs
- OutputCacheProfile.cs
- ToolStripButton.cs
- DSACryptoServiceProvider.cs
- FlowNode.cs
- CryptoApi.cs
- LayoutEditorPart.cs
- SqlTopReducer.cs
- LogPolicy.cs