Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Commit

Permalink
[Direct2D1] adaptation mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSt committed Apr 11, 2017
1 parent a0614e5 commit 7f451ca
Show file tree
Hide file tree
Showing 7 changed files with 254 additions and 5 deletions.
76 changes: 76 additions & 0 deletions Source/SharpDX.Direct2D1/ColorContext1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Text;

namespace SharpDX.Direct2D1
{
public partial class ColorContext1
{
/// <summary>
/// Initializes a new instance of <see cref="ColorContext1"/> class from ColorSpaceType.
/// </summary>
/// <param name="context">No documentation.</param>
/// <param name="wicColorContext">No documentation.</param>
/// <unmanaged>HRESULT ID2D1DeviceContext5::CreateColorContextFromDxgiColorSpace([In] DXGI_COLOR_SPACE_TYPE colorSpace,[Out, Fast] ID2D1ColorContext1** colorContext)</unmanaged>
public ColorContext1(DeviceContext5 context, SharpDX.DXGI.ColorSpaceType colorSpace)
: base(IntPtr.Zero)
{
context.CreateColorContextFromDxgiColorSpace(colorSpace, this);
}

/// <summary>
/// Initializes a new instance of <see cref="ColorContext1"/> class from SimpleColorProfile.
/// </summary>
/// <param name="context">No documentation.</param>
/// <param name="wicColorContext">No documentation.</param>
/// <unmanaged>HRESULT ID2D1DeviceContext5::CreateColorContextFromDxgiColorSpace([In] DXGI_COLOR_SPACE_TYPE colorSpace,[Out, Fast] ID2D1ColorContext1** colorContext)</unmanaged>
public ColorContext1(DeviceContext5 context, ref SharpDX.Direct2D1.SimpleColorProfile simpleProfile)
: base(IntPtr.Zero)
{
context.CreateColorContextFromSimpleColorProfile(ref simpleProfile, this);
}

/// <summary>
/// Initializes a new instance of <see cref="ColorContext1"/> class from ColorSpaceType.
/// </summary>
/// <param name="context">No documentation.</param>
/// <param name="wicColorContext">No documentation.</param>
/// <unmanaged>HRESULT ID2D1DeviceContext5::CreateColorContextFromDxgiColorSpace([In] DXGI_COLOR_SPACE_TYPE colorSpace,[Out, Fast] ID2D1ColorContext1** colorContext)</unmanaged>
public ColorContext1(EffectContext2 context, SharpDX.DXGI.ColorSpaceType colorSpace)
: base(IntPtr.Zero)
{
context.CreateColorContextFromDxgiColorSpace(colorSpace, this);
}

/// <summary>
/// Initializes a new instance of <see cref="ColorContext1"/> class from SimpleColorProfile.
/// </summary>
/// <param name="context">No documentation.</param>
/// <param name="wicColorContext">No documentation.</param>
/// <unmanaged>HRESULT ID2D1DeviceContext5::CreateColorContextFromDxgiColorSpace([In] DXGI_COLOR_SPACE_TYPE colorSpace,[Out, Fast] ID2D1ColorContext1** colorContext)</unmanaged>
public ColorContext1(EffectContext2 context, ref SharpDX.Direct2D1.SimpleColorProfile simpleProfile)
: base(IntPtr.Zero)
{
context.CreateColorContextFromSimpleColorProfile(ref simpleProfile, this);
}
}
}
2 changes: 1 addition & 1 deletion Source/SharpDX.Direct2D1/Device3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public partial class Device3
/// Each call to CreateDevice returns a unique <see cref="SharpDX.Direct2D1.Device3"/> object.The <see cref="SharpDX.DXGI.Device"/> object is obtained by calling QueryInterface on an ID3D10Device or an ID3D11Device.
/// </remarks>
/// <unmanaged>HRESULT ID2D1Factory3::CreateDevice([In] IDXGIDevice* dxgiDevice,[Out] ID2D1Device2** d2dDevice2)</unmanaged>
public Device3(Factory4 factory, SharpDX.DXGI.Device3 device)
public Device3(Factory4 factory, SharpDX.DXGI.Device device)
: base(IntPtr.Zero)
{
factory.CreateDevice(device, this);
Expand Down
42 changes: 42 additions & 0 deletions Source/SharpDX.Direct2D1/Device4.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System;

namespace SharpDX.Direct2D1
{
public partial class Device4
{
/// <summary>
/// Initializes a new instance of the <see cref="Device4"/> class.
/// </summary>
/// <param name="factory"><para>The <see cref="Factory5"/> object used when creating the <see cref="SharpDX.Direct2D1.Device3"/>. </para></param>
/// <param name="device"><para>The <see cref="SharpDX.DXGI.Device"/> object used when creating the <see cref="SharpDX.Direct2D1.Device4"/>. </para></param>
/// <remarks>
/// Each call to CreateDevice returns a unique <see cref="SharpDX.Direct2D1.Device4"/> object.The <see cref="SharpDX.DXGI.Device4"/> object is obtained by calling QueryInterface on an ID3D10Device or an ID3D11Device.
/// </remarks>
/// <unmanaged>HRESULT ID2D1Factory5::CreateDevice([In] IDXGIDevice* dxgiDevice,[Out] ID2D1Device5** d2dDevice4)</unmanaged>
public Device4(Factory5 factory, SharpDX.DXGI.Device device)
: base(IntPtr.Zero)
{
factory.CreateDevice(device, this);
}
}
}
42 changes: 42 additions & 0 deletions Source/SharpDX.Direct2D1/Device5.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System;

namespace SharpDX.Direct2D1
{
public partial class Device5
{
/// <summary>
/// Initializes a new instance of the <see cref="Device5"/> class.
/// </summary>
/// <param name="factory"><para>The <see cref="Factory4"/> object used when creating the <see cref="SharpDX.Direct2D1.Device5"/>. </para></param>
/// <param name="device"><para>The <see cref="SharpDX.DXGI.Device"/> object used when creating the <see cref="SharpDX.Direct2D1.Device5"/>. </para></param>
/// <remarks>
/// Each call to CreateDevice returns a unique <see cref="SharpDX.Direct2D1.Device5"/> object.The <see cref="SharpDX.DXGI.Device"/> object is obtained by calling QueryInterface on an ID3D10Device or an ID3D11Device.
/// </remarks>
/// <unmanaged>HRESULT ID2D1Factory3::CreateDevice([In] IDXGIDevice* dxgiDevice,[Out] ID2D1Device2** d2dDevice2)</unmanaged>
public Device5(Factory6 factory, SharpDX.DXGI.Device device)
: base(IntPtr.Zero)
{
factory.CreateDevice(device, this);
}
}
}
42 changes: 42 additions & 0 deletions Source/SharpDX.Direct2D1/DeviceContext4.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System;

namespace SharpDX.Direct2D1
{
public partial class DeviceContext4
{
/// <summary>
/// Initializes a new instance of the <see cref="DeviceContext4"/> class using an existing <see cref="Device4"/>.
/// </summary>
/// <param name="device">The device.</param>
/// <param name="options">The options to be applied to the created device context.</param>
/// <remarks>
/// The new device context will not have a selected target bitmap. The caller must create and select a bitmap as the target surface of the context.
/// </remarks>
/// <unmanaged>HRESULT ID2D1Device4::CreateDeviceContext([In] D2D1_DEVICE_CONTEXT_OPTIONS options,[Out] ID2D1DeviceContext4** DeviceContext4)</unmanaged>
public DeviceContext4(Device4 device, DeviceContextOptions options)
: base(IntPtr.Zero)
{
device.CreateDeviceContext(options, this);
}
}
}
42 changes: 42 additions & 0 deletions Source/SharpDX.Direct2D1/DeviceContext5.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System;

namespace SharpDX.Direct2D1
{
public partial class DeviceContext5
{
/// <summary>
/// Initializes a new instance of the <see cref="DeviceContext5"/> class using an existing <see cref="Device5"/>.
/// </summary>
/// <param name="device">The device.</param>
/// <param name="options">The options to be applied to the created device context.</param>
/// <remarks>
/// The new device context will not have a selected target bitmap. The caller must create and select a bitmap as the target surface of the context.
/// </remarks>
/// <unmanaged>HRESULT ID2D1Device5::CreateDeviceContext([In] D2D1_DEVICE_CONTEXT_OPTIONS options,[Out] ID2D1DeviceContext5** DeviceContext5)</unmanaged>
public DeviceContext5(Device5 device, DeviceContextOptions options)
: base(IntPtr.Zero)
{
device.CreateDeviceContext(options, this);
}
}
}
13 changes: 9 additions & 4 deletions Source/SharpDX.Direct2D1/Mapping-direct2d1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
<map method="ID2D1Factory::GetDesktopDpi" visibility="internal" />
<map method="ID2D(\d+)Factory\d?::Create.*" visibility="internal" />

<map param="ID2D1Factory[1234]::CreateDevice::d2dDevice[1234]?" attribute="out fast"/>
<map param="ID2D1Factory[123456]::CreateDevice::d2dDevice[12345]?" attribute="out fast"/>
<map param="ID2D1Factory1::CreateStrokeStyle::strokeStyle" attribute="out fast"/>
<map param="ID2D1Factory1::CreatePathGeometry::pathGeometry" attribute="out fast"/>
<map param="ID2D1Factory1::CreateDrawingStateBlock::drawingStateBlock" attribute="out fast"/>
Expand All @@ -325,8 +325,8 @@
<map param="ID2D(\d+)Factory::CreateDCRenderTarget::dcRenderTarget" attribute="out fast"/>
<map param="ID2D(\d+)Factory::CreateWicBitmapRenderTarget::renderTarget" attribute="out fast"/>

<map method="ID2D\dDevice[123]?::Create.*" visibility="internal"/>
<map param="ID2D\dDevice[123]?::CreateDeviceContext::deviceContext[123]?" attribute="out fast"/>
<map method="ID2D\dDevice[12345]?::Create.*" visibility="internal"/>
<map param="ID2D\dDevice[12345]?::CreateDeviceContext::deviceContext[12345]?" attribute="out fast"/>
<map param="ID2D\dDevice::CreatePrintControl::printControl" attribute="out fast"/>

<map method="ID2D\dDeviceContext[123]?::Create.*" visibility="internal"/>
Expand Down Expand Up @@ -490,7 +490,12 @@
<map interface="ID2D1DrawTransform" callback-visibility="public" callback="true" callback-dual="true" />
<map interface="ID2D1SourceTransform" callback-visibility="public" callback="true" callback-dual="true" />

<!--
<map param="ID2D\dDeviceContext5::CreateColorContextFromDxgiColorSpace::colorContext" attribute="out fast"/>
<map param="ID2D\dDeviceContext5::CreateColorContextFromSimpleColorProfile::colorContext" attribute="out fast"/>
<map param="ID2D\dEffectContext2::CreateColorContextFromDxgiColorSpace::colorContext" attribute="out fast"/>
<map param="ID2D\dEffectContext2::CreateColorContextFromSimpleColorProfile::colorContext" attribute="out fast"/>

<!--
// *****************************************************************
// D2D1 Functions
// *****************************************************************
Expand Down

0 comments on commit 7f451ca

Please sign in to comment.