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
- DispatcherProcessingDisabled.cs
- Site.cs
- SystemKeyConverter.cs
- WsiProfilesElementCollection.cs
- OleDbParameter.cs
- EncodingInfo.cs
- Error.cs
- UInt32Storage.cs
- IdentifierService.cs
- ErrorLog.cs
- DesignerActionGlyph.cs
- XhtmlBasicCommandAdapter.cs
- PageSettings.cs
- HtmlContainerControl.cs
- embossbitmapeffect.cs
- CodeTypeParameterCollection.cs
- TableStyle.cs
- ComponentEditorForm.cs
- EnvelopedSignatureTransform.cs
- sapiproxy.cs
- Span.cs
- TextEditorSelection.cs
- precedingsibling.cs
- HttpContextBase.cs
- sqlpipe.cs
- ErrorFormatter.cs
- ReflectionServiceProvider.cs
- Clause.cs
- GridViewDeleteEventArgs.cs
- SplitterEvent.cs
- DataSetMappper.cs
- EpmSourcePathSegment.cs
- SafeUserTokenHandle.cs
- InteropBitmapSource.cs
- SafeLibraryHandle.cs
- DesignerAttribute.cs
- ThemeableAttribute.cs
- Propagator.Evaluator.cs
- cookieexception.cs
- PhoneCall.cs
- SharedUtils.cs
- ConfigXmlSignificantWhitespace.cs
- StylusOverProperty.cs
- AutomationProperties.cs
- WindowsRegion.cs
- GenerateHelper.cs
- FontEmbeddingManager.cs
- Pens.cs
- httpstaticobjectscollection.cs
- RectIndependentAnimationStorage.cs
- LinkedList.cs
- XmlTextAttribute.cs
- PartEditor.cs
- UnsafeNativeMethods.cs
- Stack.cs
- ItemsPresenter.cs
- ParameterCollection.cs
- KeyValuePairs.cs
- XmlDigitalSignatureProcessor.cs
- DataGridState.cs
- Command.cs
- TypeLibConverter.cs
- ObjectDataSourceDisposingEventArgs.cs
- HtmlTextViewAdapter.cs
- TabPanel.cs
- Expr.cs
- TreeNodeStyle.cs
- XmlAttributeHolder.cs
- ToolboxCategoryItems.cs
- GuidConverter.cs
- OleDbWrapper.cs
- CreateUserErrorEventArgs.cs
- WebPermission.cs
- WindowShowOrOpenTracker.cs
- WindowsUpDown.cs
- SequenceDesigner.cs
- addressfiltermode.cs
- EntityContainerEmitter.cs
- ColorKeyFrameCollection.cs
- COM2Properties.cs
- RoleManagerSection.cs
- LockCookie.cs
- DataServiceHostFactory.cs
- XmlnsDictionary.cs
- EndpointReference.cs
- DetailsView.cs
- Glyph.cs
- NextPreviousPagerField.cs
- ToolStripEditorManager.cs
- ToolStripManager.cs
- InputDevice.cs
- ContextProperty.cs
- BaseTemplateBuildProvider.cs
- basecomparevalidator.cs
- RuntimeConfigLKG.cs
- MulticastDelegate.cs
- ScrollBar.cs
- SpellerHighlightLayer.cs
- RichTextBox.cs
- ScrollViewerAutomationPeer.cs