Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #494 from weitzhandler/feature/move-to-windows
Browse files Browse the repository at this point in the history
Move types up to Windows.Core
  • Loading branch information
AArnott authored Jul 12, 2020
2 parents 171b717 + 65af43d commit 86376b1
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 124 deletions.
20 changes: 2 additions & 18 deletions src/User32/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
PInvoke.User32.DISPLAY_DEVICE
PInvoke.User32.DISPLAY_DEVICE.DISPLAY_DEVICE() -> void
PInvoke.User32.DISPLAY_DEVICE.DeviceID -> char*
PInvoke.User32.DISPLAY_DEVICE.DeviceKey -> char*
PInvoke.User32.DISPLAY_DEVICE.DeviceName -> char*
PInvoke.User32.DISPLAY_DEVICE.DeviceString -> char*
PInvoke.User32.DISPLAY_DEVICE.StateFlags -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DISPLAY_DEVICE.cb -> uint
PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_ACTIVE = 1 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_MIRRORING_DRIVER = 8 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_MODESPRUNED = 134217728 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_PRIMARY_DEVICE = 4 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_REMOVABLE = 32 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.DisplayDeviceFlags.DISPLAY_DEVICE_VGA_COMPATIBLE = 16 -> PInvoke.User32.DisplayDeviceFlags
PInvoke.User32.EnumDisplayDevicesFlags
PInvoke.User32.EnumDisplayDevicesFlags.EDD_GET_DEVICE_INTERFACE_NAME = 1 -> PInvoke.User32.EnumDisplayDevicesFlags
static PInvoke.User32.DISPLAY_DEVICE.Create() -> PInvoke.User32.DISPLAY_DEVICE
static PInvoke.User32.EnumDisplayDevices(string lpDevice, uint iDevNum, System.IntPtr lpDisplayDevice, PInvoke.User32.EnumDisplayDevicesFlags dwFlags) -> bool
static PInvoke.User32.EnumDisplayDevices(string lpDevice, uint iDevNum, ref PInvoke.User32.DISPLAY_DEVICE lpDisplayDevice, PInvoke.User32.EnumDisplayDevicesFlags dwFlags) -> bool
static extern PInvoke.User32.EnumDisplayDevices(string lpDevice, uint iDevNum, PInvoke.User32.DISPLAY_DEVICE* lpDisplayDevice, PInvoke.User32.EnumDisplayDevicesFlags dwFlags) -> bool
static PInvoke.User32.EnumDisplayDevices(string lpDevice, uint iDevNum, ref PInvoke.DISPLAY_DEVICE lpDisplayDevice, PInvoke.User32.EnumDisplayDevicesFlags dwFlags) -> bool
static extern PInvoke.User32.EnumDisplayDevices(string lpDevice, uint iDevNum, PInvoke.DISPLAY_DEVICE* lpDisplayDevice, PInvoke.User32.EnumDisplayDevicesFlags dwFlags) -> bool
static extern PInvoke.User32.UnregisterClass(string lpClassName, System.IntPtr hInstance) -> bool
static readonly PInvoke.User32.DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED -> System.IntPtr
58 changes: 0 additions & 58 deletions src/User32/User32+DISPLAY_DEVICE.cs

This file was deleted.

47 changes: 0 additions & 47 deletions src/User32/User32+DisplayDeviceFlags.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/User32/User32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace PInvoke
using System.Security;
using System.Text;
using System.Threading;
using PInvoke;
using static PInvoke.Kernel32;

