Added HCOLORSPACE

pull/83/head
David Hall 2019-09-25 14:13:54 -05:00
parent 1450d98b32
commit 0d92eb39b8
2 changed files with 69 additions and 1 deletions

View File

@ -239,6 +239,54 @@ namespace Vanara.PInvoke
public IntPtr DangerousGetHandle() => handle;
}
/// <summary>Provides a handle to a color space.</summary>
[StructLayout(LayoutKind.Sequential)]
public struct HCOLORSPACE : IGraphicsObjectHandle
{
private IntPtr handle;
/// <summary>Initializes a new instance of the <see cref="HCOLORSPACE"/> struct.</summary>
/// <param name="preexistingHandle">An <see cref="IntPtr"/> object that represents the pre-existing handle to use.</param>
public HCOLORSPACE(IntPtr preexistingHandle) => handle = preexistingHandle;
/// <summary>Returns an invalid handle by instantiating a <see cref="HCOLORSPACE"/> object with <see cref="IntPtr.Zero"/>.</summary>
public static HCOLORSPACE NULL => new HCOLORSPACE(IntPtr.Zero);
/// <summary>Gets a value indicating whether this instance is a null handle.</summary>
public bool IsNull => handle == IntPtr.Zero;
/// <summary>Performs an explicit conversion from <see cref="HCOLORSPACE"/> to <see cref="IntPtr"/>.</summary>
/// <param name="h">The handle.</param>
/// <returns>The result of the conversion.</returns>
public static explicit operator IntPtr(HCOLORSPACE h) => h.handle;
/// <summary>Performs an implicit conversion from <see cref="IntPtr"/> to <see cref="HCOLORSPACE"/>.</summary>
/// <param name="h">The pointer to a handle.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator HCOLORSPACE(IntPtr h) => new HCOLORSPACE(h);
/// <summary>Implements the operator !=.</summary>
/// <param name="h1">The first handle.</param>
/// <param name="h2">The second handle.</param>
/// <returns>The result of the operator.</returns>
public static bool operator !=(HCOLORSPACE h1, HCOLORSPACE h2) => !(h1 == h2);
/// <summary>Implements the operator ==.</summary>
/// <param name="h1">The first handle.</param>
/// <param name="h2">The second handle.</param>
/// <returns>The result of the operator.</returns>
public static bool operator ==(HCOLORSPACE h1, HCOLORSPACE h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HCOLORSPACE h ? handle == h.handle : false;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
/// <inheritdoc/>
public IntPtr DangerousGetHandle() => handle;
}
/// <summary>Provides a handle to a Windows cursor.</summary>
[StructLayout(LayoutKind.Sequential), DebuggerDisplay("{handle}")]
public struct HCURSOR : IGraphicsObjectHandle
@ -774,11 +822,31 @@ namespace Vanara.PInvoke
/// <returns>The result of the conversion.</returns>
public static implicit operator HGDIOBJ(HBRUSH h) => new HGDIOBJ((IntPtr)h);
/// <summary>Performs an implicit conversion from <see cref="HCOLORSPACE"/> to <see cref="HGDIOBJ"/>.</summary>
/// <param name="h">The pointer to a handle.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator HGDIOBJ(HCOLORSPACE h) => new HGDIOBJ((IntPtr)h);
/// <summary>Performs an implicit conversion from <see cref="HDC"/> to <see cref="HGDIOBJ"/>.</summary>
/// <param name="h">The pointer to a handle.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator HGDIOBJ(HDC h) => new HGDIOBJ((IntPtr)h);
/// <summary>Performs an implicit conversion from <see cref="HFONT"/> to <see cref="HGDIOBJ"/>.</summary>
/// <param name="h">The pointer to a handle.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator HGDIOBJ(HFONT h) => new HGDIOBJ((IntPtr)h);
/// <summary>Performs an implicit conversion from <see cref="HMETAFILE"/> to <see cref="HGDIOBJ"/>.</summary>
/// <param name="h">The pointer to a handle.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator HGDIOBJ(HMETAFILE h) => new HGDIOBJ((IntPtr)h);
/// <summary>Performs an implicit conversion from <see cref="HENHMETAFILE"/> to <see cref="HGDIOBJ"/>.</summary>
/// <param name="h">The pointer to a handle.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator HGDIOBJ(HENHMETAFILE h) => new HGDIOBJ((IntPtr)h);
/// <summary>Performs an implicit conversion from <see cref="HPALETTE"/> to <see cref="HGDIOBJ"/>.</summary>
/// <param name="h">The pointer to a handle.</param>
/// <returns>The result of the conversion.</returns>

View File

@ -35,7 +35,7 @@ Classes
IErrorProvider, IGraphicsObjectHandle, IHandle, IKernelHandle, ISecurityObject, IShellHandle, ISyncHandle, IUserHandle, AssociateAttribute, ComTryGetNext, CoTaskMemStringMarshaler, FunctionHelper, IEnumFromCom&lt;T&gt;, IEnumFromIndexer&lt;T&gt;, IEnumFromNext&lt;T&gt;, Lib, Macros, NullTermStringArrayMarshaler, OverlappedAsync, OverlappedAsyncResult, PInvokeClientExtensions, PInvokeDataAttribute, PRECT, PtrFunc&lt;T&gt;, RegistryTypeExt, SafeElementArray&lt;T&gt;, SafeHANDLE, SafeNativeArray&lt;T&gt;, SafeNativeArrayBase&lt;T&gt;, SafeNativeLinkedList&lt;T&gt;, SafeResourceId, SBFunc&lt;T&gt;, SECURITY_ATTRIBUTES, SizeFunc&lt;T&gt;, StringPtrArrayMarshaler, StructHelper, TryGetNext
Structures
ACCESS_MASK, BusNumber, CLIPFORMAT, CM_FULL_RESOURCE_DESCRIPTOR, CM_PARTIAL_RESOURCE_DESCRIPTOR, CM_PARTIAL_RESOURCE_LIST, CM_RESOURCE_LIST, COLORREF, Connection, DevicePrivate, DeviceSpecificData, Dma, DmaV3, Generic, HACCEL, HANDLE, HBITMAP, HBRUSH, HCURSOR, HDC, HDESK, HDPA, HDROP, HDSA, HDWP, HENHMETAFILE, HFILE, HFONT, HGDIOBJ, HICON, HIMAGELIST, HINSTANCE, HKEY, HMENU, HMETAFILE, HMONITOR, HPALETTE, HPEN, HPROCESS, HPROPSHEET, HPROPSHEETPAGE, HRESULT, HRGN, HTASK, HTHEME, HTHREAD, HTHUMBNAIL, HTOKEN, HWINSTA, HWND, Interrupt, LCID, LOGFONT, Memory40, Memory48, Memory64, MessageInterruptRaw, MSG, NTStatus, OBJECT_TYPE_LIST, PACE, PACL, POINTS, PRECT, PSECURITY_DESCRIPTOR, PSID, RECT, ResourceId, SECURITY_ATTRIBUTES, SIZE, SYSTEMTIME, union, WIN32_FIND_DATA, Win32Error
ACCESS_MASK, BusNumber, CLIPFORMAT, CM_FULL_RESOURCE_DESCRIPTOR, CM_PARTIAL_RESOURCE_DESCRIPTOR, CM_PARTIAL_RESOURCE_LIST, CM_RESOURCE_LIST, COLORREF, Connection, DevicePrivate, DeviceSpecificData, Dma, DmaV3, Generic, HACCEL, HANDLE, HBITMAP, HBRUSH, HCOLORSPACE, HCURSOR, HDC, HDESK, HDPA, HDROP, HDSA, HDWP, HENHMETAFILE, HFILE, HFONT, HGDIOBJ, HICON, HIMAGELIST, HINSTANCE, HKEY, HMENU, HMETAFILE, HMONITOR, HPALETTE, HPEN, HPROCESS, HPROPSHEET, HPROPSHEETPAGE, HRESULT, HRGN, HTASK, HTHEME, HTHREAD, HTHUMBNAIL, HTOKEN, HWINSTA, HWND, Interrupt, LCID, LOGFONT, Memory40, Memory48, Memory64, MessageInterruptRaw, MSG, NTStatus, OBJECT_TYPE_LIST, PACE, PACL, POINTS, PRECT, PSECURITY_DESCRIPTOR, PSID, RECT, ResourceId, SECURITY_ATTRIBUTES, SIZE, SYSTEMTIME, union, WIN32_FIND_DATA, Win32Error
Enumerations
CM_RESOURCE, CM_SHARE_DISPOSITION, CmResourceType, DrawTextFlags, FacilityCode, FacilityCode, FileFlagsAndAttributes, FontFamily, FontPitch, INTERFACE_TYPE, LogFontCharSet, LogFontClippingPrecision, LogFontOutputPrecision, LogFontOutputQuality, NTDDI, ObjectTypeListLevel, PInvokeClient, ProcessorArchitecture, REG_VALUE_TYPE, ResourceType, SECURITY_INFORMATION, SeverityLevel, SeverityLevel, ShowWindowCommand, STGM, SystemColorIndex, SystemShutDownReason, URLZONE, WIN32_WINNT