#pragma warning disable SA1300 // Elements must begin with an uppercase letter
Expand Down
41 changes: 41 additions & 0 deletions src/Windows.Core/DISPLAY_DEVICE+DisplayDeviceFlags.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright © .NET Foundation and Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace PInvoke
{
using System;

/// <summary>
/// Device state flags.
/// </summary>
[Flags]
public enum DisplayDeviceFlags : uint
{
/// <summary>
/// Specifies whether a monitor is presented as being "on" by the respective GDI view.
/// Windows Vista: EnumDisplayDevices will only enumerate monitors that can be presented as being "on".
/// </summary>
DISPLAY_DEVICE_ACTIVE = 0x00000001,

/// <summary>
/// Represents a pseudo device used to mirror application drawing for remoting or other purposes. An invisible pseudo monitor is associated with this device.
/// For example, NetMeeting uses it. Note that <c>User32.GetSystemMetrics</c> (<c>SM_MONITORS</c>) only accounts for visible display monitors.
/// </summary>
DISPLAY_DEVICE_MIRRORING_DRIVER = 0x00000008,

/// <summary>The device has more display modes than its output devices support.</summary>
DISPLAY_DEVICE_MODESPRUNED = 0x08000000,

/// <summary>
/// The primary desktop is on the device. For a system with a single display card, this is always set.
/// For a system with multiple display cards, only one device can have this set.
/// </summary>
DISPLAY_DEVICE_PRIMARY_DEVICE = 0x00000004,

/// <summary>The device is removable; it cannot be the primary display.</summary>
DISPLAY_DEVICE_REMOVABLE = 0x00000020,

/// <summary>The device is VGA compatible.</summary>
DISPLAY_DEVICE_VGA_COMPATIBLE = 0x00000010,
}
}
50 changes: 50 additions & 0 deletions src/Windows.Core/DISPLAY_DEVICE.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright © .NET Foundation and Contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace PInvoke
{
/// <summary>
/// Receives information about the display device specified by the <c>iDevNum</c> parameter of the <c>User32.EnumDisplayDevices</c> function.
/// </summary>
public unsafe struct DISPLAY_DEVICE
{
/// <summary>
/// Size, in bytes, of the DISPLAY_DEVICE structure. This must be initialized prior to calling <c>User32.EnumDisplayDevices</c>.
/// </summary>
public uint cb;

/// <summary>
/// An array of characters identifying the device name. This is either the adapter device or the monitor device.
/// </summary>
public fixed char DeviceName[32];

/// <summary>
/// An array of characters containing the device context string. This is either a description of the display adapter or of the display monitor.
/// </summary>
public fixed char DeviceString[128];

/// <summary>
/// Device state flags.
/// </summary>
public DisplayDeviceFlags StateFlags;

/// <summary>
/// Not used.
/// </summary>
public fixed char DeviceID[128];

/// <summary>
/// Reserved.
/// </summary>
public fixed char DeviceKey[128];

/// <summary>
/// Initializes a new instance of the <see cref="DISPLAY_DEVICE"/> struct
/// with the <see cref="cb" /> field initialized.
/// </summary>
/// <returns>
/// An instance of the structure.
/// </returns>
public static DISPLAY_DEVICE Create() => new DISPLAY_DEVICE { cb = (uint)sizeof(DISPLAY_DEVICE) };
}
}
16 changes: 16 additions & 0 deletions src/Windows.Core/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
PInvoke.DISPLAY_DEVICE
PInvoke.DISPLAY_DEVICE.DISPLAY_DEVICE() -> void
PInvoke.DISPLAY_DEVICE.DeviceID -> char*
PInvoke.DISPLAY_DEVICE.DeviceKey -> char*
PInvoke.DISPLAY_DEVICE.DeviceName -> char*
PInvoke.DISPLAY_DEVICE.DeviceString -> char*
PInvoke.DISPLAY_DEVICE.StateFlags -> PInvoke.DisplayDeviceFlags
PInvoke.DISPLAY_DEVICE.cb -> uint
PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_ACTIVE = 1 -> PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_MIRRORING_DRIVER = 8 -> PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_MODESPRUNED = 134217728 -> PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_PRIMARY_DEVICE = 4 -> PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_REMOVABLE = 32 -> PInvoke.DisplayDeviceFlags
PInvoke.DisplayDeviceFlags.DISPLAY_DEVICE_VGA_COMPATIBLE = 16 -> PInvoke.DisplayDeviceFlags
static PInvoke.DISPLAY_DEVICE.Create() -> PInvoke.DISPLAY_DEVICE

0 comments on commit 86376b1

Please sign in to comment.