From 504057f54d16db6b037ce65cfde72313522328e1 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 22 Jun 2023 10:24:14 -0700 Subject: [PATCH 1/8] Ensure inline files are being consistently handled --- generation/DirectX/um/d3dcompiler/generate.rsp | 4 +++- generation/DirectX/um/d3dcompiler/um-d3dcompiler.h | 1 + generation/Windows/um/CommCtrl/generate.rsp | 1 + generation/Windows/um/CommCtrl/um-CommCtrl.h | 1 + generation/Windows/um/WinBase/generate.rsp | 1 + generation/Windows/um/WinBase/um-WinBase.h | 1 + generation/Windows/um/WinUser/generate.rsp | 1 + generation/Windows/um/WinUser/um-WinUser.h | 1 + generation/Windows/um/prsht/generate.rsp | 1 + generation/Windows/um/prsht/um-prsht.h | 1 + .../Windows/DirectX/headers/d3d12/DirectX.Manual.cs | 9 ++++++++- 11 files changed, 20 insertions(+), 2 deletions(-) diff --git a/generation/DirectX/um/d3dcompiler/generate.rsp b/generation/DirectX/um/d3dcompiler/generate.rsp index 9ecf6614d7..b48533e88d 100644 --- a/generation/DirectX/um/d3dcompiler/generate.rsp +++ b/generation/DirectX/um/d3dcompiler/generate.rsp @@ -2,6 +2,8 @@ @../../../remap.rsp --exclude D3DDisassemble10Effect(struct ID3D10Effect *, UINT, ID3DBlob **):HRESULT +D3D12Reflect(LPCVOID, SIZE_T, ID3D11ShaderReflection **):HRESULT +D3D12ReflectLibrary(LPCVOID, SIZE_T, ID3D12LibraryReflection **):HRESULT --file um-d3dcompiler.h --methodClassName @@ -14,7 +16,7 @@ TerraFX.Interop.DirectX ../../../../tests/Interop/Windows/DirectX/um/d3dcompiler --traverse C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/d3dcompiler.h -C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um\d3dcompiler.inl +C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/d3dcompiler.inl --with-attribute D3DCOMPILER_STRIP_FLAGS=Flags --with-librarypath diff --git a/generation/DirectX/um/d3dcompiler/um-d3dcompiler.h b/generation/DirectX/um/d3dcompiler/um-d3dcompiler.h index 5b69644722..fc1b27c0c7 100644 --- a/generation/DirectX/um/d3dcompiler/um-d3dcompiler.h +++ b/generation/DirectX/um/d3dcompiler/um-d3dcompiler.h @@ -1,2 +1,3 @@ #include "..\..\..\TerraFX.h" #include +#include diff --git a/generation/Windows/um/CommCtrl/generate.rsp b/generation/Windows/um/CommCtrl/generate.rsp index c078d388a6..7c0c5327bf 100644 --- a/generation/Windows/um/CommCtrl/generate.rsp +++ b/generation/Windows/um/CommCtrl/generate.rsp @@ -450,6 +450,7 @@ TerraFX.Interop.Windows ../../../../tests/Interop/Windows/Windows/um/CommCtrl --traverse C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/CommCtrl.h +C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/CommCtrl.inl --with-attribute EC_ENDOFLINE=SupportedOSPlatform("windows10.0.17763.0") Edit_EnableSearchWeb=SupportedOSPlatform("windows10.0.17763.0") diff --git a/generation/Windows/um/CommCtrl/um-CommCtrl.h b/generation/Windows/um/CommCtrl/um-CommCtrl.h index 3c65c19ade..e109e07d0a 100644 --- a/generation/Windows/um/CommCtrl/um-CommCtrl.h +++ b/generation/Windows/um/CommCtrl/um-CommCtrl.h @@ -1,2 +1,3 @@ #include "..\..\..\TerraFX.h" #include +#include diff --git a/generation/Windows/um/WinBase/generate.rsp b/generation/Windows/um/WinBase/generate.rsp index 53db264b48..da248f7d60 100644 --- a/generation/Windows/um/WinBase/generate.rsp +++ b/generation/Windows/um/WinBase/generate.rsp @@ -63,6 +63,7 @@ TerraFX.Interop.Windows ../../../../tests/Interop/Windows/Windows/um/WinBase --traverse C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/WinBase.h +C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/WinBase.inl --with-attribute CopyFile2=SupportedOSPlatform("windows6.2") CopyFile2ProgressRoutine=SupportedOSPlatform("windows6.2") diff --git a/generation/Windows/um/WinBase/um-WinBase.h b/generation/Windows/um/WinBase/um-WinBase.h index a15ff962f2..c0144ea0fa 100644 --- a/generation/Windows/um/WinBase/um-WinBase.h +++ b/generation/Windows/um/WinBase/um-WinBase.h @@ -1,2 +1,3 @@ #include "..\..\..\TerraFX.h" #include +#include diff --git a/generation/Windows/um/WinUser/generate.rsp b/generation/Windows/um/WinUser/generate.rsp index 8dcbf3299e..a9e144f40b 100644 --- a/generation/Windows/um/WinUser/generate.rsp +++ b/generation/Windows/um/WinUser/generate.rsp @@ -117,6 +117,7 @@ TerraFX.Interop.Windows ../../../../tests/Interop/Windows/Windows/um/WinUser --traverse C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/WinUser.h +C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/WinUser.inl --with-attribute AR_STATE=Flags DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS=Flags diff --git a/generation/Windows/um/WinUser/um-WinUser.h b/generation/Windows/um/WinUser/um-WinUser.h index 209be980fe..edbbf8a437 100644 --- a/generation/Windows/um/WinUser/um-WinUser.h +++ b/generation/Windows/um/WinUser/um-WinUser.h @@ -1,2 +1,3 @@ #include "..\..\..\TerraFX.h" #include +#include diff --git a/generation/Windows/um/prsht/generate.rsp b/generation/Windows/um/prsht/generate.rsp index 0c2914f411..b2ef1d949a 100644 --- a/generation/Windows/um/prsht/generate.rsp +++ b/generation/Windows/um/prsht/generate.rsp @@ -46,6 +46,7 @@ TerraFX.Interop.Windows ../../../../tests/Interop/Windows/Windows/um/prsht --traverse C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/prsht.h +C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/prsht.inl --with-librarypath CreatePropertySheetPage=comctl32 CreatePropertySheetPageA=comctl32 diff --git a/generation/Windows/um/prsht/um-prsht.h b/generation/Windows/um/prsht/um-prsht.h index bb994965f9..b1cddece7b 100644 --- a/generation/Windows/um/prsht/um-prsht.h +++ b/generation/Windows/um/prsht/um-prsht.h @@ -1,2 +1,3 @@ #include "..\..\..\TerraFX.h" #include +#include diff --git a/sources/Interop/Windows/DirectX/headers/d3d12/DirectX.Manual.cs b/sources/Interop/Windows/DirectX/headers/d3d12/DirectX.Manual.cs index a634e9a2d7..65b2a932e6 100644 --- a/sources/Interop/Windows/DirectX/headers/d3d12/DirectX.Manual.cs +++ b/sources/Interop/Windows/DirectX/headers/d3d12/DirectX.Manual.cs @@ -84,7 +84,14 @@ public static bool D3D12_DECODE_IS_ANISOTROPIC_FILTER(D3D12_FILTER D3D12Filter) public static uint D3D12_GET_COARSE_SHADING_RATE_Y_AXIS(uint y) => y & D3D12_SHADING_RATE_VALID_MASK; - public static HRESULT D3D12ReflectLibrary(void* pSrcData, nuint SrcDataSize, ID3D12LibraryReflection** ppReflector) + /// + public static HRESULT D3D12Reflect([NativeTypeName("LPCVOID")] void* pSrcData, [NativeTypeName("SIZE_T")] nuint SrcDataSize, ID3D11ShaderReflection** ppReflector) + { + return D3DReflect(pSrcData, SrcDataSize, __uuidof(), unchecked((void**)(ppReflector))); + } + + /// + public static HRESULT D3D12ReflectLibrary([NativeTypeName("LPCVOID")] void* pSrcData, [NativeTypeName("SIZE_T")] nuint SrcDataSize, ID3D12LibraryReflection** ppReflector) { return D3DReflectLibrary(pSrcData, SrcDataSize, __uuidof(), (void**)ppReflector); } From 04f9530d46764f5bddca9935d5e0cf2d4400ea14 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 22 Jun 2023 11:35:40 -0700 Subject: [PATCH 2/8] Generating bindings for um/CommDlg --- TerraFX.Interop.Windows.sln | 8 + generation/Windows/um/CommDlg/generate.rsp | 54 +++++ generation/Windows/um/CommDlg/header.txt | 4 + generation/Windows/um/CommDlg/um-CommDlg.h | 3 + generation/remap-classes.rsp | 8 + .../Interop/Windows/Windows/um/CommDlg/CC.cs | 36 +++ .../Interop/Windows/Windows/um/CommDlg/CD.cs | 21 ++ .../Interop/Windows/Windows/um/CommDlg/CDM.cs | 36 +++ .../Interop/Windows/Windows/um/CommDlg/CDN.cs | 39 +++ .../Interop/Windows/Windows/um/CommDlg/CF.cs | 96 ++++++++ .../Windows/um/CommDlg/CHOOSECOLORA.cs | 41 ++++ .../Windows/um/CommDlg/CHOOSECOLORW.cs | 41 ++++ .../Windows/Windows/um/CommDlg/CHOOSEFONTA.cs | 66 ++++++ .../Windows/Windows/um/CommDlg/CHOOSEFONTW.cs | 66 ++++++ .../Windows/Windows/um/CommDlg/DEVNAMES.cs | 26 ++ .../Windows/um/CommDlg/FINDREPLACEA.cs | 51 ++++ .../Windows/um/CommDlg/FINDREPLACEW.cs | 51 ++++ .../Interop/Windows/Windows/um/CommDlg/FR.cs | 81 +++++++ .../Interop/Windows/Windows/um/CommDlg/FRM.cs | 21 ++ .../Interop/Windows/Windows/um/CommDlg/IID.cs | 64 +++++ .../um/CommDlg/IPrintDialogCallback.cs | 106 +++++++++ .../um/CommDlg/IPrintDialogServices.cs | 106 +++++++++ .../Interop/Windows/Windows/um/CommDlg/OFN.cs | 99 ++++++++ .../Windows/Windows/um/CommDlg/OFNOTIFYA.cs | 21 ++ .../Windows/Windows/um/CommDlg/OFNOTIFYEXA.cs | 25 ++ .../Windows/Windows/um/CommDlg/OFNOTIFYEXW.cs | 25 ++ .../Windows/Windows/um/CommDlg/OFNOTIFYW.cs | 21 ++ .../Windows/um/CommDlg/OPENFILENAMEA.cs | 98 ++++++++ .../Windows/um/CommDlg/OPENFILENAMEW.cs | 98 ++++++++ .../Windows/um/CommDlg/OPENFILENAME_NT4A.cs | 87 +++++++ .../Windows/um/CommDlg/OPENFILENAME_NT4W.cs | 87 +++++++ .../Windows/um/CommDlg/PAGESETUPDLGA.cs | 57 +++++ .../Windows/um/CommDlg/PAGESETUPDLGW.cs | 57 +++++ .../Interop/Windows/Windows/um/CommDlg/PD.cs | 105 +++++++++ .../Windows/Windows/um/CommDlg/PRINTDLGA.cs | 78 ++++++ .../Windows/Windows/um/CommDlg/PRINTDLGEXA.cs | 88 +++++++ .../Windows/Windows/um/CommDlg/PRINTDLGEXW.cs | 88 +++++++ .../Windows/Windows/um/CommDlg/PRINTDLGW.cs | 78 ++++++ .../Windows/um/CommDlg/PRINTPAGERANGE.cs | 18 ++ .../Interop/Windows/Windows/um/CommDlg/PS.cs | 12 + .../Interop/Windows/Windows/um/CommDlg/PSD.cs | 66 ++++++ .../Interop/Windows/Windows/um/CommDlg/WM.cs | 39 +++ .../Windows/um/CommDlg/Windows.Manual.cs | 34 +++ .../Windows/Windows/um/CommDlg/Windows.cs | 223 ++++++++++++++++++ .../Windows/um/CommDlg/CHOOSECOLORATests.cs | 42 ++++ .../Windows/um/CommDlg/CHOOSECOLORWTests.cs | 42 ++++ .../Windows/um/CommDlg/CHOOSEFONTATests.cs | 42 ++++ .../Windows/um/CommDlg/CHOOSEFONTWTests.cs | 42 ++++ .../Windows/um/CommDlg/DEVNAMESTests.cs | 34 +++ .../Windows/um/CommDlg/FINDREPLACEATests.cs | 42 ++++ .../Windows/um/CommDlg/FINDREPLACEWTests.cs | 42 ++++ .../Windows/Windows/um/CommDlg/IIDTests.cs | 28 +++ .../um/CommDlg/IPrintDialogCallbackTests.cs | 50 ++++ .../um/CommDlg/IPrintDialogServicesTests.cs | 50 ++++ .../Windows/um/CommDlg/OFNOTIFYATests.cs | 42 ++++ .../Windows/um/CommDlg/OFNOTIFYEXATests.cs | 42 ++++ .../Windows/um/CommDlg/OFNOTIFYEXWTests.cs | 42 ++++ .../Windows/um/CommDlg/OFNOTIFYWTests.cs | 42 ++++ .../Windows/um/CommDlg/OPENFILENAMEATests.cs | 42 ++++ .../Windows/um/CommDlg/OPENFILENAMEWTests.cs | 42 ++++ .../um/CommDlg/OPENFILENAME_NT4ATests.cs | 42 ++++ .../um/CommDlg/OPENFILENAME_NT4WTests.cs | 42 ++++ .../Windows/um/CommDlg/PAGESETUPDLGATests.cs | 42 ++++ .../Windows/um/CommDlg/PAGESETUPDLGWTests.cs | 42 ++++ .../Windows/um/CommDlg/PRINTDLGATests.cs | 42 ++++ .../Windows/um/CommDlg/PRINTDLGEXATests.cs | 42 ++++ .../Windows/um/CommDlg/PRINTDLGEXWTests.cs | 42 ++++ .../Windows/um/CommDlg/PRINTDLGWTests.cs | 42 ++++ .../Windows/um/CommDlg/PRINTPAGERANGETests.cs | 34 +++ 69 files changed, 3565 insertions(+) create mode 100644 generation/Windows/um/CommDlg/generate.rsp create mode 100644 generation/Windows/um/CommDlg/header.txt create mode 100644 generation/Windows/um/CommDlg/um-CommDlg.h create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CC.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CD.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CDM.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CDN.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CF.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORA.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORW.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTA.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTW.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/DEVNAMES.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEA.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEW.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/FR.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/FRM.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/IID.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallback.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogServices.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OFN.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYA.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXA.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXW.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYW.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEA.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEW.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4A.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4W.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGA.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGW.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PD.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGA.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXA.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXW.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGW.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGE.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PS.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PSD.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/WM.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/Windows.Manual.cs create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/Windows.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORATests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTATests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/DEVNAMESTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/FINDREPLACEATests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/FINDREPLACEWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/IIDTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallbackTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/IPrintDialogServicesTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYATests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXATests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEATests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4ATests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4WTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGATests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGATests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXATests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGETests.cs diff --git a/TerraFX.Interop.Windows.sln b/TerraFX.Interop.Windows.sln index 80e0ed2cb6..c54dba2f0f 100644 --- a/TerraFX.Interop.Windows.sln +++ b/TerraFX.Interop.Windows.sln @@ -3068,6 +3068,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dinput", "dinput", "{635B50 generation\DirectX\um\dinput\um-dinput.h = generation\DirectX\um\dinput\um-dinput.h EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommDlg", "CommDlg", "{10FB9457-4DE3-4E4C-9229-2C3C58D07346}" + ProjectSection(SolutionItems) = preProject + generation\Windows\um\CommDlg\generate.rsp = generation\Windows\um\CommDlg\generate.rsp + generation\Windows\um\CommDlg\header.txt = generation\Windows\um\CommDlg\header.txt + generation\Windows\um\CommDlg\um-CommDlg.h = generation\Windows\um\CommDlg\um-CommDlg.h + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -3538,6 +3545,7 @@ Global {5E5D7257-3F63-45F9-899B-CE0DFEFCC2D1} = {D9638FEE-50A4-44FF-B1F6-72E59548490B} {566C5B1B-E5DC-420D-8740-A991751A5D09} = {65954CB3-F28F-4CF0-BC77-0FFD6E858BCE} {635B5075-171E-4AE9-B25D-F2E3C36E2F7E} = {849C4129-3383-468E-9CFA-B709015C0BE2} + {10FB9457-4DE3-4E4C-9229-2C3C58D07346} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {2FE36DF8-2D9C-4F20-8787-45DC74B57461} diff --git a/generation/Windows/um/CommDlg/generate.rsp b/generation/Windows/um/CommDlg/generate.rsp new file mode 100644 index 0000000000..177addb6ea --- /dev/null +++ b/generation/Windows/um/CommDlg/generate.rsp @@ -0,0 +1,54 @@ +@../../../settings.rsp +@../../../remap.rsp +--exclude +CDSIZEOF_STRUCT +CommDlg_FindReplace_SendCustomResult +CommDlg_FindReplace_SendResult +CommDlg_OpenSave_GetFilePathA +CommDlg_OpenSave_GetFilePathW +CommDlg_OpenSave_GetFolderIDList +CommDlg_OpenSave_GetFolderPathA +CommDlg_OpenSave_GetFolderPathW +CommDlg_OpenSave_GetSpecA +CommDlg_OpenSave_GetSpecW +CommDlg_OpenSave_HideControl +CommDlg_OpenSave_SetControlText +CommDlg_OpenSave_SetDefExt +OPENFILENAME_SIZE_VERSION_400A +OPENFILENAME_SIZE_VERSION_400W +OPENFILENAME_SIZE_VERSION_400 +--file +um-CommDlg.h +--methodClassName +Windows +--namespace +TerraFX.Interop.Windows +--output +../../../../sources/Interop/Windows/Windows/um/CommDlg +--test-output +../../../../tests/Interop/Windows/Windows/um/CommDlg +--traverse +C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/CommDlg.h +C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/CommDlg.inl +--with-librarypath +ChooseColorA=comdlg32 +ChooseColorW=comdlg32 +ChooseFontA=comdlg32 +ChooseFontW=comdlg32 +CommDlgExtendedError=comdlg32 +FindTextA=comdlg32 +FindTextW=comdlg32 +GetFileTitleA=comdlg32 +GetFileTitleW=comdlg32 +GetOpenFileNameA=comdlg32 +GetOpenFileNameW=comdlg32 +GetSaveFileNameA=comdlg32 +GetSaveFileNameW=comdlg32 +PageSetupDlgA=comdlg32 +PageSetupDlgW=comdlg32 +PrintDlgA=comdlg32 +PrintDlgW=comdlg32 +PrintDlgExA=comdlg32 +PrintDlgExW=comdlg32 +ReplaceTextA=comdlg32 +ReplaceTextW=comdlg32 diff --git a/generation/Windows/um/CommDlg/header.txt b/generation/Windows/um/CommDlg/header.txt new file mode 100644 index 0000000000..0b4f90ff7f --- /dev/null +++ b/generation/Windows/um/CommDlg/header.txt @@ -0,0 +1,4 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. diff --git a/generation/Windows/um/CommDlg/um-CommDlg.h b/generation/Windows/um/CommDlg/um-CommDlg.h new file mode 100644 index 0000000000..f62676263b --- /dev/null +++ b/generation/Windows/um/CommDlg/um-CommDlg.h @@ -0,0 +1,3 @@ +#include "..\..\..\TerraFX.h" +#include +#include diff --git a/generation/remap-classes.rsp b/generation/remap-classes.rsp index f843dd02c1..1c0c61117e 100644 --- a/generation/remap-classes.rsp +++ b/generation/remap-classes.rsp @@ -48,7 +48,10 @@ CCS_*=CCS CC_*=CC CDDS_*=CDDS CDIS_*=CDIS +CDM_*=CDM +CDN_*=CDN CDS_*=CDS +CD_*=CD CENTRAL_ACCESS_POLICY_*=CENTRAL_ACCESSPOLICY CERTSRV_*=CERTSRV CERT_*=CERT @@ -271,7 +274,9 @@ FOFX_*=FOFX FOF_*=FOF FOLDERTYPEID_*=FOLDERTYPEID FORMAT_*=FORMAT +FRM_*=FRM FRS_*=FRS +FR_*=FR FSCTL_*=FSCTL FS_*=FS FVE_*=FVE @@ -452,6 +457,7 @@ OBM_*=OBM OCR_*=OCR OCSP_*=OCSP ODS_*=ODS +OFN_*=OFN OF_*=OF OIC_*=OIC OLE_*=OLE @@ -470,6 +476,7 @@ PBT_*=PBT PCF_*=PCF PC_*=PC PDC_*=PDC +PD_*=PD PEERDIST_*=PEERDIST PEER_*=PEER PERSISTENT_*=PERSISTENT @@ -507,6 +514,7 @@ PSM_*=PSM PSN_*=PSN PSP_*=PSP PST_*=PST +PSD_*=PSD PS_*=PS QS_*=QS QUERY_*=QUERY diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CC.cs b/sources/Interop/Windows/Windows/um/CommDlg/CC.cs new file mode 100644 index 0000000000..593dd41342 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CC.cs @@ -0,0 +1,36 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class CC +{ + [NativeTypeName("#define CC_RGBINIT 0x00000001")] + public const int CC_RGBINIT = 0x00000001; + + [NativeTypeName("#define CC_FULLOPEN 0x00000002")] + public const int CC_FULLOPEN = 0x00000002; + + [NativeTypeName("#define CC_PREVENTFULLOPEN 0x00000004")] + public const int CC_PREVENTFULLOPEN = 0x00000004; + + [NativeTypeName("#define CC_SHOWHELP 0x00000008")] + public const int CC_SHOWHELP = 0x00000008; + + [NativeTypeName("#define CC_ENABLEHOOK 0x00000010")] + public const int CC_ENABLEHOOK = 0x00000010; + + [NativeTypeName("#define CC_ENABLETEMPLATE 0x00000020")] + public const int CC_ENABLETEMPLATE = 0x00000020; + + [NativeTypeName("#define CC_ENABLETEMPLATEHANDLE 0x00000040")] + public const int CC_ENABLETEMPLATEHANDLE = 0x00000040; + + [NativeTypeName("#define CC_SOLIDCOLOR 0x00000080")] + public const int CC_SOLIDCOLOR = 0x00000080; + + [NativeTypeName("#define CC_ANYCOLOR 0x00000100")] + public const int CC_ANYCOLOR = 0x00000100; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CD.cs b/sources/Interop/Windows/Windows/um/CommDlg/CD.cs new file mode 100644 index 0000000000..95744ee0c3 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CD.cs @@ -0,0 +1,21 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class CD +{ + [NativeTypeName("#define CD_LBSELNOITEMS -1")] + public const int CD_LBSELNOITEMS = -1; + + [NativeTypeName("#define CD_LBSELCHANGE 0")] + public const int CD_LBSELCHANGE = 0; + + [NativeTypeName("#define CD_LBSELSUB 1")] + public const int CD_LBSELSUB = 1; + + [NativeTypeName("#define CD_LBSELADD 2")] + public const int CD_LBSELADD = 2; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CDM.cs b/sources/Interop/Windows/Windows/um/CommDlg/CDM.cs new file mode 100644 index 0000000000..945a373edc --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CDM.cs @@ -0,0 +1,36 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class CDM +{ + [NativeTypeName("#define CDM_FIRST (WM_USER + 100)")] + public const int CDM_FIRST = (0x0400 + 100); + + [NativeTypeName("#define CDM_LAST (WM_USER + 200)")] + public const int CDM_LAST = (0x0400 + 200); + + [NativeTypeName("#define CDM_GETSPEC (CDM_FIRST + 0x0000)")] + public const int CDM_GETSPEC = ((0x0400 + 100) + 0x0000); + + [NativeTypeName("#define CDM_GETFILEPATH (CDM_FIRST + 0x0001)")] + public const int CDM_GETFILEPATH = ((0x0400 + 100) + 0x0001); + + [NativeTypeName("#define CDM_GETFOLDERPATH (CDM_FIRST + 0x0002)")] + public const int CDM_GETFOLDERPATH = ((0x0400 + 100) + 0x0002); + + [NativeTypeName("#define CDM_GETFOLDERIDLIST (CDM_FIRST + 0x0003)")] + public const int CDM_GETFOLDERIDLIST = ((0x0400 + 100) + 0x0003); + + [NativeTypeName("#define CDM_SETCONTROLTEXT (CDM_FIRST + 0x0004)")] + public const int CDM_SETCONTROLTEXT = ((0x0400 + 100) + 0x0004); + + [NativeTypeName("#define CDM_HIDECONTROL (CDM_FIRST + 0x0005)")] + public const int CDM_HIDECONTROL = ((0x0400 + 100) + 0x0005); + + [NativeTypeName("#define CDM_SETDEFEXT (CDM_FIRST + 0x0006)")] + public const int CDM_SETDEFEXT = ((0x0400 + 100) + 0x0006); +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CDN.cs b/sources/Interop/Windows/Windows/um/CommDlg/CDN.cs new file mode 100644 index 0000000000..aae05f13a6 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CDN.cs @@ -0,0 +1,39 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class CDN +{ + [NativeTypeName("#define CDN_FIRST (0U-601U)")] + public const uint CDN_FIRST = unchecked(0U - 601U); + + [NativeTypeName("#define CDN_LAST (0U-699U)")] + public const uint CDN_LAST = unchecked(0U - 699U); + + [NativeTypeName("#define CDN_INITDONE (CDN_FIRST - 0x0000)")] + public const uint CDN_INITDONE = unchecked((0U - 601U) - 0x0000); + + [NativeTypeName("#define CDN_SELCHANGE (CDN_FIRST - 0x0001)")] + public const uint CDN_SELCHANGE = unchecked((0U - 601U) - 0x0001); + + [NativeTypeName("#define CDN_FOLDERCHANGE (CDN_FIRST - 0x0002)")] + public const uint CDN_FOLDERCHANGE = unchecked((0U - 601U) - 0x0002); + + [NativeTypeName("#define CDN_SHAREVIOLATION (CDN_FIRST - 0x0003)")] + public const uint CDN_SHAREVIOLATION = unchecked((0U - 601U) - 0x0003); + + [NativeTypeName("#define CDN_HELP (CDN_FIRST - 0x0004)")] + public const uint CDN_HELP = unchecked((0U - 601U) - 0x0004); + + [NativeTypeName("#define CDN_FILEOK (CDN_FIRST - 0x0005)")] + public const uint CDN_FILEOK = unchecked((0U - 601U) - 0x0005); + + [NativeTypeName("#define CDN_TYPECHANGE (CDN_FIRST - 0x0006)")] + public const uint CDN_TYPECHANGE = unchecked((0U - 601U) - 0x0006); + + [NativeTypeName("#define CDN_INCLUDEITEM (CDN_FIRST - 0x0007)")] + public const uint CDN_INCLUDEITEM = unchecked((0U - 601U) - 0x0007); +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CF.cs b/sources/Interop/Windows/Windows/um/CommDlg/CF.cs new file mode 100644 index 0000000000..f6eaf0ed2d --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CF.cs @@ -0,0 +1,96 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class CF +{ + [NativeTypeName("#define CF_SCREENFONTS 0x00000001")] + public const int CF_SCREENFONTS = 0x00000001; + + [NativeTypeName("#define CF_PRINTERFONTS 0x00000002")] + public const int CF_PRINTERFONTS = 0x00000002; + + [NativeTypeName("#define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)")] + public const int CF_BOTH = (0x00000001 | 0x00000002); + + [NativeTypeName("#define CF_SHOWHELP 0x00000004L")] + public const int CF_SHOWHELP = 0x00000004; + + [NativeTypeName("#define CF_ENABLEHOOK 0x00000008L")] + public const int CF_ENABLEHOOK = 0x00000008; + + [NativeTypeName("#define CF_ENABLETEMPLATE 0x00000010L")] + public const int CF_ENABLETEMPLATE = 0x00000010; + + [NativeTypeName("#define CF_ENABLETEMPLATEHANDLE 0x00000020L")] + public const int CF_ENABLETEMPLATEHANDLE = 0x00000020; + + [NativeTypeName("#define CF_INITTOLOGFONTSTRUCT 0x00000040L")] + public const int CF_INITTOLOGFONTSTRUCT = 0x00000040; + + [NativeTypeName("#define CF_USESTYLE 0x00000080L")] + public const int CF_USESTYLE = 0x00000080; + + [NativeTypeName("#define CF_EFFECTS 0x00000100L")] + public const int CF_EFFECTS = 0x00000100; + + [NativeTypeName("#define CF_APPLY 0x00000200L")] + public const int CF_APPLY = 0x00000200; + + [NativeTypeName("#define CF_ANSIONLY 0x00000400L")] + public const int CF_ANSIONLY = 0x00000400; + + [NativeTypeName("#define CF_SCRIPTSONLY CF_ANSIONLY")] + public const int CF_SCRIPTSONLY = 0x00000400; + + [NativeTypeName("#define CF_NOVECTORFONTS 0x00000800L")] + public const int CF_NOVECTORFONTS = 0x00000800; + + [NativeTypeName("#define CF_NOOEMFONTS CF_NOVECTORFONTS")] + public const int CF_NOOEMFONTS = 0x00000800; + + [NativeTypeName("#define CF_NOSIMULATIONS 0x00001000L")] + public const int CF_NOSIMULATIONS = 0x00001000; + + [NativeTypeName("#define CF_LIMITSIZE 0x00002000L")] + public const int CF_LIMITSIZE = 0x00002000; + + [NativeTypeName("#define CF_FIXEDPITCHONLY 0x00004000L")] + public const int CF_FIXEDPITCHONLY = 0x00004000; + + [NativeTypeName("#define CF_WYSIWYG 0x00008000L")] + public const int CF_WYSIWYG = 0x00008000; + + [NativeTypeName("#define CF_FORCEFONTEXIST 0x00010000L")] + public const int CF_FORCEFONTEXIST = 0x00010000; + + [NativeTypeName("#define CF_SCALABLEONLY 0x00020000L")] + public const int CF_SCALABLEONLY = 0x00020000; + + [NativeTypeName("#define CF_TTONLY 0x00040000L")] + public const int CF_TTONLY = 0x00040000; + + [NativeTypeName("#define CF_NOFACESEL 0x00080000L")] + public const int CF_NOFACESEL = 0x00080000; + + [NativeTypeName("#define CF_NOSTYLESEL 0x00100000L")] + public const int CF_NOSTYLESEL = 0x00100000; + + [NativeTypeName("#define CF_NOSIZESEL 0x00200000L")] + public const int CF_NOSIZESEL = 0x00200000; + + [NativeTypeName("#define CF_SELECTSCRIPT 0x00400000L")] + public const int CF_SELECTSCRIPT = 0x00400000; + + [NativeTypeName("#define CF_NOSCRIPTSEL 0x00800000L")] + public const int CF_NOSCRIPTSEL = 0x00800000; + + [NativeTypeName("#define CF_NOVERTFONTS 0x01000000L")] + public const int CF_NOVERTFONTS = 0x01000000; + + [NativeTypeName("#define CF_INACTIVEFONTS 0x02000000L")] + public const int CF_INACTIVEFONTS = 0x02000000; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORA.cs b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORA.cs new file mode 100644 index 0000000000..981173e8ae --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORA.cs @@ -0,0 +1,41 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct CHOOSECOLORA +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HWND hInstance; + + /// + public COLORREF rgbResult; + + /// + public COLORREF* lpCustColors; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPCCHOOKPROC")] + public delegate* unmanaged lpfnHook; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpTemplateName; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORW.cs b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORW.cs new file mode 100644 index 0000000000..0a40780879 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORW.cs @@ -0,0 +1,41 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct CHOOSECOLORW +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HWND hInstance; + + /// + public COLORREF rgbResult; + + /// + public COLORREF* lpCustColors; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPCCHOOKPROC")] + public delegate* unmanaged lpfnHook; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpTemplateName; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTA.cs b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTA.cs new file mode 100644 index 0000000000..29e3ccaf2f --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTA.cs @@ -0,0 +1,66 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct CHOOSEFONTA +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HDC hDC; + + /// + [NativeTypeName("LPLOGFONTA")] + public LOGFONTA* lpLogFont; + + /// + public int iPointSize; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + public COLORREF rgbColors; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPCFHOOKPROC")] + public delegate* unmanaged lpfnHook; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpTemplateName; + + /// + public HINSTANCE hInstance; + + /// + [NativeTypeName("LPSTR")] + public sbyte* lpszStyle; + + /// + [NativeTypeName("WORD")] + public ushort nFontType; + + /// + [NativeTypeName("WORD")] + public ushort ___MISSING_ALIGNMENT__; + + /// + public int nSizeMin; + + /// + public int nSizeMax; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTW.cs b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTW.cs new file mode 100644 index 0000000000..09fc6cd5ec --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTW.cs @@ -0,0 +1,66 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct CHOOSEFONTW +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HDC hDC; + + /// + [NativeTypeName("LPLOGFONTW")] + public LOGFONTW* lpLogFont; + + /// + public int iPointSize; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + public COLORREF rgbColors; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPCFHOOKPROC")] + public delegate* unmanaged lpfnHook; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpTemplateName; + + /// + public HINSTANCE hInstance; + + /// + [NativeTypeName("LPWSTR")] + public ushort* lpszStyle; + + /// + [NativeTypeName("WORD")] + public ushort nFontType; + + /// + [NativeTypeName("WORD")] + public ushort ___MISSING_ALIGNMENT__; + + /// + public int nSizeMin; + + /// + public int nSizeMax; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/DEVNAMES.cs b/sources/Interop/Windows/Windows/um/CommDlg/DEVNAMES.cs new file mode 100644 index 0000000000..4a30ea065a --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/DEVNAMES.cs @@ -0,0 +1,26 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct DEVNAMES +{ + /// + [NativeTypeName("WORD")] + public ushort wDriverOffset; + + /// + [NativeTypeName("WORD")] + public ushort wDeviceOffset; + + /// + [NativeTypeName("WORD")] + public ushort wOutputOffset; + + /// + [NativeTypeName("WORD")] + public ushort wDefault; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEA.cs b/sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEA.cs new file mode 100644 index 0000000000..4643f795f0 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEA.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct FINDREPLACEA +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HINSTANCE hInstance; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + [NativeTypeName("LPSTR")] + public sbyte* lpstrFindWhat; + + /// + [NativeTypeName("LPSTR")] + public sbyte* lpstrReplaceWith; + + /// + [NativeTypeName("WORD")] + public ushort wFindWhatLen; + + /// + [NativeTypeName("WORD")] + public ushort wReplaceWithLen; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPFRHOOKPROC")] + public delegate* unmanaged lpfnHook; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpTemplateName; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEW.cs b/sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEW.cs new file mode 100644 index 0000000000..b50a33461f --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEW.cs @@ -0,0 +1,51 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct FINDREPLACEW +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HINSTANCE hInstance; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + [NativeTypeName("LPWSTR")] + public ushort* lpstrFindWhat; + + /// + [NativeTypeName("LPWSTR")] + public ushort* lpstrReplaceWith; + + /// + [NativeTypeName("WORD")] + public ushort wFindWhatLen; + + /// + [NativeTypeName("WORD")] + public ushort wReplaceWithLen; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPFRHOOKPROC")] + public delegate* unmanaged lpfnHook; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpTemplateName; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/FR.cs b/sources/Interop/Windows/Windows/um/CommDlg/FR.cs new file mode 100644 index 0000000000..021d63ba50 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/FR.cs @@ -0,0 +1,81 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class FR +{ + [NativeTypeName("#define FR_DOWN 0x00000001")] + public const int FR_DOWN = 0x00000001; + + [NativeTypeName("#define FR_WHOLEWORD 0x00000002")] + public const int FR_WHOLEWORD = 0x00000002; + + [NativeTypeName("#define FR_MATCHCASE 0x00000004")] + public const int FR_MATCHCASE = 0x00000004; + + [NativeTypeName("#define FR_FINDNEXT 0x00000008")] + public const int FR_FINDNEXT = 0x00000008; + + [NativeTypeName("#define FR_REPLACE 0x00000010")] + public const int FR_REPLACE = 0x00000010; + + [NativeTypeName("#define FR_REPLACEALL 0x00000020")] + public const int FR_REPLACEALL = 0x00000020; + + [NativeTypeName("#define FR_DIALOGTERM 0x00000040")] + public const int FR_DIALOGTERM = 0x00000040; + + [NativeTypeName("#define FR_SHOWHELP 0x00000080")] + public const int FR_SHOWHELP = 0x00000080; + + [NativeTypeName("#define FR_ENABLEHOOK 0x00000100")] + public const int FR_ENABLEHOOK = 0x00000100; + + [NativeTypeName("#define FR_ENABLETEMPLATE 0x00000200")] + public const int FR_ENABLETEMPLATE = 0x00000200; + + [NativeTypeName("#define FR_NOUPDOWN 0x00000400")] + public const int FR_NOUPDOWN = 0x00000400; + + [NativeTypeName("#define FR_NOMATCHCASE 0x00000800")] + public const int FR_NOMATCHCASE = 0x00000800; + + [NativeTypeName("#define FR_NOWHOLEWORD 0x00001000")] + public const int FR_NOWHOLEWORD = 0x00001000; + + [NativeTypeName("#define FR_ENABLETEMPLATEHANDLE 0x00002000")] + public const int FR_ENABLETEMPLATEHANDLE = 0x00002000; + + [NativeTypeName("#define FR_HIDEUPDOWN 0x00004000")] + public const int FR_HIDEUPDOWN = 0x00004000; + + [NativeTypeName("#define FR_HIDEMATCHCASE 0x00008000")] + public const int FR_HIDEMATCHCASE = 0x00008000; + + [NativeTypeName("#define FR_HIDEWHOLEWORD 0x00010000")] + public const int FR_HIDEWHOLEWORD = 0x00010000; + + [NativeTypeName("#define FR_RAW 0x00020000")] + public const int FR_RAW = 0x00020000; + + [NativeTypeName("#define FR_SHOWWRAPAROUND 0x00040000")] + public const int FR_SHOWWRAPAROUND = 0x00040000; + + [NativeTypeName("#define FR_NOWRAPAROUND 0x00080000")] + public const int FR_NOWRAPAROUND = 0x00080000; + + [NativeTypeName("#define FR_WRAPAROUND 0x00100000")] + public const int FR_WRAPAROUND = 0x00100000; + + [NativeTypeName("#define FR_MATCHDIAC 0x20000000")] + public const int FR_MATCHDIAC = 0x20000000; + + [NativeTypeName("#define FR_MATCHKASHIDA 0x40000000")] + public const int FR_MATCHKASHIDA = 0x40000000; + + [NativeTypeName("#define FR_MATCHALEFHAMZA 0x80000000")] + public const uint FR_MATCHALEFHAMZA = 0x80000000; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/FRM.cs b/sources/Interop/Windows/Windows/um/CommDlg/FRM.cs new file mode 100644 index 0000000000..dcfd368020 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/FRM.cs @@ -0,0 +1,21 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class FRM +{ + [NativeTypeName("#define FRM_FIRST (WM_USER + 100)")] + public const int FRM_FIRST = (0x0400 + 100); + + [NativeTypeName("#define FRM_LAST (WM_USER + 200)")] + public const int FRM_LAST = (0x0400 + 200); + + [NativeTypeName("#define FRM_SETOPERATIONRESULT (FRM_FIRST + 0x0000)")] + public const int FRM_SETOPERATIONRESULT = ((0x0400 + 100) + 0x0000); + + [NativeTypeName("#define FRM_SETOPERATIONRESULTTEXT (FRM_FIRST + 0x0001)")] + public const int FRM_SETOPERATIONRESULTTEXT = ((0x0400 + 100) + 0x0001); +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/IID.cs b/sources/Interop/Windows/Windows/um/CommDlg/IID.cs new file mode 100644 index 0000000000..492c4f6392 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/IID.cs @@ -0,0 +1,64 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows; + +public static partial class IID +{ + [NativeTypeName("const GUID")] + public static ref readonly Guid IID_IPrintDialogCallback + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ReadOnlySpan data = new byte[] { + 0xC3, 0xA2, 0x52, 0x58, + 0x30, 0x65, + 0xD1, 0x11, + 0xB6, + 0xA3, + 0x00, + 0x00, + 0xF8, + 0x75, + 0x7B, + 0xF9 + }; + + Debug.Assert(data.Length == Unsafe.SizeOf()); + return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); + } + } + + [NativeTypeName("const GUID")] + public static ref readonly Guid IID_IPrintDialogServices + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ReadOnlySpan data = new byte[] { + 0xDA, 0xAE, 0x9A, 0x50, + 0x39, 0x56, + 0xD1, 0x11, + 0xB6, + 0xA1, + 0x00, + 0x00, + 0xF8, + 0x75, + 0x7B, + 0xF9 + }; + + Debug.Assert(data.Length == Unsafe.SizeOf()); + return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); + } + } +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallback.cs b/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallback.cs new file mode 100644 index 0000000000..65c19abbff --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallback.cs @@ -0,0 +1,106 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows.IID; + +namespace TerraFX.Interop.Windows; + +/// +[Guid("5852A2C3-6530-11D1-B6A3-0000F8757BF9")] +[NativeTypeName("struct IPrintDialogCallback : IUnknown")] +[NativeInheritance("IUnknown")] +public unsafe partial struct IPrintDialogCallback : IPrintDialogCallback.Interface, INativeGuid +{ + static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IPrintDialogCallback)); + + public void** lpVtbl; + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(0)] + public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IPrintDialogCallback*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(1)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IPrintDialogCallback*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(2)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IPrintDialogCallback*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(3)] + public HRESULT InitDone() + { + return ((delegate* unmanaged)(lpVtbl[3]))((IPrintDialogCallback*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(4)] + public HRESULT SelectionChange() + { + return ((delegate* unmanaged)(lpVtbl[4]))((IPrintDialogCallback*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(5)] + public HRESULT HandleMessage(HWND hDlg, uint uMsg, WPARAM wParam, LPARAM lParam, LRESULT* pResult) + { + return ((delegate* unmanaged)(lpVtbl[5]))((IPrintDialogCallback*)Unsafe.AsPointer(ref this), hDlg, uMsg, wParam, lParam, pResult); + } + + public interface Interface : IUnknown.Interface + { + [VtblIndex(3)] + HRESULT InitDone(); + + [VtblIndex(4)] + HRESULT SelectionChange(); + + [VtblIndex(5)] + HRESULT HandleMessage(HWND hDlg, uint uMsg, WPARAM wParam, LPARAM lParam, LRESULT* pResult); + } + + public partial struct Vtbl + where TSelf : unmanaged, Interface + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public delegate* unmanaged QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public delegate* unmanaged AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public delegate* unmanaged Release; + + [NativeTypeName("HRESULT () __attribute__((nothrow)) __attribute__((stdcall))")] + public delegate* unmanaged InitDone; + + [NativeTypeName("HRESULT () __attribute__((nothrow)) __attribute__((stdcall))")] + public delegate* unmanaged SelectionChange; + + [NativeTypeName("HRESULT (HWND, UINT, WPARAM, LPARAM, LRESULT *) __attribute__((nothrow)) __attribute__((stdcall))")] + public delegate* unmanaged HandleMessage; + } +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogServices.cs b/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogServices.cs new file mode 100644 index 0000000000..053d017ff2 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogServices.cs @@ -0,0 +1,106 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows.IID; + +namespace TerraFX.Interop.Windows; + +/// +[Guid("509AAEDA-5639-11D1-B6A1-0000F8757BF9")] +[NativeTypeName("struct IPrintDialogServices : IUnknown")] +[NativeInheritance("IUnknown")] +public unsafe partial struct IPrintDialogServices : IPrintDialogServices.Interface, INativeGuid +{ + static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IPrintDialogServices)); + + public void** lpVtbl; + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(0)] + public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IPrintDialogServices*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(1)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IPrintDialogServices*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(2)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IPrintDialogServices*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(3)] + public HRESULT GetCurrentDevMode([NativeTypeName("LPDEVMODE")] DEVMODEW* pDevMode, uint* pcbSize) + { + return ((delegate* unmanaged)(lpVtbl[3]))((IPrintDialogServices*)Unsafe.AsPointer(ref this), pDevMode, pcbSize); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(4)] + public HRESULT GetCurrentPrinterName([NativeTypeName("LPWSTR")] ushort* pPrinterName, uint* pcchSize) + { + return ((delegate* unmanaged)(lpVtbl[4]))((IPrintDialogServices*)Unsafe.AsPointer(ref this), pPrinterName, pcchSize); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(5)] + public HRESULT GetCurrentPortName([NativeTypeName("LPWSTR")] ushort* pPortName, uint* pcchSize) + { + return ((delegate* unmanaged)(lpVtbl[5]))((IPrintDialogServices*)Unsafe.AsPointer(ref this), pPortName, pcchSize); + } + + public interface Interface : IUnknown.Interface + { + [VtblIndex(3)] + HRESULT GetCurrentDevMode([NativeTypeName("LPDEVMODE")] DEVMODEW* pDevMode, uint* pcbSize); + + [VtblIndex(4)] + HRESULT GetCurrentPrinterName([NativeTypeName("LPWSTR")] ushort* pPrinterName, uint* pcchSize); + + [VtblIndex(5)] + HRESULT GetCurrentPortName([NativeTypeName("LPWSTR")] ushort* pPortName, uint* pcchSize); + } + + public partial struct Vtbl + where TSelf : unmanaged, Interface + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public delegate* unmanaged QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public delegate* unmanaged AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public delegate* unmanaged Release; + + [NativeTypeName("HRESULT (LPDEVMODE, UINT *) __attribute__((nothrow)) __attribute__((stdcall))")] + public delegate* unmanaged GetCurrentDevMode; + + [NativeTypeName("HRESULT (LPWSTR, UINT *) __attribute__((nothrow)) __attribute__((stdcall))")] + public delegate* unmanaged GetCurrentPrinterName; + + [NativeTypeName("HRESULT (LPWSTR, UINT *) __attribute__((nothrow)) __attribute__((stdcall))")] + public delegate* unmanaged GetCurrentPortName; + } +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OFN.cs b/sources/Interop/Windows/Windows/um/CommDlg/OFN.cs new file mode 100644 index 0000000000..c470edbb5e --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OFN.cs @@ -0,0 +1,99 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class OFN +{ + [NativeTypeName("#define OFN_READONLY 0x00000001")] + public const int OFN_READONLY = 0x00000001; + + [NativeTypeName("#define OFN_OVERWRITEPROMPT 0x00000002")] + public const int OFN_OVERWRITEPROMPT = 0x00000002; + + [NativeTypeName("#define OFN_HIDEREADONLY 0x00000004")] + public const int OFN_HIDEREADONLY = 0x00000004; + + [NativeTypeName("#define OFN_NOCHANGEDIR 0x00000008")] + public const int OFN_NOCHANGEDIR = 0x00000008; + + [NativeTypeName("#define OFN_SHOWHELP 0x00000010")] + public const int OFN_SHOWHELP = 0x00000010; + + [NativeTypeName("#define OFN_ENABLEHOOK 0x00000020")] + public const int OFN_ENABLEHOOK = 0x00000020; + + [NativeTypeName("#define OFN_ENABLETEMPLATE 0x00000040")] + public const int OFN_ENABLETEMPLATE = 0x00000040; + + [NativeTypeName("#define OFN_ENABLETEMPLATEHANDLE 0x00000080")] + public const int OFN_ENABLETEMPLATEHANDLE = 0x00000080; + + [NativeTypeName("#define OFN_NOVALIDATE 0x00000100")] + public const int OFN_NOVALIDATE = 0x00000100; + + [NativeTypeName("#define OFN_ALLOWMULTISELECT 0x00000200")] + public const int OFN_ALLOWMULTISELECT = 0x00000200; + + [NativeTypeName("#define OFN_EXTENSIONDIFFERENT 0x00000400")] + public const int OFN_EXTENSIONDIFFERENT = 0x00000400; + + [NativeTypeName("#define OFN_PATHMUSTEXIST 0x00000800")] + public const int OFN_PATHMUSTEXIST = 0x00000800; + + [NativeTypeName("#define OFN_FILEMUSTEXIST 0x00001000")] + public const int OFN_FILEMUSTEXIST = 0x00001000; + + [NativeTypeName("#define OFN_CREATEPROMPT 0x00002000")] + public const int OFN_CREATEPROMPT = 0x00002000; + + [NativeTypeName("#define OFN_SHAREAWARE 0x00004000")] + public const int OFN_SHAREAWARE = 0x00004000; + + [NativeTypeName("#define OFN_NOREADONLYRETURN 0x00008000")] + public const int OFN_NOREADONLYRETURN = 0x00008000; + + [NativeTypeName("#define OFN_NOTESTFILECREATE 0x00010000")] + public const int OFN_NOTESTFILECREATE = 0x00010000; + + [NativeTypeName("#define OFN_NONETWORKBUTTON 0x00020000")] + public const int OFN_NONETWORKBUTTON = 0x00020000; + + [NativeTypeName("#define OFN_NOLONGNAMES 0x00040000")] + public const int OFN_NOLONGNAMES = 0x00040000; + + [NativeTypeName("#define OFN_EXPLORER 0x00080000")] + public const int OFN_EXPLORER = 0x00080000; + + [NativeTypeName("#define OFN_NODEREFERENCELINKS 0x00100000")] + public const int OFN_NODEREFERENCELINKS = 0x00100000; + + [NativeTypeName("#define OFN_LONGNAMES 0x00200000")] + public const int OFN_LONGNAMES = 0x00200000; + + [NativeTypeName("#define OFN_ENABLEINCLUDENOTIFY 0x00400000")] + public const int OFN_ENABLEINCLUDENOTIFY = 0x00400000; + + [NativeTypeName("#define OFN_ENABLESIZING 0x00800000")] + public const int OFN_ENABLESIZING = 0x00800000; + + [NativeTypeName("#define OFN_DONTADDTORECENT 0x02000000")] + public const int OFN_DONTADDTORECENT = 0x02000000; + + [NativeTypeName("#define OFN_FORCESHOWHIDDEN 0x10000000")] + public const int OFN_FORCESHOWHIDDEN = 0x10000000; + + [NativeTypeName("#define OFN_EX_NOPLACESBAR 0x00000001")] + public const int OFN_EX_NOPLACESBAR = 0x00000001; + + [NativeTypeName("#define OFN_SHAREFALLTHROUGH 2")] + public const int OFN_SHAREFALLTHROUGH = 2; + + [NativeTypeName("#define OFN_SHARENOWARN 1")] + public const int OFN_SHARENOWARN = 1; + + [NativeTypeName("#define OFN_SHAREWARN 0")] + public const int OFN_SHAREWARN = 0; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYA.cs b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYA.cs new file mode 100644 index 0000000000..459bb6572d --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYA.cs @@ -0,0 +1,21 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct OFNOTIFYA +{ + /// + public NMHDR hdr; + + /// + [NativeTypeName("LPOPENFILENAMEA")] + public OPENFILENAMEA* lpOFN; + + /// + [NativeTypeName("LPSTR")] + public sbyte* pszFile; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXA.cs b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXA.cs new file mode 100644 index 0000000000..78a1ba7dfb --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXA.cs @@ -0,0 +1,25 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct OFNOTIFYEXA +{ + /// + public NMHDR hdr; + + /// + [NativeTypeName("LPOPENFILENAMEA")] + public OPENFILENAMEA* lpOFN; + + /// + [NativeTypeName("LPVOID")] + public void* psf; + + /// + [NativeTypeName("LPVOID")] + public void* pidl; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXW.cs b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXW.cs new file mode 100644 index 0000000000..d1599ef367 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXW.cs @@ -0,0 +1,25 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct OFNOTIFYEXW +{ + /// + public NMHDR hdr; + + /// + [NativeTypeName("LPOPENFILENAMEW")] + public OPENFILENAMEW* lpOFN; + + /// + [NativeTypeName("LPVOID")] + public void* psf; + + /// + [NativeTypeName("LPVOID")] + public void* pidl; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYW.cs b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYW.cs new file mode 100644 index 0000000000..e34b191d5c --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYW.cs @@ -0,0 +1,21 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct OFNOTIFYW +{ + /// + public NMHDR hdr; + + /// + [NativeTypeName("LPOPENFILENAMEW")] + public OPENFILENAMEW* lpOFN; + + /// + [NativeTypeName("LPWSTR")] + public ushort* pszFile; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEA.cs b/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEA.cs new file mode 100644 index 0000000000..ede7492b42 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEA.cs @@ -0,0 +1,98 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct OPENFILENAMEA +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HINSTANCE hInstance; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpstrFilter; + + /// + [NativeTypeName("LPSTR")] + public sbyte* lpstrCustomFilter; + + /// + [NativeTypeName("DWORD")] + public uint nMaxCustFilter; + + /// + [NativeTypeName("DWORD")] + public uint nFilterIndex; + + /// + [NativeTypeName("LPSTR")] + public sbyte* lpstrFile; + + /// + [NativeTypeName("DWORD")] + public uint nMaxFile; + + /// + [NativeTypeName("LPSTR")] + public sbyte* lpstrFileTitle; + + /// + [NativeTypeName("DWORD")] + public uint nMaxFileTitle; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpstrInitialDir; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpstrTitle; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + [NativeTypeName("WORD")] + public ushort nFileOffset; + + /// + [NativeTypeName("WORD")] + public ushort nFileExtension; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpstrDefExt; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPOFNHOOKPROC")] + public delegate* unmanaged lpfnHook; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpTemplateName; + + /// + public void* pvReserved; + + /// + [NativeTypeName("DWORD")] + public uint dwReserved; + + /// + [NativeTypeName("DWORD")] + public uint FlagsEx; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEW.cs b/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEW.cs new file mode 100644 index 0000000000..c93c11570f --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEW.cs @@ -0,0 +1,98 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct OPENFILENAMEW +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HINSTANCE hInstance; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpstrFilter; + + /// + [NativeTypeName("LPWSTR")] + public ushort* lpstrCustomFilter; + + /// + [NativeTypeName("DWORD")] + public uint nMaxCustFilter; + + /// + [NativeTypeName("DWORD")] + public uint nFilterIndex; + + /// + [NativeTypeName("LPWSTR")] + public ushort* lpstrFile; + + /// + [NativeTypeName("DWORD")] + public uint nMaxFile; + + /// + [NativeTypeName("LPWSTR")] + public ushort* lpstrFileTitle; + + /// + [NativeTypeName("DWORD")] + public uint nMaxFileTitle; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpstrInitialDir; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpstrTitle; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + [NativeTypeName("WORD")] + public ushort nFileOffset; + + /// + [NativeTypeName("WORD")] + public ushort nFileExtension; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpstrDefExt; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPOFNHOOKPROC")] + public delegate* unmanaged lpfnHook; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpTemplateName; + + /// + public void* pvReserved; + + /// + [NativeTypeName("DWORD")] + public uint dwReserved; + + /// + [NativeTypeName("DWORD")] + public uint FlagsEx; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4A.cs b/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4A.cs new file mode 100644 index 0000000000..d2db8d2c7a --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4A.cs @@ -0,0 +1,87 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct OPENFILENAME_NT4A +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HINSTANCE hInstance; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpstrFilter; + + /// + [NativeTypeName("LPSTR")] + public sbyte* lpstrCustomFilter; + + /// + [NativeTypeName("DWORD")] + public uint nMaxCustFilter; + + /// + [NativeTypeName("DWORD")] + public uint nFilterIndex; + + /// + [NativeTypeName("LPSTR")] + public sbyte* lpstrFile; + + /// + [NativeTypeName("DWORD")] + public uint nMaxFile; + + /// + [NativeTypeName("LPSTR")] + public sbyte* lpstrFileTitle; + + /// + [NativeTypeName("DWORD")] + public uint nMaxFileTitle; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpstrInitialDir; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpstrTitle; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + [NativeTypeName("WORD")] + public ushort nFileOffset; + + /// + [NativeTypeName("WORD")] + public ushort nFileExtension; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpstrDefExt; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPOFNHOOKPROC")] + public delegate* unmanaged lpfnHook; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpTemplateName; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4W.cs b/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4W.cs new file mode 100644 index 0000000000..e95a8b09fc --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4W.cs @@ -0,0 +1,87 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct OPENFILENAME_NT4W +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HINSTANCE hInstance; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpstrFilter; + + /// + [NativeTypeName("LPWSTR")] + public ushort* lpstrCustomFilter; + + /// + [NativeTypeName("DWORD")] + public uint nMaxCustFilter; + + /// + [NativeTypeName("DWORD")] + public uint nFilterIndex; + + /// + [NativeTypeName("LPWSTR")] + public ushort* lpstrFile; + + /// + [NativeTypeName("DWORD")] + public uint nMaxFile; + + /// + [NativeTypeName("LPWSTR")] + public ushort* lpstrFileTitle; + + /// + [NativeTypeName("DWORD")] + public uint nMaxFileTitle; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpstrInitialDir; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpstrTitle; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + [NativeTypeName("WORD")] + public ushort nFileOffset; + + /// + [NativeTypeName("WORD")] + public ushort nFileExtension; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpstrDefExt; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPOFNHOOKPROC")] + public delegate* unmanaged lpfnHook; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpTemplateName; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGA.cs b/sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGA.cs new file mode 100644 index 0000000000..cd7e7b3d43 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGA.cs @@ -0,0 +1,57 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct PAGESETUPDLGA +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HGLOBAL hDevMode; + + /// + public HGLOBAL hDevNames; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + public POINT ptPaperSize; + + /// + public RECT rtMinMargin; + + /// + public RECT rtMargin; + + /// + public HINSTANCE hInstance; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPPAGESETUPHOOK")] + public delegate* unmanaged lpfnPageSetupHook; + + /// + [NativeTypeName("LPPAGEPAINTHOOK")] + public delegate* unmanaged lpfnPagePaintHook; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpPageSetupTemplateName; + + /// + public HGLOBAL hPageSetupTemplate; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGW.cs b/sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGW.cs new file mode 100644 index 0000000000..dd43906b20 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGW.cs @@ -0,0 +1,57 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct PAGESETUPDLGW +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HGLOBAL hDevMode; + + /// + public HGLOBAL hDevNames; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + public POINT ptPaperSize; + + /// + public RECT rtMinMargin; + + /// + public RECT rtMargin; + + /// + public HINSTANCE hInstance; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPPAGESETUPHOOK")] + public delegate* unmanaged lpfnPageSetupHook; + + /// + [NativeTypeName("LPPAGEPAINTHOOK")] + public delegate* unmanaged lpfnPagePaintHook; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpPageSetupTemplateName; + + /// + public HGLOBAL hPageSetupTemplate; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PD.cs b/sources/Interop/Windows/Windows/um/CommDlg/PD.cs new file mode 100644 index 0000000000..b9041a6ed3 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PD.cs @@ -0,0 +1,105 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class PD +{ + [NativeTypeName("#define PD_ALLPAGES 0x00000000")] + public const int PD_ALLPAGES = 0x00000000; + + [NativeTypeName("#define PD_SELECTION 0x00000001")] + public const int PD_SELECTION = 0x00000001; + + [NativeTypeName("#define PD_PAGENUMS 0x00000002")] + public const int PD_PAGENUMS = 0x00000002; + + [NativeTypeName("#define PD_NOSELECTION 0x00000004")] + public const int PD_NOSELECTION = 0x00000004; + + [NativeTypeName("#define PD_NOPAGENUMS 0x00000008")] + public const int PD_NOPAGENUMS = 0x00000008; + + [NativeTypeName("#define PD_COLLATE 0x00000010")] + public const int PD_COLLATE = 0x00000010; + + [NativeTypeName("#define PD_PRINTTOFILE 0x00000020")] + public const int PD_PRINTTOFILE = 0x00000020; + + [NativeTypeName("#define PD_PRINTSETUP 0x00000040")] + public const int PD_PRINTSETUP = 0x00000040; + + [NativeTypeName("#define PD_NOWARNING 0x00000080")] + public const int PD_NOWARNING = 0x00000080; + + [NativeTypeName("#define PD_RETURNDC 0x00000100")] + public const int PD_RETURNDC = 0x00000100; + + [NativeTypeName("#define PD_RETURNIC 0x00000200")] + public const int PD_RETURNIC = 0x00000200; + + [NativeTypeName("#define PD_RETURNDEFAULT 0x00000400")] + public const int PD_RETURNDEFAULT = 0x00000400; + + [NativeTypeName("#define PD_SHOWHELP 0x00000800")] + public const int PD_SHOWHELP = 0x00000800; + + [NativeTypeName("#define PD_ENABLEPRINTHOOK 0x00001000")] + public const int PD_ENABLEPRINTHOOK = 0x00001000; + + [NativeTypeName("#define PD_ENABLESETUPHOOK 0x00002000")] + public const int PD_ENABLESETUPHOOK = 0x00002000; + + [NativeTypeName("#define PD_ENABLEPRINTTEMPLATE 0x00004000")] + public const int PD_ENABLEPRINTTEMPLATE = 0x00004000; + + [NativeTypeName("#define PD_ENABLESETUPTEMPLATE 0x00008000")] + public const int PD_ENABLESETUPTEMPLATE = 0x00008000; + + [NativeTypeName("#define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000")] + public const int PD_ENABLEPRINTTEMPLATEHANDLE = 0x00010000; + + [NativeTypeName("#define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000")] + public const int PD_ENABLESETUPTEMPLATEHANDLE = 0x00020000; + + [NativeTypeName("#define PD_USEDEVMODECOPIES 0x00040000")] + public const int PD_USEDEVMODECOPIES = 0x00040000; + + [NativeTypeName("#define PD_USEDEVMODECOPIESANDCOLLATE 0x00040000")] + public const int PD_USEDEVMODECOPIESANDCOLLATE = 0x00040000; + + [NativeTypeName("#define PD_DISABLEPRINTTOFILE 0x00080000")] + public const int PD_DISABLEPRINTTOFILE = 0x00080000; + + [NativeTypeName("#define PD_HIDEPRINTTOFILE 0x00100000")] + public const int PD_HIDEPRINTTOFILE = 0x00100000; + + [NativeTypeName("#define PD_NONETWORKBUTTON 0x00200000")] + public const int PD_NONETWORKBUTTON = 0x00200000; + + [NativeTypeName("#define PD_CURRENTPAGE 0x00400000")] + public const int PD_CURRENTPAGE = 0x00400000; + + [NativeTypeName("#define PD_NOCURRENTPAGE 0x00800000")] + public const int PD_NOCURRENTPAGE = 0x00800000; + + [NativeTypeName("#define PD_EXCLUSIONFLAGS 0x01000000")] + public const int PD_EXCLUSIONFLAGS = 0x01000000; + + [NativeTypeName("#define PD_USELARGETEMPLATE 0x10000000")] + public const int PD_USELARGETEMPLATE = 0x10000000; + + [NativeTypeName("#define PD_EXCL_COPIESANDCOLLATE (DM_COPIES | DM_COLLATE)")] + public const int PD_EXCL_COPIESANDCOLLATE = (0x00000100 | 0x00008000); + + [NativeTypeName("#define PD_RESULT_CANCEL 0")] + public const int PD_RESULT_CANCEL = 0; + + [NativeTypeName("#define PD_RESULT_PRINT 1")] + public const int PD_RESULT_PRINT = 1; + + [NativeTypeName("#define PD_RESULT_APPLY 2")] + public const int PD_RESULT_APPLY = 2; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGA.cs b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGA.cs new file mode 100644 index 0000000000..dbb48b2174 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGA.cs @@ -0,0 +1,78 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct PRINTDLGA +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HGLOBAL hDevMode; + + /// + public HGLOBAL hDevNames; + + /// + public HDC hDC; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + [NativeTypeName("WORD")] + public ushort nFromPage; + + /// + [NativeTypeName("WORD")] + public ushort nToPage; + + /// + [NativeTypeName("WORD")] + public ushort nMinPage; + + /// + [NativeTypeName("WORD")] + public ushort nMaxPage; + + /// + [NativeTypeName("WORD")] + public ushort nCopies; + + /// + public HINSTANCE hInstance; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPPRINTHOOKPROC")] + public delegate* unmanaged lpfnPrintHook; + + /// + [NativeTypeName("LPSETUPHOOKPROC")] + public delegate* unmanaged lpfnSetupHook; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpPrintTemplateName; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpSetupTemplateName; + + /// + public HGLOBAL hPrintTemplate; + + /// + public HGLOBAL hSetupTemplate; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXA.cs b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXA.cs new file mode 100644 index 0000000000..e44dc6b03f --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXA.cs @@ -0,0 +1,88 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct PRINTDLGEXA +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HGLOBAL hDevMode; + + /// + public HGLOBAL hDevNames; + + /// + public HDC hDC; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + [NativeTypeName("DWORD")] + public uint Flags2; + + /// + [NativeTypeName("DWORD")] + public uint ExclusionFlags; + + /// + [NativeTypeName("DWORD")] + public uint nPageRanges; + + /// + [NativeTypeName("DWORD")] + public uint nMaxPageRanges; + + /// + [NativeTypeName("LPPRINTPAGERANGE")] + public PRINTPAGERANGE* lpPageRanges; + + /// + [NativeTypeName("DWORD")] + public uint nMinPage; + + /// + [NativeTypeName("DWORD")] + public uint nMaxPage; + + /// + [NativeTypeName("DWORD")] + public uint nCopies; + + /// + public HINSTANCE hInstance; + + /// + [NativeTypeName("LPCSTR")] + public sbyte* lpPrintTemplateName; + + /// + [NativeTypeName("LPUNKNOWN")] + public IUnknown* lpCallback; + + /// + [NativeTypeName("DWORD")] + public uint nPropertyPages; + + /// + public HPROPSHEETPAGE* lphPropertyPages; + + /// + [NativeTypeName("DWORD")] + public uint nStartPage; + + /// + [NativeTypeName("DWORD")] + public uint dwResultAction; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXW.cs b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXW.cs new file mode 100644 index 0000000000..23ceede11d --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXW.cs @@ -0,0 +1,88 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct PRINTDLGEXW +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HGLOBAL hDevMode; + + /// + public HGLOBAL hDevNames; + + /// + public HDC hDC; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + [NativeTypeName("DWORD")] + public uint Flags2; + + /// + [NativeTypeName("DWORD")] + public uint ExclusionFlags; + + /// + [NativeTypeName("DWORD")] + public uint nPageRanges; + + /// + [NativeTypeName("DWORD")] + public uint nMaxPageRanges; + + /// + [NativeTypeName("LPPRINTPAGERANGE")] + public PRINTPAGERANGE* lpPageRanges; + + /// + [NativeTypeName("DWORD")] + public uint nMinPage; + + /// + [NativeTypeName("DWORD")] + public uint nMaxPage; + + /// + [NativeTypeName("DWORD")] + public uint nCopies; + + /// + public HINSTANCE hInstance; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpPrintTemplateName; + + /// + [NativeTypeName("LPUNKNOWN")] + public IUnknown* lpCallback; + + /// + [NativeTypeName("DWORD")] + public uint nPropertyPages; + + /// + public HPROPSHEETPAGE* lphPropertyPages; + + /// + [NativeTypeName("DWORD")] + public uint nStartPage; + + /// + [NativeTypeName("DWORD")] + public uint dwResultAction; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGW.cs b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGW.cs new file mode 100644 index 0000000000..8fcbe91f0f --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGW.cs @@ -0,0 +1,78 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct PRINTDLGW +{ + /// + [NativeTypeName("DWORD")] + public uint lStructSize; + + /// + public HWND hwndOwner; + + /// + public HGLOBAL hDevMode; + + /// + public HGLOBAL hDevNames; + + /// + public HDC hDC; + + /// + [NativeTypeName("DWORD")] + public uint Flags; + + /// + [NativeTypeName("WORD")] + public ushort nFromPage; + + /// + [NativeTypeName("WORD")] + public ushort nToPage; + + /// + [NativeTypeName("WORD")] + public ushort nMinPage; + + /// + [NativeTypeName("WORD")] + public ushort nMaxPage; + + /// + [NativeTypeName("WORD")] + public ushort nCopies; + + /// + public HINSTANCE hInstance; + + /// + public LPARAM lCustData; + + /// + [NativeTypeName("LPPRINTHOOKPROC")] + public delegate* unmanaged lpfnPrintHook; + + /// + [NativeTypeName("LPSETUPHOOKPROC")] + public delegate* unmanaged lpfnSetupHook; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpPrintTemplateName; + + /// + [NativeTypeName("LPCWSTR")] + public ushort* lpSetupTemplateName; + + /// + public HGLOBAL hPrintTemplate; + + /// + public HGLOBAL hSetupTemplate; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGE.cs b/sources/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGE.cs new file mode 100644 index 0000000000..cdbab5fbc5 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGE.cs @@ -0,0 +1,18 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct PRINTPAGERANGE +{ + /// + [NativeTypeName("DWORD")] + public uint nFromPage; + + /// + [NativeTypeName("DWORD")] + public uint nToPage; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PS.cs b/sources/Interop/Windows/Windows/um/CommDlg/PS.cs new file mode 100644 index 0000000000..745da7a16e --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PS.cs @@ -0,0 +1,12 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class PS +{ + [NativeTypeName("#define PS_OPENTYPE_FONTTYPE 0x10000")] + public const int PS_OPENTYPE_FONTTYPE = 0x10000; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PSD.cs b/sources/Interop/Windows/Windows/um/CommDlg/PSD.cs new file mode 100644 index 0000000000..f8ba43fed7 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PSD.cs @@ -0,0 +1,66 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class PSD +{ + [NativeTypeName("#define PSD_DEFAULTMINMARGINS 0x00000000")] + public const int PSD_DEFAULTMINMARGINS = 0x00000000; + + [NativeTypeName("#define PSD_INWININIINTLMEASURE 0x00000000")] + public const int PSD_INWININIINTLMEASURE = 0x00000000; + + [NativeTypeName("#define PSD_MINMARGINS 0x00000001")] + public const int PSD_MINMARGINS = 0x00000001; + + [NativeTypeName("#define PSD_MARGINS 0x00000002")] + public const int PSD_MARGINS = 0x00000002; + + [NativeTypeName("#define PSD_INTHOUSANDTHSOFINCHES 0x00000004")] + public const int PSD_INTHOUSANDTHSOFINCHES = 0x00000004; + + [NativeTypeName("#define PSD_INHUNDREDTHSOFMILLIMETERS 0x00000008")] + public const int PSD_INHUNDREDTHSOFMILLIMETERS = 0x00000008; + + [NativeTypeName("#define PSD_DISABLEMARGINS 0x00000010")] + public const int PSD_DISABLEMARGINS = 0x00000010; + + [NativeTypeName("#define PSD_DISABLEPRINTER 0x00000020")] + public const int PSD_DISABLEPRINTER = 0x00000020; + + [NativeTypeName("#define PSD_NOWARNING 0x00000080")] + public const int PSD_NOWARNING = 0x00000080; + + [NativeTypeName("#define PSD_DISABLEORIENTATION 0x00000100")] + public const int PSD_DISABLEORIENTATION = 0x00000100; + + [NativeTypeName("#define PSD_RETURNDEFAULT 0x00000400")] + public const int PSD_RETURNDEFAULT = 0x00000400; + + [NativeTypeName("#define PSD_DISABLEPAPER 0x00000200")] + public const int PSD_DISABLEPAPER = 0x00000200; + + [NativeTypeName("#define PSD_SHOWHELP 0x00000800")] + public const int PSD_SHOWHELP = 0x00000800; + + [NativeTypeName("#define PSD_ENABLEPAGESETUPHOOK 0x00002000")] + public const int PSD_ENABLEPAGESETUPHOOK = 0x00002000; + + [NativeTypeName("#define PSD_ENABLEPAGESETUPTEMPLATE 0x00008000")] + public const int PSD_ENABLEPAGESETUPTEMPLATE = 0x00008000; + + [NativeTypeName("#define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 0x00020000")] + public const int PSD_ENABLEPAGESETUPTEMPLATEHANDLE = 0x00020000; + + [NativeTypeName("#define PSD_ENABLEPAGEPAINTHOOK 0x00040000")] + public const int PSD_ENABLEPAGEPAINTHOOK = 0x00040000; + + [NativeTypeName("#define PSD_DISABLEPAGEPAINTING 0x00080000")] + public const int PSD_DISABLEPAGEPAINTING = 0x00080000; + + [NativeTypeName("#define PSD_NONETWORKBUTTON 0x00200000")] + public const int PSD_NONETWORKBUTTON = 0x00200000; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/WM.cs b/sources/Interop/Windows/Windows/um/CommDlg/WM.cs new file mode 100644 index 0000000000..974a205efe --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/WM.cs @@ -0,0 +1,39 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class WM +{ + [NativeTypeName("#define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)")] + public const int WM_CHOOSEFONT_GETLOGFONT = (0x0400 + 1); + + [NativeTypeName("#define WM_CHOOSEFONT_SETLOGFONT (WM_USER + 101)")] + public const int WM_CHOOSEFONT_SETLOGFONT = (0x0400 + 101); + + [NativeTypeName("#define WM_CHOOSEFONT_SETFLAGS (WM_USER + 102)")] + public const int WM_CHOOSEFONT_SETFLAGS = (0x0400 + 102); + + [NativeTypeName("#define WM_PSD_PAGESETUPDLG (WM_USER )")] + public const int WM_PSD_PAGESETUPDLG = (0x0400); + + [NativeTypeName("#define WM_PSD_FULLPAGERECT (WM_USER+1)")] + public const int WM_PSD_FULLPAGERECT = (0x0400 + 1); + + [NativeTypeName("#define WM_PSD_MINMARGINRECT (WM_USER+2)")] + public const int WM_PSD_MINMARGINRECT = (0x0400 + 2); + + [NativeTypeName("#define WM_PSD_MARGINRECT (WM_USER+3)")] + public const int WM_PSD_MARGINRECT = (0x0400 + 3); + + [NativeTypeName("#define WM_PSD_GREEKTEXTRECT (WM_USER+4)")] + public const int WM_PSD_GREEKTEXTRECT = (0x0400 + 4); + + [NativeTypeName("#define WM_PSD_ENVSTAMPRECT (WM_USER+5)")] + public const int WM_PSD_ENVSTAMPRECT = (0x0400 + 5); + + [NativeTypeName("#define WM_PSD_YAFULLPAGERECT (WM_USER+6)")] + public const int WM_PSD_YAFULLPAGERECT = (0x0400 + 6); +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/Windows.Manual.cs b/sources/Interop/Windows/Windows/um/CommDlg/Windows.Manual.cs new file mode 100644 index 0000000000..16f6ac1640 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/Windows.Manual.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System.Runtime.CompilerServices; + +namespace TerraFX.Interop.Windows; + +public static unsafe partial class Windows +{ + [NativeTypeName("#define OPENFILENAME_SIZE_VERSION_400A CDSIZEOF_STRUCT(OPENFILENAMEA,lpTemplateName)")] + public static nuint OPENFILENAME_SIZE_VERSION_400A + { + get + { + Unsafe.SkipInit(out OPENFILENAMEA tmp); + return unchecked((nuint)(((byte*)(&tmp)->lpTemplateName) - ((byte*)(&tmp))) + (uint)sizeof(ushort*)); + } + } + + [NativeTypeName("#define OPENFILENAME_SIZE_VERSION_400W CDSIZEOF_STRUCT(OPENFILENAMEW,lpTemplateName)")] + public static nuint OPENFILENAME_SIZE_VERSION_400W + { + get + { + Unsafe.SkipInit(out OPENFILENAMEW tmp); + return unchecked((nuint)(((byte*)(&tmp)->lpTemplateName) - ((byte*)(&tmp))) + (uint)sizeof(ushort*)); + } + } + + [NativeTypeName("#define OPENFILENAME_SIZE_VERSION_400 OPENFILENAME_SIZE_VERSION_400W")] + public static nuint OPENFILENAME_SIZE_VERSION_400 => OPENFILENAME_SIZE_VERSION_400W; +} diff --git a/sources/Interop/Windows/Windows/um/CommDlg/Windows.cs b/sources/Interop/Windows/Windows/um/CommDlg/Windows.cs new file mode 100644 index 0000000000..507614a07b --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/Windows.cs @@ -0,0 +1,223 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows; + +public static unsafe partial class Windows +{ + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL GetOpenFileNameA([NativeTypeName("LPOPENFILENAMEA")] OPENFILENAMEA* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL GetOpenFileNameW([NativeTypeName("LPOPENFILENAMEW")] OPENFILENAMEW* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL GetSaveFileNameA([NativeTypeName("LPOPENFILENAMEA")] OPENFILENAMEA* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL GetSaveFileNameW([NativeTypeName("LPOPENFILENAMEW")] OPENFILENAMEW* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern short GetFileTitleA([NativeTypeName("LPCSTR")] sbyte* param0, [NativeTypeName("LPSTR")] sbyte* Buf, [NativeTypeName("WORD")] ushort cchSize); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern short GetFileTitleW([NativeTypeName("LPCWSTR")] ushort* param0, [NativeTypeName("LPWSTR")] ushort* Buf, [NativeTypeName("WORD")] ushort cchSize); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL ChooseColorA([NativeTypeName("LPCHOOSECOLORA")] CHOOSECOLORA* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL ChooseColorW([NativeTypeName("LPCHOOSECOLORW")] CHOOSECOLORW* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern HWND FindTextA([NativeTypeName("LPFINDREPLACEA")] FINDREPLACEA* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern HWND FindTextW([NativeTypeName("LPFINDREPLACEW")] FINDREPLACEW* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern HWND ReplaceTextA([NativeTypeName("LPFINDREPLACEA")] FINDREPLACEA* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern HWND ReplaceTextW([NativeTypeName("LPFINDREPLACEW")] FINDREPLACEW* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL ChooseFontA([NativeTypeName("LPCHOOSEFONTA")] CHOOSEFONTA* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL ChooseFontW([NativeTypeName("LPCHOOSEFONTW")] CHOOSEFONTW* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL PrintDlgA([NativeTypeName("LPPRINTDLGA")] PRINTDLGA* pPD); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL PrintDlgW([NativeTypeName("LPPRINTDLGW")] PRINTDLGW* pPD); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern HRESULT PrintDlgExA([NativeTypeName("LPPRINTDLGEXA")] PRINTDLGEXA* pPD); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern HRESULT PrintDlgExW([NativeTypeName("LPPRINTDLGEXW")] PRINTDLGEXW* pPD); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + [return: NativeTypeName("DWORD")] + public static extern uint CommDlgExtendedError(); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL PageSetupDlgA([NativeTypeName("LPPAGESETUPDLGA")] PAGESETUPDLGA* param0); + + /// + [DllImport("comdlg32", ExactSpelling = true)] + public static extern BOOL PageSetupDlgW([NativeTypeName("LPPAGESETUPDLGW")] PAGESETUPDLGW* param0); + + [NativeTypeName("#define GetOpenFileName GetOpenFileNameW")] + public static delegate* GetOpenFileName => &GetOpenFileNameW; + + [NativeTypeName("#define GetSaveFileName GetSaveFileNameW")] + public static delegate* GetSaveFileName => &GetSaveFileNameW; + + [NativeTypeName("#define GetFileTitle GetFileTitleW")] + public static delegate* GetFileTitle => &GetFileTitleW; + + [NativeTypeName("#define ChooseColor ChooseColorW")] + public static delegate* ChooseColor => &ChooseColorW; + + [NativeTypeName("#define FindText FindTextW")] + public static delegate* FindText => &FindTextW; + + [NativeTypeName("#define ReplaceText ReplaceTextW")] + public static delegate* ReplaceText => &ReplaceTextW; + + [NativeTypeName("#define ChooseFont ChooseFontW")] + public static delegate* ChooseFont => &ChooseFontW; + + [NativeTypeName("#define SIMULATED_FONTTYPE 0x8000")] + public const int SIMULATED_FONTTYPE = 0x8000; + + [NativeTypeName("#define PRINTER_FONTTYPE 0x4000")] + public const int PRINTER_FONTTYPE = 0x4000; + + [NativeTypeName("#define SCREEN_FONTTYPE 0x2000")] + public const int SCREEN_FONTTYPE = 0x2000; + + [NativeTypeName("#define BOLD_FONTTYPE 0x0100")] + public const int BOLD_FONTTYPE = 0x0100; + + [NativeTypeName("#define ITALIC_FONTTYPE 0x0200")] + public const int ITALIC_FONTTYPE = 0x0200; + + [NativeTypeName("#define REGULAR_FONTTYPE 0x0400")] + public const int REGULAR_FONTTYPE = 0x0400; + + [NativeTypeName("#define TT_OPENTYPE_FONTTYPE 0x20000")] + public const int TT_OPENTYPE_FONTTYPE = 0x20000; + + [NativeTypeName("#define TYPE1_FONTTYPE 0x40000")] + public const int TYPE1_FONTTYPE = 0x40000; + + [NativeTypeName("#define SYMBOL_FONTTYPE 0x80000")] + public const int SYMBOL_FONTTYPE = 0x80000; + + [NativeTypeName("#define LBSELCHSTRINGA \"commdlg_LBSelChangedNotify\"")] + public static ReadOnlySpan LBSELCHSTRINGA => "commdlg_LBSelChangedNotify"u8; + + [NativeTypeName("#define SHAREVISTRINGA \"commdlg_ShareViolation\"")] + public static ReadOnlySpan SHAREVISTRINGA => "commdlg_ShareViolation"u8; + + [NativeTypeName("#define FILEOKSTRINGA \"commdlg_FileNameOK\"")] + public static ReadOnlySpan FILEOKSTRINGA => "commdlg_FileNameOK"u8; + + [NativeTypeName("#define COLOROKSTRINGA \"commdlg_ColorOK\"")] + public static ReadOnlySpan COLOROKSTRINGA => "commdlg_ColorOK"u8; + + [NativeTypeName("#define SETRGBSTRINGA \"commdlg_SetRGBColor\"")] + public static ReadOnlySpan SETRGBSTRINGA => "commdlg_SetRGBColor"u8; + + [NativeTypeName("#define HELPMSGSTRINGA \"commdlg_help\"")] + public static ReadOnlySpan HELPMSGSTRINGA => "commdlg_help"u8; + + [NativeTypeName("#define FINDMSGSTRINGA \"commdlg_FindReplace\"")] + public static ReadOnlySpan FINDMSGSTRINGA => "commdlg_FindReplace"u8; + + [NativeTypeName("#define LBSELCHSTRINGW L\"commdlg_LBSelChangedNotify\"")] + public const string LBSELCHSTRINGW = "commdlg_LBSelChangedNotify"; + + [NativeTypeName("#define SHAREVISTRINGW L\"commdlg_ShareViolation\"")] + public const string SHAREVISTRINGW = "commdlg_ShareViolation"; + + [NativeTypeName("#define FILEOKSTRINGW L\"commdlg_FileNameOK\"")] + public const string FILEOKSTRINGW = "commdlg_FileNameOK"; + + [NativeTypeName("#define COLOROKSTRINGW L\"commdlg_ColorOK\"")] + public const string COLOROKSTRINGW = "commdlg_ColorOK"; + + [NativeTypeName("#define SETRGBSTRINGW L\"commdlg_SetRGBColor\"")] + public const string SETRGBSTRINGW = "commdlg_SetRGBColor"; + + [NativeTypeName("#define HELPMSGSTRINGW L\"commdlg_help\"")] + public const string HELPMSGSTRINGW = "commdlg_help"; + + [NativeTypeName("#define FINDMSGSTRINGW L\"commdlg_FindReplace\"")] + public const string FINDMSGSTRINGW = "commdlg_FindReplace"; + + [NativeTypeName("#define LBSELCHSTRING LBSELCHSTRINGW")] + public const string LBSELCHSTRING = "commdlg_LBSelChangedNotify"; + + [NativeTypeName("#define SHAREVISTRING SHAREVISTRINGW")] + public const string SHAREVISTRING = "commdlg_ShareViolation"; + + [NativeTypeName("#define FILEOKSTRING FILEOKSTRINGW")] + public const string FILEOKSTRING = "commdlg_FileNameOK"; + + [NativeTypeName("#define COLOROKSTRING COLOROKSTRINGW")] + public const string COLOROKSTRING = "commdlg_ColorOK"; + + [NativeTypeName("#define SETRGBSTRING SETRGBSTRINGW")] + public const string SETRGBSTRING = "commdlg_SetRGBColor"; + + [NativeTypeName("#define HELPMSGSTRING HELPMSGSTRINGW")] + public const string HELPMSGSTRING = "commdlg_help"; + + [NativeTypeName("#define FINDMSGSTRING FINDMSGSTRINGW")] + public const string FINDMSGSTRING = "commdlg_FindReplace"; + + [NativeTypeName("#define PrintDlg PrintDlgW")] + public static delegate* PrintDlg => &PrintDlgW; + + [NativeTypeName("#define PrintDlgEx PrintDlgExW")] + public static delegate* PrintDlgEx => &PrintDlgExW; + + [NativeTypeName("#define START_PAGE_GENERAL 0xffffffff")] + public const uint START_PAGE_GENERAL = 0xffffffff; + + [NativeTypeName("#define DN_DEFAULTPRN 0x0001")] + public const int DN_DEFAULTPRN = 0x0001; + + [NativeTypeName("#define PageSetupDlg PageSetupDlgW")] + public static delegate* PageSetupDlg => &PageSetupDlgW; +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORATests.cs b/tests/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORATests.cs new file mode 100644 index 0000000000..f0572778e4 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class CHOOSECOLORATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(CHOOSECOLORA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(CHOOSECOLORA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(CHOOSECOLORA), Is.EqualTo(72)); + } + else + { + Assert.That(sizeof(CHOOSECOLORA), Is.EqualTo(36)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORWTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORWTests.cs new file mode 100644 index 0000000000..4b7b1472ea --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class CHOOSECOLORWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(CHOOSECOLORW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(CHOOSECOLORW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(CHOOSECOLORW), Is.EqualTo(72)); + } + else + { + Assert.That(sizeof(CHOOSECOLORW), Is.EqualTo(36)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTATests.cs b/tests/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTATests.cs new file mode 100644 index 0000000000..e88b83ade2 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class CHOOSEFONTATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(CHOOSEFONTA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(CHOOSEFONTA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(CHOOSEFONTA), Is.EqualTo(104)); + } + else + { + Assert.That(sizeof(CHOOSEFONTA), Is.EqualTo(60)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTWTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTWTests.cs new file mode 100644 index 0000000000..50711bd88a --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class CHOOSEFONTWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(CHOOSEFONTW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(CHOOSEFONTW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(CHOOSEFONTW), Is.EqualTo(104)); + } + else + { + Assert.That(sizeof(CHOOSEFONTW), Is.EqualTo(60)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/DEVNAMESTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/DEVNAMESTests.cs new file mode 100644 index 0000000000..f86a5b465f --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/DEVNAMESTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class DEVNAMESTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(DEVNAMES))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(DEVNAMES).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(DEVNAMES), Is.EqualTo(8)); + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/FINDREPLACEATests.cs b/tests/Interop/Windows/Windows/um/CommDlg/FINDREPLACEATests.cs new file mode 100644 index 0000000000..621fa3e84c --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/FINDREPLACEATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class FINDREPLACEATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(FINDREPLACEA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(FINDREPLACEA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(FINDREPLACEA), Is.EqualTo(80)); + } + else + { + Assert.That(sizeof(FINDREPLACEA), Is.EqualTo(40)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/FINDREPLACEWTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/FINDREPLACEWTests.cs new file mode 100644 index 0000000000..4d797b3c05 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/FINDREPLACEWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class FINDREPLACEWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(FINDREPLACEW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(FINDREPLACEW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(FINDREPLACEW), Is.EqualTo(80)); + } + else + { + Assert.That(sizeof(FINDREPLACEW), Is.EqualTo(40)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/IIDTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/IIDTests.cs new file mode 100644 index 0000000000..4225c46b2d --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/IIDTests.cs @@ -0,0 +1,28 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using static TerraFX.Interop.Windows.IID; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the class. +public static partial class IIDTests +{ + /// Validates that the value of the property is correct. + [Test] + public static void IID_IPrintDialogCallbackTest() + { + Assert.That(IID_IPrintDialogCallback, Is.EqualTo(new Guid(0x5852a2c3, 0x6530, 0x11d1, 0xb6, 0xa3, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9))); + } + + /// Validates that the value of the property is correct. + [Test] + public static void IID_IPrintDialogServicesTest() + { + Assert.That(IID_IPrintDialogServices, Is.EqualTo(new Guid(0x509aaeda, 0x5639, 0x11d1, 0xb6, 0xa1, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9))); + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallbackTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallbackTests.cs new file mode 100644 index 0000000000..0b34507b39 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallbackTests.cs @@ -0,0 +1,50 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows.IID; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class IPrintDialogCallbackTests +{ + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IPrintDialogCallback).GUID, Is.EqualTo(IID_IPrintDialogCallback)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IPrintDialogCallback))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IPrintDialogCallback).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IPrintDialogCallback), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IPrintDialogCallback), Is.EqualTo(4)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/IPrintDialogServicesTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/IPrintDialogServicesTests.cs new file mode 100644 index 0000000000..a623b8ce5a --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/IPrintDialogServicesTests.cs @@ -0,0 +1,50 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows.IID; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class IPrintDialogServicesTests +{ + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IPrintDialogServices).GUID, Is.EqualTo(IID_IPrintDialogServices)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IPrintDialogServices))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IPrintDialogServices).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IPrintDialogServices), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IPrintDialogServices), Is.EqualTo(4)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYATests.cs b/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYATests.cs new file mode 100644 index 0000000000..5551734949 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class OFNOTIFYATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(OFNOTIFYA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(OFNOTIFYA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(OFNOTIFYA), Is.EqualTo(40)); + } + else + { + Assert.That(sizeof(OFNOTIFYA), Is.EqualTo(20)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXATests.cs b/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXATests.cs new file mode 100644 index 0000000000..89c6921785 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class OFNOTIFYEXATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(OFNOTIFYEXA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(OFNOTIFYEXA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(OFNOTIFYEXA), Is.EqualTo(48)); + } + else + { + Assert.That(sizeof(OFNOTIFYEXA), Is.EqualTo(24)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXWTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXWTests.cs new file mode 100644 index 0000000000..39bca5971d --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class OFNOTIFYEXWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(OFNOTIFYEXW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(OFNOTIFYEXW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(OFNOTIFYEXW), Is.EqualTo(48)); + } + else + { + Assert.That(sizeof(OFNOTIFYEXW), Is.EqualTo(24)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYWTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYWTests.cs new file mode 100644 index 0000000000..5961c5fc5e --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/OFNOTIFYWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class OFNOTIFYWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(OFNOTIFYW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(OFNOTIFYW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(OFNOTIFYW), Is.EqualTo(40)); + } + else + { + Assert.That(sizeof(OFNOTIFYW), Is.EqualTo(20)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEATests.cs b/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEATests.cs new file mode 100644 index 0000000000..e45ab47b20 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class OPENFILENAMEATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(OPENFILENAMEA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(OPENFILENAMEA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(OPENFILENAMEA), Is.EqualTo(152)); + } + else + { + Assert.That(sizeof(OPENFILENAMEA), Is.EqualTo(88)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEWTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEWTests.cs new file mode 100644 index 0000000000..8095f720a9 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAMEWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class OPENFILENAMEWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(OPENFILENAMEW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(OPENFILENAMEW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(OPENFILENAMEW), Is.EqualTo(152)); + } + else + { + Assert.That(sizeof(OPENFILENAMEW), Is.EqualTo(88)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4ATests.cs b/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4ATests.cs new file mode 100644 index 0000000000..0d95abe14d --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4ATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class OPENFILENAME_NT4ATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(OPENFILENAME_NT4A))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(OPENFILENAME_NT4A).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(OPENFILENAME_NT4A), Is.EqualTo(136)); + } + else + { + Assert.That(sizeof(OPENFILENAME_NT4A), Is.EqualTo(76)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4WTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4WTests.cs new file mode 100644 index 0000000000..54d4114408 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4WTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class OPENFILENAME_NT4WTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(OPENFILENAME_NT4W))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(OPENFILENAME_NT4W).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(OPENFILENAME_NT4W), Is.EqualTo(136)); + } + else + { + Assert.That(sizeof(OPENFILENAME_NT4W), Is.EqualTo(76)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGATests.cs b/tests/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGATests.cs new file mode 100644 index 0000000000..40a90b183f --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PAGESETUPDLGATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PAGESETUPDLGA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PAGESETUPDLGA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(PAGESETUPDLGA), Is.EqualTo(128)); + } + else + { + Assert.That(sizeof(PAGESETUPDLGA), Is.EqualTo(84)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGWTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGWTests.cs new file mode 100644 index 0000000000..2904ba51e5 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PAGESETUPDLGWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PAGESETUPDLGW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PAGESETUPDLGW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(PAGESETUPDLGW), Is.EqualTo(128)); + } + else + { + Assert.That(sizeof(PAGESETUPDLGW), Is.EqualTo(84)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGATests.cs b/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGATests.cs new file mode 100644 index 0000000000..989e9050de --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PRINTDLGATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PRINTDLGA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PRINTDLGA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(PRINTDLGA), Is.EqualTo(120)); + } + else + { + Assert.That(sizeof(PRINTDLGA), Is.EqualTo(68)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXATests.cs b/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXATests.cs new file mode 100644 index 0000000000..63e0a55421 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PRINTDLGEXATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PRINTDLGEXA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PRINTDLGEXA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(PRINTDLGEXA), Is.EqualTo(136)); + } + else + { + Assert.That(sizeof(PRINTDLGEXA), Is.EqualTo(84)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXWTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXWTests.cs new file mode 100644 index 0000000000..0624c67f71 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PRINTDLGEXWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PRINTDLGEXW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PRINTDLGEXW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(PRINTDLGEXW), Is.EqualTo(136)); + } + else + { + Assert.That(sizeof(PRINTDLGEXW), Is.EqualTo(84)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGWTests.cs b/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGWTests.cs new file mode 100644 index 0000000000..9ddaa50d43 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/PRINTDLGWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PRINTDLGWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PRINTDLGW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PRINTDLGW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(PRINTDLGW), Is.EqualTo(120)); + } + else + { + Assert.That(sizeof(PRINTDLGW), Is.EqualTo(68)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGETests.cs b/tests/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGETests.cs new file mode 100644 index 0000000000..b42842fe4c --- /dev/null +++ b/tests/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGETests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommDlg.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PRINTPAGERANGETests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PRINTPAGERANGE))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PRINTPAGERANGE).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(PRINTPAGERANGE), Is.EqualTo(8)); + } +} From 3b2ed56bbca9a3c267b55b5a462420d45f1f655a Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 22 Jun 2023 17:04:12 -0700 Subject: [PATCH 3/8] Generating bindings for um/icm --- TerraFX.Interop.Windows.sln | 8 + generation/Windows/um/icm/generate.rsp | 227 +++++ generation/Windows/um/icm/header.txt | 4 + generation/Windows/um/icm/um-icm.h | 2 + generation/remap-transparent.rsp | 4 +- generation/remap-types.rsp | 8 + .../Windows/other/helper-types/HPROFILE.cs | 101 ++ .../Windows/other/helper-types/HTRANSFORM.cs | 101 ++ .../Windows/Windows/um/CommCtrl/CDN.cs | 15 + .../Windows/Windows/um/CommCtrl/Windows.cs | 6 - .../Windows/Windows/um/SetupAPI/DICD.cs | 15 + .../Windows/Windows/um/SetupAPI/Windows.cs | 6 - .../Windows/Windows/um/icm/BMFORMAT.cs | 133 +++ .../Windows/Windows/um/icm/CMYKCOLOR.cs | 26 + .../Interop/Windows/Windows/um/icm/COLOR.cs | 104 +++ .../Windows/Windows/um/icm/COLORDATATYPE.cs | 31 + .../Windows/um/icm/COLORMATCHSETUPA.cs | 83 ++ .../Windows/um/icm/COLORMATCHSETUPW.cs | 83 ++ .../Windows/um/icm/COLORPROFILESUBTYPE.cs | 37 + .../Windows/um/icm/COLORPROFILETYPE.cs | 22 + .../Windows/Windows/um/icm/COLORTYPE.cs | 46 + .../Interop/Windows/Windows/um/icm/ENABLE.cs | 12 + .../Interop/Windows/Windows/um/icm/ENUM.cs | 12 + .../Windows/Windows/um/icm/ENUMTYPEA.cs | 90 ++ .../Windows/Windows/um/icm/ENUMTYPEW.cs | 90 ++ .../Interop/Windows/Windows/um/icm/FAST.cs | 12 + .../Interop/Windows/Windows/um/icm/FLAG.cs | 18 + .../Windows/Windows/um/icm/GENERIC3CHANNEL.cs | 22 + .../Windows/Windows/um/icm/GRAYCOLOR.cs | 14 + .../Windows/Windows/um/icm/HiFiCOLOR.cs | 14 + .../Windows/Windows/um/icm/LabCOLOR.cs | 22 + sources/Interop/Windows/Windows/um/icm/MAX.cs | 12 + .../Windows/Windows/um/icm/NAMEDCOLOR.cs | 14 + .../Windows/um/icm/NAMED_PROFILE_INFO.cs | 30 + .../Interop/Windows/Windows/um/icm/PROFILE.cs | 22 + .../Windows/Windows/um/icm/PROFILEHEADER.cs | 77 ++ .../Windows/Windows/um/icm/RGBCOLOR.cs | 22 + .../um/icm/WCS_DEVICE_CAPABILITIES_TYPE.cs | 16 + .../um/icm/WCS_DEVICE_MHC2_CAPABILITIES.cs | 25 + .../um/icm/WCS_DEVICE_VCGT_CAPABILITIES.cs | 16 + .../um/icm/WCS_PROFILE_MANAGEMENT_SCOPE.cs | 16 + .../Interop/Windows/Windows/um/icm/Windows.cs | 866 ++++++++++++++++++ .../Windows/Windows/um/icm/XYZCOLOR.cs | 22 + .../Windows/Windows/um/icm/YxyCOLOR.cs | 22 + .../Interop/Windows/Windows/um/wingdi/FR.cs | 15 + .../Windows/Windows/um/wingdi/Windows.cs | 6 - .../Windows/Windows/um/icm/CMYKCOLORTests.cs | 34 + .../Windows/um/icm/COLORMATCHSETUPATests.cs | 42 + .../Windows/um/icm/COLORMATCHSETUPWTests.cs | 42 + .../Windows/Windows/um/icm/COLORTests.cs | 46 + .../Windows/Windows/um/icm/ENUMTYPEATests.cs | 42 + .../Windows/Windows/um/icm/ENUMTYPEWTests.cs | 42 + .../Windows/um/icm/GENERIC3CHANNELTests.cs | 34 + .../Windows/Windows/um/icm/GRAYCOLORTests.cs | 34 + .../Windows/Windows/um/icm/HiFiCOLORTests.cs | 34 + .../Windows/Windows/um/icm/LabCOLORTests.cs | 34 + .../Windows/Windows/um/icm/NAMEDCOLORTests.cs | 34 + .../Windows/um/icm/NAMED_PROFILE_INFOTests.cs | 34 + .../Windows/um/icm/PROFILEHEADERTests.cs | 34 + .../Windows/Windows/um/icm/PROFILETests.cs | 42 + .../Windows/Windows/um/icm/RGBCOLORTests.cs | 34 + .../icm/WCS_DEVICE_MHC2_CAPABILITIESTests.cs | 34 + .../icm/WCS_DEVICE_VCGT_CAPABILITIESTests.cs | 34 + .../Windows/Windows/um/icm/XYZCOLORTests.cs | 34 + .../Windows/Windows/um/icm/YxyCOLORTests.cs | 34 + 65 files changed, 3227 insertions(+), 20 deletions(-) create mode 100644 generation/Windows/um/icm/generate.rsp create mode 100644 generation/Windows/um/icm/header.txt create mode 100644 generation/Windows/um/icm/um-icm.h create mode 100644 sources/Interop/Windows/Windows/other/helper-types/HPROFILE.cs create mode 100644 sources/Interop/Windows/Windows/other/helper-types/HTRANSFORM.cs create mode 100644 sources/Interop/Windows/Windows/um/CommCtrl/CDN.cs create mode 100644 sources/Interop/Windows/Windows/um/SetupAPI/DICD.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/BMFORMAT.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/CMYKCOLOR.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/COLOR.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/COLORDATATYPE.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/COLORMATCHSETUPA.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/COLORMATCHSETUPW.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/COLORPROFILESUBTYPE.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/COLORPROFILETYPE.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/COLORTYPE.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/ENABLE.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/ENUM.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/ENUMTYPEA.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/ENUMTYPEW.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/FAST.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/FLAG.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/GENERIC3CHANNEL.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/GRAYCOLOR.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/HiFiCOLOR.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/LabCOLOR.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/MAX.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/NAMEDCOLOR.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFO.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/PROFILE.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/PROFILEHEADER.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/RGBCOLOR.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_CAPABILITIES_TYPE.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_MHC2_CAPABILITIES.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_VCGT_CAPABILITIES.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/WCS_PROFILE_MANAGEMENT_SCOPE.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/Windows.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/XYZCOLOR.cs create mode 100644 sources/Interop/Windows/Windows/um/icm/YxyCOLOR.cs create mode 100644 sources/Interop/Windows/Windows/um/wingdi/FR.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/CMYKCOLORTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/COLORMATCHSETUPATests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/COLORMATCHSETUPWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/COLORTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/ENUMTYPEATests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/ENUMTYPEWTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/GENERIC3CHANNELTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/GRAYCOLORTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/HiFiCOLORTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/LabCOLORTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/NAMEDCOLORTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFOTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/PROFILEHEADERTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/PROFILETests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/RGBCOLORTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/WCS_DEVICE_MHC2_CAPABILITIESTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/WCS_DEVICE_VCGT_CAPABILITIESTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/XYZCOLORTests.cs create mode 100644 tests/Interop/Windows/Windows/um/icm/YxyCOLORTests.cs diff --git a/TerraFX.Interop.Windows.sln b/TerraFX.Interop.Windows.sln index c54dba2f0f..5002de9671 100644 --- a/TerraFX.Interop.Windows.sln +++ b/TerraFX.Interop.Windows.sln @@ -3075,6 +3075,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommDlg", "CommDlg", "{10FB generation\Windows\um\CommDlg\um-CommDlg.h = generation\Windows\um\CommDlg\um-CommDlg.h EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "icm", "icm", "{CA0728D0-571F-48A0-A4A9-4681A76D120C}" + ProjectSection(SolutionItems) = preProject + generation\Windows\um\icm\generate.rsp = generation\Windows\um\icm\generate.rsp + generation\Windows\um\icm\header.txt = generation\Windows\um\icm\header.txt + generation\Windows\um\icm\um-icm.h = generation\Windows\um\icm\um-icm.h + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -3546,6 +3553,7 @@ Global {566C5B1B-E5DC-420D-8740-A991751A5D09} = {65954CB3-F28F-4CF0-BC77-0FFD6E858BCE} {635B5075-171E-4AE9-B25D-F2E3C36E2F7E} = {849C4129-3383-468E-9CFA-B709015C0BE2} {10FB9457-4DE3-4E4C-9229-2C3C58D07346} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE} + {CA0728D0-571F-48A0-A4A9-4681A76D120C} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {2FE36DF8-2D9C-4F20-8787-45DC74B57461} diff --git a/generation/Windows/um/icm/generate.rsp b/generation/Windows/um/icm/generate.rsp new file mode 100644 index 0000000000..d9abb7b335 --- /dev/null +++ b/generation/Windows/um/icm/generate.rsp @@ -0,0 +1,227 @@ +@../../../settings.rsp +@../../../remap.rsp +--file +um-icm.h +--methodClassName +Windows +--namespace +TerraFX.Interop.Windows +--output +../../../../sources/Interop/Windows/Windows/um/icm +--test-output +../../../../tests/Interop/Windows/Windows/um/icm +--traverse +C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/icm.h +--with-attribute +AssociateColorProfileWithDevice=SupportedOSPlatform("windows10.0.19043.0") +AssociateColorProfileWithDeviceA=SupportedOSPlatform("windows10.0.19043.0") +CMCheckRGBs=SupportedOSPlatform("windows10.0.19043.0") +CMCreateTransform=SupportedOSPlatform("windows10.0.19043.0") +CMCreateTransformW=SupportedOSPlatform("windows10.0.19043.0") +CMGetPS2ColorRenderingDictionary=SupportedOSPlatform("windows10.0.19043.0") +CMGetPS2ColorSpaceArray=SupportedOSPlatform("windows10.0.19043.0") +ColorProfileAddDisplayAssociation=SupportedOSPlatform("windows10.0.19043.0") +ColorProfileGetDisplayDefault=SupportedOSPlatform("windows10.0.19043.0") +ColorProfileGetDisplayList=SupportedOSPlatform("windows10.0.19043.0") +ColorProfileGetDisplayUserScope=SupportedOSPlatform("windows10.0.19043.0") +ColorProfileRemoveDisplayAssociation=SupportedOSPlatform("windows10.0.19043.0") +ColorProfileSetDisplayDefaultAssociation=SupportedOSPlatform("windows10.0.19043.0") +--with-librarypath +AssociateColorProfileWithDevice=mscms +AssociateColorProfileWithDeviceA=mscms +AssociateColorProfileWithDeviceW=mscms +CheckBitmapBits=mscms +CheckColors=mscms +CloseColorProfile=mscms +CMCheckColors=mscms +CMCheckColorsInGamut=mscms +CMCheckRGBs=mscms +CMConvertColorNameToIndex=mscms +CMConvertIndexToColorName=mscms +CMCreateDeviceLinkProfile=icm32 +CMCreateMultiProfileTransform=icm32 +CMCreateProfile=mscms +CMCreateProfileW=mscms +CMCreateTransform=mscms +CMCreateTransformExt=icm32 +CMCreateTransformExtW=icm32 +CMCreateTransformW=mscms +CMDeleteTransform=icm32 +CMGetInfo=mscms +CMGetNamedProfileInfo=icm32 +CMGetPS2ColorRenderingDictionary=mscms +CMGetPS2ColorRenderingIntent=mscms +CMGetPS2ColorSpaceArray=mscms +CMIsProfileValid=mscms +CMTranslateColors=icm32 +CMTranslateRGB=icm32 +CMTranslateRGBs=icm32 +CMTranslateRGBsExt=icm32 +ColorProfileAddDisplayAssociation=mscms +ColorProfileGetDisplayDefault=mscms +ColorProfileGetDisplayList=mscms +ColorProfileGetDisplayUserScope=mscms +ColorProfileRemoveDisplayAssociation=mscms +ColorProfileSetDisplayDefaultAssociation=mscms +ConvertColorNameToIndex=mscms +ConvertIndexToColorName=mscms +CreateColorTransform=mscms +CreateColorTransformA=mscms +CreateColorTransformW=mscms +CreateDeviceLinkProfile=mscms +CreateMultiProfileTransform=mscms +CreateProfileFromLogColorSpace=mscms +CreateProfileFromLogColorSpaceA=mscms +CreateProfileFromLogColorSpaceW=mscms +DeleteColorTransform=mscms +DisassociateColorProfileFromDevice=mscms +DisassociateColorProfileFromDeviceA=mscms +DisassociateColorProfileFromDeviceW=mscms +EnumColorProfiles=mscms +EnumColorProfilesA=mscms +EnumColorProfilesW=mscms +GetCMMInfo=mscms +GetColorDirectory=mscms +GetColorDirectoryA=mscms +GetColorDirectoryW=mscms +GetColorProfileElement=mscms +GetColorProfileElementTag=mscms +GetColorProfileFromHandle=mscms +GetColorProfileHeader=mscms +GetCountColorProfileElements=mscms +GetNamedProfileInfo=mscms +GetPS2ColorRenderingDictionary=mscms +GetPS2ColorRenderingIntent=mscms +GetPS2ColorSpaceArray=mscms +GetStandardColorSpaceProfile=mscms +GetStandardColorSpaceProfileA=mscms +GetStandardColorSpaceProfileW=mscms +InstallColorProfile=mscms +InstallColorProfileA=mscms +InstallColorProfileW=mscms +IsColorProfileTagPresent=mscms +IsColorProfileValid=mscms +OpenColorProfile=mscms +OpenColorProfileA=mscms +OpenColorProfileW=mscms +RegisterCMM=mscms +RegisterCMMA=mscms +RegisterCMMW=mscms +SelectCMM=mscms +SetColorProfileElement=mscms +SetColorProfileElementReference=mscms +SetColorProfileElementSize=mscms +SetColorProfileHeader=mscms +SetStandardColorSpaceProfile=mscms +SetStandardColorSpaceProfileA=mscms +SetStandardColorSpaceProfileW=mscms +SetupColorMatching=icmui +SetupColorMatchingA=icmui +SetupColorMatchingW=icmui +TranslateBitmapBits=mscms +TranslateColors=mscms +UninstallColorProfile=mscms +UninstallColorProfileA=mscms +UninstallColorProfileW=mscms +UnregisterCMM=mscms +UnregisterCMMA=mscms +UnregisterCMMW=mscms +WcsAssociateColorProfileWithDevice=mscms +WcsCheckColors=mscms +WcsCreateIccProfile=mscms +WcsDisassociateColorProfileFromDevice=mscms +WcsEnumColorProfiles=mscms +WcsEnumColorProfilesSize=mscms +WcsGetCalibrationManagementState=mscms +WcsGetDefaultColorProfile=mscms +WcsGetDefaultColorProfileSize=mscms +WcsGetDefaultRenderingIntent=mscms +WcsGetUsePerUserProfiles=mscms +WcsOpenColorProfile=mscms +WcsOpenColorProfileA=mscms +WcsOpenColorProfileW=mscms +WcsSetCalibrationManagementState=mscms +WcsSetDefaultColorProfile=mscms +WcsSetDefaultRenderingIntent=mscms +WcsSetUsePerUserProfiles=mscms +WcsTranslateColors=mscms +--with-setlasterror +AssociateColorProfileWithDevice +AssociateColorProfileWithDeviceA +AssociateColorProfileWithDeviceW +CheckBitmapBits +CheckColors +CloseColorProfile +CMCheckColorsInGamut +CMCreateProfile +CMCreateProfileW +CMTranslateRGBs +CreateColorTransform +CreateColorTransformA +CreateColorTransformW +CreateDeviceLinkProfile +CreateMultiProfileTransform +DeleteColorTransform +DisassociateColorProfileFromDevice +DisassociateColorProfileFromDeviceA +DisassociateColorProfileFromDeviceW +EnumColorProfiles +EnumColorProfilesA +EnumColorProfilesW +GetColorDirectory +GetColorDirectoryA +GetColorDirectoryW +GetColorProfileElement +GetColorProfileElementTag +GetColorProfileFromHandle +GetColorProfileHeader +GetCountColorProfileElements +GetPS2ColorRenderingIntent +GetPS2ColorSpaceArray +GetStandardColorSpaceProfile +GetStandardColorSpaceProfileA +GetStandardColorSpaceProfileW +InstallColorProfile +InstallColorProfileA +InstallColorProfileW +IsColorProfileTagPresent +IsColorProfileValid +OpenColorProfile +OpenColorProfileA +OpenColorProfileW +RegisterCMM +RegisterCMMA +RegisterCMMW +SelectCMM +SetColorProfileElement +SetColorProfileElementReference +SetColorProfileElementSize +SetColorProfileHeader +SetStandardColorSpaceProfile +SetStandardColorSpaceProfileA +SetStandardColorSpaceProfileW +SetupColorMatching +SetupColorMatchingA +SetupColorMatchingW +TranslateBitmapBits +TranslateColors +UninstallColorProfile +UninstallColorProfileA +UninstallColorProfileW +UnregisterCMM +UnregisterCMMA +UnregisterCMMW +WcsAssociateColorProfileWithDevice +WcsCheckColors +WcsCreateIccProfile +WcsDisassociateColorProfileFromDevice +WcsEnumColorProfiles +WcsEnumColorProfilesSize +WcsGetDefaultColorProfile +WcsGetDefaultColorProfileSize +WcsGetDefaultRenderingIntent +WcsGetUsePerUserProfiles +WcsSetDefaultColorProfile +WcsSetDefaultRenderingIntent +WcsSetUsePerUserProfiles +WcsTranslateColors diff --git a/generation/Windows/um/icm/header.txt b/generation/Windows/um/icm/header.txt new file mode 100644 index 0000000000..892fc3d9fe --- /dev/null +++ b/generation/Windows/um/icm/header.txt @@ -0,0 +1,4 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. diff --git a/generation/Windows/um/icm/um-icm.h b/generation/Windows/um/icm/um-icm.h new file mode 100644 index 0000000000..227c845255 --- /dev/null +++ b/generation/Windows/um/icm/um-icm.h @@ -0,0 +1,2 @@ +#include "..\..\..\TerraFX.h" +#include diff --git a/generation/remap-transparent.rsp b/generation/remap-transparent.rsp index d08fa1cbcc..909f876dc9 100644 --- a/generation/remap-transparent.rsp +++ b/generation/remap-transparent.rsp @@ -76,6 +76,7 @@ HPAINTBUFFER=void*;HandleWin32 HPALETTE=void*;HandleWin32 HPCON=void*;HandleWin32 HPEN=void*;HandleWin32 +HPROFILE=void*;HandleWin32 HPOWERNOTIFY=void*;HandleWin32 HPROPSHEETPAGE=void*;HandleWin32 HPSS=void*;HandleWin32 @@ -96,6 +97,7 @@ HTASK=void*;HandleWin32 HTHEME=void*;HandleWin32 HTHUMBNAIL=void*;HandleWin32 HTOUCHINPUT=void*;HandleWin32 +HTRANSFORM=void*;HandleWin32 HTREEITEM=void*;HandleWin32 HUSKEY=void*;HandleWin32 HWAVEIN=void*;HandleWin32 @@ -202,7 +204,6 @@ HMF=HMF HMMIO=HMMIO HOBJECT=HOBJECT HPORT=HPORT -HPROFILE=HPROFILE HPTPROVIDER=HPTPROVIDER HRASCONN=HRASCONN HRECOALT=HRECOALT @@ -221,7 +222,6 @@ HSPRITE=HSPRITE HSTR=HSTR HSURF=HSURF HSZ=HSZ -HTRANSFORM=HTRANSFORM HTTP_PUSH_WAIT_HANDLE=HTTP_PUSH_WAIT_HANDLE HUIAEVENT=HUIAEVENT HUIANODE=HUIANODE diff --git a/generation/remap-types.rsp b/generation/remap-types.rsp index 498c37db1a..81cf8dbf15 100644 --- a/generation/remap-types.rsp +++ b/generation/remap-types.rsp @@ -365,6 +365,7 @@ tagCLIPDATA=CLIPDATA tagCLSCTX=CLSCTX tagCOINIT=COINIT tagCOINITBASE=COINITBASE +tagCOLOR=COLOR tagCOLORADJUSTMENT=COLORADJUSTMENT tagCOLORCORRECTPALETTE=EMRCOLORCORRECTPALETTE tagCOLORKEY=COLORKEY @@ -543,6 +544,8 @@ tagENUMLOGFONTEXW=ENUMLOGFONTEXW tagENUMLOGFONTW=ENUMLOGFONTW tagENUMTEXTMETRICA=ENUMTEXTMETRICA tagENUMTEXTMETRICW=ENUMTEXTMETRICW +tagENUMTYPEA=ENUMTYPEA +tagENUMTYPEW=ENUMTYPEW tagENUMUILANG=ENUMUILANG tagEOLE_AUTHENTICATION_CAPABILITIES=EOLE_AUTHENTICATION_CAPABILITIES tagEVENTMSG=EVENTMSG @@ -877,6 +880,7 @@ tagMSLLHOOKSTRUCT=MSLLHOOKSTRUCT tagMULTIKEYHELPA=MULTIKEYHELPA tagMULTIKEYHELPW=MULTIKEYHELPW tagMULTI_QI=MULTI_QI +tagNAMED_PROFILE_INFO=NAMED_PROFILE_INFO tagNCCALCSIZE_PARAMS=NCCALCSIZE_PARAMS tagNC_ADDRESS=NC_ADDRESS tagNEWCPLINFOA=NEWCPLINFOA @@ -1015,6 +1019,8 @@ tagPOLYTEXTW=POLYTEXTW tagPRINTPAGERANGE=PRINTPAGERANGE tagPROCESSENTRY32=PROCESSENTRY32 tagPROCESSENTRY32W=PROCESSENTRY32W +tagPROFILE=PROFILE +tagPROFILEHEADER=PROFILEHEADER tagPROPBAG2=PROPBAG2 tagPROPBAG2_TYPE=PROPBAG2_TYPE tagPROPPAGEINFO=PROPPAGEINFO @@ -4802,6 +4808,8 @@ _tagAUTOCOMPLETELISTOPTIONS=AUTOCOMPLETELISTOPTIONS _tagAUTOCOMPLETEOPTIONS=AUTOCOMPLETEOPTIONS _tagBINDINFO=BINDINFO _tagCODEBASEHOLD=CODEBASEHOLD +_tagCOLORMATCHSETUPA=COLORMATCHSETUPA +_tagCOLORMATCHSETUPW=COLORMATCHSETUPW _tagDATAINFO=DATAINFO _tagEDITBALLOONTIP=EDITBALLOONTIP _tagHIT_LOGGING_INFO=HIT_LOGGING_INFO diff --git a/sources/Interop/Windows/Windows/other/helper-types/HPROFILE.cs b/sources/Interop/Windows/Windows/other/helper-types/HPROFILE.cs new file mode 100644 index 0000000000..cfde0f6980 --- /dev/null +++ b/sources/Interop/Windows/Windows/other/helper-types/HPROFILE.cs @@ -0,0 +1,101 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +using System; + +namespace TerraFX.Interop.Windows; + +public readonly unsafe partial struct HPROFILE : IComparable, IComparable, IEquatable, IFormattable +{ + public readonly void* Value; + + public HPROFILE(void* value) + { + Value = value; + } + + public static HPROFILE INVALID_VALUE => new HPROFILE((void*)(-1)); + + public static HPROFILE NULL => new HPROFILE(null); + + public static bool operator ==(HPROFILE left, HPROFILE right) => left.Value == right.Value; + + public static bool operator !=(HPROFILE left, HPROFILE right) => left.Value != right.Value; + + public static bool operator <(HPROFILE left, HPROFILE right) => left.Value < right.Value; + + public static bool operator <=(HPROFILE left, HPROFILE right) => left.Value <= right.Value; + + public static bool operator >(HPROFILE left, HPROFILE right) => left.Value > right.Value; + + public static bool operator >=(HPROFILE left, HPROFILE right) => left.Value >= right.Value; + + public static explicit operator HPROFILE(void* value) => new HPROFILE(value); + + public static implicit operator void*(HPROFILE value) => value.Value; + + public static explicit operator HPROFILE(HANDLE value) => new HPROFILE(value); + + public static implicit operator HANDLE(HPROFILE value) => new HANDLE(value.Value); + + public static explicit operator HPROFILE(byte value) => new HPROFILE(unchecked((void*)(value))); + + public static explicit operator byte(HPROFILE value) => (byte)(value.Value); + + public static explicit operator HPROFILE(short value) => new HPROFILE(unchecked((void*)(value))); + + public static explicit operator short(HPROFILE value) => (short)(value.Value); + + public static explicit operator HPROFILE(int value) => new HPROFILE(unchecked((void*)(value))); + + public static explicit operator int(HPROFILE value) => (int)(value.Value); + + public static explicit operator HPROFILE(long value) => new HPROFILE(unchecked((void*)(value))); + + public static explicit operator long(HPROFILE value) => (long)(value.Value); + + public static explicit operator HPROFILE(nint value) => new HPROFILE(unchecked((void*)(value))); + + public static implicit operator nint(HPROFILE value) => (nint)(value.Value); + + public static explicit operator HPROFILE(sbyte value) => new HPROFILE(unchecked((void*)(value))); + + public static explicit operator sbyte(HPROFILE value) => (sbyte)(value.Value); + + public static explicit operator HPROFILE(ushort value) => new HPROFILE(unchecked((void*)(value))); + + public static explicit operator ushort(HPROFILE value) => (ushort)(value.Value); + + public static explicit operator HPROFILE(uint value) => new HPROFILE(unchecked((void*)(value))); + + public static explicit operator uint(HPROFILE value) => (uint)(value.Value); + + public static explicit operator HPROFILE(ulong value) => new HPROFILE(unchecked((void*)(value))); + + public static explicit operator ulong(HPROFILE value) => (ulong)(value.Value); + + public static explicit operator HPROFILE(nuint value) => new HPROFILE(unchecked((void*)(value))); + + public static implicit operator nuint(HPROFILE value) => (nuint)(value.Value); + + public int CompareTo(object? obj) + { + if (obj is HPROFILE other) + { + return CompareTo(other); + } + + return (obj is null) ? 1 : throw new ArgumentException("obj is not an instance of HPROFILE."); + } + + public int CompareTo(HPROFILE other) => ((nuint)(Value)).CompareTo((nuint)(other.Value)); + + public override bool Equals(object? obj) => (obj is HPROFILE other) && Equals(other); + + public bool Equals(HPROFILE other) => ((nuint)(Value)).Equals((nuint)(other.Value)); + + public override int GetHashCode() => ((nuint)(Value)).GetHashCode(); + + public override string ToString() => ((nuint)(Value)).ToString((sizeof(nint) == 4) ? "X8" : "X16"); + + public string ToString(string? format, IFormatProvider? formatProvider) => ((nuint)(Value)).ToString(format, formatProvider); +} diff --git a/sources/Interop/Windows/Windows/other/helper-types/HTRANSFORM.cs b/sources/Interop/Windows/Windows/other/helper-types/HTRANSFORM.cs new file mode 100644 index 0000000000..15dcab92fd --- /dev/null +++ b/sources/Interop/Windows/Windows/other/helper-types/HTRANSFORM.cs @@ -0,0 +1,101 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +using System; + +namespace TerraFX.Interop.Windows; + +public readonly unsafe partial struct HTRANSFORM : IComparable, IComparable, IEquatable, IFormattable +{ + public readonly void* Value; + + public HTRANSFORM(void* value) + { + Value = value; + } + + public static HTRANSFORM INVALID_VALUE => new HTRANSFORM((void*)(-1)); + + public static HTRANSFORM NULL => new HTRANSFORM(null); + + public static bool operator ==(HTRANSFORM left, HTRANSFORM right) => left.Value == right.Value; + + public static bool operator !=(HTRANSFORM left, HTRANSFORM right) => left.Value != right.Value; + + public static bool operator <(HTRANSFORM left, HTRANSFORM right) => left.Value < right.Value; + + public static bool operator <=(HTRANSFORM left, HTRANSFORM right) => left.Value <= right.Value; + + public static bool operator >(HTRANSFORM left, HTRANSFORM right) => left.Value > right.Value; + + public static bool operator >=(HTRANSFORM left, HTRANSFORM right) => left.Value >= right.Value; + + public static explicit operator HTRANSFORM(void* value) => new HTRANSFORM(value); + + public static implicit operator void*(HTRANSFORM value) => value.Value; + + public static explicit operator HTRANSFORM(HANDLE value) => new HTRANSFORM(value); + + public static implicit operator HANDLE(HTRANSFORM value) => new HANDLE(value.Value); + + public static explicit operator HTRANSFORM(byte value) => new HTRANSFORM(unchecked((void*)(value))); + + public static explicit operator byte(HTRANSFORM value) => (byte)(value.Value); + + public static explicit operator HTRANSFORM(short value) => new HTRANSFORM(unchecked((void*)(value))); + + public static explicit operator short(HTRANSFORM value) => (short)(value.Value); + + public static explicit operator HTRANSFORM(int value) => new HTRANSFORM(unchecked((void*)(value))); + + public static explicit operator int(HTRANSFORM value) => (int)(value.Value); + + public static explicit operator HTRANSFORM(long value) => new HTRANSFORM(unchecked((void*)(value))); + + public static explicit operator long(HTRANSFORM value) => (long)(value.Value); + + public static explicit operator HTRANSFORM(nint value) => new HTRANSFORM(unchecked((void*)(value))); + + public static implicit operator nint(HTRANSFORM value) => (nint)(value.Value); + + public static explicit operator HTRANSFORM(sbyte value) => new HTRANSFORM(unchecked((void*)(value))); + + public static explicit operator sbyte(HTRANSFORM value) => (sbyte)(value.Value); + + public static explicit operator HTRANSFORM(ushort value) => new HTRANSFORM(unchecked((void*)(value))); + + public static explicit operator ushort(HTRANSFORM value) => (ushort)(value.Value); + + public static explicit operator HTRANSFORM(uint value) => new HTRANSFORM(unchecked((void*)(value))); + + public static explicit operator uint(HTRANSFORM value) => (uint)(value.Value); + + public static explicit operator HTRANSFORM(ulong value) => new HTRANSFORM(unchecked((void*)(value))); + + public static explicit operator ulong(HTRANSFORM value) => (ulong)(value.Value); + + public static explicit operator HTRANSFORM(nuint value) => new HTRANSFORM(unchecked((void*)(value))); + + public static implicit operator nuint(HTRANSFORM value) => (nuint)(value.Value); + + public int CompareTo(object? obj) + { + if (obj is HTRANSFORM other) + { + return CompareTo(other); + } + + return (obj is null) ? 1 : throw new ArgumentException("obj is not an instance of HTRANSFORM."); + } + + public int CompareTo(HTRANSFORM other) => ((nuint)(Value)).CompareTo((nuint)(other.Value)); + + public override bool Equals(object? obj) => (obj is HTRANSFORM other) && Equals(other); + + public bool Equals(HTRANSFORM other) => ((nuint)(Value)).Equals((nuint)(other.Value)); + + public override int GetHashCode() => ((nuint)(Value)).GetHashCode(); + + public override string ToString() => ((nuint)(Value)).ToString((sizeof(nint) == 4) ? "X8" : "X16"); + + public string ToString(string? format, IFormatProvider? formatProvider) => ((nuint)(Value)).ToString(format, formatProvider); +} diff --git a/sources/Interop/Windows/Windows/um/CommCtrl/CDN.cs b/sources/Interop/Windows/Windows/um/CommCtrl/CDN.cs new file mode 100644 index 0000000000..a324941ee3 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommCtrl/CDN.cs @@ -0,0 +1,15 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/CommCtrl.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class CDN +{ + [NativeTypeName("#define CDN_FIRST (0U-601U)")] + public const uint CDN_FIRST = unchecked(0U - 601U); + + [NativeTypeName("#define CDN_LAST (0U-699U)")] + public const uint CDN_LAST = unchecked(0U - 699U); +} diff --git a/sources/Interop/Windows/Windows/um/CommCtrl/Windows.cs b/sources/Interop/Windows/Windows/um/CommCtrl/Windows.cs index d927c91d9e..d6b15a2770 100644 --- a/sources/Interop/Windows/Windows/um/CommCtrl/Windows.cs +++ b/sources/Interop/Windows/Windows/um/CommCtrl/Windows.cs @@ -355,12 +355,6 @@ public static HIMAGELIST IImageListToHIMAGELIST([NativeTypeName("struct IImageLi [NativeTypeName("#define TCN_LAST (0U-580U)")] public const uint TCN_LAST = unchecked(0U - 580U); - [NativeTypeName("#define CDN_FIRST (0U-601U)")] - public const uint CDN_FIRST = unchecked(0U - 601U); - - [NativeTypeName("#define CDN_LAST (0U-699U)")] - public const uint CDN_LAST = unchecked(0U - 699U); - [NativeTypeName("#define UDN_FIRST (0U-721U)")] public const uint UDN_FIRST = unchecked(0U - 721U); diff --git a/sources/Interop/Windows/Windows/um/SetupAPI/DICD.cs b/sources/Interop/Windows/Windows/um/SetupAPI/DICD.cs new file mode 100644 index 0000000000..3e57090131 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/SetupAPI/DICD.cs @@ -0,0 +1,15 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/SetupAPI.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class DICD +{ + [NativeTypeName("#define DICD_GENERATE_ID 0x00000001")] + public const int DICD_GENERATE_ID = 0x00000001; + + [NativeTypeName("#define DICD_INHERIT_CLASSDRVS 0x00000002")] + public const int DICD_INHERIT_CLASSDRVS = 0x00000002; +} diff --git a/sources/Interop/Windows/Windows/um/SetupAPI/Windows.cs b/sources/Interop/Windows/Windows/um/SetupAPI/Windows.cs index e9c95326b4..c6e76e3f2f 100644 --- a/sources/Interop/Windows/Windows/um/SetupAPI/Windows.cs +++ b/sources/Interop/Windows/Windows/um/SetupAPI/Windows.cs @@ -2076,12 +2076,6 @@ public static unsafe partial class Windows [NativeTypeName("#define SetupDiGetDeviceInfoListDetail SetupDiGetDeviceInfoListDetailW")] public static delegate* SetupDiGetDeviceInfoListDetail => &SetupDiGetDeviceInfoListDetailW; - [NativeTypeName("#define DICD_GENERATE_ID 0x00000001")] - public const int DICD_GENERATE_ID = 0x00000001; - - [NativeTypeName("#define DICD_INHERIT_CLASSDRVS 0x00000002")] - public const int DICD_INHERIT_CLASSDRVS = 0x00000002; - [NativeTypeName("#define SetupDiCreateDeviceInfo SetupDiCreateDeviceInfoW")] public static delegate* SetupDiCreateDeviceInfo => &SetupDiCreateDeviceInfoW; diff --git a/sources/Interop/Windows/Windows/um/icm/BMFORMAT.cs b/sources/Interop/Windows/Windows/um/icm/BMFORMAT.cs new file mode 100644 index 0000000000..9871070b64 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/BMFORMAT.cs @@ -0,0 +1,133 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public enum BMFORMAT +{ + /// + BM_x555RGB = 0x0000, + + /// + BM_x555XYZ = 0x0101, + + /// + BM_x555Yxy, + + /// + BM_x555Lab, + + /// + BM_x555G3CH, + + /// + BM_RGBTRIPLETS = 0x0002, + + /// + BM_BGRTRIPLETS = 0x0004, + + /// + BM_XYZTRIPLETS = 0x0201, + + /// + BM_YxyTRIPLETS, + + /// + BM_LabTRIPLETS, + + /// + BM_G3CHTRIPLETS, + + /// + BM_5CHANNEL, + + /// + BM_6CHANNEL, + + /// + BM_7CHANNEL, + + /// + BM_8CHANNEL, + + /// + BM_GRAY, + + /// + BM_xRGBQUADS = 0x0008, + + /// + BM_xBGRQUADS = 0x0010, + + /// + BM_xG3CHQUADS = 0x0304, + + /// + BM_KYMCQUADS, + + /// + BM_CMYKQUADS = 0x0020, + + /// + BM_10b_RGB = 0x0009, + + /// + BM_10b_XYZ = 0x0401, + + /// + BM_10b_Yxy, + + /// + BM_10b_Lab, + + /// + BM_10b_G3CH, + + /// + BM_NAMED_INDEX, + + /// + BM_16b_RGB = 0x000A, + + /// + BM_16b_XYZ = 0x0501, + + /// + BM_16b_Yxy, + + /// + BM_16b_Lab, + + /// + BM_16b_G3CH, + + /// + BM_16b_GRAY, + + /// + BM_565RGB = 0x0001, + + /// + BM_32b_scRGB = 0x0601, + + /// + BM_32b_scARGB = 0x0602, + + /// + BM_S2DOT13FIXED_scRGB = 0x0603, + + /// + BM_S2DOT13FIXED_scARGB = 0x0604, + + /// + BM_R10G10B10A2 = 0x0701, + + /// + BM_R10G10B10A2_XR = 0x0702, + + /// + BM_R16G16B16A16_FLOAT = 0x0703, +} diff --git a/sources/Interop/Windows/Windows/um/icm/CMYKCOLOR.cs b/sources/Interop/Windows/Windows/um/icm/CMYKCOLOR.cs new file mode 100644 index 0000000000..05aca8f9d9 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/CMYKCOLOR.cs @@ -0,0 +1,26 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct CMYKCOLOR +{ + /// + [NativeTypeName("WORD")] + public ushort cyan; + + /// + [NativeTypeName("WORD")] + public ushort magenta; + + /// + [NativeTypeName("WORD")] + public ushort yellow; + + /// + [NativeTypeName("WORD")] + public ushort black; +} diff --git a/sources/Interop/Windows/Windows/um/icm/COLOR.cs b/sources/Interop/Windows/Windows/um/icm/COLOR.cs new file mode 100644 index 0000000000..ebafdcd83f --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLOR.cs @@ -0,0 +1,104 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows; + +public static partial class COLOR +{ + /// + [StructLayout(LayoutKind.Explicit)] + public unsafe partial struct COLOR + { + /// + [FieldOffset(0)] + [NativeTypeName("struct GRAYCOLOR")] + public GRAYCOLOR gray; + + /// + [FieldOffset(0)] + [NativeTypeName("struct RGBCOLOR")] + public RGBCOLOR rgb; + + /// + [FieldOffset(0)] + [NativeTypeName("struct CMYKCOLOR")] + public CMYKCOLOR cmyk; + + /// + [FieldOffset(0)] + [NativeTypeName("struct XYZCOLOR")] + public XYZCOLOR XYZ; + + /// + [FieldOffset(0)] + [NativeTypeName("struct YxyCOLOR")] + public YxyCOLOR Yxy; + + /// + [FieldOffset(0)] + [NativeTypeName("struct LabCOLOR")] + public LabCOLOR Lab; + + /// + [FieldOffset(0)] + [NativeTypeName("struct GENERIC3CHANNEL")] + public GENERIC3CHANNEL gen3ch; + + /// + [FieldOffset(0)] + [NativeTypeName("struct NAMEDCOLOR")] + public NAMEDCOLOR named; + + /// + [FieldOffset(0)] + [NativeTypeName("struct HiFiCOLOR")] + public HiFiCOLOR hifi; + + /// + [FieldOffset(0)] + [NativeTypeName("__AnonymousRecord_icm_L127_C5")] + public _Anonymous_e__Struct Anonymous; + + /// + [UnscopedRef] + public ref uint reserved1 + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return ref Anonymous.reserved1; + } + } + + /// + [UnscopedRef] + public ref void* reserved2 + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return ref Anonymous.reserved2; + } + } + + /// + public unsafe partial struct _Anonymous_e__Struct + { + /// + [NativeTypeName("DWORD")] + public uint reserved1; + + /// + public void* reserved2; + } + } + + [NativeTypeName("#define COLOR_MATCH_VERSION 0x0200")] + public const int COLOR_MATCH_VERSION = 0x0200; +} diff --git a/sources/Interop/Windows/Windows/um/icm/COLORDATATYPE.cs b/sources/Interop/Windows/Windows/um/icm/COLORDATATYPE.cs new file mode 100644 index 0000000000..82d47bf269 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLORDATATYPE.cs @@ -0,0 +1,31 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public enum COLORDATATYPE +{ + /// + COLOR_BYTE = 1, + + /// + COLOR_WORD, + + /// + COLOR_FLOAT, + + /// + COLOR_S2DOT13FIXED, + + /// + COLOR_10b_R10G10B10A2, + + /// + COLOR_10b_R10G10B10A2_XR, + + /// + COLOR_FLOAT16, +} diff --git a/sources/Interop/Windows/Windows/um/icm/COLORMATCHSETUPA.cs b/sources/Interop/Windows/Windows/um/icm/COLORMATCHSETUPA.cs new file mode 100644 index 0000000000..a01c8d6efa --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLORMATCHSETUPA.cs @@ -0,0 +1,83 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct COLORMATCHSETUPA +{ + /// + [NativeTypeName("DWORD")] + public uint dwSize; + + /// + [NativeTypeName("DWORD")] + public uint dwVersion; + + /// + [NativeTypeName("DWORD")] + public uint dwFlags; + + /// + public HWND hwndOwner; + + /// + [NativeTypeName("PCSTR")] + public sbyte* pSourceName; + + /// + [NativeTypeName("PCSTR")] + public sbyte* pDisplayName; + + /// + [NativeTypeName("PCSTR")] + public sbyte* pPrinterName; + + /// + [NativeTypeName("DWORD")] + public uint dwRenderIntent; + + /// + [NativeTypeName("DWORD")] + public uint dwProofingIntent; + + /// + [NativeTypeName("PSTR")] + public sbyte* pMonitorProfile; + + /// + [NativeTypeName("DWORD")] + public uint ccMonitorProfile; + + /// + [NativeTypeName("PSTR")] + public sbyte* pPrinterProfile; + + /// + [NativeTypeName("DWORD")] + public uint ccPrinterProfile; + + /// + [NativeTypeName("PSTR")] + public sbyte* pTargetProfile; + + /// + [NativeTypeName("DWORD")] + public uint ccTargetProfile; + + /// + [NativeTypeName("DLGPROC")] + public delegate* unmanaged lpfnHook; + + /// + public LPARAM lParam; + + /// + [NativeTypeName("PCMSCALLBACKA")] + public delegate* unmanaged lpfnApplyCallback; + + /// + public LPARAM lParamApplyCallback; +} diff --git a/sources/Interop/Windows/Windows/um/icm/COLORMATCHSETUPW.cs b/sources/Interop/Windows/Windows/um/icm/COLORMATCHSETUPW.cs new file mode 100644 index 0000000000..ac37696ef7 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLORMATCHSETUPW.cs @@ -0,0 +1,83 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct COLORMATCHSETUPW +{ + /// + [NativeTypeName("DWORD")] + public uint dwSize; + + /// + [NativeTypeName("DWORD")] + public uint dwVersion; + + /// + [NativeTypeName("DWORD")] + public uint dwFlags; + + /// + public HWND hwndOwner; + + /// + [NativeTypeName("PCWSTR")] + public ushort* pSourceName; + + /// + [NativeTypeName("PCWSTR")] + public ushort* pDisplayName; + + /// + [NativeTypeName("PCWSTR")] + public ushort* pPrinterName; + + /// + [NativeTypeName("DWORD")] + public uint dwRenderIntent; + + /// + [NativeTypeName("DWORD")] + public uint dwProofingIntent; + + /// + [NativeTypeName("PWSTR")] + public ushort* pMonitorProfile; + + /// + [NativeTypeName("DWORD")] + public uint ccMonitorProfile; + + /// + [NativeTypeName("PWSTR")] + public ushort* pPrinterProfile; + + /// + [NativeTypeName("DWORD")] + public uint ccPrinterProfile; + + /// + [NativeTypeName("PWSTR")] + public ushort* pTargetProfile; + + /// + [NativeTypeName("DWORD")] + public uint ccTargetProfile; + + /// + [NativeTypeName("DLGPROC")] + public delegate* unmanaged lpfnHook; + + /// + public LPARAM lParam; + + /// + [NativeTypeName("PCMSCALLBACKW")] + public delegate* unmanaged lpfnApplyCallback; + + /// + public LPARAM lParamApplyCallback; +} diff --git a/sources/Interop/Windows/Windows/um/icm/COLORPROFILESUBTYPE.cs b/sources/Interop/Windows/Windows/um/icm/COLORPROFILESUBTYPE.cs new file mode 100644 index 0000000000..7852b6bace --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLORPROFILESUBTYPE.cs @@ -0,0 +1,37 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public enum COLORPROFILESUBTYPE +{ + /// + CPST_PERCEPTUAL = 0, + + /// + CPST_RELATIVE_COLORIMETRIC = 1, + + /// + CPST_SATURATION = 2, + + /// + CPST_ABSOLUTE_COLORIMETRIC = 3, + + /// + CPST_NONE, + + /// + CPST_RGB_WORKING_SPACE, + + /// + CPST_CUSTOM_WORKING_SPACE, + + /// + CPST_STANDARD_DISPLAY_COLOR_MODE, + + /// + CPST_EXTENDED_DISPLAY_COLOR_MODE, +} diff --git a/sources/Interop/Windows/Windows/um/icm/COLORPROFILETYPE.cs b/sources/Interop/Windows/Windows/um/icm/COLORPROFILETYPE.cs new file mode 100644 index 0000000000..40dde823b5 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLORPROFILETYPE.cs @@ -0,0 +1,22 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public enum COLORPROFILETYPE +{ + /// + CPT_ICC, + + /// + CPT_DMP, + + /// + CPT_CAMP, + + /// + CPT_GMMP, +} diff --git a/sources/Interop/Windows/Windows/um/icm/COLORTYPE.cs b/sources/Interop/Windows/Windows/um/icm/COLORTYPE.cs new file mode 100644 index 0000000000..3595b9c3d5 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLORTYPE.cs @@ -0,0 +1,46 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public enum COLORTYPE +{ + /// + COLOR_GRAY = 1, + + /// + COLOR_RGB, + + /// + COLOR_XYZ, + + /// + COLOR_Yxy, + + /// + COLOR_Lab, + + /// + COLOR_3_CHANNEL, + + /// + COLOR_CMYK, + + /// + COLOR_5_CHANNEL, + + /// + COLOR_6_CHANNEL, + + /// + COLOR_7_CHANNEL, + + /// + COLOR_8_CHANNEL, + + /// + COLOR_NAMED, +} diff --git a/sources/Interop/Windows/Windows/um/icm/ENABLE.cs b/sources/Interop/Windows/Windows/um/icm/ENABLE.cs new file mode 100644 index 0000000000..952d143c95 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/ENABLE.cs @@ -0,0 +1,12 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class ENABLE +{ + [NativeTypeName("#define ENABLE_GAMUT_CHECKING 0x00010000")] + public const int ENABLE_GAMUT_CHECKING = 0x00010000; +} diff --git a/sources/Interop/Windows/Windows/um/icm/ENUM.cs b/sources/Interop/Windows/Windows/um/icm/ENUM.cs new file mode 100644 index 0000000000..51d96eb46e --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/ENUM.cs @@ -0,0 +1,12 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class ENUM +{ + [NativeTypeName("#define ENUM_TYPE_VERSION 0x0300")] + public const int ENUM_TYPE_VERSION = 0x0300; +} diff --git a/sources/Interop/Windows/Windows/um/icm/ENUMTYPEA.cs b/sources/Interop/Windows/Windows/um/icm/ENUMTYPEA.cs new file mode 100644 index 0000000000..defc1ddc74 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/ENUMTYPEA.cs @@ -0,0 +1,90 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct ENUMTYPEA +{ + /// + [NativeTypeName("DWORD")] + public uint dwSize; + + /// + [NativeTypeName("DWORD")] + public uint dwVersion; + + /// + [NativeTypeName("DWORD")] + public uint dwFields; + + /// + [NativeTypeName("PCSTR")] + public sbyte* pDeviceName; + + /// + [NativeTypeName("DWORD")] + public uint dwMediaType; + + /// + [NativeTypeName("DWORD")] + public uint dwDitheringMode; + + /// + [NativeTypeName("DWORD[2]")] + public fixed uint dwResolution[2]; + + /// + [NativeTypeName("DWORD")] + public uint dwCMMType; + + /// + [NativeTypeName("DWORD")] + public uint dwClass; + + /// + [NativeTypeName("DWORD")] + public uint dwDataColorSpace; + + /// + [NativeTypeName("DWORD")] + public uint dwConnectionSpace; + + /// + [NativeTypeName("DWORD")] + public uint dwSignature; + + /// + [NativeTypeName("DWORD")] + public uint dwPlatform; + + /// + [NativeTypeName("DWORD")] + public uint dwProfileFlags; + + /// + [NativeTypeName("DWORD")] + public uint dwManufacturer; + + /// + [NativeTypeName("DWORD")] + public uint dwModel; + + /// + [NativeTypeName("DWORD[2]")] + public fixed uint dwAttributes[2]; + + /// + [NativeTypeName("DWORD")] + public uint dwRenderingIntent; + + /// + [NativeTypeName("DWORD")] + public uint dwCreator; + + /// + [NativeTypeName("DWORD")] + public uint dwDeviceClass; +} diff --git a/sources/Interop/Windows/Windows/um/icm/ENUMTYPEW.cs b/sources/Interop/Windows/Windows/um/icm/ENUMTYPEW.cs new file mode 100644 index 0000000000..a0f08a1ca8 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/ENUMTYPEW.cs @@ -0,0 +1,90 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct ENUMTYPEW +{ + /// + [NativeTypeName("DWORD")] + public uint dwSize; + + /// + [NativeTypeName("DWORD")] + public uint dwVersion; + + /// + [NativeTypeName("DWORD")] + public uint dwFields; + + /// + [NativeTypeName("PCWSTR")] + public ushort* pDeviceName; + + /// + [NativeTypeName("DWORD")] + public uint dwMediaType; + + /// + [NativeTypeName("DWORD")] + public uint dwDitheringMode; + + /// + [NativeTypeName("DWORD[2]")] + public fixed uint dwResolution[2]; + + /// + [NativeTypeName("DWORD")] + public uint dwCMMType; + + /// + [NativeTypeName("DWORD")] + public uint dwClass; + + /// + [NativeTypeName("DWORD")] + public uint dwDataColorSpace; + + /// + [NativeTypeName("DWORD")] + public uint dwConnectionSpace; + + /// + [NativeTypeName("DWORD")] + public uint dwSignature; + + /// + [NativeTypeName("DWORD")] + public uint dwPlatform; + + /// + [NativeTypeName("DWORD")] + public uint dwProfileFlags; + + /// + [NativeTypeName("DWORD")] + public uint dwManufacturer; + + /// + [NativeTypeName("DWORD")] + public uint dwModel; + + /// + [NativeTypeName("DWORD[2]")] + public fixed uint dwAttributes[2]; + + /// + [NativeTypeName("DWORD")] + public uint dwRenderingIntent; + + /// + [NativeTypeName("DWORD")] + public uint dwCreator; + + /// + [NativeTypeName("DWORD")] + public uint dwDeviceClass; +} diff --git a/sources/Interop/Windows/Windows/um/icm/FAST.cs b/sources/Interop/Windows/Windows/um/icm/FAST.cs new file mode 100644 index 0000000000..f4a30730e4 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/FAST.cs @@ -0,0 +1,12 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class FAST +{ + [NativeTypeName("#define FAST_TRANSLATE 0x00040000")] + public const int FAST_TRANSLATE = 0x00040000; +} diff --git a/sources/Interop/Windows/Windows/um/icm/FLAG.cs b/sources/Interop/Windows/Windows/um/icm/FLAG.cs new file mode 100644 index 0000000000..d620e9a080 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/FLAG.cs @@ -0,0 +1,18 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class FLAG +{ + [NativeTypeName("#define FLAG_EMBEDDEDPROFILE 0x00000001")] + public const int FLAG_EMBEDDEDPROFILE = 0x00000001; + + [NativeTypeName("#define FLAG_DEPENDENTONDATA 0x00000002")] + public const int FLAG_DEPENDENTONDATA = 0x00000002; + + [NativeTypeName("#define FLAG_ENABLE_CHROMATIC_ADAPTATION 0x02000000")] + public const int FLAG_ENABLE_CHROMATIC_ADAPTATION = 0x02000000; +} diff --git a/sources/Interop/Windows/Windows/um/icm/GENERIC3CHANNEL.cs b/sources/Interop/Windows/Windows/um/icm/GENERIC3CHANNEL.cs new file mode 100644 index 0000000000..5801e6185e --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/GENERIC3CHANNEL.cs @@ -0,0 +1,22 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct GENERIC3CHANNEL +{ + /// + [NativeTypeName("WORD")] + public ushort ch1; + + /// + [NativeTypeName("WORD")] + public ushort ch2; + + /// + [NativeTypeName("WORD")] + public ushort ch3; +} diff --git a/sources/Interop/Windows/Windows/um/icm/GRAYCOLOR.cs b/sources/Interop/Windows/Windows/um/icm/GRAYCOLOR.cs new file mode 100644 index 0000000000..8091495b4d --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/GRAYCOLOR.cs @@ -0,0 +1,14 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct GRAYCOLOR +{ + /// + [NativeTypeName("WORD")] + public ushort gray; +} diff --git a/sources/Interop/Windows/Windows/um/icm/HiFiCOLOR.cs b/sources/Interop/Windows/Windows/um/icm/HiFiCOLOR.cs new file mode 100644 index 0000000000..3e6323a036 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/HiFiCOLOR.cs @@ -0,0 +1,14 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct HiFiCOLOR +{ + /// + [NativeTypeName("BYTE[8]")] + public fixed byte channel[8]; +} diff --git a/sources/Interop/Windows/Windows/um/icm/LabCOLOR.cs b/sources/Interop/Windows/Windows/um/icm/LabCOLOR.cs new file mode 100644 index 0000000000..e85ca4926f --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/LabCOLOR.cs @@ -0,0 +1,22 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct LabCOLOR +{ + /// + [NativeTypeName("WORD")] + public ushort L; + + /// + [NativeTypeName("WORD")] + public ushort a; + + /// + [NativeTypeName("WORD")] + public ushort b; +} diff --git a/sources/Interop/Windows/Windows/um/icm/MAX.cs b/sources/Interop/Windows/Windows/um/icm/MAX.cs new file mode 100644 index 0000000000..a753b43e65 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/MAX.cs @@ -0,0 +1,12 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class MAX +{ + [NativeTypeName("#define MAX_COLOR_CHANNELS 8")] + public const int MAX_COLOR_CHANNELS = 8; +} diff --git a/sources/Interop/Windows/Windows/um/icm/NAMEDCOLOR.cs b/sources/Interop/Windows/Windows/um/icm/NAMEDCOLOR.cs new file mode 100644 index 0000000000..efdc373c5e --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/NAMEDCOLOR.cs @@ -0,0 +1,14 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct NAMEDCOLOR +{ + /// + [NativeTypeName("DWORD")] + public uint dwIndex; +} diff --git a/sources/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFO.cs b/sources/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFO.cs new file mode 100644 index 0000000000..0f32714998 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFO.cs @@ -0,0 +1,30 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct NAMED_PROFILE_INFO +{ + /// + [NativeTypeName("DWORD")] + public uint dwFlags; + + /// + [NativeTypeName("DWORD")] + public uint dwCount; + + /// + [NativeTypeName("DWORD")] + public uint dwCountDevCoordinates; + + /// + [NativeTypeName("COLOR_NAME")] + public fixed sbyte szPrefix[32]; + + /// + [NativeTypeName("COLOR_NAME")] + public fixed sbyte szSuffix[32]; +} diff --git a/sources/Interop/Windows/Windows/um/icm/PROFILE.cs b/sources/Interop/Windows/Windows/um/icm/PROFILE.cs new file mode 100644 index 0000000000..05fbe0da10 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/PROFILE.cs @@ -0,0 +1,22 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct PROFILE +{ + /// + [NativeTypeName("DWORD")] + public uint dwType; + + /// + [NativeTypeName("PVOID")] + public void* pProfileData; + + /// + [NativeTypeName("DWORD")] + public uint cbDataSize; +} diff --git a/sources/Interop/Windows/Windows/um/icm/PROFILEHEADER.cs b/sources/Interop/Windows/Windows/um/icm/PROFILEHEADER.cs new file mode 100644 index 0000000000..568ebbc430 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/PROFILEHEADER.cs @@ -0,0 +1,77 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct PROFILEHEADER +{ + /// + [NativeTypeName("DWORD")] + public uint phSize; + + /// + [NativeTypeName("DWORD")] + public uint phCMMType; + + /// + [NativeTypeName("DWORD")] + public uint phVersion; + + /// + [NativeTypeName("DWORD")] + public uint phClass; + + /// + [NativeTypeName("DWORD")] + public uint phDataColorSpace; + + /// + [NativeTypeName("DWORD")] + public uint phConnectionSpace; + + /// + [NativeTypeName("DWORD[3]")] + public fixed uint phDateTime[3]; + + /// + [NativeTypeName("DWORD")] + public uint phSignature; + + /// + [NativeTypeName("DWORD")] + public uint phPlatform; + + /// + [NativeTypeName("DWORD")] + public uint phProfileFlags; + + /// + [NativeTypeName("DWORD")] + public uint phManufacturer; + + /// + [NativeTypeName("DWORD")] + public uint phModel; + + /// + [NativeTypeName("DWORD[2]")] + public fixed uint phAttributes[2]; + + /// + [NativeTypeName("DWORD")] + public uint phRenderingIntent; + + /// + public CIEXYZ phIlluminant; + + /// + [NativeTypeName("DWORD")] + public uint phCreator; + + /// + [NativeTypeName("BYTE[44]")] + public fixed byte phReserved[44]; +} diff --git a/sources/Interop/Windows/Windows/um/icm/RGBCOLOR.cs b/sources/Interop/Windows/Windows/um/icm/RGBCOLOR.cs new file mode 100644 index 0000000000..e17b447629 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/RGBCOLOR.cs @@ -0,0 +1,22 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct RGBCOLOR +{ + /// + [NativeTypeName("WORD")] + public ushort red; + + /// + [NativeTypeName("WORD")] + public ushort green; + + /// + [NativeTypeName("WORD")] + public ushort blue; +} diff --git a/sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_CAPABILITIES_TYPE.cs b/sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_CAPABILITIES_TYPE.cs new file mode 100644 index 0000000000..7b48dee8bd --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_CAPABILITIES_TYPE.cs @@ -0,0 +1,16 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public enum WCS_DEVICE_CAPABILITIES_TYPE +{ + /// + VideoCardGammaTable = 1, + + /// + MicrosoftHardwareColorV2 = 2, +} diff --git a/sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_MHC2_CAPABILITIES.cs b/sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_MHC2_CAPABILITIES.cs new file mode 100644 index 0000000000..03b12bcbc3 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_MHC2_CAPABILITIES.cs @@ -0,0 +1,25 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct WCS_DEVICE_MHC2_CAPABILITIES +{ + /// + public uint Size; + + /// + public BOOL SupportsMhc2; + + /// + public uint RegammaLutEntryCount; + + /// + public uint CscXyzMatrixRows; + + /// + public uint CscXyzMatrixColumns; +} diff --git a/sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_VCGT_CAPABILITIES.cs b/sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_VCGT_CAPABILITIES.cs new file mode 100644 index 0000000000..c79de99b24 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/WCS_DEVICE_VCGT_CAPABILITIES.cs @@ -0,0 +1,16 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct WCS_DEVICE_VCGT_CAPABILITIES +{ + /// + public uint Size; + + /// + public BOOL SupportsVcgt; +} diff --git a/sources/Interop/Windows/Windows/um/icm/WCS_PROFILE_MANAGEMENT_SCOPE.cs b/sources/Interop/Windows/Windows/um/icm/WCS_PROFILE_MANAGEMENT_SCOPE.cs new file mode 100644 index 0000000000..1ea815abf4 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/WCS_PROFILE_MANAGEMENT_SCOPE.cs @@ -0,0 +1,16 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public enum WCS_PROFILE_MANAGEMENT_SCOPE +{ + /// + WCS_PROFILE_MANAGEMENT_SCOPE_SYSTEM_WIDE, + + /// + WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER, +} diff --git a/sources/Interop/Windows/Windows/um/icm/Windows.cs b/sources/Interop/Windows/Windows/um/icm/Windows.cs new file mode 100644 index 0000000000..e6727bd5de --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/Windows.cs @@ -0,0 +1,866 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System.Runtime.InteropServices; +using System.Runtime.Versioning; + +namespace TerraFX.Interop.Windows; + +public static unsafe partial class Windows +{ + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern HPROFILE OpenColorProfileA([NativeTypeName("PPROFILE")] PROFILE* pProfile, [NativeTypeName("DWORD")] uint dwDesiredAccess, [NativeTypeName("DWORD")] uint dwShareMode, [NativeTypeName("DWORD")] uint dwCreationMode); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern HPROFILE OpenColorProfileW([NativeTypeName("PPROFILE")] PROFILE* pProfile, [NativeTypeName("DWORD")] uint dwDesiredAccess, [NativeTypeName("DWORD")] uint dwShareMode, [NativeTypeName("DWORD")] uint dwCreationMode); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL CloseColorProfile(HPROFILE hProfile); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetColorProfileFromHandle(HPROFILE hProfile, [NativeTypeName("PBYTE")] byte* pProfile, [NativeTypeName("PDWORD")] uint* pcbProfile); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL IsColorProfileValid(HPROFILE hProfile, [NativeTypeName("PBOOL")] BOOL* pbValid); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL CreateProfileFromLogColorSpaceA([NativeTypeName("LPLOGCOLORSPACEA")] LOGCOLORSPACEA* pLogColorSpace, [NativeTypeName("PBYTE *")] byte** pProfile); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL CreateProfileFromLogColorSpaceW([NativeTypeName("LPLOGCOLORSPACEW")] LOGCOLORSPACEW* pLogColorSpace, [NativeTypeName("PBYTE *")] byte** pProfile); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetCountColorProfileElements(HPROFILE hProfile, [NativeTypeName("PDWORD")] uint* pnElementCount); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetColorProfileHeader(HPROFILE hProfile, [NativeTypeName("PPROFILEHEADER")] PROFILEHEADER* pHeader); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetColorProfileElementTag(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIndex, [NativeTypeName("PTAGTYPE")] uint* pTag); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL IsColorProfileTagPresent(HPROFILE hProfile, [NativeTypeName("TAGTYPE")] uint tag, [NativeTypeName("PBOOL")] BOOL* pbPresent); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetColorProfileElement(HPROFILE hProfile, [NativeTypeName("TAGTYPE")] uint tag, [NativeTypeName("DWORD")] uint dwOffset, [NativeTypeName("PDWORD")] uint* pcbElement, [NativeTypeName("PVOID")] void* pElement, [NativeTypeName("PBOOL")] BOOL* pbReference); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL SetColorProfileHeader(HPROFILE hProfile, [NativeTypeName("PPROFILEHEADER")] PROFILEHEADER* pHeader); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL SetColorProfileElementSize(HPROFILE hProfile, [NativeTypeName("TAGTYPE")] uint tagType, [NativeTypeName("DWORD")] uint pcbElement); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL SetColorProfileElement(HPROFILE hProfile, [NativeTypeName("TAGTYPE")] uint tag, [NativeTypeName("DWORD")] uint dwOffset, [NativeTypeName("PDWORD")] uint* pcbElement, [NativeTypeName("PVOID")] void* pElement); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL SetColorProfileElementReference(HPROFILE hProfile, [NativeTypeName("TAGTYPE")] uint newTag, [NativeTypeName("TAGTYPE")] uint refTag); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetPS2ColorSpaceArray(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("DWORD")] uint dwCSAType, [NativeTypeName("PBYTE")] byte* pPS2ColorSpaceArray, [NativeTypeName("PDWORD")] uint* pcbPS2ColorSpaceArray, [NativeTypeName("PBOOL")] BOOL* pbBinary); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetPS2ColorRenderingIntent(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("PBYTE")] byte* pBuffer, [NativeTypeName("PDWORD")] uint* pcbPS2ColorRenderingIntent); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL GetPS2ColorRenderingDictionary(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("PBYTE")] byte* pPS2ColorRenderingDictionary, [NativeTypeName("PDWORD")] uint* pcbPS2ColorRenderingDictionary, [NativeTypeName("PBOOL")] BOOL* pbBinary); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL GetNamedProfileInfo(HPROFILE hProfile, [NativeTypeName("PNAMED_PROFILE_INFO")] NAMED_PROFILE_INFO* pNamedProfileInfo); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL ConvertColorNameToIndex(HPROFILE hProfile, [NativeTypeName("PCOLOR_NAME")] sbyte** paColorName, [NativeTypeName("PDWORD")] uint* paIndex, [NativeTypeName("DWORD")] uint dwCount); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL ConvertIndexToColorName(HPROFILE hProfile, [NativeTypeName("PDWORD")] uint* paIndex, [NativeTypeName("PCOLOR_NAME")] sbyte** paColorName, [NativeTypeName("DWORD")] uint dwCount); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL CreateDeviceLinkProfile([NativeTypeName("PHPROFILE")] HPROFILE* hProfile, [NativeTypeName("DWORD")] uint nProfiles, [NativeTypeName("PDWORD")] uint* padwIntent, [NativeTypeName("DWORD")] uint nIntents, [NativeTypeName("DWORD")] uint dwFlags, [NativeTypeName("PBYTE *")] byte** pProfileData, [NativeTypeName("DWORD")] uint indexPreferredCMM); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern HTRANSFORM CreateColorTransformA([NativeTypeName("LPLOGCOLORSPACEA")] LOGCOLORSPACEA* pLogColorSpace, HPROFILE hDestProfile, HPROFILE hTargetProfile, [NativeTypeName("DWORD")] uint dwFlags); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern HTRANSFORM CreateColorTransformW([NativeTypeName("LPLOGCOLORSPACEW")] LOGCOLORSPACEW* pLogColorSpace, HPROFILE hDestProfile, HPROFILE hTargetProfile, [NativeTypeName("DWORD")] uint dwFlags); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern HTRANSFORM CreateMultiProfileTransform([NativeTypeName("PHPROFILE")] HPROFILE* pahProfiles, [NativeTypeName("DWORD")] uint nProfiles, [NativeTypeName("PDWORD")] uint* padwIntent, [NativeTypeName("DWORD")] uint nIntents, [NativeTypeName("DWORD")] uint dwFlags, [NativeTypeName("DWORD")] uint indexPreferredCMM); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL DeleteColorTransform(HTRANSFORM hxform); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL TranslateBitmapBits(HTRANSFORM hColorTransform, [NativeTypeName("PVOID")] void* pSrcBits, BMFORMAT bmInput, [NativeTypeName("DWORD")] uint dwWidth, [NativeTypeName("DWORD")] uint dwHeight, [NativeTypeName("DWORD")] uint dwInputStride, [NativeTypeName("PVOID")] void* pDestBits, BMFORMAT bmOutput, [NativeTypeName("DWORD")] uint dwOutputStride, [NativeTypeName("PBMCALLBACKFN")] delegate* unmanaged pfnCallBack, LPARAM ulCallbackData); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL CheckBitmapBits(HTRANSFORM hColorTransform, [NativeTypeName("PVOID")] void* pSrcBits, BMFORMAT bmInput, [NativeTypeName("DWORD")] uint dwWidth, [NativeTypeName("DWORD")] uint dwHeight, [NativeTypeName("DWORD")] uint dwStride, [NativeTypeName("PBYTE")] byte* paResult, [NativeTypeName("PBMCALLBACKFN")] delegate* unmanaged pfnCallback, LPARAM lpCallbackData); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL TranslateColors(HTRANSFORM hColorTransform, [NativeTypeName("PCOLOR")] COLOR* paInputColors, [NativeTypeName("DWORD")] uint nColors, COLORTYPE ctInput, [NativeTypeName("PCOLOR")] COLOR* paOutputColors, COLORTYPE ctOutput); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL CheckColors(HTRANSFORM hColorTransform, [NativeTypeName("PCOLOR")] COLOR* paInputColors, [NativeTypeName("DWORD")] uint nColors, COLORTYPE ctInput, [NativeTypeName("PBYTE")] byte* paResult); + + /// + [DllImport("mscms", ExactSpelling = true)] + [return: NativeTypeName("DWORD")] + public static extern uint GetCMMInfo(HTRANSFORM hColorTransform, [NativeTypeName("DWORD")] uint param1); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL RegisterCMMA([NativeTypeName("PCSTR")] sbyte* pMachineName, [NativeTypeName("DWORD")] uint cmmID, [NativeTypeName("PCSTR")] sbyte* pCMMdll); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL RegisterCMMW([NativeTypeName("PCWSTR")] ushort* pMachineName, [NativeTypeName("DWORD")] uint cmmID, [NativeTypeName("PCWSTR")] ushort* pCMMdll); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL UnregisterCMMA([NativeTypeName("PCSTR")] sbyte* pMachineName, [NativeTypeName("DWORD")] uint cmmID); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL UnregisterCMMW([NativeTypeName("PCWSTR")] ushort* pMachineName, [NativeTypeName("DWORD")] uint cmmID); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL SelectCMM([NativeTypeName("DWORD")] uint dwCMMType); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetColorDirectoryA([NativeTypeName("PCSTR")] sbyte* pMachineName, [NativeTypeName("PSTR")] sbyte* pBuffer, [NativeTypeName("PDWORD")] uint* pdwSize); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetColorDirectoryW([NativeTypeName("PCWSTR")] ushort* pMachineName, [NativeTypeName("PWSTR")] ushort* pBuffer, [NativeTypeName("PDWORD")] uint* pdwSize); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL InstallColorProfileA([NativeTypeName("PCSTR")] sbyte* pMachineName, [NativeTypeName("PCSTR")] sbyte* pProfileName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL InstallColorProfileW([NativeTypeName("PCWSTR")] ushort* pMachineName, [NativeTypeName("PCWSTR")] ushort* pProfileName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL UninstallColorProfileA([NativeTypeName("PCSTR")] sbyte* pMachineName, [NativeTypeName("PCSTR")] sbyte* pProfileName, BOOL bDelete); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL UninstallColorProfileW([NativeTypeName("PCWSTR")] ushort* pMachineName, [NativeTypeName("PCWSTR")] ushort* pProfileName, BOOL bDelete); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL EnumColorProfilesA([NativeTypeName("PCSTR")] sbyte* pMachineName, [NativeTypeName("PENUMTYPEA")] ENUMTYPEA* pEnumRecord, [NativeTypeName("PBYTE")] byte* pEnumerationBuffer, [NativeTypeName("PDWORD")] uint* pdwSizeOfEnumerationBuffer, [NativeTypeName("PDWORD")] uint* pnProfiles); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL EnumColorProfilesW([NativeTypeName("PCWSTR")] ushort* pMachineName, [NativeTypeName("PENUMTYPEW")] ENUMTYPEW* pEnumRecord, [NativeTypeName("PBYTE")] byte* pEnumerationBuffer, [NativeTypeName("PDWORD")] uint* pdwSizeOfEnumerationBuffer, [NativeTypeName("PDWORD")] uint* pnProfiles); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL SetStandardColorSpaceProfileA([NativeTypeName("PCSTR")] sbyte* pMachineName, [NativeTypeName("DWORD")] uint dwProfileID, [NativeTypeName("PCSTR")] sbyte* pProfilename); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL SetStandardColorSpaceProfileW([NativeTypeName("PCWSTR")] ushort* pMachineName, [NativeTypeName("DWORD")] uint dwProfileID, [NativeTypeName("PCWSTR")] ushort* pProfileName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetStandardColorSpaceProfileA([NativeTypeName("PCSTR")] sbyte* pMachineName, [NativeTypeName("DWORD")] uint dwSCS, [NativeTypeName("PSTR")] sbyte* pBuffer, [NativeTypeName("PDWORD")] uint* pcbSize); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL GetStandardColorSpaceProfileW([NativeTypeName("PCWSTR")] ushort* pMachineName, [NativeTypeName("DWORD")] uint dwSCS, [NativeTypeName("PWSTR")] ushort* pBuffer, [NativeTypeName("PDWORD")] uint* pcbSize); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern BOOL AssociateColorProfileWithDeviceA([NativeTypeName("PCSTR")] sbyte* pMachineName, [NativeTypeName("PCSTR")] sbyte* pProfileName, [NativeTypeName("PCSTR")] sbyte* pDeviceName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL AssociateColorProfileWithDeviceW([NativeTypeName("PCWSTR")] ushort* pMachineName, [NativeTypeName("PCWSTR")] ushort* pProfileName, [NativeTypeName("PCWSTR")] ushort* pDeviceName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL DisassociateColorProfileFromDeviceA([NativeTypeName("PCSTR")] sbyte* pMachineName, [NativeTypeName("PCSTR")] sbyte* pProfileName, [NativeTypeName("PCSTR")] sbyte* pDeviceName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL DisassociateColorProfileFromDeviceW([NativeTypeName("PCWSTR")] ushort* pMachineName, [NativeTypeName("PCWSTR")] ushort* pProfileName, [NativeTypeName("PCWSTR")] ushort* pDeviceName); + + /// + [DllImport("icmui", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL SetupColorMatchingW([NativeTypeName("PCOLORMATCHSETUPW")] COLORMATCHSETUPW* pcms); + + /// + [DllImport("icmui", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL SetupColorMatchingA([NativeTypeName("PCOLORMATCHSETUPA")] COLORMATCHSETUPA* pcms); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsAssociateColorProfileWithDevice(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PCWSTR")] ushort* pProfileName, [NativeTypeName("PCWSTR")] ushort* pDeviceName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsDisassociateColorProfileFromDevice(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PCWSTR")] ushort* pProfileName, [NativeTypeName("PCWSTR")] ushort* pDeviceName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsEnumColorProfilesSize(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PENUMTYPEW")] ENUMTYPEW* pEnumRecord, [NativeTypeName("PDWORD")] uint* pdwSize); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsEnumColorProfiles(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PENUMTYPEW")] ENUMTYPEW* pEnumRecord, [NativeTypeName("PBYTE")] byte* pBuffer, [NativeTypeName("DWORD")] uint dwSize, [NativeTypeName("PDWORD")] uint* pnProfiles); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsGetDefaultColorProfileSize(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PCWSTR")] ushort* pDeviceName, COLORPROFILETYPE cptColorProfileType, COLORPROFILESUBTYPE cpstColorProfileSubType, [NativeTypeName("DWORD")] uint dwProfileID, [NativeTypeName("PDWORD")] uint* pcbProfileName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsGetDefaultColorProfile(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PCWSTR")] ushort* pDeviceName, COLORPROFILETYPE cptColorProfileType, COLORPROFILESUBTYPE cpstColorProfileSubType, [NativeTypeName("DWORD")] uint dwProfileID, [NativeTypeName("DWORD")] uint cbProfileName, [NativeTypeName("LPWSTR")] ushort* pProfileName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsSetDefaultColorProfile(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PCWSTR")] ushort* pDeviceName, COLORPROFILETYPE cptColorProfileType, COLORPROFILESUBTYPE cpstColorProfileSubType, [NativeTypeName("DWORD")] uint dwProfileID, [NativeTypeName("LPCWSTR")] ushort* pProfileName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsSetDefaultRenderingIntent(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("DWORD")] uint dwRenderingIntent); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsGetDefaultRenderingIntent(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PDWORD")] uint* pdwRenderingIntent); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsGetUsePerUserProfiles([NativeTypeName("LPCWSTR")] ushort* pDeviceName, [NativeTypeName("DWORD")] uint dwDeviceClass, [NativeTypeName("PBOOL")] BOOL* pUsePerUserProfiles); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsSetUsePerUserProfiles([NativeTypeName("LPCWSTR")] ushort* pDeviceName, [NativeTypeName("DWORD")] uint dwDeviceClass, BOOL usePerUserProfiles); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsTranslateColors(HTRANSFORM hColorTransform, [NativeTypeName("DWORD")] uint nColors, [NativeTypeName("DWORD")] uint nInputChannels, COLORDATATYPE cdtInput, [NativeTypeName("DWORD")] uint cbInput, [NativeTypeName("PVOID")] void* pInputData, [NativeTypeName("DWORD")] uint nOutputChannels, COLORDATATYPE cdtOutput, [NativeTypeName("DWORD")] uint cbOutput, [NativeTypeName("PVOID")] void* pOutputData); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL WcsCheckColors(HTRANSFORM hColorTransform, [NativeTypeName("DWORD")] uint nColors, [NativeTypeName("DWORD")] uint nInputChannels, COLORDATATYPE cdtInput, [NativeTypeName("DWORD")] uint cbInput, [NativeTypeName("PVOID")] void* pInputData, [NativeTypeName("PBYTE")] byte* paResult); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL CMCheckColors(HCMTRANSFORM hcmTransform, [NativeTypeName("LPCOLOR")] COLOR* lpaInputColors, [NativeTypeName("DWORD")] uint nColors, COLORTYPE ctInput, [NativeTypeName("LPBYTE")] byte* lpaResult); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern BOOL CMCheckRGBs(HCMTRANSFORM hcmTransform, [NativeTypeName("LPVOID")] void* lpSrcBits, BMFORMAT bmInput, [NativeTypeName("DWORD")] uint dwWidth, [NativeTypeName("DWORD")] uint dwHeight, [NativeTypeName("DWORD")] uint dwStride, [NativeTypeName("LPBYTE")] byte* lpaResult, [NativeTypeName("PBMCALLBACKFN")] delegate* unmanaged pfnCallback, LPARAM ulCallbackData); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL CMConvertColorNameToIndex(HPROFILE hProfile, [NativeTypeName("PCOLOR_NAME")] sbyte** paColorName, [NativeTypeName("PDWORD")] uint* paIndex, [NativeTypeName("DWORD")] uint dwCount); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL CMConvertIndexToColorName(HPROFILE hProfile, [NativeTypeName("PDWORD")] uint* paIndex, [NativeTypeName("PCOLOR_NAME")] sbyte** paColorName, [NativeTypeName("DWORD")] uint dwCount); + + /// + [DllImport("icm32", ExactSpelling = true)] + public static extern BOOL CMCreateDeviceLinkProfile([NativeTypeName("PHPROFILE")] HPROFILE* pahProfiles, [NativeTypeName("DWORD")] uint nProfiles, [NativeTypeName("PDWORD")] uint* padwIntents, [NativeTypeName("DWORD")] uint nIntents, [NativeTypeName("DWORD")] uint dwFlags, [NativeTypeName("LPBYTE *")] byte** lpProfileData); + + /// + [DllImport("icm32", ExactSpelling = true)] + public static extern HCMTRANSFORM CMCreateMultiProfileTransform([NativeTypeName("PHPROFILE")] HPROFILE* pahProfiles, [NativeTypeName("DWORD")] uint nProfiles, [NativeTypeName("PDWORD")] uint* padwIntents, [NativeTypeName("DWORD")] uint nIntents, [NativeTypeName("DWORD")] uint dwFlags); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL CMCreateProfileW([NativeTypeName("LPLOGCOLORSPACEW")] LOGCOLORSPACEW* lpColorSpace, [NativeTypeName("LPDEVCHARACTER *")] void** lpProfileData); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern HCMTRANSFORM CMCreateTransform([NativeTypeName("LPLOGCOLORSPACEA")] LOGCOLORSPACEA* lpColorSpace, [NativeTypeName("LPDEVCHARACTER")] void* lpDevCharacter, [NativeTypeName("LPDEVCHARACTER")] void* lpTargetDevCharacter); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern HCMTRANSFORM CMCreateTransformW([NativeTypeName("LPLOGCOLORSPACEW")] LOGCOLORSPACEW* lpColorSpace, [NativeTypeName("LPDEVCHARACTER")] void* lpDevCharacter, [NativeTypeName("LPDEVCHARACTER")] void* lpTargetDevCharacter); + + /// + [DllImport("icm32", ExactSpelling = true)] + public static extern HCMTRANSFORM CMCreateTransformExt([NativeTypeName("LPLOGCOLORSPACEA")] LOGCOLORSPACEA* lpColorSpace, [NativeTypeName("LPDEVCHARACTER")] void* lpDevCharacter, [NativeTypeName("LPDEVCHARACTER")] void* lpTargetDevCharacter, [NativeTypeName("DWORD")] uint dwFlags); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL CMCheckColorsInGamut(HCMTRANSFORM hcmTransform, RGBTRIPLE* lpaRGBTriple, [NativeTypeName("LPBYTE")] byte* lpaResult, uint nCount); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL CMCreateProfile([NativeTypeName("LPLOGCOLORSPACEA")] LOGCOLORSPACEA* lpColorSpace, [NativeTypeName("LPDEVCHARACTER *")] void** lpProfileData); + + /// + [DllImport("icm32", ExactSpelling = true)] + public static extern BOOL CMTranslateRGB(HCMTRANSFORM hcmTransform, COLORREF ColorRef, [NativeTypeName("LPCOLORREF")] uint* lpColorRef, [NativeTypeName("DWORD")] uint dwFlags); + + /// + [DllImport("icm32", ExactSpelling = true)] + [SetsLastSystemError] + public static extern BOOL CMTranslateRGBs(HCMTRANSFORM hcmTransform, [NativeTypeName("LPVOID")] void* lpSrcBits, BMFORMAT bmInput, [NativeTypeName("DWORD")] uint dwWidth, [NativeTypeName("DWORD")] uint dwHeight, [NativeTypeName("DWORD")] uint dwStride, [NativeTypeName("LPVOID")] void* lpDestBits, BMFORMAT bmOutput, [NativeTypeName("DWORD")] uint dwTranslateDirection); + + /// + [DllImport("icm32", ExactSpelling = true)] + public static extern HCMTRANSFORM CMCreateTransformExtW([NativeTypeName("LPLOGCOLORSPACEW")] LOGCOLORSPACEW* lpColorSpace, [NativeTypeName("LPDEVCHARACTER")] void* lpDevCharacter, [NativeTypeName("LPDEVCHARACTER")] void* lpTargetDevCharacter, [NativeTypeName("DWORD")] uint dwFlags); + + /// + [DllImport("icm32", ExactSpelling = true)] + public static extern BOOL CMDeleteTransform(HCMTRANSFORM hcmTransform); + + /// + [DllImport("mscms", ExactSpelling = true)] + [return: NativeTypeName("DWORD")] + public static extern uint CMGetInfo([NativeTypeName("DWORD")] uint dwInfo); + + /// + [DllImport("icm32", ExactSpelling = true)] + public static extern BOOL CMGetNamedProfileInfo(HPROFILE hProfile, [NativeTypeName("PNAMED_PROFILE_INFO")] NAMED_PROFILE_INFO* pNamedProfileInfo); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern BOOL CMGetPS2ColorRenderingDictionary(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("LPBYTE")] byte* lpBuffer, [NativeTypeName("LPDWORD")] uint* lpcbSize, [NativeTypeName("LPBOOL")] BOOL* lpbBinary); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL CMGetPS2ColorRenderingIntent(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("LPBYTE")] byte* lpBuffer, [NativeTypeName("LPDWORD")] uint* lpcbSize); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern BOOL CMGetPS2ColorSpaceArray(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("DWORD")] uint dwCSAType, [NativeTypeName("LPBYTE")] byte* lpBuffer, [NativeTypeName("LPDWORD")] uint* lpcbSize, [NativeTypeName("LPBOOL")] BOOL* lpbBinary); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL CMIsProfileValid(HPROFILE hProfile, [NativeTypeName("LPBOOL")] BOOL* lpbValid); + + /// + [DllImport("icm32", ExactSpelling = true)] + public static extern BOOL CMTranslateColors(HCMTRANSFORM hcmTransform, [NativeTypeName("LPCOLOR")] COLOR* lpaInputColors, [NativeTypeName("DWORD")] uint nColors, COLORTYPE ctInput, [NativeTypeName("LPCOLOR")] COLOR* lpaOutputColors, COLORTYPE ctOutput); + + /// + [DllImport("icm32", ExactSpelling = true)] + public static extern BOOL CMTranslateRGBsExt(HCMTRANSFORM hcmTransform, [NativeTypeName("LPVOID")] void* lpSrcBits, BMFORMAT bmInput, [NativeTypeName("DWORD")] uint dwWidth, [NativeTypeName("DWORD")] uint dwHeight, [NativeTypeName("DWORD")] uint dwInputStride, [NativeTypeName("LPVOID")] void* lpDestBits, BMFORMAT bmOutput, [NativeTypeName("DWORD")] uint dwOutputStride, [NativeTypeName("LPBMCALLBACKFN")] delegate* unmanaged lpfnCallback, LPARAM ulCallbackData); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern HPROFILE WcsOpenColorProfileA([NativeTypeName("PPROFILE")] PROFILE* pCDMPProfile, [NativeTypeName("PPROFILE")] PROFILE* pCAMPProfile, [NativeTypeName("PPROFILE")] PROFILE* pGMMPProfile, [NativeTypeName("DWORD")] uint dwDesireAccess, [NativeTypeName("DWORD")] uint dwShareMode, [NativeTypeName("DWORD")] uint dwCreationMode, [NativeTypeName("DWORD")] uint dwFlags); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern HPROFILE WcsOpenColorProfileW([NativeTypeName("PPROFILE")] PROFILE* pCDMPProfile, [NativeTypeName("PPROFILE")] PROFILE* pCAMPProfile, [NativeTypeName("PPROFILE")] PROFILE* pGMMPProfile, [NativeTypeName("DWORD")] uint dwDesireAccess, [NativeTypeName("DWORD")] uint dwShareMode, [NativeTypeName("DWORD")] uint dwCreationMode, [NativeTypeName("DWORD")] uint dwFlags); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SetsLastSystemError] + public static extern HPROFILE WcsCreateIccProfile(HPROFILE hWcsProfile, [NativeTypeName("DWORD")] uint dwOptions); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL WcsGetCalibrationManagementState(BOOL* pbIsEnabled); + + /// + [DllImport("mscms", ExactSpelling = true)] + public static extern BOOL WcsSetCalibrationManagementState(BOOL bIsEnabled); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern HRESULT ColorProfileAddDisplayAssociation(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PCWSTR")] ushort* profileName, LUID targetAdapterID, [NativeTypeName("UINT32")] uint sourceID, BOOL setAsDefault, BOOL associateAsAdvancedColor); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern HRESULT ColorProfileRemoveDisplayAssociation(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PCWSTR")] ushort* profileName, LUID targetAdapterID, [NativeTypeName("UINT32")] uint sourceID, BOOL dissociateAdvancedColor); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern HRESULT ColorProfileSetDisplayDefaultAssociation(WCS_PROFILE_MANAGEMENT_SCOPE scope, [NativeTypeName("PCWSTR")] ushort* profileName, COLORPROFILETYPE profileType, COLORPROFILESUBTYPE profileSubType, LUID targetAdapterID, [NativeTypeName("UINT32")] uint sourceID); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern HRESULT ColorProfileGetDisplayList(WCS_PROFILE_MANAGEMENT_SCOPE scope, LUID targetAdapterID, [NativeTypeName("UINT32")] uint sourceID, [NativeTypeName("LPWSTR **")] ushort*** profileList, [NativeTypeName("PDWORD")] uint* profileCount); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern HRESULT ColorProfileGetDisplayDefault(WCS_PROFILE_MANAGEMENT_SCOPE scope, LUID targetAdapterID, [NativeTypeName("UINT32")] uint sourceID, COLORPROFILETYPE profileType, COLORPROFILESUBTYPE profileSubType, [NativeTypeName("LPWSTR *")] ushort** profileName); + + /// + [DllImport("mscms", ExactSpelling = true)] + [SupportedOSPlatform("windows10.0.19043.0")] + public static extern HRESULT ColorProfileGetDisplayUserScope(LUID targetAdapterID, [NativeTypeName("UINT32")] uint sourceID, WCS_PROFILE_MANAGEMENT_SCOPE* scope); + + /// + [DllImport("", ExactSpelling = true)] + public static extern HRESULT ColorProfileGetDeviceCapabilities(WCS_PROFILE_MANAGEMENT_SCOPE scope, LUID targetAdapterID, [NativeTypeName("UINT32")] uint sourceID, WCS_DEVICE_CAPABILITIES_TYPE capsType, [NativeTypeName("PVOID")] void* outputCapabilities); + + [NativeTypeName("#define INTENT_PERCEPTUAL 0")] + public const int INTENT_PERCEPTUAL = 0; + + [NativeTypeName("#define INTENT_RELATIVE_COLORIMETRIC 1")] + public const int INTENT_RELATIVE_COLORIMETRIC = 1; + + [NativeTypeName("#define INTENT_SATURATION 2")] + public const int INTENT_SATURATION = 2; + + [NativeTypeName("#define INTENT_ABSOLUTE_COLORIMETRIC 3")] + public const int INTENT_ABSOLUTE_COLORIMETRIC = 3; + + [NativeTypeName("#define CLASS_MONITOR 'mntr'")] + public const int CLASS_MONITOR = 0x6D6E7472; + + [NativeTypeName("#define CLASS_PRINTER 'prtr'")] + public const int CLASS_PRINTER = 0x70727472; + + [NativeTypeName("#define CLASS_SCANNER 'scnr'")] + public const int CLASS_SCANNER = 0x73636E72; + + [NativeTypeName("#define CLASS_LINK 'link'")] + public const int CLASS_LINK = 0x6C696E6B; + + [NativeTypeName("#define CLASS_ABSTRACT 'abst'")] + public const int CLASS_ABSTRACT = 0x61627374; + + [NativeTypeName("#define CLASS_COLORSPACE 'spac'")] + public const int CLASS_COLORSPACE = 0x73706163; + + [NativeTypeName("#define CLASS_NAMED 'nmcl'")] + public const int CLASS_NAMED = 0x6E6D636C; + + [NativeTypeName("#define CLASS_CAMP 'camp'")] + public const int CLASS_CAMP = 0x63616D70; + + [NativeTypeName("#define CLASS_GMMP 'gmmp'")] + public const int CLASS_GMMP = 0x676D6D70; + + [NativeTypeName("#define SPACE_XYZ 'XYZ '")] + public const int SPACE_XYZ = 0x58595A20; + + [NativeTypeName("#define SPACE_Lab 'Lab '")] + public const int SPACE_Lab = 0x4C616220; + + [NativeTypeName("#define SPACE_Luv 'Luv '")] + public const int SPACE_Luv = 0x4C757620; + + [NativeTypeName("#define SPACE_YCbCr 'YCbr'")] + public const int SPACE_YCbCr = 0x59436272; + + [NativeTypeName("#define SPACE_Yxy 'Yxy '")] + public const int SPACE_Yxy = 0x59787920; + + [NativeTypeName("#define SPACE_RGB 'RGB '")] + public const int SPACE_RGB = 0x52474220; + + [NativeTypeName("#define SPACE_GRAY 'GRAY'")] + public const int SPACE_GRAY = 0x47524159; + + [NativeTypeName("#define SPACE_HSV 'HSV '")] + public const int SPACE_HSV = 0x48535620; + + [NativeTypeName("#define SPACE_HLS 'HLS '")] + public const int SPACE_HLS = 0x484C5320; + + [NativeTypeName("#define SPACE_CMYK 'CMYK'")] + public const int SPACE_CMYK = 0x434D594B; + + [NativeTypeName("#define SPACE_CMY 'CMY '")] + public const int SPACE_CMY = 0x434D5920; + + [NativeTypeName("#define SPACE_2_CHANNEL '2CLR'")] + public const int SPACE_2_CHANNEL = 0x32434C52; + + [NativeTypeName("#define SPACE_3_CHANNEL '3CLR'")] + public const int SPACE_3_CHANNEL = 0x33434C52; + + [NativeTypeName("#define SPACE_4_CHANNEL '4CLR'")] + public const int SPACE_4_CHANNEL = 0x34434C52; + + [NativeTypeName("#define SPACE_5_CHANNEL '5CLR'")] + public const int SPACE_5_CHANNEL = 0x35434C52; + + [NativeTypeName("#define SPACE_6_CHANNEL '6CLR'")] + public const int SPACE_6_CHANNEL = 0x36434C52; + + [NativeTypeName("#define SPACE_7_CHANNEL '7CLR'")] + public const int SPACE_7_CHANNEL = 0x37434C52; + + [NativeTypeName("#define SPACE_8_CHANNEL '8CLR'")] + public const int SPACE_8_CHANNEL = 0x38434C52; + + [NativeTypeName("#define ATTRIB_TRANSPARENCY 0x00000001")] + public const int ATTRIB_TRANSPARENCY = 0x00000001; + + [NativeTypeName("#define ATTRIB_MATTE 0x00000002")] + public const int ATTRIB_MATTE = 0x00000002; + + [NativeTypeName("#define PROFILE_FILENAME 1")] + public const int PROFILE_FILENAME = 1; + + [NativeTypeName("#define PROFILE_MEMBUFFER 2")] + public const int PROFILE_MEMBUFFER = 2; + + [NativeTypeName("#define PROFILE_READ 1")] + public const int PROFILE_READ = 1; + + [NativeTypeName("#define PROFILE_READWRITE 2")] + public const int PROFILE_READWRITE = 2; + + [NativeTypeName("#define INDEX_DONT_CARE 0")] + public const int INDEX_DONT_CARE = 0; + + [NativeTypeName("#define CMM_FROM_PROFILE INDEX_DONT_CARE")] + public const int CMM_FROM_PROFILE = 0; + + [NativeTypeName("#define CMM_WINDOWS_DEFAULT 'Win '")] + public const int CMM_WINDOWS_DEFAULT = 0x57696E20; + + [NativeTypeName("#define ET_DEVICENAME 0x00000001")] + public const int ET_DEVICENAME = 0x00000001; + + [NativeTypeName("#define ET_MEDIATYPE 0x00000002")] + public const int ET_MEDIATYPE = 0x00000002; + + [NativeTypeName("#define ET_DITHERMODE 0x00000004")] + public const int ET_DITHERMODE = 0x00000004; + + [NativeTypeName("#define ET_RESOLUTION 0x00000008")] + public const int ET_RESOLUTION = 0x00000008; + + [NativeTypeName("#define ET_CMMTYPE 0x00000010")] + public const int ET_CMMTYPE = 0x00000010; + + [NativeTypeName("#define ET_CLASS 0x00000020")] + public const int ET_CLASS = 0x00000020; + + [NativeTypeName("#define ET_DATACOLORSPACE 0x00000040")] + public const int ET_DATACOLORSPACE = 0x00000040; + + [NativeTypeName("#define ET_CONNECTIONSPACE 0x00000080")] + public const int ET_CONNECTIONSPACE = 0x00000080; + + [NativeTypeName("#define ET_SIGNATURE 0x00000100")] + public const int ET_SIGNATURE = 0x00000100; + + [NativeTypeName("#define ET_PLATFORM 0x00000200")] + public const int ET_PLATFORM = 0x00000200; + + [NativeTypeName("#define ET_PROFILEFLAGS 0x00000400")] + public const int ET_PROFILEFLAGS = 0x00000400; + + [NativeTypeName("#define ET_MANUFACTURER 0x00000800")] + public const int ET_MANUFACTURER = 0x00000800; + + [NativeTypeName("#define ET_MODEL 0x00001000")] + public const int ET_MODEL = 0x00001000; + + [NativeTypeName("#define ET_ATTRIBUTES 0x00002000")] + public const int ET_ATTRIBUTES = 0x00002000; + + [NativeTypeName("#define ET_RENDERINGINTENT 0x00004000")] + public const int ET_RENDERINGINTENT = 0x00004000; + + [NativeTypeName("#define ET_CREATOR 0x00008000")] + public const int ET_CREATOR = 0x00008000; + + [NativeTypeName("#define ET_DEVICECLASS 0x00010000")] + public const int ET_DEVICECLASS = 0x00010000; + + [NativeTypeName("#define ET_STANDARDDISPLAYCOLOR 0x00020000")] + public const int ET_STANDARDDISPLAYCOLOR = 0x00020000; + + [NativeTypeName("#define ET_EXTENDEDDISPLAYCOLOR 0x00040000")] + public const int ET_EXTENDEDDISPLAYCOLOR = 0x00040000; + + [NativeTypeName("#define PROOF_MODE 0x00000001")] + public const int PROOF_MODE = 0x00000001; + + [NativeTypeName("#define NORMAL_MODE 0x00000002")] + public const int NORMAL_MODE = 0x00000002; + + [NativeTypeName("#define BEST_MODE 0x00000003")] + public const int BEST_MODE = 0x00000003; + + [NativeTypeName("#define USE_RELATIVE_COLORIMETRIC 0x00020000")] + public const int USE_RELATIVE_COLORIMETRIC = 0x00020000; + + [NativeTypeName("#define PRESERVEBLACK 0x00100000")] + public const int PRESERVEBLACK = 0x00100000; + + [NativeTypeName("#define WCS_ALWAYS 0x00200000")] + public const int WCS_ALWAYS = 0x00200000; + + [NativeTypeName("#define SEQUENTIAL_TRANSFORM 0x80800000")] + public const uint SEQUENTIAL_TRANSFORM = 0x80800000; + + [NativeTypeName("#define RESERVED 0x80000000")] + public const uint RESERVED = 0x80000000; + + [NativeTypeName("#define CSA_A 1")] + public const int CSA_A = 1; + + [NativeTypeName("#define CSA_ABC 2")] + public const int CSA_ABC = 2; + + [NativeTypeName("#define CSA_DEF 3")] + public const int CSA_DEF = 3; + + [NativeTypeName("#define CSA_DEFG 4")] + public const int CSA_DEFG = 4; + + [NativeTypeName("#define CSA_GRAY 5")] + public const int CSA_GRAY = 5; + + [NativeTypeName("#define CSA_RGB 6")] + public const int CSA_RGB = 6; + + [NativeTypeName("#define CSA_CMYK 7")] + public const int CSA_CMYK = 7; + + [NativeTypeName("#define CSA_Lab 8")] + public const int CSA_Lab = 8; + + [NativeTypeName("#define CMM_WIN_VERSION 0")] + public const int CMM_WIN_VERSION = 0; + + [NativeTypeName("#define CMM_IDENT 1")] + public const int CMM_IDENT = 1; + + [NativeTypeName("#define CMM_DRIVER_VERSION 2")] + public const int CMM_DRIVER_VERSION = 2; + + [NativeTypeName("#define CMM_DLL_VERSION 3")] + public const int CMM_DLL_VERSION = 3; + + [NativeTypeName("#define CMM_VERSION 4")] + public const int CMM_VERSION = 4; + + [NativeTypeName("#define CMM_DESCRIPTION 5")] + public const int CMM_DESCRIPTION = 5; + + [NativeTypeName("#define CMM_LOGOICON 6")] + public const int CMM_LOGOICON = 6; + + [NativeTypeName("#define CMS_FORWARD 0")] + public const int CMS_FORWARD = 0; + + [NativeTypeName("#define CMS_BACKWARD 1")] + public const int CMS_BACKWARD = 1; + + [NativeTypeName("#define CMS_DISABLEICM 1")] + public const int CMS_DISABLEICM = 1; + + [NativeTypeName("#define CMS_ENABLEPROOFING 2")] + public const int CMS_ENABLEPROOFING = 2; + + [NativeTypeName("#define CMS_SETRENDERINTENT 4")] + public const int CMS_SETRENDERINTENT = 4; + + [NativeTypeName("#define CMS_SETPROOFINTENT 8")] + public const int CMS_SETPROOFINTENT = 8; + + [NativeTypeName("#define CMS_SETMONITORPROFILE 0x10")] + public const int CMS_SETMONITORPROFILE = 0x10; + + [NativeTypeName("#define CMS_SETPRINTERPROFILE 0x20")] + public const int CMS_SETPRINTERPROFILE = 0x20; + + [NativeTypeName("#define CMS_SETTARGETPROFILE 0x40")] + public const int CMS_SETTARGETPROFILE = 0x40; + + [NativeTypeName("#define CMS_USEHOOK 0x80")] + public const int CMS_USEHOOK = 0x80; + + [NativeTypeName("#define CMS_USEAPPLYCALLBACK 0x100")] + public const int CMS_USEAPPLYCALLBACK = 0x100; + + [NativeTypeName("#define CMS_USEDESCRIPTION 0x200")] + public const int CMS_USEDESCRIPTION = 0x200; + + [NativeTypeName("#define CMS_DISABLEINTENT 0x400")] + public const int CMS_DISABLEINTENT = 0x400; + + [NativeTypeName("#define CMS_DISABLERENDERINTENT 0x800")] + public const int CMS_DISABLERENDERINTENT = 0x800; + + [NativeTypeName("#define CMS_MONITOROVERFLOW 0x80000000L")] + public const uint CMS_MONITOROVERFLOW = 0x80000000; + + [NativeTypeName("#define CMS_PRINTEROVERFLOW 0x40000000L")] + public const int CMS_PRINTEROVERFLOW = 0x40000000; + + [NativeTypeName("#define CMS_TARGETOVERFLOW 0x20000000L")] + public const int CMS_TARGETOVERFLOW = 0x20000000; + + [NativeTypeName("#define InstallColorProfile InstallColorProfileW")] + public static delegate* InstallColorProfile => &InstallColorProfileW; + + [NativeTypeName("#define CreateColorTransform CreateColorTransformW")] + public static delegate* CreateColorTransform => &CreateColorTransformW; + + [NativeTypeName("#define OpenColorProfile OpenColorProfileW")] + public static delegate* OpenColorProfile => &OpenColorProfileW; + + [NativeTypeName("#define CreateProfileFromLogColorSpace CreateProfileFromLogColorSpaceW")] + public static delegate* CreateProfileFromLogColorSpace => &CreateProfileFromLogColorSpaceW; + + [NativeTypeName("#define RegisterCMM RegisterCMMW")] + public static delegate* RegisterCMM => &RegisterCMMW; + + [NativeTypeName("#define UnregisterCMM UnregisterCMMW")] + public static delegate* UnregisterCMM => &UnregisterCMMW; + + [NativeTypeName("#define GetColorDirectory GetColorDirectoryW")] + public static delegate* GetColorDirectory => &GetColorDirectoryW; + + [NativeTypeName("#define UninstallColorProfile UninstallColorProfileW")] + public static delegate* UninstallColorProfile => &UninstallColorProfileW; + + [NativeTypeName("#define AssociateColorProfileWithDevice AssociateColorProfileWithDeviceW")] + [SupportedOSPlatform("windows10.0.19043.0")] + public static delegate* AssociateColorProfileWithDevice => &AssociateColorProfileWithDeviceW; + + [NativeTypeName("#define DisassociateColorProfileFromDevice DisassociateColorProfileFromDeviceW")] + public static delegate* DisassociateColorProfileFromDevice => &DisassociateColorProfileFromDeviceW; + + [NativeTypeName("#define EnumColorProfiles EnumColorProfilesW")] + public static delegate* EnumColorProfiles => &EnumColorProfilesW; + + [NativeTypeName("#define SetStandardColorSpaceProfile SetStandardColorSpaceProfileW")] + public static delegate* SetStandardColorSpaceProfile => &SetStandardColorSpaceProfileW; + + [NativeTypeName("#define GetStandardColorSpaceProfile GetStandardColorSpaceProfileW")] + public static delegate* GetStandardColorSpaceProfile => &GetStandardColorSpaceProfileW; + + [NativeTypeName("#define SetupColorMatching SetupColorMatchingW")] + public static delegate* SetupColorMatching => &SetupColorMatchingW; + + [NativeTypeName("#define WcsOpenColorProfile WcsOpenColorProfileW")] + public static delegate* WcsOpenColorProfile => &WcsOpenColorProfileW; + + [NativeTypeName("#define DONT_USE_EMBEDDED_WCS_PROFILES 0x00000001L")] + public const int DONT_USE_EMBEDDED_WCS_PROFILES = 0x00000001; + + [NativeTypeName("#define WCS_DEFAULT 0x00000000L")] + public const int WCS_DEFAULT = 0x00000000; + + [NativeTypeName("#define WCS_ICCONLY 0x00010000L")] + public const int WCS_ICCONLY = 0x00010000; + + [NativeTypeName("#define WCS_EMBEDDED_TAG_SIGNATURE 'MS00'")] + public const int WCS_EMBEDDED_TAG_SIGNATURE = 0x4D533030; + + [NativeTypeName("#define WCS_EMBEDDED_TAG_TYPE_SIGNATURE 'MS10'")] + public const int WCS_EMBEDDED_TAG_TYPE_SIGNATURE = 0x4D533130; +} diff --git a/sources/Interop/Windows/Windows/um/icm/XYZCOLOR.cs b/sources/Interop/Windows/Windows/um/icm/XYZCOLOR.cs new file mode 100644 index 0000000000..9cab5324d1 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/XYZCOLOR.cs @@ -0,0 +1,22 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct XYZCOLOR +{ + /// + [NativeTypeName("WORD")] + public ushort X; + + /// + [NativeTypeName("WORD")] + public ushort Y; + + /// + [NativeTypeName("WORD")] + public ushort Z; +} diff --git a/sources/Interop/Windows/Windows/um/icm/YxyCOLOR.cs b/sources/Interop/Windows/Windows/um/icm/YxyCOLOR.cs new file mode 100644 index 0000000000..b59f30bea6 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/YxyCOLOR.cs @@ -0,0 +1,22 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct YxyCOLOR +{ + /// + [NativeTypeName("WORD")] + public ushort Y; + + /// + [NativeTypeName("WORD")] + public ushort x; + + /// + [NativeTypeName("WORD")] + public ushort y; +} diff --git a/sources/Interop/Windows/Windows/um/wingdi/FR.cs b/sources/Interop/Windows/Windows/um/wingdi/FR.cs new file mode 100644 index 0000000000..45adf374c5 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wingdi/FR.cs @@ -0,0 +1,15 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wingdi.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +public static partial class FR +{ + [NativeTypeName("#define FR_PRIVATE 0x10")] + public const int FR_PRIVATE = 0x10; + + [NativeTypeName("#define FR_NOT_ENUM 0x20")] + public const int FR_NOT_ENUM = 0x20; +} diff --git a/sources/Interop/Windows/Windows/um/wingdi/Windows.cs b/sources/Interop/Windows/Windows/um/wingdi/Windows.cs index 3f7767bd3b..e6b7025bc7 100644 --- a/sources/Interop/Windows/Windows/um/wingdi/Windows.cs +++ b/sources/Interop/Windows/Windows/um/wingdi/Windows.cs @@ -2908,12 +2908,6 @@ public static unsafe partial class Windows [NativeTypeName("#define RemoveFontResourceEx RemoveFontResourceExW")] public static delegate* RemoveFontResourceEx => &RemoveFontResourceExW; - [NativeTypeName("#define FR_PRIVATE 0x10")] - public const int FR_PRIVATE = 0x10; - - [NativeTypeName("#define FR_NOT_ENUM 0x20")] - public const int FR_NOT_ENUM = 0x20; - [NativeTypeName("#define CreateFontIndirectEx CreateFontIndirectExW")] public static delegate* CreateFontIndirectEx => &CreateFontIndirectExW; diff --git a/tests/Interop/Windows/Windows/um/icm/CMYKCOLORTests.cs b/tests/Interop/Windows/Windows/um/icm/CMYKCOLORTests.cs new file mode 100644 index 0000000000..35eb061602 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/CMYKCOLORTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class CMYKCOLORTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(CMYKCOLOR))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(CMYKCOLOR).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(CMYKCOLOR), Is.EqualTo(8)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/COLORMATCHSETUPATests.cs b/tests/Interop/Windows/Windows/um/icm/COLORMATCHSETUPATests.cs new file mode 100644 index 0000000000..b80712a462 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/COLORMATCHSETUPATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class COLORMATCHSETUPATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(COLORMATCHSETUPA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(COLORMATCHSETUPA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(COLORMATCHSETUPA), Is.EqualTo(136)); + } + else + { + Assert.That(sizeof(COLORMATCHSETUPA), Is.EqualTo(76)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/COLORMATCHSETUPWTests.cs b/tests/Interop/Windows/Windows/um/icm/COLORMATCHSETUPWTests.cs new file mode 100644 index 0000000000..f9d1b5cfad --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/COLORMATCHSETUPWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class COLORMATCHSETUPWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(COLORMATCHSETUPW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(COLORMATCHSETUPW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(COLORMATCHSETUPW), Is.EqualTo(136)); + } + else + { + Assert.That(sizeof(COLORMATCHSETUPW), Is.EqualTo(76)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/COLORTests.cs b/tests/Interop/Windows/Windows/um/icm/COLORTests.cs new file mode 100644 index 0000000000..fa7b3770a5 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/COLORTests.cs @@ -0,0 +1,46 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the class. +public static partial class COLORTests +{ + /// Provides validation of the struct. + public static unsafe partial class COLORTests + { + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(COLOR))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutExplicitTest() + { + Assert.That(typeof(COLOR).IsExplicitLayout, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(COLOR), Is.EqualTo(16)); + } + else + { + Assert.That(sizeof(COLOR), Is.EqualTo(8)); + } + } + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/ENUMTYPEATests.cs b/tests/Interop/Windows/Windows/um/icm/ENUMTYPEATests.cs new file mode 100644 index 0000000000..ab3a359ccf --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/ENUMTYPEATests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class ENUMTYPEATests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(ENUMTYPEA))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(ENUMTYPEA).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(ENUMTYPEA), Is.EqualTo(96)); + } + else + { + Assert.That(sizeof(ENUMTYPEA), Is.EqualTo(88)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/ENUMTYPEWTests.cs b/tests/Interop/Windows/Windows/um/icm/ENUMTYPEWTests.cs new file mode 100644 index 0000000000..df5e55a822 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/ENUMTYPEWTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class ENUMTYPEWTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(ENUMTYPEW))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(ENUMTYPEW).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(ENUMTYPEW), Is.EqualTo(96)); + } + else + { + Assert.That(sizeof(ENUMTYPEW), Is.EqualTo(88)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/GENERIC3CHANNELTests.cs b/tests/Interop/Windows/Windows/um/icm/GENERIC3CHANNELTests.cs new file mode 100644 index 0000000000..db5314fbc8 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/GENERIC3CHANNELTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class GENERIC3CHANNELTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(GENERIC3CHANNEL))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(GENERIC3CHANNEL).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(GENERIC3CHANNEL), Is.EqualTo(6)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/GRAYCOLORTests.cs b/tests/Interop/Windows/Windows/um/icm/GRAYCOLORTests.cs new file mode 100644 index 0000000000..3ffeb9c2f6 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/GRAYCOLORTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class GRAYCOLORTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(GRAYCOLOR))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(GRAYCOLOR).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(GRAYCOLOR), Is.EqualTo(2)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/HiFiCOLORTests.cs b/tests/Interop/Windows/Windows/um/icm/HiFiCOLORTests.cs new file mode 100644 index 0000000000..05c29e9eb3 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/HiFiCOLORTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class HiFiCOLORTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(HiFiCOLOR))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(HiFiCOLOR).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(HiFiCOLOR), Is.EqualTo(8)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/LabCOLORTests.cs b/tests/Interop/Windows/Windows/um/icm/LabCOLORTests.cs new file mode 100644 index 0000000000..30e58d6e91 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/LabCOLORTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class LabCOLORTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(LabCOLOR))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(LabCOLOR).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(LabCOLOR), Is.EqualTo(6)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/NAMEDCOLORTests.cs b/tests/Interop/Windows/Windows/um/icm/NAMEDCOLORTests.cs new file mode 100644 index 0000000000..fee31c68bb --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/NAMEDCOLORTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class NAMEDCOLORTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(NAMEDCOLOR))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(NAMEDCOLOR).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(NAMEDCOLOR), Is.EqualTo(4)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFOTests.cs b/tests/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFOTests.cs new file mode 100644 index 0000000000..b129dea2e9 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFOTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class NAMED_PROFILE_INFOTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(NAMED_PROFILE_INFO))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(NAMED_PROFILE_INFO).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(NAMED_PROFILE_INFO), Is.EqualTo(76)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/PROFILEHEADERTests.cs b/tests/Interop/Windows/Windows/um/icm/PROFILEHEADERTests.cs new file mode 100644 index 0000000000..014abeb4e4 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/PROFILEHEADERTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PROFILEHEADERTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PROFILEHEADER))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PROFILEHEADER).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(PROFILEHEADER), Is.EqualTo(128)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/PROFILETests.cs b/tests/Interop/Windows/Windows/um/icm/PROFILETests.cs new file mode 100644 index 0000000000..8f905ddc9b --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/PROFILETests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PROFILETests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PROFILE))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PROFILE).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(PROFILE), Is.EqualTo(24)); + } + else + { + Assert.That(sizeof(PROFILE), Is.EqualTo(12)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/RGBCOLORTests.cs b/tests/Interop/Windows/Windows/um/icm/RGBCOLORTests.cs new file mode 100644 index 0000000000..771e040ba1 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/RGBCOLORTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class RGBCOLORTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(RGBCOLOR))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(RGBCOLOR).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(RGBCOLOR), Is.EqualTo(6)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/WCS_DEVICE_MHC2_CAPABILITIESTests.cs b/tests/Interop/Windows/Windows/um/icm/WCS_DEVICE_MHC2_CAPABILITIESTests.cs new file mode 100644 index 0000000000..4ad4ee5e53 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/WCS_DEVICE_MHC2_CAPABILITIESTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class WCS_DEVICE_MHC2_CAPABILITIESTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(WCS_DEVICE_MHC2_CAPABILITIES))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(WCS_DEVICE_MHC2_CAPABILITIES).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(WCS_DEVICE_MHC2_CAPABILITIES), Is.EqualTo(20)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/WCS_DEVICE_VCGT_CAPABILITIESTests.cs b/tests/Interop/Windows/Windows/um/icm/WCS_DEVICE_VCGT_CAPABILITIESTests.cs new file mode 100644 index 0000000000..22e79eeb5c --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/WCS_DEVICE_VCGT_CAPABILITIESTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class WCS_DEVICE_VCGT_CAPABILITIESTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(WCS_DEVICE_VCGT_CAPABILITIES))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(WCS_DEVICE_VCGT_CAPABILITIES).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(WCS_DEVICE_VCGT_CAPABILITIES), Is.EqualTo(8)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/XYZCOLORTests.cs b/tests/Interop/Windows/Windows/um/icm/XYZCOLORTests.cs new file mode 100644 index 0000000000..a999e6adb8 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/XYZCOLORTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class XYZCOLORTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(XYZCOLOR))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(XYZCOLOR).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(XYZCOLOR), Is.EqualTo(6)); + } +} diff --git a/tests/Interop/Windows/Windows/um/icm/YxyCOLORTests.cs b/tests/Interop/Windows/Windows/um/icm/YxyCOLORTests.cs new file mode 100644 index 0000000000..8ed52f8726 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/icm/YxyCOLORTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/icm.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class YxyCOLORTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(YxyCOLOR))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(YxyCOLOR).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(YxyCOLOR), Is.EqualTo(6)); + } +} From f189b85258d6229478d3a38c5876576502d58f54 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 22 Jun 2023 17:11:20 -0700 Subject: [PATCH 4/8] Regenerating xml documentation --- .../Windows/um/CommDlg/CHOOSECOLORA.xml | 353 ++++ .../Windows/um/CommDlg/CHOOSECOLORW.xml | 353 ++++ .../Windows/um/CommDlg/CHOOSEFONTA.xml | 1217 ++++++++++++ .../Windows/Windows/um/CommDlg/DEVNAMES.xml | 20 + .../Windows/um/CommDlg/FINDREPLACEA.xml | 611 ++++++ .../um/CommDlg/IPrintDialogCallback.xml | 52 + .../um/CommDlg/IPrintDialogServices.xml | 59 + .../Windows/Windows/um/CommDlg/OFNOTIFYA.xml | 29 + .../Windows/um/CommDlg/OFNOTIFYEXA.xml | 35 + .../Windows/um/CommDlg/OPENFILENAME_NT4A.xml | 59 + .../Windows/um/CommDlg/PAGESETUPDLGA.xml | 683 +++++++ .../Windows/Windows/um/CommDlg/PRINTDLGA.xml | 887 +++++++++ .../Windows/um/CommDlg/PRINTDLGEXA.xml | 845 ++++++++ .../Windows/um/CommDlg/PRINTPAGERANGE.xml | 14 + .../Windows/Windows/um/CommDlg/Windows.xml | 427 +++++ .../Windows/Windows/um/icm/BMFORMAT.xml | 140 ++ .../Windows/Windows/um/icm/CMYKCOLOR.xml | 20 + .../Interop/Windows/Windows/um/icm/COLOR.xml | 41 + .../Windows/Windows/um/icm/COLORDATATYPE.xml | 32 + .../Windows/um/icm/COLORPROFILESUBTYPE.xml | 35 + .../Windows/um/icm/COLORPROFILETYPE.xml | 20 + .../Windows/Windows/um/icm/COLORTYPE.xml | 44 + .../Windows/um/icm/GENERIC3CHANNEL.xml | 17 + .../Windows/Windows/um/icm/GRAYCOLOR.xml | 11 + .../Windows/Windows/um/icm/HiFiCOLOR.xml | 11 + .../Windows/Windows/um/icm/LabCOLOR.xml | 17 + .../Windows/Windows/um/icm/NAMEDCOLOR.xml | 11 + .../Windows/um/icm/NAMED_PROFILE_INFO.xml | 23 + .../Windows/um/icm/PCOLORMATCHSETUPA.xml | 87 + .../Windows/um/icm/PCOLORMATCHSETUPW.xml | 87 + .../Windows/Windows/um/icm/PENUMTYPEA.xml | 113 ++ .../Windows/Windows/um/icm/PENUMTYPEW.xml | 113 ++ .../Windows/Windows/um/icm/PROFILE.xml | 20 + .../Windows/Windows/um/icm/PROFILEHEADER.xml | 84 + .../Windows/Windows/um/icm/RGBCOLOR.xml | 17 + .../um/icm/WCS_PROFILE_MANAGEMENT_SCOPE.xml | 14 + .../Windows/Windows/um/icm/Windows.xml | 1703 +++++++++++++++++ .../Windows/Windows/um/icm/XYZCOLOR.xml | 17 + .../Windows/Windows/um/icm/YxyCOLOR.xml | 17 + 39 files changed, 8338 insertions(+) create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORA.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORW.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTA.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/DEVNAMES.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEA.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallback.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogServices.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYA.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXA.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4A.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGA.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGA.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXA.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGE.xml create mode 100644 sources/Interop/Windows/Windows/um/CommDlg/Windows.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/BMFORMAT.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/CMYKCOLOR.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/COLOR.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/COLORDATATYPE.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/COLORPROFILESUBTYPE.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/COLORPROFILETYPE.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/COLORTYPE.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/GENERIC3CHANNEL.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/GRAYCOLOR.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/HiFiCOLOR.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/LabCOLOR.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/NAMEDCOLOR.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFO.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/PCOLORMATCHSETUPA.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/PCOLORMATCHSETUPW.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/PENUMTYPEA.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/PENUMTYPEW.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/PROFILE.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/PROFILEHEADER.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/RGBCOLOR.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/WCS_PROFILE_MANAGEMENT_SCOPE.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/Windows.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/XYZCOLOR.xml create mode 100644 sources/Interop/Windows/Windows/um/icm/YxyCOLOR.xml diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORA.xml b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORA.xml new file mode 100644 index 0000000000..754f069df9 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORA.xml @@ -0,0 +1,353 @@ + + + + + + Contains information the ChooseColor function uses to initialize the Color dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure. + + + The length, in bytes, of the structure. + + + A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. + + + If the CC_ENABLETEMPLATEHANDLE flag is set in the Flags member, hInstance is a handle to a memory object containing a dialog box template. If the CC_ENABLETEMPLATE flag is set, hInstance is a handle to a module that contains a dialog box template named by the lpTemplateName member. If neither CC_ENABLETEMPLATEHANDLE nor CC_ENABLETEMPLATE is set, this member is ignored. + + + If the CC_RGBINIT flag is set, rgbResult specifies the color initially selected when the dialog box is created. If the specified color value is not among the available colors, the system selects the nearest solid color available. If rgbResult is zero or CC_RGBINIT is not set, the initially selected color is black. If the user clicks the OK button, rgbResult specifies the user's color selection. To create a COLORREF color value, use the RGB macro. + + + A pointer to an array of 16 values that contain red, green, blue (RGB) values for the custom color boxes in the dialog box. If the user modifies these colors, the system updates the array with the new RGB values. To preserve new custom colors between calls to the ChooseColor function, you should allocate static memory for the array. To create a COLORREF color value, use the RGB macro. + + + + A set of bit flags that you can use to initialize the Color dialog box. When the dialog box returns, it sets these flags to indicate the user's input. This member can be a combination of the following flags. + + + Value + Meaning + + + + + + + CC_ANYCOLOR + + + + 0x00000100 + + + + Causes the dialog box to display all available colors in the set of basic colors. + + + + + + + CC_ENABLEHOOK + + + + 0x00000010 + + + + Enables the hook procedure specified in the lpfnHook member of this structure. This flag is used only to initialize the dialog box. + + + + + + + CC_ENABLETEMPLATE + + + + 0x00000020 + + + + The hInstance and lpTemplateName members specify a dialog box template to use in place of the default template. This flag is used only to initialize the dialog box. + + + + + + + CC_ENABLETEMPLATEHANDLE + + + + 0x00000040 + + + + The hInstance member identifies a data block that contains a preloaded dialog box template. The system ignores the lpTemplateName member if this flag is specified. This flag is used only to initialize the dialog box. + + + + + + + CC_FULLOPEN + + + + 0x00000002 + + + + Causes the dialog box to display the additional controls that allow the user to create custom colors. If this flag is not set, the user must click the Define Custom Color button to display the custom color controls. + + + + + + + CC_PREVENTFULLOPEN + + + + 0x00000004 + + + + Disables the Define Custom Color button. + + + + + + + CC_RGBINIT + + + + 0x00000001 + + + + Causes the dialog box to use the color specified in the rgbResult member as the initial color selection. + + + + + + + CC_SHOWHELP + + + + 0x00000008 + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + + CC_SOLIDCOLOR + + + + 0x00000080 + + + + Causes the dialog box to display only solid colors in the set of basic colors. + + + + + + Application-defined data that the system passes to the hook procedure identified by the lpfnHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the CHOOSECOLOR structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to a CCHookProc hook procedure that can process messages intended for the dialog box. This member is ignored unless the CC_ENABLEHOOK flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, lpTemplateName can be a value returned by the MAKEINTRESOURCE macro. This member is ignored unless the CC_ENABLETEMPLATE flag is set in the Flags member. + + + + Contains information the ChooseColor function uses to initialize the Color dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure. + + + The length, in bytes, of the structure. + + + A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. + + + If the CC_ENABLETEMPLATEHANDLE flag is set in the Flags member, hInstance is a handle to a memory object containing a dialog box template. If the CC_ENABLETEMPLATE flag is set, hInstance is a handle to a module that contains a dialog box template named by the lpTemplateName member. If neither CC_ENABLETEMPLATEHANDLE nor CC_ENABLETEMPLATE is set, this member is ignored. + + + If the CC_RGBINIT flag is set, rgbResult specifies the color initially selected when the dialog box is created. If the specified color value is not among the available colors, the system selects the nearest solid color available. If rgbResult is zero or CC_RGBINIT is not set, the initially selected color is black. If the user clicks the OK button, rgbResult specifies the user's color selection. To create a COLORREF color value, use the macro. + + + A pointer to an array of 16 values that contain red, green, blue (RGB) values for the custom color boxes in the dialog box. If the user modifies these colors, the system updates the array with the new RGB values. To preserve new custom colors between calls to the ChooseColor function, you should allocate static memory for the array. To create a COLORREF color value, use the macro. + + + + A set of bit flags that you can use to initialize the Color dialog box. When the dialog box returns, it sets these flags to indicate the user's input. This member can be a combination of the following flags. + + + Value + Meaning + + + + + + + CC_ANYCOLOR + + + + 0x00000100 + + + + Causes the dialog box to display all available colors in the set of basic colors. + + + + + + + CC_ENABLEHOOK + + + + 0x00000010 + + + + Enables the hook procedure specified in the lpfnHook member of this structure. This flag is used only to initialize the dialog box. + + + + + + + CC_ENABLETEMPLATE + + + + 0x00000020 + + + + The hInstance and lpTemplateName members specify a dialog box template to use in place of the default template. This flag is used only to initialize the dialog box. + + + + + + + CC_ENABLETEMPLATEHANDLE + + + + 0x00000040 + + + + The hInstance member identifies a data block that contains a preloaded dialog box template. The system ignores the lpTemplateName member if this flag is specified. This flag is used only to initialize the dialog box. + + + + + + + CC_FULLOPEN + + + + 0x00000002 + + + + Causes the dialog box to display the additional controls that allow the user to create custom colors. If this flag is not set, the user must click the Define Custom Color button to display the custom color controls. + + + + + + + CC_PREVENTFULLOPEN + + + + 0x00000004 + + + + Disables the Define Custom Color button. + + + + + + + CC_RGBINIT + + + + 0x00000001 + + + + Causes the dialog box to use the color specified in the rgbResult member as the initial color selection. + + + + + + + CC_SHOWHELP + + + + 0x00000008 + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + + CC_SOLIDCOLOR + + + + 0x00000080 + + + + Causes the dialog box to display only solid colors in the set of basic colors. + + + + + + Application-defined data that the system passes to the hook procedure identified by the lpfnHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the CHOOSECOLOR structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to a CCHookProc hook procedure that can process messages intended for the dialog box. This member is ignored unless the CC_ENABLEHOOK flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, lpTemplateName can be a value returned by the macro. This member is ignored unless the CC_ENABLETEMPLATE flag is set in the Flags member. + + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORW.xml b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORW.xml new file mode 100644 index 0000000000..61a9214cb7 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSECOLORW.xml @@ -0,0 +1,353 @@ + + + + + + Contains information the ChooseColor function uses to initialize the Color dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure. + + + The length, in bytes, of the structure. + + + A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. + + + If the CC_ENABLETEMPLATEHANDLE flag is set in the Flags member, hInstance is a handle to a memory object containing a dialog box template. If the CC_ENABLETEMPLATE flag is set, hInstance is a handle to a module that contains a dialog box template named by the lpTemplateName member. If neither CC_ENABLETEMPLATEHANDLE nor CC_ENABLETEMPLATE is set, this member is ignored. + + + If the CC_RGBINIT flag is set, rgbResult specifies the color initially selected when the dialog box is created. If the specified color value is not among the available colors, the system selects the nearest solid color available. If rgbResult is zero or CC_RGBINIT is not set, the initially selected color is black. If the user clicks the OK button, rgbResult specifies the user's color selection. To create a COLORREF color value, use the RGB macro. + + + A pointer to an array of 16 values that contain red, green, blue (RGB) values for the custom color boxes in the dialog box. If the user modifies these colors, the system updates the array with the new RGB values. To preserve new custom colors between calls to the ChooseColor function, you should allocate static memory for the array. To create a COLORREF color value, use the RGB macro. + + + + A set of bit flags that you can use to initialize the Color dialog box. When the dialog box returns, it sets these flags to indicate the user's input. This member can be a combination of the following flags. + + + Value + Meaning + + + + + + + CC_ANYCOLOR + + + + 0x00000100 + + + + Causes the dialog box to display all available colors in the set of basic colors. + + + + + + + CC_ENABLEHOOK + + + + 0x00000010 + + + + Enables the hook procedure specified in the lpfnHook member of this structure. This flag is used only to initialize the dialog box. + + + + + + + CC_ENABLETEMPLATE + + + + 0x00000020 + + + + The hInstance and lpTemplateName members specify a dialog box template to use in place of the default template. This flag is used only to initialize the dialog box. + + + + + + + CC_ENABLETEMPLATEHANDLE + + + + 0x00000040 + + + + The hInstance member identifies a data block that contains a preloaded dialog box template. The system ignores the lpTemplateName member if this flag is specified. This flag is used only to initialize the dialog box. + + + + + + + CC_FULLOPEN + + + + 0x00000002 + + + + Causes the dialog box to display the additional controls that allow the user to create custom colors. If this flag is not set, the user must click the Define Custom Color button to display the custom color controls. + + + + + + + CC_PREVENTFULLOPEN + + + + 0x00000004 + + + + Disables the Define Custom Color button. + + + + + + + CC_RGBINIT + + + + 0x00000001 + + + + Causes the dialog box to use the color specified in the rgbResult member as the initial color selection. + + + + + + + CC_SHOWHELP + + + + 0x00000008 + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + + CC_SOLIDCOLOR + + + + 0x00000080 + + + + Causes the dialog box to display only solid colors in the set of basic colors. + + + + + + Application-defined data that the system passes to the hook procedure identified by the lpfnHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the CHOOSECOLOR structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to a CCHookProc hook procedure that can process messages intended for the dialog box. This member is ignored unless the CC_ENABLEHOOK flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, lpTemplateName can be a value returned by the MAKEINTRESOURCE macro. This member is ignored unless the CC_ENABLETEMPLATE flag is set in the Flags member. + + + + Contains information the ChooseColor function uses to initialize the Color dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure. + + + The length, in bytes, of the structure. + + + A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. + + + If the CC_ENABLETEMPLATEHANDLE flag is set in the Flags member, hInstance is a handle to a memory object containing a dialog box template. If the CC_ENABLETEMPLATE flag is set, hInstance is a handle to a module that contains a dialog box template named by the lpTemplateName member. If neither CC_ENABLETEMPLATEHANDLE nor CC_ENABLETEMPLATE is set, this member is ignored. + + + If the CC_RGBINIT flag is set, rgbResult specifies the color initially selected when the dialog box is created. If the specified color value is not among the available colors, the system selects the nearest solid color available. If rgbResult is zero or CC_RGBINIT is not set, the initially selected color is black. If the user clicks the OK button, rgbResult specifies the user's color selection. To create a COLORREF color value, use the macro. + + + A pointer to an array of 16 values that contain red, green, blue (RGB) values for the custom color boxes in the dialog box. If the user modifies these colors, the system updates the array with the new RGB values. To preserve new custom colors between calls to the ChooseColor function, you should allocate static memory for the array. To create a COLORREF color value, use the macro. + + + + A set of bit flags that you can use to initialize the Color dialog box. When the dialog box returns, it sets these flags to indicate the user's input. This member can be a combination of the following flags. + + + Value + Meaning + + + + + + + CC_ANYCOLOR + + + + 0x00000100 + + + + Causes the dialog box to display all available colors in the set of basic colors. + + + + + + + CC_ENABLEHOOK + + + + 0x00000010 + + + + Enables the hook procedure specified in the lpfnHook member of this structure. This flag is used only to initialize the dialog box. + + + + + + + CC_ENABLETEMPLATE + + + + 0x00000020 + + + + The hInstance and lpTemplateName members specify a dialog box template to use in place of the default template. This flag is used only to initialize the dialog box. + + + + + + + CC_ENABLETEMPLATEHANDLE + + + + 0x00000040 + + + + The hInstance member identifies a data block that contains a preloaded dialog box template. The system ignores the lpTemplateName member if this flag is specified. This flag is used only to initialize the dialog box. + + + + + + + CC_FULLOPEN + + + + 0x00000002 + + + + Causes the dialog box to display the additional controls that allow the user to create custom colors. If this flag is not set, the user must click the Define Custom Color button to display the custom color controls. + + + + + + + CC_PREVENTFULLOPEN + + + + 0x00000004 + + + + Disables the Define Custom Color button. + + + + + + + CC_RGBINIT + + + + 0x00000001 + + + + Causes the dialog box to use the color specified in the rgbResult member as the initial color selection. + + + + + + + CC_SHOWHELP + + + + 0x00000008 + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + + CC_SOLIDCOLOR + + + + 0x00000080 + + + + Causes the dialog box to display only solid colors in the set of basic colors. + + + + + + Application-defined data that the system passes to the hook procedure identified by the lpfnHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the CHOOSECOLOR structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to a CCHookProc hook procedure that can process messages intended for the dialog box. This member is ignored unless the CC_ENABLEHOOK flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, lpTemplateName can be a value returned by the macro. This member is ignored unless the CC_ENABLETEMPLATE flag is set in the Flags member. + + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTA.xml b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTA.xml new file mode 100644 index 0000000000..6762bfd350 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/CHOOSEFONTA.xml @@ -0,0 +1,1217 @@ + + + + + + Contains information that the ChooseFont function uses to initialize the Font dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure. + + + The length of the structure, in bytes. + + + A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. + + + + This member is ignored by the ChooseFont function. + + Windows Vista and Windows XP/2000:  A handle to the device context or information context of the printer whose fonts will be listed in the dialog box. This member is used only if the Flags member specifies the CF_PRINTERFONTS or CF_BOTH flag; otherwise, this member is ignored. + + + + A pointer to a structure. If you set the CF_INITTOLOGFONTSTRUCT flag in the Flags member and initialize the other members, the ChooseFont function initializes the dialog box with a font that matches the LOGFONT members. If the user clicks the OK button, ChooseFont sets the members of the LOGFONT structure based on the user's selections. + + + The size of the selected font, in units of 1/10 of a point. The ChooseFont function sets this value after the user closes the dialog box. + + + + A set of bit flags that you can use to initialize the Font dialog box. When the dialog box returns, it sets these flags to indicate the user input. This member can be one or more of the following values. + + + Value + Meaning + + + + + + + CF_APPLY + + + + 0x00000200L + + + + Causes the dialog box to display the Apply button. You should provide a hook procedure to process WM_COMMAND messages for the Apply button. The hook procedure can send the WM_CHOOSEFONT_GETLOGFONT message to the dialog box to retrieve the address of the structure that contains the current selections for the font. + + + + + + + CF_ANSIONLY + + + + 0x00000400L + + + + This flag is obsolete. To limit font selections to all scripts except those that use the OEM or Symbol character sets, use CF_SCRIPTSONLY. To get the original CF_ANSIONLY behavior, use CF_SELECTSCRIPT and specify ANSI_CHARSET in the lfCharSet member of the structure pointed to by lpLogFont. + + + + + + + CF_BOTH + + + + 0x00000003 + + + + This flag is ignored for font enumeration.Windows Vista and Windows XP/2000:  Causes the dialog box to list the available printer and screen fonts. The hDC member is a handle to the device context or information context associated with the printer. This flag is a combination of the CF_SCREENFONTS and CF_PRINTERFONTS flags. + + + + + + + CF_EFFECTS + + + + 0x00000100L + + + + Causes the dialog box to display the controls that allow the user to specify strikeout, underline, and text color options. If this flag is set, you can use the rgbColors member to specify the initial text color. You can use the lfStrikeOut and lfUnderline members of the structure pointed to by lpLogFont to specify the initial settings of the strikeout and underline check boxes. ChooseFont can use these members to return the user's selections. + + + + + + + CF_ENABLEHOOK + + + + 0x00000008L + + + + Enables the hook procedure specified in the lpfnHook member of this structure. + + + + + + + CF_ENABLETEMPLATE + + + + 0x00000010L + + + + Indicates that the hInstance and lpTemplateName members specify a dialog box template to use in place of the default template. + + + + + + + CF_ENABLETEMPLATEHANDLE + + + + 0x00000020L + + + + Indicates that the hInstance member identifies a data block that contains a preloaded dialog box template. The system ignores the lpTemplateName member if this flag is specified. + + + + + + + CF_FIXEDPITCHONLY + + + + 0x00004000L + + + + + ChooseFont should enumerate and allow selection of only fixed-pitch fonts. + + + + + + + CF_FORCEFONTEXIST + + + + 0x00010000L + + + + + ChooseFont should indicate an error condition if the user attempts to select a font or style that is not listed in the dialog box. + + + + + + + CF_INACTIVEFONTS + + + + 0x02000000L + + + + + + ChooseFont should additionally display fonts that are set to Hide in Fonts Control Panel. + + Windows Vista and Windows XP/2000:  This flag is not supported until Windows 7. + + + + + + + + CF_INITTOLOGFONTSTRUCT + + + + 0x00000040L + + + + + ChooseFont should use the structure pointed to by the lpLogFont member to initialize the dialog box controls. + + + + + + + CF_LIMITSIZE + + + + 0x00002000L + + + + + ChooseFont should select only font sizes within the range specified by the nSizeMin and nSizeMax members. + + + + + + + CF_NOOEMFONTS + + + + 0x00000800L + + + + Same as the CF_NOVECTORFONTS flag. + + + + + + + CF_NOFACESEL + + + + 0x00080000L + + + + When using a structure to initialize the dialog box controls, use this flag to prevent the dialog box from displaying an initial selection for the font name combo box. This is useful when there is no single font name that applies to the text selection. + + + + + + + CF_NOSCRIPTSEL + + + + 0x00800000L + + + + Disables the Script combo box. When this flag is set, the lfCharSet member of the structure is set to DEFAULT_CHARSET when ChooseFont returns. This flag is used only to initialize the dialog box. + + + + + + + CF_NOSIMULATIONS + + + + 0x00001000L + + + + + ChooseFont should not display or allow selection of font simulations. + + + + + + + CF_NOSIZESEL + + + + 0x00200000L + + + + When using a structure to initialize the dialog box controls, use this flag to prevent the dialog box from displaying an initial selection for the Font Size combo box. This is useful when there is no single font size that applies to the text selection. + + + + + + + CF_NOSTYLESEL + + + + 0x00100000L + + + + When using a structure to initialize the dialog box controls, use this flag to prevent the dialog box from displaying an initial selection for the Font Style combo box. This is useful when there is no single font style that applies to the text selection. + + + + + + + CF_NOVECTORFONTS + + + + 0x00000800L + + + + + ChooseFont should not allow vector font selections. + + + + + + + CF_NOVERTFONTS + + + + 0x01000000L + + + + Causes the Font dialog box to list only horizontally oriented fonts. + + + + + + + CF_PRINTERFONTS + + + + 0x00000002 + + + + This flag is ignored for font enumeration.Windows Vista and Windows XP/2000:  Causes the dialog box to list only the fonts supported by the printer associated with the device context or information context identified by the hDC member. It also causes the font type description label to appear at the bottom of the Font dialog box. + + + + + + + CF_SCALABLEONLY + + + + 0x00020000L + + + + Specifies that ChooseFont should allow only the selection of scalable fonts. Scalable fonts include vector fonts, scalable printer fonts, TrueType fonts, and fonts scaled by other technologies. + + + + + + + CF_SCREENFONTS + + + + 0x00000001 + + + + This flag is ignored for font enumeration.Windows Vista and Windows XP/2000:  Causes the dialog box to list only the screen fonts supported by the system. + + + + + + + CF_SCRIPTSONLY + + + + 0x00000400L + + + + + ChooseFont should allow selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set. This supersedes the CF_ANSIONLY value. + + + + + + + CF_SELECTSCRIPT + + + + 0x00400000L + + + + When specified on input, only fonts with the character set identified in the lfCharSet member of the structure are displayed. The user will not be allowed to change the character set specified in the Scripts combo box. + + + + + + + CF_SHOWHELP + + + + 0x00000004L + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + + CF_TTONLY + + + + 0x00040000L + + + + + ChooseFont should only enumerate and allow the selection of TrueType fonts. + + + + + + + CF_USESTYLE + + + + 0x00000080L + + + + The lpszStyle member is a pointer to a buffer that contains style data that ChooseFont should use to initialize the Font Style combo box. When the user closes the dialog box, ChooseFont copies style data for the user's selection to this buffer.
Note  To globalize your application, you should specify the style by using the lfWeight and lfItalic members of the structure pointed to by lpLogFont. The style name may change depending on the system user interface language.
+
+ + + + + + CF_WYSIWYG + + + + 0x00008000L + + + + Obsolete. ChooseFont ignores this flag.Windows Vista and Windows XP/2000:  ChooseFont should allow only the selection of fonts available on both the printer and the display. If this flag is specified, the CF_SCREENSHOTS and CF_PRINTERFONTS, or CF_BOTH flags should also be specified. + +
+
+
+ + If the CF_EFFECTS flag is set, rgbColors specifies the initial text color. When ChooseFont returns successfully, this member contains the RGB value of the text color that the user selected. To create a COLORREF color value, use the macro. + + + Application-defined data that the system passes to the hook procedure identified by the lpfnHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the CHOOSEFONT structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to a CFHookProc hook procedure that can process messages intended for the dialog box. This member is ignored unless the CF_ENABLEHOOK flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, lpTemplateName can be a value returned by the macro. This member is ignored unless the CF_ENABLETEMPLATE flag is set in the Flags member. + + + If the CF_ENABLETEMPLATEHANDLE flag is set in the Flags member, hInstance is a handle to a memory object containing a dialog box template. If the CF_ENABLETEMPLATE flag is set, hInstance is a handle to a module that contains a dialog box template named by the lpTemplateName member. If neither CF_ENABLETEMPLATEHANDLE nor CF_ENABLETEMPLATE is set, this member is ignored. + + + The style data. If the CF_USESTYLE flag is specified, ChooseFont uses the data in this buffer to initialize the Font Style combo box. When the user closes the dialog box, ChooseFont copies the string in the Font Style combo box into this buffer. + + + + The type of the selected font when ChooseFont returns. This member can be one or more of the following values. + + + Value + Meaning + + + + + + + BOLD_FONTTYPE + + + + 0x0100 + + + + The font weight is bold. This information is duplicated in the lfWeight member of the structure and is equivalent to FW_BOLD. + + + + + + + ITALIC_FONTTYPE + + + + 0x0200 + + + + The italic font attribute is set. This information is duplicated in the lfItalic member of the structure. + + + + + + + PRINTER_FONTTYPE + + + + 0x4000 + + + + The font is a printer font. + + + + + + + REGULAR_FONTTYPE + + + + 0x0400 + + + + The font weight is normal. This information is duplicated in the lfWeight member of the structure and is equivalent to FW_REGULAR. + + + + + + + SCREEN_FONTTYPE + + + + 0x2000 + + + + The font is a screen font. + + + + + + + SIMULATED_FONTTYPE + + + + 0x8000 + + + + The font is simulated by the graphics device interface (GDI). + + + + + + The minimum point size a user can select. ChooseFont recognizes this member only if the CF_LIMITSIZE flag is specified. + + + The maximum point size a user can select. ChooseFont recognizes this member only if the CF_LIMITSIZE flag is specified. + + + Contains information that the ChooseFont function uses to initialize the Font dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure. + + + The length of the structure, in bytes. + + + A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. + + + + This member is ignored by the ChooseFont function. + + Windows Vista and Windows XP/2000:  A handle to the device context or information context of the printer whose fonts will be listed in the dialog box. This member is used only if the Flags member specifies the CF_PRINTERFONTS or CF_BOTH flag; otherwise, this member is ignored. + + + + A pointer to a structure. If you set the CF_INITTOLOGFONTSTRUCT flag in the Flags member and initialize the other members, the ChooseFont function initializes the dialog box with a font that matches the LOGFONT members. If the user clicks the OK button, ChooseFont sets the members of the LOGFONT structure based on the user's selections. + + + The size of the selected font, in units of 1/10 of a point. The ChooseFont function sets this value after the user closes the dialog box. + + + + A set of bit flags that you can use to initialize the Font dialog box. When the dialog box returns, it sets these flags to indicate the user input. This member can be one or more of the following values. + + + Value + Meaning + + + + + + + CF_APPLY + + + + 0x00000200L + + + + Causes the dialog box to display the Apply button. You should provide a hook procedure to process WM_COMMAND messages for the Apply button. The hook procedure can send the WM_CHOOSEFONT_GETLOGFONT message to the dialog box to retrieve the address of the structure that contains the current selections for the font. + + + + + + + CF_ANSIONLY + + + + 0x00000400L + + + + This flag is obsolete. To limit font selections to all scripts except those that use the OEM or Symbol character sets, use CF_SCRIPTSONLY. To get the original CF_ANSIONLY behavior, use CF_SELECTSCRIPT and specify ANSI_CHARSET in the lfCharSet member of the structure pointed to by lpLogFont. + + + + + + + CF_BOTH + + + + 0x00000003 + + + + This flag is ignored for font enumeration.Windows Vista and Windows XP/2000:  Causes the dialog box to list the available printer and screen fonts. The hDC member is a handle to the device context or information context associated with the printer. This flag is a combination of the CF_SCREENFONTS and CF_PRINTERFONTS flags. + + + + + + + CF_EFFECTS + + + + 0x00000100L + + + + Causes the dialog box to display the controls that allow the user to specify strikeout, underline, and text color options. If this flag is set, you can use the rgbColors member to specify the initial text color. You can use the lfStrikeOut and lfUnderline members of the structure pointed to by lpLogFont to specify the initial settings of the strikeout and underline check boxes. ChooseFont can use these members to return the user's selections. + + + + + + + CF_ENABLEHOOK + + + + 0x00000008L + + + + Enables the hook procedure specified in the lpfnHook member of this structure. + + + + + + + CF_ENABLETEMPLATE + + + + 0x00000010L + + + + Indicates that the hInstance and lpTemplateName members specify a dialog box template to use in place of the default template. + + + + + + + CF_ENABLETEMPLATEHANDLE + + + + 0x00000020L + + + + Indicates that the hInstance member identifies a data block that contains a preloaded dialog box template. The system ignores the lpTemplateName member if this flag is specified. + + + + + + + CF_FIXEDPITCHONLY + + + + 0x00004000L + + + + + ChooseFont should enumerate and allow selection of only fixed-pitch fonts. + + + + + + + CF_FORCEFONTEXIST + + + + 0x00010000L + + + + + ChooseFont should indicate an error condition if the user attempts to select a font or style that is not listed in the dialog box. + + + + + + + CF_INACTIVEFONTS + + + + 0x02000000L + + + + + + ChooseFont should additionally display fonts that are set to Hide in Fonts Control Panel. + + Windows Vista and Windows XP/2000:  This flag is not supported until Windows 7. + + + + + + + + CF_INITTOLOGFONTSTRUCT + + + + 0x00000040L + + + + + ChooseFont should use the structure pointed to by the lpLogFont member to initialize the dialog box controls. + + + + + + + CF_LIMITSIZE + + + + 0x00002000L + + + + + ChooseFont should select only font sizes within the range specified by the nSizeMin and nSizeMax members. + + + + + + + CF_NOOEMFONTS + + + + 0x00000800L + + + + Same as the CF_NOVECTORFONTS flag. + + + + + + + CF_NOFACESEL + + + + 0x00080000L + + + + When using a structure to initialize the dialog box controls, use this flag to prevent the dialog box from displaying an initial selection for the font name combo box. This is useful when there is no single font name that applies to the text selection. + + + + + + + CF_NOSCRIPTSEL + + + + 0x00800000L + + + + Disables the Script combo box. When this flag is set, the lfCharSet member of the structure is set to DEFAULT_CHARSET when ChooseFont returns. This flag is used only to initialize the dialog box. + + + + + + + CF_NOSIMULATIONS + + + + 0x00001000L + + + + + ChooseFont should not display or allow selection of font simulations. + + + + + + + CF_NOSIZESEL + + + + 0x00200000L + + + + When using a structure to initialize the dialog box controls, use this flag to prevent the dialog box from displaying an initial selection for the Font Size combo box. This is useful when there is no single font size that applies to the text selection. + + + + + + + CF_NOSTYLESEL + + + + 0x00100000L + + + + When using a structure to initialize the dialog box controls, use this flag to prevent the dialog box from displaying an initial selection for the Font Style combo box. This is useful when there is no single font style that applies to the text selection. + + + + + + + CF_NOVECTORFONTS + + + + 0x00000800L + + + + + ChooseFont should not allow vector font selections. + + + + + + + CF_NOVERTFONTS + + + + 0x01000000L + + + + Causes the Font dialog box to list only horizontally oriented fonts. + + + + + + + CF_PRINTERFONTS + + + + 0x00000002 + + + + This flag is ignored for font enumeration.Windows Vista and Windows XP/2000:  Causes the dialog box to list only the fonts supported by the printer associated with the device context or information context identified by the hDC member. It also causes the font type description label to appear at the bottom of the Font dialog box. + + + + + + + CF_SCALABLEONLY + + + + 0x00020000L + + + + Specifies that ChooseFont should allow only the selection of scalable fonts. Scalable fonts include vector fonts, scalable printer fonts, TrueType fonts, and fonts scaled by other technologies. + + + + + + + CF_SCREENFONTS + + + + 0x00000001 + + + + This flag is ignored for font enumeration.Windows Vista and Windows XP/2000:  Causes the dialog box to list only the screen fonts supported by the system. + + + + + + + CF_SCRIPTSONLY + + + + 0x00000400L + + + + + ChooseFont should allow selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set. This supersedes the CF_ANSIONLY value. + + + + + + + CF_SELECTSCRIPT + + + + 0x00400000L + + + + When specified on input, only fonts with the character set identified in the lfCharSet member of the structure are displayed. The user will not be allowed to change the character set specified in the Scripts combo box. + + + + + + + CF_SHOWHELP + + + + 0x00000004L + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + + CF_TTONLY + + + + 0x00040000L + + + + + ChooseFont should only enumerate and allow the selection of TrueType fonts. + + + + + + + CF_USESTYLE + + + + 0x00000080L + + + + The lpszStyle member is a pointer to a buffer that contains style data that ChooseFont should use to initialize the Font Style combo box. When the user closes the dialog box, ChooseFont copies style data for the user's selection to this buffer.
Note  To globalize your application, you should specify the style by using the lfWeight and lfItalic members of the structure pointed to by lpLogFont. The style name may change depending on the system user interface language.
+
+ + + + + + CF_WYSIWYG + + + + 0x00008000L + + + + Obsolete. ChooseFont ignores this flag.Windows Vista and Windows XP/2000:  ChooseFont should allow only the selection of fonts available on both the printer and the display. If this flag is specified, the CF_SCREENSHOTS and CF_PRINTERFONTS, or CF_BOTH flags should also be specified. + +
+
+
+ + If the CF_EFFECTS flag is set, rgbColors specifies the initial text color. When ChooseFont returns successfully, this member contains the RGB value of the text color that the user selected. To create a COLORREF color value, use the macro. + + + Application-defined data that the system passes to the hook procedure identified by the lpfnHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the CHOOSEFONT structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to a CFHookProc hook procedure that can process messages intended for the dialog box. This member is ignored unless the CF_ENABLEHOOK flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, lpTemplateName can be a value returned by the macro. This member is ignored unless the CF_ENABLETEMPLATE flag is set in the Flags member. + + + If the CF_ENABLETEMPLATEHANDLE flag is set in the Flags member, hInstance is a handle to a memory object containing a dialog box template. If the CF_ENABLETEMPLATE flag is set, hInstance is a handle to a module that contains a dialog box template named by the lpTemplateName member. If neither CF_ENABLETEMPLATEHANDLE nor CF_ENABLETEMPLATE is set, this member is ignored. + + + The style data. If the CF_USESTYLE flag is specified, ChooseFont uses the data in this buffer to initialize the Font Style combo box. When the user closes the dialog box, ChooseFont copies the string in the Font Style combo box into this buffer. + + + + The type of the selected font when ChooseFont returns. This member can be one or more of the following values. + + + Value + Meaning + + + + + + + BOLD_FONTTYPE + + + + 0x0100 + + + + The font weight is bold. This information is duplicated in the lfWeight member of the structure and is equivalent to FW_BOLD. + + + + + + + ITALIC_FONTTYPE + + + + 0x0200 + + + + The italic font attribute is set. This information is duplicated in the lfItalic member of the structure. + + + + + + + PRINTER_FONTTYPE + + + + 0x4000 + + + + The font is a printer font. + + + + + + + REGULAR_FONTTYPE + + + + 0x0400 + + + + The font weight is normal. This information is duplicated in the lfWeight member of the structure and is equivalent to FW_REGULAR. + + + + + + + SCREEN_FONTTYPE + + + + 0x2000 + + + + The font is a screen font. + + + + + + + SIMULATED_FONTTYPE + + + + 0x8000 + + + + The font is simulated by the graphics device interface (GDI). + + + + + + The minimum point size a user can select. ChooseFont recognizes this member only if the CF_LIMITSIZE flag is specified. + + + The maximum point size a user can select. ChooseFont recognizes this member only if the CF_LIMITSIZE flag is specified. + +
\ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/DEVNAMES.xml b/sources/Interop/Windows/Windows/um/CommDlg/DEVNAMES.xml new file mode 100644 index 0000000000..73f77aab72 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/DEVNAMES.xml @@ -0,0 +1,20 @@ + + + + + + Contains strings that identify the driver, device, and output port names for a printer. These strings must be ANSI strings when the ANSI version of PrintDlg or PrintDlgEx is used, and must be Unicode strings when the Unicode version of PrintDlg or PrintDlgEx is used. The PrintDlgEx and PrintDlg functions use these strings to initialize the system-defined Print Property Sheet or Print Dialog Box. When the user closes the property sheet or dialog box, information about the selected printer is returned in this structure. + + + The offset, in characters, from the beginning of this structure to a null-terminated string that contains the file name (without the extension) of the device driver. On input, this string is used to determine the printer to display initially in the dialog box. + + + The offset, in characters, from the beginning of this structure to the null-terminated string that contains the name of the device. + + + The offset, in characters, from the beginning of this structure to the null-terminated string that contains the device name for the physical output medium (output port). + + + Indicates whether the strings contained in the DEVNAMES structure identify the default printer. This string is used to verify that the default printer has not changed since the last print operation. If any of the strings do not match, a warning message is displayed informing the user that the document may need to be reformatted. On output, the wDefault member is changed only if the Print Setup dialog box was displayed and the user chose the OK button. The DN_DEFAULTPRN flag is used if the default printer was selected. If a specific printer is selected, the flag is not used. All other flags in this member are reserved for internal use by the dialog box procedure for the Print property sheet or Print dialog box. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEA.xml b/sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEA.xml new file mode 100644 index 0000000000..9db8945f0d --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/FINDREPLACEA.xml @@ -0,0 +1,611 @@ + + + + + + Contains information that the and functions use to initialize the Find and Replace dialog boxes. The FINDMSGSTRING registered message uses this structure to pass the user's search or replacement input to the owner window of a Find or Replace dialog box. + + + The length, in bytes, of the structure. + + + A handle to the window that owns the dialog box. The window procedure of the specified window receives FINDMSGSTRING messages from the dialog box. This member can be any valid window handle, but it must not be NULL. + + + If the FR_ENABLETEMPLATEHANDLE flag is set in the Flags, hInstance is a handle to a memory object containing a dialog box template. If the FR_ENABLETEMPLATE flag is set, hInstance is a handle to a module that contains a dialog box template named by the lpTemplateName member. If neither flag is set, this member is ignored. + + + + A set of bit flags that you can use to initialize the dialog box. The dialog box sets these flags when it sends the FINDMSGSTRING registered message to indicate the user's input. This member can be one or more of the following values. + + + Value + Meaning + + + + + + + FR_DIALOGTERM + + + + 0x00000040 + + + + If set in a FINDMSGSTRING message, indicates that the dialog box is closing. When you receive a message with this flag set, the dialog box handle returned by the or function is no longer valid. + + + + + + + FR_DOWN + + + + 0x00000001 + + + + If set, the Down button of the direction radio buttons in a Find dialog box is selected indicating that you should search from the current location to the end of the document. If not set, the Up button is selected so you should search to the beginning of the document. You can set this flag to initialize the dialog box. If set in a FINDMSGSTRING message, indicates the user's selection. + + + + + + + FR_ENABLEHOOK + + + + 0x00000100 + + + + Enables the hook function specified in the lpfnHook member. This flag is used only to initialize the dialog box. + + + + + + + FR_ENABLETEMPLATE + + + + 0x00000200 + + + + Indicates that the hInstance and lpTemplateName members specify a dialog box template to use in place of the default template. This flag is used only to initialize the dialog box. + + + + + + + FR_ENABLETEMPLATEHANDLE + + + + 0x00002000 + + + + Indicates that the hInstance member identifies a data block that contains a preloaded dialog box template. The system ignores the lpTemplateName member if this flag is specified. + + + + + + + FR_FINDNEXT + + + + 0x00000008 + + + + If set in a FINDMSGSTRING message, indicates that the user clicked the Find Next button in a Find or Replace dialog box. The lpstrFindWhat member specifies the string to search for. + + + + + + + FR_HIDEUPDOWN + + + + 0x00004000 + + + + If set when initializing a Find dialog box, hides the search direction radio buttons. + + + + + + + FR_HIDEMATCHCASE + + + + 0x00008000 + + + + If set when initializing a Find or Replace dialog box, hides the Match Case check box. + + + + + + + FR_HIDEWHOLEWORD + + + + 0x00010000 + + + + If set when initializing a Find or Replace dialog box, hides the Match Whole Word Only check box. + + + + + + + FR_MATCHCASE + + + + 0x00000004 + + + + If set, the Match Case check box is selected indicating that the search should be case-sensitive. If not set, the check box is unselected so the search should be case-insensitive. You can set this flag to initialize the dialog box. If set in a FINDMSGSTRING message, indicates the user's selection. + + + + + + + FR_NOMATCHCASE + + + + 0x00000800 + + + + If set when initializing a Find or Replace dialog box, disables the Match Case check box. + + + + + + + FR_NOUPDOWN + + + + 0x00000400 + + + + If set when initializing a Find dialog box, disables the search direction radio buttons. + + + + + + + FR_NOWHOLEWORD + + + + 0x00001000 + + + + If set when initializing a Find or Replace dialog box, disables the Whole Word check box. + + + + + + + FR_REPLACE + + + + 0x00000010 + + + + If set in a FINDMSGSTRING message, indicates that the user clicked the Replace button in a Replace dialog box. The lpstrFindWhat member specifies the string to be replaced and the lpstrReplaceWith member specifies the replacement string. + + + + + + + FR_REPLACEALL + + + + 0x00000020 + + + + If set in a FINDMSGSTRING message, indicates that the user clicked the Replace All button in a Replace dialog box. The lpstrFindWhat member specifies the string to be replaced and the lpstrReplaceWith member specifies the replacement string. + + + + + + + FR_SHOWHELP + + + + 0x00000080 + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + + FR_WHOLEWORD + + + + 0x00000002 + + + + If set, the Match Whole Word Only check box is selected indicating that you should search only for whole words that match the search string. If not set, the check box is unselected so you should also search for word fragments that match the search string. You can set this flag to initialize the dialog box. If set in a FINDMSGSTRING message, indicates the user's selection. + + + + + + The search string that the user typed in the Find What edit control. You must dynamically allocate the buffer or use a global or static array so it does not go out of scope before the dialog box closes. The buffer should be at least 80 characters long. If the buffer contains a string when you initialize the dialog box, the string is displayed in the Find What edit control. If a FINDMSGSTRING message specifies the FR_FINDNEXT flag, lpstrFindWhat contains the string to search for. The FR_DOWN, FR_WHOLEWORD, and FR_MATCHCASE flags indicate the direction and type of search. If a FINDMSGSTRING message specifies the FR_REPLACE or FR_REPLACE flags, lpstrFindWhat contains the string to be replaced. + + + + The replacement string that the user typed in the Replace With edit control. You must dynamically allocate the buffer or use a global or static array so it does not go out of scope before the dialog box closes. If the buffer contains a string when you initialize the dialog box, the string is displayed in the Replace With edit control. + If a FINDMSGSTRING message specifies the FR_REPLACE or FR_REPLACEALL flags, lpstrReplaceWith contains the replacement string . + The function ignores this member. + + + + The length, in bytes, of the buffer pointed to by the lpstrFindWhat member. + + + The length, in bytes, of the buffer pointed to by the lpstrReplaceWith member. + + + Application-defined data that the system passes to the hook procedure identified by the lpfnHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the FINDREPLACE structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to an FRHookProc hook procedure that can process messages intended for the dialog box. This member is ignored unless the FR_ENABLEHOOK flag is set in the Flags member. If the hook procedure returns FALSE in response to the WM_INITDIALOG message, the hook procedure must display the dialog box or else the dialog box will not be shown. To do this, first perform any other paint operations, and then call the and functions. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, this can be a value returned by the macro. This member is ignored unless the FR_ENABLETEMPLATE flag is set in the Flags member. + + + Contains information that the and functions use to initialize the Find and Replace dialog boxes. The FINDMSGSTRING registered message uses this structure to pass the user's search or replacement input to the owner window of a Find or Replace dialog box. + + + The length, in bytes, of the structure. + + + A handle to the window that owns the dialog box. The window procedure of the specified window receives FINDMSGSTRING messages from the dialog box. This member can be any valid window handle, but it must not be NULL. + + + If the FR_ENABLETEMPLATEHANDLE flag is set in the Flags, hInstance is a handle to a memory object containing a dialog box template. If the FR_ENABLETEMPLATE flag is set, hInstance is a handle to a module that contains a dialog box template named by the lpTemplateName member. If neither flag is set, this member is ignored. + + + + A set of bit flags that you can use to initialize the dialog box. The dialog box sets these flags when it sends the FINDMSGSTRING registered message to indicate the user's input. This member can be one or more of the following values. + + + Value + Meaning + + + + + + + FR_DIALOGTERM + + + + 0x00000040 + + + + If set in a FINDMSGSTRING message, indicates that the dialog box is closing. When you receive a message with this flag set, the dialog box handle returned by the or function is no longer valid. + + + + + + + FR_DOWN + + + + 0x00000001 + + + + If set, the Down button of the direction radio buttons in a Find dialog box is selected indicating that you should search from the current location to the end of the document. If not set, the Up button is selected so you should search to the beginning of the document. You can set this flag to initialize the dialog box. If set in a FINDMSGSTRING message, indicates the user's selection. + + + + + + + FR_ENABLEHOOK + + + + 0x00000100 + + + + Enables the hook function specified in the lpfnHook member. This flag is used only to initialize the dialog box. + + + + + + + FR_ENABLETEMPLATE + + + + 0x00000200 + + + + Indicates that the hInstance and lpTemplateName members specify a dialog box template to use in place of the default template. This flag is used only to initialize the dialog box. + + + + + + + FR_ENABLETEMPLATEHANDLE + + + + 0x00002000 + + + + Indicates that the hInstance member identifies a data block that contains a preloaded dialog box template. The system ignores the lpTemplateName member if this flag is specified. + + + + + + + FR_FINDNEXT + + + + 0x00000008 + + + + If set in a FINDMSGSTRING message, indicates that the user clicked the Find Next button in a Find or Replace dialog box. The lpstrFindWhat member specifies the string to search for. + + + + + + + FR_HIDEUPDOWN + + + + 0x00004000 + + + + If set when initializing a Find dialog box, hides the search direction radio buttons. + + + + + + + FR_HIDEMATCHCASE + + + + 0x00008000 + + + + If set when initializing a Find or Replace dialog box, hides the Match Case check box. + + + + + + + FR_HIDEWHOLEWORD + + + + 0x00010000 + + + + If set when initializing a Find or Replace dialog box, hides the Match Whole Word Only check box. + + + + + + + FR_MATCHCASE + + + + 0x00000004 + + + + If set, the Match Case check box is selected indicating that the search should be case-sensitive. If not set, the check box is unselected so the search should be case-insensitive. You can set this flag to initialize the dialog box. If set in a FINDMSGSTRING message, indicates the user's selection. + + + + + + + FR_NOMATCHCASE + + + + 0x00000800 + + + + If set when initializing a Find or Replace dialog box, disables the Match Case check box. + + + + + + + FR_NOUPDOWN + + + + 0x00000400 + + + + If set when initializing a Find dialog box, disables the search direction radio buttons. + + + + + + + FR_NOWHOLEWORD + + + + 0x00001000 + + + + If set when initializing a Find or Replace dialog box, disables the Whole Word check box. + + + + + + + FR_REPLACE + + + + 0x00000010 + + + + If set in a FINDMSGSTRING message, indicates that the user clicked the Replace button in a Replace dialog box. The lpstrFindWhat member specifies the string to be replaced and the lpstrReplaceWith member specifies the replacement string. + + + + + + + FR_REPLACEALL + + + + 0x00000020 + + + + If set in a FINDMSGSTRING message, indicates that the user clicked the Replace All button in a Replace dialog box. The lpstrFindWhat member specifies the string to be replaced and the lpstrReplaceWith member specifies the replacement string. + + + + + + + FR_SHOWHELP + + + + 0x00000080 + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + + FR_WHOLEWORD + + + + 0x00000002 + + + + If set, the Match Whole Word Only check box is selected indicating that you should search only for whole words that match the search string. If not set, the check box is unselected so you should also search for word fragments that match the search string. You can set this flag to initialize the dialog box. If set in a FINDMSGSTRING message, indicates the user's selection. + + + + + + The search string that the user typed in the Find What edit control. You must dynamically allocate the buffer or use a global or static array so it does not go out of scope before the dialog box closes. The buffer should be at least 80 characters long. If the buffer contains a string when you initialize the dialog box, the string is displayed in the Find What edit control. If a FINDMSGSTRING message specifies the FR_FINDNEXT flag, lpstrFindWhat contains the string to search for. The FR_DOWN, FR_WHOLEWORD, and FR_MATCHCASE flags indicate the direction and type of search. If a FINDMSGSTRING message specifies the FR_REPLACE or FR_REPLACE flags, lpstrFindWhat contains the string to be replaced. + + + + The replacement string that the user typed in the Replace With edit control. You must dynamically allocate the buffer or use a global or static array so it does not go out of scope before the dialog box closes. If the buffer contains a string when you initialize the dialog box, the string is displayed in the Replace With edit control. + If a FINDMSGSTRING message specifies the FR_REPLACE or FR_REPLACEALL flags, lpstrReplaceWith contains the replacement string . + The function ignores this member. + + + + The length, in bytes, of the buffer pointed to by the lpstrFindWhat member. + + + The length, in bytes, of the buffer pointed to by the lpstrReplaceWith member. + + + Application-defined data that the system passes to the hook procedure identified by the lpfnHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the FINDREPLACE structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to an FRHookProc hook procedure that can process messages intended for the dialog box. This member is ignored unless the FR_ENABLEHOOK flag is set in the Flags member. If the hook procedure returns FALSE in response to the WM_INITDIALOG message, the hook procedure must display the dialog box or else the dialog box will not be shown. To do this, first perform any other paint operations, and then call the and functions. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, this can be a value returned by the macro. This member is ignored unless the FR_ENABLETEMPLATE flag is set in the Flags member. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallback.xml b/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallback.xml new file mode 100644 index 0000000000..e89920ef56 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogCallback.xml @@ -0,0 +1,52 @@ + + + + + + + IUnknown's + AddRef method + + + Called by PrintDlgEx to give your application an opportunity to handle messages sent to the child dialog box in the lower portion of the General page of the Print Property Sheet. The child dialog box contains controls similar to those of the Print dialog box. + A handle to the child dialog box in the lower portion of the General page. + The identifier of the message being received. + Additional information about the message. The exact meaning depends on the value of the uMsg parameter. + + Additional information about the message. The exact meaning depends on the value of the uMsg parameter. + If the uMsg parameter indicates the WM_INITDIALOG message, lParam is a pointer to a structure containing the values specified when the property sheet was created. + + Indicates the result to be returned by the dialog box procedure for the message. The value pointed to should be TRUE if you process the message, otherwise it should be FALSE or whatever is an appropriate value according to the message type. + + Return S_OK if your IPrintDialogCallback.HandleMessage implementation handled the message. In this case, the PrintDlgEx function does not perform any default message handling. + Return S_FALSE if you want PrintDlgEx to perform its default message handling. + + + + Called by PrintDlgEx when the system has finished initializing the General page of the Print Property Sheet. + + Return S_OK to prevent the PrintDlgEx function from performing its default actions. + Return S_FALSE to allow PrintDlgEx to perform its default actions. Currently, PrintDlgEx does not perform any default processing after the InitDone call. + + + + + IUnknown's + QueryInterface method + + + + IUnknown's + Release method + + + Called by PrintDlgEx when the user selects a different printer from the list of installed printers on the General page of the Print Property Sheet. + + Return S_OK to prevent the PrintDlgEx function from performing its default actions. + Return S_FALSE to allow PrintDlgEx to perform its default actions, which include adjustments to the Copies, Collate, and Print Range items. + + + + Provides methods that enable an application to receive notifications and messages from the PrintDlgEx function while the Print Property Sheet is displayed. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogServices.xml b/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogServices.xml new file mode 100644 index 0000000000..50c6c06fed --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/IPrintDialogServices.xml @@ -0,0 +1,59 @@ + + + + + + + IUnknown's + AddRef method + + + Fills a structure with information about the currently selected printer for use with PrintDlgEx. + A pointer to a buffer that receives a structure containing information about the currently selected printer. + + On input, the variable specifies the size, in bytes, of the buffer pointed to by the lpDevMode parameter. On output, the variable contains the number of bytes written to lpDevMode. + If the size is zero on input, the function returns the required buffer size (in bytes) in pcbSize and does not use the lpDevMode buffer. + + + If the method is successful, the return value is S_OK. If no printer is currently selected, the return value is S_OK, the value returned in pcbSize is zero, and the lpDevMode buffer is unchanged. + If an error occurs, the return value is a COM error code. For more information, see Error Handling. + + + + Retrieves the name of the current port for use with PrintDlgEx. + The name of the current port. + + On input, the variable specifies the size, in characters, of the buffer pointed to by the lpPortName parameter. On output, the variable contains the number of bytes (ANSI) or characters (Unicode), including the terminating null character, written to the buffer. + If the size is zero on input, the function returns the required buffer size (in bytes or characters) in pcchSize and does not use the lpPortName buffer. + + + If the method is successful, the return value is S_OK. If there is no current port, the return value is S_OK, the value returned in pcchSize is zero, and the lpPortName buffer is unchanged. + If an error occurs, the return value is a COM error code. For more information, see Error Handling. + + + + Retrieves the name of the currently selected printer, for use with PrintDlgEx. + The name of the currently selected printer. + + On input, the variable specifies the size, in characters, of the buffer pointed to by the lpPrinterName parameter. On output, the variable contains the number of bytes (ANSI) or characters (Unicode), including the terminating null character, written to the buffer. + If the size is zero on input, the function returns the required buffer size (in bytes or characters) in pcchSize and does not use the lpPrinterName buffer. + + + If the method is successful, the return value is S_OK. If no printer is currently selected, the return value is S_OK, the value returned in pcchSize is zero, and the lpPrinterName buffer is unchanged. + If an error occurs, the return value is a COM error code. For more information, see Error Handling. + + + + + IUnknown's + QueryInterface method + + + + IUnknown's + Release method + + + Provides methods that enable an application using the PrintDlgEx function to retrieve information about the currently selected printer. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYA.xml b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYA.xml new file mode 100644 index 0000000000..0a4e8eb46f --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYA.xml @@ -0,0 +1,29 @@ + + + + + + Contains information about a WM_NOTIFY message sent to an OFNHookProc hook procedure for an Open or Save As dialog box. The lParam parameter of the WM_NOTIFY message is a pointer to an OFNOTIFY structure. + + + The code member of this structure can be one of the following notification messages that identify the message being sent: CDN_FILEOK, CDN_FOLDERCHANGE, CDN_HELP, CDN_INITDONE, CDN_SELCHANGE, CDN_SHAREVIOLATION, CDN_TYPECHANGE. + + + A pointer to the structure that was specified when the Open or Save As dialog box was created. For some of the notification messages, this structure contains additional information about the event that caused the notification. + + + The file name for which a network sharing violation has occurred. This member is valid only with the CDN_SHAREVIOLATION notification message. + + + Contains information about a WM_NOTIFY message sent to an OFNHookProc hook procedure for an Open or Save As dialog box. The lParam parameter of the WM_NOTIFY message is a pointer to an OFNOTIFY structure. + + + The code member of this structure can be one of the following notification messages that identify the message being sent: CDN_FILEOK, CDN_FOLDERCHANGE, CDN_HELP, CDN_INITDONE, CDN_SELCHANGE, CDN_SHAREVIOLATION, CDN_TYPECHANGE. + + + A pointer to the structure that was specified when the Open or Save As dialog box was created. For some of the notification messages, this structure contains additional information about the event that caused the notification. + + + The file name for which a network sharing violation has occurred. This member is valid only with the CDN_SHAREVIOLATION notification message. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXA.xml b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXA.xml new file mode 100644 index 0000000000..243f427685 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OFNOTIFYEXA.xml @@ -0,0 +1,35 @@ + + + + + + Contains information about a CDN_INCLUDEITEM notification message. + + + The code member of this structure identifies the notification message being sent. + + + A pointer to an structure containing the values specified when the Open or Save As dialog box was created. + + + A pointer to the interface for the folder or shell name-space extension whose items are being enumerated. + + + A pointer to an item identifier list that identifies an item in the container identified by the psf member. The item identifier is relative to the psf container. + + + Contains information about a CDN_INCLUDEITEM notification message. + + + The code member of this structure identifies the notification message being sent. + + + A pointer to an structure containing the values specified when the Open or Save As dialog box was created. + + + A pointer to the interface for the folder or shell name-space extension whose items are being enumerated. + + + A pointer to an item identifier list that identifies an item in the container identified by the psf member. The item identifier is relative to the psf container. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4A.xml b/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4A.xml new file mode 100644 index 0000000000..a46745c314 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/OPENFILENAME_NT4A.xml @@ -0,0 +1,59 @@ + + + + + + + The OPENFILENAME_NT4 structure is identical to with _WIN32_WINNT set to 0x0400. It allows an application to take advantage of other post-Microsoft Windows NT 4.0 features while running on Microsoft Windows NT 4.0. Also, MFC42 applications must use OPENFILENAME_NT4 to avoid heap corruption. This is because Microsoft Foundation Classes (MFC) has classes with embedded OPENFILENAME structures, and you must use the same structure size. +
+ Note  This structure is provided only for compatibility.
+
+
+ + + + + + + + + + + + + + + + + + + + + + + The OPENFILENAME_NT4 structure is identical to with _WIN32_WINNT set to 0x0400. It allows an application to take advantage of other post-Microsoft Windows NT 4.0 features while running on Microsoft Windows NT 4.0. Also, MFC42 applications must use OPENFILENAME_NT4 to avoid heap corruption. This is because Microsoft Foundation Classes (MFC) has classes with embedded OPENFILENAME structures, and you must use the same structure size. +
+ Note  This structure is provided only for compatibility.
+
+
+ + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGA.xml b/sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGA.xml new file mode 100644 index 0000000000..efc9ccdd42 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PAGESETUPDLGA.xml @@ -0,0 +1,683 @@ + + + + + + Contains information the PageSetupDlg function uses to initialize the Page Setup dialog box. After the user closes the dialog box, the system returns information about the user-defined page parameters in this structure. + + + The size, in bytes, of this structure. + + + A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. + + + A handle to a global memory object that contains a structure. On input, if a handle is specified, the values in the corresponding DEVMODE structure are used to initialize the controls in the dialog box. On output, the dialog box sets hDevMode to a global memory handle to a DEVMODE structure that contains values specifying the user's selections. If the user's selections are not available, the dialog box sets hDevMode to NULL. + + + A handle to a global memory object that contains a structure. This structure contains three strings that specify the driver name, the printer name, and the output port name. On input, if a handle is specified, the strings in the corresponding DEVNAMES structure are used to initialize controls in the dialog box. On output, the dialog box setshDevNames to a global memory handle to a DEVNAMES structure that contains strings specifying the user's selections. If the user's selections are not available, the dialog box sets hDevNames to NULL. + + + + A set of bit flags that you can use to initialize the Page Setup dialog box. When the dialog box returns, it sets these flags to indicate the user's input. This member can be one or more of the following values. + + + Value + Meaning + + + + + + + PSD_DEFAULTMINMARGINS + + + + 0x00000000 + + + + Sets the minimum values that the user can specify for the page margins to be the minimum margins allowed by the printer. This is the default. This flag is ignored if the PSD_MARGINS and PSD_MINMARGINS flags are also specified. + + + + + + + PSD_DISABLEMARGINS + + + + 0x00000010 + + + + Disables the margin controls, preventing the user from setting the margins. + + + + + + + PSD_DISABLEORIENTATION + + + + 0x00000100 + + + + Disables the orientation controls, preventing the user from setting the page orientation. + + + + + + + PSD_DISABLEPAGEPAINTING + + + + 0x00080000 + + + + Prevents the dialog box from drawing the contents of the sample page. If you enable a PagePaintHook hook procedure, you can still draw the contents of the sample page. + + + + + + + PSD_DISABLEPAPER + + + + 0x00000200 + + + + Disables the paper controls, preventing the user from setting page parameters such as the paper size and source. + + + + + + + PSD_DISABLEPRINTER + + + + 0x00000020 + + + + Obsolete.Windows XP/2000:  Disables the Printer button, preventing the user from invoking a dialog box that contains additional printer setup information. + + + + + + + PSD_ENABLEPAGEPAINTHOOK + + + + 0x00040000 + + + + Enables the hook procedure specified in the lpfnPagePaintHook member. + + + + + + + PSD_ENABLEPAGESETUPHOOK + + + + 0x00002000 + + + + Enables the hook procedure specified in the lpfnPageSetupHook member. + + + + + + + PSD_ENABLEPAGESETUPTEMPLATE + + + + 0x00008000 + + + + Indicates that the hInstance and lpPageSetupTemplateName members specify a dialog box template to use in place of the default template. + + + + + + + PSD_ENABLEPAGESETUPTEMPLATEHANDLE + + + + 0x00020000 + + + + Indicates that the hPageSetupTemplate member identifies a data block that contains a preloaded dialog box template. The system ignores the lpPageSetupTemplateName member if this flag is specified. + + + + + + + PSD_INHUNDREDTHSOFMILLIMETERS + + + + 0x00000008 + + + + Indicates that hundredths of millimeters are the unit of measurement for margins and paper size. The values in the rtMargin, rtMinMargin, and ptPaperSize members are in hundredths of millimeters. You can set this flag on input to override the default unit of measurement for the user's locale. When the function returns, the dialog box sets this flag to indicate the units used. + + + + + + + PSD_INTHOUSANDTHSOFINCHES + + + + 0x00000004 + + + + Indicates that thousandths of inches are the unit of measurement for margins and paper size. The values in the rtMargin, rtMinMargin, and ptPaperSize members are in thousandths of inches. You can set this flag on input to override the default unit of measurement for the user's locale. When the function returns, the dialog box sets this flag to indicate the units used. + + + + + + + PSD_INWININIINTLMEASURE + + + + 0x00000000 + + + + Reserved. + + + + + + + PSD_MARGINS + + + + 0x00000002 + + + + Causes the system to use the values specified in the rtMargin member as the initial widths for the left, top, right, and bottom margins. If PSD_MARGINS is not set, the system sets the initial widths to one inch for all margins. + + + + + + + PSD_MINMARGINS + + + + 0x00000001 + + + + Causes the system to use the values specified in the rtMinMargin member as the minimum allowable widths for the left, top, right, and bottom margins. The system prevents the user from entering a width that is less than the specified minimum. If PSD_MINMARGINS is not specified, the system sets the minimum allowable widths to those allowed by the printer. + + + + + + + PSD_NONETWORKBUTTON + + + + 0x00200000 + + + + Hides and disables the Network button. + + + + + + + PSD_NOWARNING + + + + 0x00000080 + + + + Prevents the system from displaying a warning message when there is no default printer. + + + + + + + PSD_RETURNDEFAULT + + + + 0x00000400 + + + + + PageSetupDlg does not display the dialog box. Instead, it sets the hDevNames and hDevMode members to handles to and structures that are initialized for the system default printer. PageSetupDlg returns an error if either hDevNames or hDevMode is not NULL. + + + + + + + PSD_SHOWHELP + + + + 0x00000800 + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + The dimensions of the paper selected by the user. The PSD_INTHOUSANDTHSOFINCHES or PSD_INHUNDREDTHSOFMILLIMETERS flag indicates the units of measurement. + + + The minimum allowable widths for the left, top, right, and bottom margins. The system ignores this member if the PSD_MINMARGINS flag is not set. These values must be less than or equal to the values specified in the rtMargin member. The PSD_INTHOUSANDTHSOFINCHES or PSD_INHUNDREDTHSOFMILLIMETERS flag indicates the units of measurement. + + + The widths of the left, top, right, and bottom margins. If you set the PSD_MARGINS flag, rtMargin specifies the initial margin values. When PageSetupDlg returns, rtMargin contains the margin widths selected by the user. The PSD_INHUNDREDTHSOFMILLIMETERS or PSD_INTHOUSANDTHSOFINCHES flag indicates the units of measurement. + + + If the PSD_ENABLEPAGESETUPTEMPLATE flag is set in the Flags member, hInstance is a handle to the application or module instance that contains the dialog box template named by the lpPageSetupTemplateName member. + + + Application-defined data that the system passes to the hook procedure identified by the lpfnPageSetupHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the PAGESETUPDLG structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to a PageSetupHook hook procedure that can process messages intended for the dialog box. This member is ignored unless the PSD_ENABLEPAGESETUPHOOK flag is set in the Flags member. + + + A pointer to a PagePaintHook hook procedure that receives WM_PSD_* messages from the dialog box whenever the sample page is redrawn. By processing the messages, the hook procedure can customize the appearance of the sample page. This member is ignored unless the PSD_ENABLEPAGEPAINTHOOK flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, lpPageSetupTemplateName can be a value returned by the macro. This member is ignored unless the PSD_ENABLEPAGESETUPTEMPLATE flag is set in the Flags member. + + + If the PSD_ENABLEPAGESETUPTEMPLATEHANDLE flag is set in the Flags member, hPageSetupTemplate is a handle to a memory object containing a dialog box template. + + + Contains information the PageSetupDlg function uses to initialize the Page Setup dialog box. After the user closes the dialog box, the system returns information about the user-defined page parameters in this structure. + + + The size, in bytes, of this structure. + + + A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. + + + A handle to a global memory object that contains a structure. On input, if a handle is specified, the values in the corresponding DEVMODE structure are used to initialize the controls in the dialog box. On output, the dialog box sets hDevMode to a global memory handle to a DEVMODE structure that contains values specifying the user's selections. If the user's selections are not available, the dialog box sets hDevMode to NULL. + + + A handle to a global memory object that contains a structure. This structure contains three strings that specify the driver name, the printer name, and the output port name. On input, if a handle is specified, the strings in the corresponding DEVNAMES structure are used to initialize controls in the dialog box. On output, the dialog box setshDevNames to a global memory handle to a DEVNAMES structure that contains strings specifying the user's selections. If the user's selections are not available, the dialog box sets hDevNames to NULL. + + + + A set of bit flags that you can use to initialize the Page Setup dialog box. When the dialog box returns, it sets these flags to indicate the user's input. This member can be one or more of the following values. + + + Value + Meaning + + + + + + + PSD_DEFAULTMINMARGINS + + + + 0x00000000 + + + + Sets the minimum values that the user can specify for the page margins to be the minimum margins allowed by the printer. This is the default. This flag is ignored if the PSD_MARGINS and PSD_MINMARGINS flags are also specified. + + + + + + + PSD_DISABLEMARGINS + + + + 0x00000010 + + + + Disables the margin controls, preventing the user from setting the margins. + + + + + + + PSD_DISABLEORIENTATION + + + + 0x00000100 + + + + Disables the orientation controls, preventing the user from setting the page orientation. + + + + + + + PSD_DISABLEPAGEPAINTING + + + + 0x00080000 + + + + Prevents the dialog box from drawing the contents of the sample page. If you enable a PagePaintHook hook procedure, you can still draw the contents of the sample page. + + + + + + + PSD_DISABLEPAPER + + + + 0x00000200 + + + + Disables the paper controls, preventing the user from setting page parameters such as the paper size and source. + + + + + + + PSD_DISABLEPRINTER + + + + 0x00000020 + + + + Obsolete.Windows XP/2000:  Disables the Printer button, preventing the user from invoking a dialog box that contains additional printer setup information. + + + + + + + PSD_ENABLEPAGEPAINTHOOK + + + + 0x00040000 + + + + Enables the hook procedure specified in the lpfnPagePaintHook member. + + + + + + + PSD_ENABLEPAGESETUPHOOK + + + + 0x00002000 + + + + Enables the hook procedure specified in the lpfnPageSetupHook member. + + + + + + + PSD_ENABLEPAGESETUPTEMPLATE + + + + 0x00008000 + + + + Indicates that the hInstance and lpPageSetupTemplateName members specify a dialog box template to use in place of the default template. + + + + + + + PSD_ENABLEPAGESETUPTEMPLATEHANDLE + + + + 0x00020000 + + + + Indicates that the hPageSetupTemplate member identifies a data block that contains a preloaded dialog box template. The system ignores the lpPageSetupTemplateName member if this flag is specified. + + + + + + + PSD_INHUNDREDTHSOFMILLIMETERS + + + + 0x00000008 + + + + Indicates that hundredths of millimeters are the unit of measurement for margins and paper size. The values in the rtMargin, rtMinMargin, and ptPaperSize members are in hundredths of millimeters. You can set this flag on input to override the default unit of measurement for the user's locale. When the function returns, the dialog box sets this flag to indicate the units used. + + + + + + + PSD_INTHOUSANDTHSOFINCHES + + + + 0x00000004 + + + + Indicates that thousandths of inches are the unit of measurement for margins and paper size. The values in the rtMargin, rtMinMargin, and ptPaperSize members are in thousandths of inches. You can set this flag on input to override the default unit of measurement for the user's locale. When the function returns, the dialog box sets this flag to indicate the units used. + + + + + + + PSD_INWININIINTLMEASURE + + + + 0x00000000 + + + + Reserved. + + + + + + + PSD_MARGINS + + + + 0x00000002 + + + + Causes the system to use the values specified in the rtMargin member as the initial widths for the left, top, right, and bottom margins. If PSD_MARGINS is not set, the system sets the initial widths to one inch for all margins. + + + + + + + PSD_MINMARGINS + + + + 0x00000001 + + + + Causes the system to use the values specified in the rtMinMargin member as the minimum allowable widths for the left, top, right, and bottom margins. The system prevents the user from entering a width that is less than the specified minimum. If PSD_MINMARGINS is not specified, the system sets the minimum allowable widths to those allowed by the printer. + + + + + + + PSD_NONETWORKBUTTON + + + + 0x00200000 + + + + Hides and disables the Network button. + + + + + + + PSD_NOWARNING + + + + 0x00000080 + + + + Prevents the system from displaying a warning message when there is no default printer. + + + + + + + PSD_RETURNDEFAULT + + + + 0x00000400 + + + + + PageSetupDlg does not display the dialog box. Instead, it sets the hDevNames and hDevMode members to handles to and structures that are initialized for the system default printer. PageSetupDlg returns an error if either hDevNames or hDevMode is not NULL. + + + + + + + PSD_SHOWHELP + + + + 0x00000800 + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + The dimensions of the paper selected by the user. The PSD_INTHOUSANDTHSOFINCHES or PSD_INHUNDREDTHSOFMILLIMETERS flag indicates the units of measurement. + + + The minimum allowable widths for the left, top, right, and bottom margins. The system ignores this member if the PSD_MINMARGINS flag is not set. These values must be less than or equal to the values specified in the rtMargin member. The PSD_INTHOUSANDTHSOFINCHES or PSD_INHUNDREDTHSOFMILLIMETERS flag indicates the units of measurement. + + + The widths of the left, top, right, and bottom margins. If you set the PSD_MARGINS flag, rtMargin specifies the initial margin values. When PageSetupDlg returns, rtMargin contains the margin widths selected by the user. The PSD_INHUNDREDTHSOFMILLIMETERS or PSD_INTHOUSANDTHSOFINCHES flag indicates the units of measurement. + + + If the PSD_ENABLEPAGESETUPTEMPLATE flag is set in the Flags member, hInstance is a handle to the application or module instance that contains the dialog box template named by the lpPageSetupTemplateName member. + + + Application-defined data that the system passes to the hook procedure identified by the lpfnPageSetupHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the PAGESETUPDLG structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to a PageSetupHook hook procedure that can process messages intended for the dialog box. This member is ignored unless the PSD_ENABLEPAGESETUPHOOK flag is set in the Flags member. + + + A pointer to a PagePaintHook hook procedure that receives WM_PSD_* messages from the dialog box whenever the sample page is redrawn. By processing the messages, the hook procedure can customize the appearance of the sample page. This member is ignored unless the PSD_ENABLEPAGEPAINTHOOK flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template is substituted for the standard dialog box template. For numbered dialog box resources, lpPageSetupTemplateName can be a value returned by the macro. This member is ignored unless the PSD_ENABLEPAGESETUPTEMPLATE flag is set in the Flags member. + + + If the PSD_ENABLEPAGESETUPTEMPLATEHANDLE flag is set in the Flags member, hPageSetupTemplate is a handle to a memory object containing a dialog box template. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGA.xml b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGA.xml new file mode 100644 index 0000000000..d17740a9d4 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGA.xml @@ -0,0 +1,887 @@ + + + + + + Contains information that the PrintDlg function uses to initialize the Print Dialog Box. After the user closes the dialog box, the system uses this structure to return information about the user's selections. + + + The structure size, in bytes. + + + A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. + + + + A handle to a movable global memory object that contains a structure. If hDevMode is not NULL on input, you must allocate a movable block of memory for the DEVMODE structure and initialize its members. The PrintDlg function uses the input data to initialize the controls in the dialog box. When PrintDlg returns, the DEVMODE members indicate the user's input. + If hDevMode is NULL on input, PrintDlg allocates memory for the structure, initializes its members to indicate the user's input, and returns a handle that identifies it. + If the device driver for the specified printer does not support extended device modes, hDevMode is NULL when PrintDlg returns. + If the device name (specified by the dmDeviceName member of the structure) does not appear in the [devices] section of WIN.INI, PrintDlg returns an error. + For more information about the hDevMode and hDevNames members, see the Remarks section at the end of this topic. + + + + + A handle to a movable global memory object that contains a structure. If hDevNames is not NULL on input, you must allocate a movable block of memory for the DEVNAMES structure and initialize its members. The PrintDlg function uses the input data to initialize the controls in the dialog box. When PrintDlg returns, the DEVNAMES members contain information for the printer chosen by the user. You can use this information to create a device context or an information context. + The hDevNames member can be NULL, in which case, PrintDlg allocates memory for the structure, initializes its members to indicate the user's input, and returns a handle that identifies it. + For more information about the hDevMode and hDevNames members, see the Remarks section at the end of this topic. + + + + A handle to a device context or an information context, depending on whether the Flags member specifies the PD_RETURNDC or PC_RETURNIC flag. If neither flag is specified, the value of this member is undefined. If both flags are specified, PD_RETURNDC has priority. + + + + Initializes the Print dialog box. When the dialog box returns, it sets these flags to indicate the user's input. This member can be one or more of the following values. + + + Value + Meaning + + + + + + + PD_ALLPAGES + + + + 0x00000000 + + + + The default flag that indicates that the All radio button is initially selected. This flag is used as a placeholder to indicate that the PD_PAGENUMS and PD_SELECTION flags are not specified. + + + + + + + PD_COLLATE + + + + 0x00000010 + + + + If this flag is set, the Collate check box is selected. If this flag is set when the PrintDlg function returns, the application must simulate collation of multiple copies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag.See PD_NOPAGENUMS. + + + + + + + PD_DISABLEPRINTTOFILE + + + + 0x00080000 + + + + Disables the Print to File check box. + + + + + + + PD_ENABLEPRINTHOOK + + + + 0x00001000 + + + + Enables the hook procedure specified in the lpfnPrintHook member. This enables the hook procedure for the Print dialog box. + + + + + + + PD_ENABLEPRINTTEMPLATE + + + + 0x00004000 + + + + Indicates that the hInstance and lpPrintTemplateName members specify a replacement for the default Print dialog box template. + + + + + + + PD_ENABLEPRINTTEMPLATEHANDLE + + + + 0x00010000 + + + + Indicates that the hPrintTemplate member identifies a data block that contains a preloaded dialog box template. This template replaces the default template for the Print dialog box. The system ignores the lpPrintTemplateName member if this flag is specified. + + + + + + + PD_ENABLESETUPHOOK + + + + 0x00002000 + + + + Enables the hook procedure specified in the lpfnSetupHook member. This enables the hook procedure for the Print Setup dialog box. + + + + + + + PD_ENABLESETUPTEMPLATE + + + + 0x00008000 + + + + Indicates that the hInstance and lpSetupTemplateName members specify a replacement for the default Print Setup dialog box template. + + + + + + + PD_ENABLESETUPTEMPLATEHANDLE + + + + 0x00020000 + + + + Indicates that the hSetupTemplate member identifies a data block that contains a preloaded dialog box template. This template replaces the default template for the Print Setup dialog box. The system ignores the lpSetupTemplateName member if this flag is specified. + + + + + + + PD_HIDEPRINTTOFILE + + + + 0x00100000 + + + + Hides the Print to File check box. + + + + + + + PD_NONETWORKBUTTON + + + + 0x00200000 + + + + Hides and disables the Network button. + + + + + + + PD_NOPAGENUMS + + + + 0x00000008 + + + + Disables the Pages radio button and the associated edit controls. Also, it causes the Collate check box to appear in the dialog. + + + + + + + PD_NOSELECTION + + + + 0x00000004 + + + + Disables the Selection radio button. + + + + + + + PD_NOWARNING + + + + 0x00000080 + + + + Prevents the warning message from being displayed when there is no default printer. + + + + + + + PD_PAGENUMS + + + + 0x00000002 + + + + If this flag is set, the Pages radio button is selected. If this flag is set when the PrintDlg function returns, the nFromPage and nToPage members indicate the starting and ending pages specified by the user. + + + + + + + PD_PRINTSETUP + + + + 0x00000040 + + + + Causes the system to display the Print Setup dialog box rather than the Print dialog box. + + + + + + + PD_PRINTTOFILE + + + + 0x00000020 + + + + If this flag is set, the Print to File check box is selected. If this flag is set when the PrintDlg function returns, the offset indicated by the wOutputOffset member of the structure contains the string "FILE:". When you call the function to start the printing operation, specify this "FILE:" string in the lpszOutput member of the structure. Specifying this string causes the print subsystem to query the user for the name of the output file. + + + + + + + PD_RETURNDC + + + + 0x00000100 + + + + Causes PrintDlg to return a device context matching the selections the user made in the dialog box. The device context is returned in hDC. + + + + + + + PD_RETURNDEFAULT + + + + 0x00000400 + + + + If this flag is set, the PrintDlg function does not display the dialog box. Instead, it sets the hDevNames and hDevMode members to handles to and structures that are initialized for the system default printer. Both hDevNames and hDevMode must be NULL, or PrintDlg returns an error. + + + + + + + PD_RETURNIC + + + + 0x00000200 + + + + Similar to the PD_RETURNDC flag, except this flag returns an information context rather than a device context. If neither PD_RETURNDC nor PD_RETURNIC is specified, hDC is undefined on output. + + + + + + + PD_SELECTION + + + + 0x00000001 + + + + If this flag is set, the Selection radio button is selected. If neither PD_PAGENUMS nor PD_SELECTION is set, the All radio button is selected. + + + + + + + PD_SHOWHELP + + + + 0x00000800 + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + + PD_USEDEVMODECOPIES + + + + 0x00040000 + + + + Same as PD_USEDEVMODECOPIESANDCOLLATE. + + + + + + + PD_USEDEVMODECOPIESANDCOLLATE + + + + 0x00040000 + + + + This flag indicates whether your application supports multiple copies and collation. Set this flag on input to indicate that your application does not support multiple copies and collation. In this case, the nCopies member of the PRINTDLG structure always returns 1, and PD_COLLATE is never set in the Flags member. If this flag is not set, the application is responsible for printing and collating multiple copies. In this case, the nCopies member of the PRINTDLG structure indicates the number of copies the user wants to print, and the PD_COLLATE flag in the Flags member indicates whether the user wants collation.Regardless of whether this flag is set, an application can determine from nCopies and PD_COLLATE how many copies to render and whether to print them collated.If this flag is set and the printer driver does not support multiple copies, the Copies edit control is disabled. Similarly, if this flag is set and the printer driver does not support collation, the Collate check box is disabled.The dmCopies and dmCollate members of the structure contain the copies and collate information used by the printer driver. If this flag is set and the printer driver supports multiple copies, the dmCopies member indicates the number of copies requested by the user. If this flag is set and the printer driver supports collation, the dmCollate member of the DEVMODE structure indicates whether the user wants collation. If this flag is not set, the dmCopies member always returns 1, and the dmCollate member is always zero.Known issue on Windows 2000/XP/2003:  If this flag is not set before calling PrintDlg, PrintDlg might swap nCopies and dmCopies values when it returns. The workaround for this issue is use dmCopies if its value is larger than 1, else, use nCopies, for you to to get the actual number of copies to be printed when PrintDlg returns. + +  To ensure that PrintDlg or PrintDlgEx returns the correct values in the dmCopies and dmCollate members of the structure, set PD_RETURNDC = TRUE and PD_USEDEVMODECOPIESANDCOLLATE = TRUE. In so doing, the nCopies member of the PRINTDLG structure is always 1 and PD_COLLATE is always FALSE.To ensure that PrintDlg or PrintDlgEx returns the correct values in nCopies and PD_COLLATE, set PD_RETURNDC = TRUE and PD_USEDEVMODECOPIESANDCOLLATE = FALSE. In so doing, dmCopies is always 1 and dmCollate is always FALSE.On Windows Vista and Windows 7, when you call PrintDlg or PrintDlgEx with PD_RETURNDC set to TRUE and PD_USEDEVMODECOPIESANDCOLLATE set to FALSE, the PrintDlg or PrintDlgEx function sets the number of copies in the nCopies member of the PRINTDLG structure, and it sets the number of copies in the structure represented by the hDC member of the PRINTDLG structure.When making calls to GDI, you must ignore the value of nCopies, consider the value as 1, and use the returned hDC to avoid printing duplicate copies. + + + + The initial value for the starting page edit control. + When PrintDlg returns, nFromPage is the starting page specified by the user. If the Pages radio button is selected when the user clicks the Okay button, PrintDlg sets the PD_PAGENUMS flag and does not return until the user enters a starting page value that is within the minimum to maximum page range. + If the input value for either nFromPage or nToPage is outside the minimum/maximum range, PrintDlg returns an error only if the PD_PAGENUMS flag is specified; otherwise, it displays the dialog box but changes the out-of-range value to the minimum or maximum value. + + + + The initial value for the ending page edit control. When PrintDlg returns, nToPage is the ending page specified by the user. If the Pages radio button is selected when the use clicks the Okay button, PrintDlg sets the PD_PAGENUMS flag and does not return until the user enters an ending page value that is within the minimum to maximum page range. + + + The minimum value for the page range specified in the From and To page edit controls. If nMinPage equals nMaxPage, the Pages radio button and the starting and ending page edit controls are disabled. + + + The maximum value for the page range specified in the From and To page edit controls. + + + The initial number of copies for the Copies edit control if hDevMode is NULL; otherwise, the dmCopies member of the structure contains the initial value. When PrintDlg returns, nCopies contains the actual number of copies to print. This value depends on whether the application or the printer driver is responsible for printing multiple copies. If the PD_USEDEVMODECOPIESANDCOLLATE flag is set in the Flags member, nCopies is always 1 on return, and the printer driver is responsible for printing multiple copies. If the flag is not set, the application is responsible for printing the number of copies specified by nCopies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag. + + + If the PD_ENABLEPRINTTEMPLATE or PD_ENABLESETUPTEMPLATE flag is set in the Flags member, hInstance is a handle to the application or module instance that contains the dialog box template named by the lpPrintTemplateName or lpSetupTemplateName member. + + + Application-defined data that the system passes to the hook procedure identified by the lpfnPrintHook or lpfnSetupHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the PRINTDLG structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to a PrintHookProc hook procedure that can process messages intended for the Print dialog box. This member is ignored unless the PD_ENABLEPRINTHOOK flag is set in the Flags member. + + + A pointer to a SetupHookProc hook procedure that can process messages intended for the Print Setup dialog box. This member is ignored unless the PD_ENABLESETUPHOOK flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template replaces the default Print dialog box template. This member is ignored unless the PD_ENABLEPRINTTEMPLATE flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template replaces the default Print Setup dialog box template. This member is ignored unless the PD_ENABLESETUPTEMPLATE flag is set in the Flags member. + + + If the PD_ENABLEPRINTTEMPLATEHANDLE flag is set in the Flags member, hPrintTemplate is a handle to a memory object containing a dialog box template. This template replaces the default Print dialog box template. + + + If the PD_ENABLESETUPTEMPLATEHANDLE flag is set in the Flags member, hSetupTemplate is a handle to a memory object containing a dialog box template. This template replaces the default Print Setup dialog box template. + + + Contains information that the PrintDlg function uses to initialize the Print Dialog Box. After the user closes the dialog box, the system uses this structure to return information about the user's selections. + + + The structure size, in bytes. + + + A handle to the window that owns the dialog box. This member can be any valid window handle, or it can be NULL if the dialog box has no owner. + + + + A handle to a movable global memory object that contains a structure. If hDevMode is not NULL on input, you must allocate a movable block of memory for the DEVMODE structure and initialize its members. The PrintDlg function uses the input data to initialize the controls in the dialog box. When PrintDlg returns, the DEVMODE members indicate the user's input. + If hDevMode is NULL on input, PrintDlg allocates memory for the structure, initializes its members to indicate the user's input, and returns a handle that identifies it. + If the device driver for the specified printer does not support extended device modes, hDevMode is NULL when PrintDlg returns. + If the device name (specified by the dmDeviceName member of the structure) does not appear in the [devices] section of WIN.INI, PrintDlg returns an error. + For more information about the hDevMode and hDevNames members, see the Remarks section at the end of this topic. + + + + + A handle to a movable global memory object that contains a structure. If hDevNames is not NULL on input, you must allocate a movable block of memory for the DEVNAMES structure and initialize its members. The PrintDlg function uses the input data to initialize the controls in the dialog box. When PrintDlg returns, the DEVNAMES members contain information for the printer chosen by the user. You can use this information to create a device context or an information context. + The hDevNames member can be NULL, in which case, PrintDlg allocates memory for the structure, initializes its members to indicate the user's input, and returns a handle that identifies it. + For more information about the hDevMode and hDevNames members, see the Remarks section at the end of this topic. + + + + A handle to a device context or an information context, depending on whether the Flags member specifies the PD_RETURNDC or PC_RETURNIC flag. If neither flag is specified, the value of this member is undefined. If both flags are specified, PD_RETURNDC has priority. + + + + Initializes the Print dialog box. When the dialog box returns, it sets these flags to indicate the user's input. This member can be one or more of the following values. + + + Value + Meaning + + + + + + + PD_ALLPAGES + + + + 0x00000000 + + + + The default flag that indicates that the All radio button is initially selected. This flag is used as a placeholder to indicate that the PD_PAGENUMS and PD_SELECTION flags are not specified. + + + + + + + PD_COLLATE + + + + 0x00000010 + + + + If this flag is set, the Collate check box is selected. If this flag is set when the PrintDlg function returns, the application must simulate collation of multiple copies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag.See PD_NOPAGENUMS. + + + + + + + PD_DISABLEPRINTTOFILE + + + + 0x00080000 + + + + Disables the Print to File check box. + + + + + + + PD_ENABLEPRINTHOOK + + + + 0x00001000 + + + + Enables the hook procedure specified in the lpfnPrintHook member. This enables the hook procedure for the Print dialog box. + + + + + + + PD_ENABLEPRINTTEMPLATE + + + + 0x00004000 + + + + Indicates that the hInstance and lpPrintTemplateName members specify a replacement for the default Print dialog box template. + + + + + + + PD_ENABLEPRINTTEMPLATEHANDLE + + + + 0x00010000 + + + + Indicates that the hPrintTemplate member identifies a data block that contains a preloaded dialog box template. This template replaces the default template for the Print dialog box. The system ignores the lpPrintTemplateName member if this flag is specified. + + + + + + + PD_ENABLESETUPHOOK + + + + 0x00002000 + + + + Enables the hook procedure specified in the lpfnSetupHook member. This enables the hook procedure for the Print Setup dialog box. + + + + + + + PD_ENABLESETUPTEMPLATE + + + + 0x00008000 + + + + Indicates that the hInstance and lpSetupTemplateName members specify a replacement for the default Print Setup dialog box template. + + + + + + + PD_ENABLESETUPTEMPLATEHANDLE + + + + 0x00020000 + + + + Indicates that the hSetupTemplate member identifies a data block that contains a preloaded dialog box template. This template replaces the default template for the Print Setup dialog box. The system ignores the lpSetupTemplateName member if this flag is specified. + + + + + + + PD_HIDEPRINTTOFILE + + + + 0x00100000 + + + + Hides the Print to File check box. + + + + + + + PD_NONETWORKBUTTON + + + + 0x00200000 + + + + Hides and disables the Network button. + + + + + + + PD_NOPAGENUMS + + + + 0x00000008 + + + + Disables the Pages radio button and the associated edit controls. Also, it causes the Collate check box to appear in the dialog. + + + + + + + PD_NOSELECTION + + + + 0x00000004 + + + + Disables the Selection radio button. + + + + + + + PD_NOWARNING + + + + 0x00000080 + + + + Prevents the warning message from being displayed when there is no default printer. + + + + + + + PD_PAGENUMS + + + + 0x00000002 + + + + If this flag is set, the Pages radio button is selected. If this flag is set when the PrintDlg function returns, the nFromPage and nToPage members indicate the starting and ending pages specified by the user. + + + + + + + PD_PRINTSETUP + + + + 0x00000040 + + + + Causes the system to display the Print Setup dialog box rather than the Print dialog box. + + + + + + + PD_PRINTTOFILE + + + + 0x00000020 + + + + If this flag is set, the Print to File check box is selected. If this flag is set when the PrintDlg function returns, the offset indicated by the wOutputOffset member of the structure contains the string "FILE:". When you call the function to start the printing operation, specify this "FILE:" string in the lpszOutput member of the structure. Specifying this string causes the print subsystem to query the user for the name of the output file. + + + + + + + PD_RETURNDC + + + + 0x00000100 + + + + Causes PrintDlg to return a device context matching the selections the user made in the dialog box. The device context is returned in hDC. + + + + + + + PD_RETURNDEFAULT + + + + 0x00000400 + + + + If this flag is set, the PrintDlg function does not display the dialog box. Instead, it sets the hDevNames and hDevMode members to handles to and structures that are initialized for the system default printer. Both hDevNames and hDevMode must be NULL, or PrintDlg returns an error. + + + + + + + PD_RETURNIC + + + + 0x00000200 + + + + Similar to the PD_RETURNDC flag, except this flag returns an information context rather than a device context. If neither PD_RETURNDC nor PD_RETURNIC is specified, hDC is undefined on output. + + + + + + + PD_SELECTION + + + + 0x00000001 + + + + If this flag is set, the Selection radio button is selected. If neither PD_PAGENUMS nor PD_SELECTION is set, the All radio button is selected. + + + + + + + PD_SHOWHELP + + + + 0x00000800 + + + + Causes the dialog box to display the Help button. The hwndOwner member must specify the window to receive the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button. + + + + + + + PD_USEDEVMODECOPIES + + + + 0x00040000 + + + + Same as PD_USEDEVMODECOPIESANDCOLLATE. + + + + + + + PD_USEDEVMODECOPIESANDCOLLATE + + + + 0x00040000 + + + + This flag indicates whether your application supports multiple copies and collation. Set this flag on input to indicate that your application does not support multiple copies and collation. In this case, the nCopies member of the PRINTDLG structure always returns 1, and PD_COLLATE is never set in the Flags member. If this flag is not set, the application is responsible for printing and collating multiple copies. In this case, the nCopies member of the PRINTDLG structure indicates the number of copies the user wants to print, and the PD_COLLATE flag in the Flags member indicates whether the user wants collation.Regardless of whether this flag is set, an application can determine from nCopies and PD_COLLATE how many copies to render and whether to print them collated.If this flag is set and the printer driver does not support multiple copies, the Copies edit control is disabled. Similarly, if this flag is set and the printer driver does not support collation, the Collate check box is disabled.The dmCopies and dmCollate members of the structure contain the copies and collate information used by the printer driver. If this flag is set and the printer driver supports multiple copies, the dmCopies member indicates the number of copies requested by the user. If this flag is set and the printer driver supports collation, the dmCollate member of the DEVMODE structure indicates whether the user wants collation. If this flag is not set, the dmCopies member always returns 1, and the dmCollate member is always zero.Known issue on Windows 2000/XP/2003:  If this flag is not set before calling PrintDlg, PrintDlg might swap nCopies and dmCopies values when it returns. The workaround for this issue is use dmCopies if its value is larger than 1, else, use nCopies, for you to to get the actual number of copies to be printed when PrintDlg returns. + +  To ensure that PrintDlg or PrintDlgEx returns the correct values in the dmCopies and dmCollate members of the structure, set PD_RETURNDC = TRUE and PD_USEDEVMODECOPIESANDCOLLATE = TRUE. In so doing, the nCopies member of the PRINTDLG structure is always 1 and PD_COLLATE is always FALSE.To ensure that PrintDlg or PrintDlgEx returns the correct values in nCopies and PD_COLLATE, set PD_RETURNDC = TRUE and PD_USEDEVMODECOPIESANDCOLLATE = FALSE. In so doing, dmCopies is always 1 and dmCollate is always FALSE.On Windows Vista and Windows 7, when you call PrintDlg or PrintDlgEx with PD_RETURNDC set to TRUE and PD_USEDEVMODECOPIESANDCOLLATE set to FALSE, the PrintDlg or PrintDlgEx function sets the number of copies in the nCopies member of the PRINTDLG structure, and it sets the number of copies in the structure represented by the hDC member of the PRINTDLG structure.When making calls to GDI, you must ignore the value of nCopies, consider the value as 1, and use the returned hDC to avoid printing duplicate copies. + + + + The initial value for the starting page edit control. + When PrintDlg returns, nFromPage is the starting page specified by the user. If the Pages radio button is selected when the user clicks the Okay button, PrintDlg sets the PD_PAGENUMS flag and does not return until the user enters a starting page value that is within the minimum to maximum page range. + If the input value for either nFromPage or nToPage is outside the minimum/maximum range, PrintDlg returns an error only if the PD_PAGENUMS flag is specified; otherwise, it displays the dialog box but changes the out-of-range value to the minimum or maximum value. + + + + The initial value for the ending page edit control. When PrintDlg returns, nToPage is the ending page specified by the user. If the Pages radio button is selected when the use clicks the Okay button, PrintDlg sets the PD_PAGENUMS flag and does not return until the user enters an ending page value that is within the minimum to maximum page range. + + + The minimum value for the page range specified in the From and To page edit controls. If nMinPage equals nMaxPage, the Pages radio button and the starting and ending page edit controls are disabled. + + + The maximum value for the page range specified in the From and To page edit controls. + + + The initial number of copies for the Copies edit control if hDevMode is NULL; otherwise, the dmCopies member of the structure contains the initial value. When PrintDlg returns, nCopies contains the actual number of copies to print. This value depends on whether the application or the printer driver is responsible for printing multiple copies. If the PD_USEDEVMODECOPIESANDCOLLATE flag is set in the Flags member, nCopies is always 1 on return, and the printer driver is responsible for printing multiple copies. If the flag is not set, the application is responsible for printing the number of copies specified by nCopies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag. + + + If the PD_ENABLEPRINTTEMPLATE or PD_ENABLESETUPTEMPLATE flag is set in the Flags member, hInstance is a handle to the application or module instance that contains the dialog box template named by the lpPrintTemplateName or lpSetupTemplateName member. + + + Application-defined data that the system passes to the hook procedure identified by the lpfnPrintHook or lpfnSetupHook member. When the system sends the WM_INITDIALOG message to the hook procedure, the message's lParam parameter is a pointer to the PRINTDLG structure specified when the dialog was created. The hook procedure can use this pointer to get the lCustData value. + + + A pointer to a PrintHookProc hook procedure that can process messages intended for the Print dialog box. This member is ignored unless the PD_ENABLEPRINTHOOK flag is set in the Flags member. + + + A pointer to a SetupHookProc hook procedure that can process messages intended for the Print Setup dialog box. This member is ignored unless the PD_ENABLESETUPHOOK flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template replaces the default Print dialog box template. This member is ignored unless the PD_ENABLEPRINTTEMPLATE flag is set in the Flags member. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template replaces the default Print Setup dialog box template. This member is ignored unless the PD_ENABLESETUPTEMPLATE flag is set in the Flags member. + + + If the PD_ENABLEPRINTTEMPLATEHANDLE flag is set in the Flags member, hPrintTemplate is a handle to a memory object containing a dialog box template. This template replaces the default Print dialog box template. + + + If the PD_ENABLESETUPTEMPLATEHANDLE flag is set in the Flags member, hSetupTemplate is a handle to a memory object containing a dialog box template. This template replaces the default Print Setup dialog box template. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXA.xml b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXA.xml new file mode 100644 index 0000000000..9916507152 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PRINTDLGEXA.xml @@ -0,0 +1,845 @@ + + + + + + Contains information that the PrintDlgEx function uses to initialize the Print property sheet. After the user closes the property sheet, the system uses this structure to return information about the user's selections. + + + The structure size, in bytes. + + + A handle to the window that owns the property sheet. This member must be a valid window handle; it cannot be NULL. + + + + A handle to a movable global memory object that contains a structure. If hDevMode is not NULL on input, you must allocate a movable block of memory for the DEVMODE structure and initialize its members. The PrintDlgEx function uses the input data to initialize the controls in the property sheet. When PrintDlgEx returns, the DEVMODE members indicate the user's input. + If hDevMode is NULL on input, PrintDlgEx allocates memory for the structure, initializes its members to indicate the user's input, and returns a handle that identifies it. + For more information about the hDevMode and hDevNames members, see the Remarks section at the end of this topic. + + + + + A handle to a movable global memory object that contains a structure. If hDevNames is not NULL on input, you must allocate a movable block of memory for the DEVNAMES structure and initialize its members. The PrintDlgEx function uses the input data to initialize the controls in the property sheet. When PrintDlgEx returns, the DEVNAMES members contain information for the printer chosen by the user. You can use this information to create a device context or an information context. + The hDevNames member can be NULL, in which case, PrintDlgEx allocates memory for the structure, initializes its members to indicate the user's input, and returns a handle that identifies it. + For more information about the hDevMode and hDevNames members, see the Remarks section at the end of this topic. + + + + A handle to a device context or an information context, depending on whether the Flags member specifies the PD_RETURNDC or PC_RETURNIC flag. If neither flag is specified, the value of this member is undefined. If both flags are specified, PD_RETURNDC has priority. + + + + A set of bit flags that you can use to initialize the Print property sheet. When the PrintDlgEx function returns, it sets these flags to indicate the user's input. This member can be one or more of the following values. + To ensure that PrintDlg or PrintDlgEx returns the correct values in the dmCopies and dmCollate members of the structure, set PD_RETURNDC = TRUE and PD_USEDEVMODECOPIESANDCOLLATE = TRUE. In so doing, the nCopies member of the structure is always 1 and PD_COLLATE is always FALSE. + To ensure that PrintDlg or PrintDlgEx returns the correct values in nCopies and PD_COLLATE, set PD_RETURNDC = TRUE and PD_USEDEVMODECOPIESANDCOLLATE = FALSE. In so doing, dmCopies is always 1 and dmCollate is always FALSE. + Starting with Windows Vista, when you call PrintDlg or PrintDlgEx with PD_RETURNDC set to TRUE and PD_USEDEVMODECOPIESANDCOLLATE set to FALSE, the PrintDlg or PrintDlgEx function sets the number of copies in the nCopies member of the structure, and it sets the number of copies in the structure represented by the hDC member of the PRINTDLG structure. + When making calls to GDI, you must ignore the value of nCopies, consider the value as 1, and use the returned hDC to avoid printing duplicate copies. + + + Value + Meaning + + + + + + + PD_ALLPAGES + + + + 0x00000000 + + + + The default flag that indicates that the All radio button is initially selected. This flag is used as a placeholder to indicate that the PD_PAGENUMS, PD_SELECTION, and PD_CURRENTPAGE flags are not specified. + + + + + + + PD_COLLATE + + + + 0x00000010 + + + + If this flag is set, the Collate check box is selected.If this flag is set when the PrintDlgEx function returns, the application must simulate collation of multiple copies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag.See PD_NOPAGENUMS. + + + + + + + PD_CURRENTPAGE + + + + 0x00400000 + + + + If this flag is set, the Current Page radio button is selected. If none of the PD_PAGENUMS, PD_SELECTION, or PD_CURRENTPAGE flags is set, the All radio button is selected. + + + + + + + PD_DISABLEPRINTTOFILE + + + + 0x00080000 + + + + Disables the Print to File check box. + + + + + + + PD_ENABLEPRINTTEMPLATE + + + + 0x00004000 + + + + Indicates that the hInstance and lpPrintTemplateName members specify a replacement for the default dialog box template in the lower portion of the General page. The default template contains controls similar to those of the Print dialog box. The system uses the specified template to create a window that is a child of the General page. + + + + + + + PD_ENABLEPRINTTEMPLATEHANDLE + + + + 0x00010000 + + + + Indicates that the hInstance member identifies a data block that contains a preloaded dialog box template. This template replaces the default dialog box template in the lower portion of the General page. The system uses the specified template to create a window that is a child of the General page. The system ignores the lpPrintTemplateName member if this flag is specified. + + + + + + + PD_EXCLUSIONFLAGS + + + + 0x01000000 + + + + Indicates that the ExclusionFlags member identifies items to be excluded from the printer driver property pages. If this flag is not set, items will be excluded by default from the printer driver property pages. The exclusions prevent the duplication of items among the General page, any application-specified pages, and the printer driver pages. + + + + + + + PD_HIDEPRINTTOFILE + + + + 0x00100000 + + + + Hides the Print to File check box. + + + + + + + PD_NOCURRENTPAGE + + + + 0x00800000 + + + + Disables the Current Page radio button. + + + + + + + PD_NOPAGENUMS + + + + 0x00000008 + + + + Disables the Pages radio button and the associated edit controls. Also, it causes the Collate check box to appear in the dialog. + + + + + + + PD_NOSELECTION + + + + 0x00000004 + + + + Disables the Selection radio button. + + + + + + + PD_NOWARNING + + + + 0x00000080 + + + + Prevents the warning message from being displayed when an error occurs. + + + + + + + PD_PAGENUMS + + + + 0x00000002 + + + + If this flag is set, the Pages radio button is selected. If none of the PD_PAGENUMS, PD_SELECTION, or PD_CURRENTPAGE flags is set, the All radio button is selected. If this flag is set when the PrintDlgEx function returns, the lpPageRanges member indicates the page ranges specified by the user. + + + + + + + PD_PRINTTOFILE + + + + 0x00000020 + + + + If this flag is set, the Print to File check box is selected. If this flag is set when PrintDlgEx returns, the offset indicated by the wOutputOffset member of the structure contains the string "FILE:". When you call the function to start the printing operation, specify this "FILE:" string in the lpszOutput member of the structure. Specifying this string causes the print subsystem to query the user for the name of the output file. + + + + + + + PD_RETURNDC + + + + 0x00000100 + + + + Causes PrintDlgEx to return a device context matching the selections the user made in the property sheet. The device context is returned in hDC. + + + + + + + PD_RETURNDEFAULT + + + + 0x00000400 + + + + If this flag is set, the PrintDlgEx function does not display the property sheet. Instead, it sets the hDevNames and hDevMode members to handles to and structures that are initialized for the system default printer. Both hDevNames and hDevMode must be NULL, or PrintDlgEx returns an error. + + + + + + + PD_RETURNIC + + + + 0x00000200 + + + + Similar to the PD_RETURNDC flag, except this flag returns an information context rather than a device context. If neither PD_RETURNDC nor PD_RETURNIC is specified, hDC is undefined on output. + + + + + + + PD_SELECTION + + + + 0x00000001 + + + + If this flag is set, the Selection radio button is selected. If none of the PD_PAGENUMS, PD_SELECTION, or PD_CURRENTPAGE flags is set, the All radio button is selected. + + + + + + + PD_USEDEVMODECOPIES + + + + 0x00040000 + + + + Same as PD_USEDEVMODECOPIESANDCOLLATE. + + + + + + + PD_USEDEVMODECOPIESANDCOLLATE + + + + 0x00040000 + + + + This flag indicates whether your application supports multiple copies and collation. Set this flag on input to indicate that your application does not support multiple copies and collation. In this case, the nCopies member of the PRINTDLGEX structure always returns 1, and PD_COLLATE is never set in the Flags member.If this flag is not set, the application is responsible for printing and collating multiple copies. In this case, the nCopies member of the PRINTDLGEX structure indicates the number of copies the user wants to print, and the PD_COLLATE flag in the Flags member indicates whether the user wants collation.Regardless of whether this flag is set, an application can determine from nCopies and PD_COLLATE how many copies to render and whether to print them collated.If this flag is set and the printer driver does not support multiple copies, the Copies edit control is disabled. Similarly, if this flag is set and the printer driver does not support collation, the Collate check box is disabled.The dmCopies and dmCollate members of the structure contain the copies and collate information used by the printer driver. If this flag is set and the printer driver supports multiple copies, the dmCopies member indicates the number of copies requested by the user. If this flag is set and the printer driver supports collation, the dmCollate member of the DEVMODE structure indicates whether the user wants collation. If this flag is not set, the dmCopies member always returns 1, and the dmCollate member is always zero.In Windows versions prior to Windows Vista, if this flag is not set by the calling application and the dmCopies member of the structure is greater than 1, use that value for the number of copies; otherwise, use the value of the nCopies member of the PRINTDLGEX structure. + + + + + + + PD_USELARGETEMPLATE + + + + 0x10000000 + + + + Forces the property sheet to use a large template for the General page. The larger template provides more space for applications that specify a custom template for the lower portion of the General page. + + + + + + + + A set of bit flags that can exclude items from the printer driver property pages in the Print property sheet. This value is used only if the PD_EXCLUSIONFLAGS flag is set in the Flags member. Exclusion flags should be used only if the item to be excluded will be included on either the General page or on an application-defined page in the Print property sheet. This member can specify the following flag. +

PD_EXCL_COPIESANDCOLLATE

+ Excludes the Copies and Collate controls from the printer driver property pages in a Print property sheet. This flag should always be set when the application uses the default Copies and Collate controls provided by the lower portion of the General page of the Print property sheet. +
+
+ + On input, set this member to the initial number of page ranges specified in the lpPageRanges array. When the PrintDlgEx function returns, nPageRanges indicates the number of user-specified page ranges stored in the lpPageRanges array. If the PD_NOPAGENUMS flag is specified, this value is not valid. + + + The size, in array elements, of the lpPageRanges buffer. This value indicates the maximum number of page ranges that can be stored in the array. If the PD_NOPAGENUMS flag is specified, this value is not valid. If the PD_NOPAGENUMS flag is not specified, this value must be greater than zero. + + + Pointer to a buffer containing an array of structures. On input, the array contains the initial page ranges to display in the Pages edit control. When the PrintDlgEx function returns, the array contains the page ranges specified by the user. If the PD_NOPAGENUMS flag is specified, this value is not valid. If the PD_NOPAGENUMS flag is not specified, lpPageRanges must be non-NULL. + + + The minimum value for the page ranges specified in the Pages edit control. If the PD_NOPAGENUMS flag is specified, this value is not valid. + + + The maximum value for the page ranges specified in the Pages edit control. If the PD_NOPAGENUMS flag is specified, this value is not valid. + + + Contains the initial number of copies for the Copies edit control if hDevMode is NULL; otherwise, the dmCopies member of the structure contains the initial value. When PrintDlgEx returns, nCopies contains the actual number of copies the application must print. This value depends on whether the application or the printer driver is responsible for printing multiple copies. If the PD_USEDEVMODECOPIESANDCOLLATE flag is set in the Flags member, nCopies is always 1 on return, and the printer driver is responsible for printing multiple copies. If the flag is not set, the application is responsible for printing the number of copies specified by nCopies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag. + + + If the PD_ENABLEPRINTTEMPLATE flag is set in the Flags member, hInstance is a handle to the application or module instance that contains the dialog box template named by the lpPrintTemplateName member. If the PD_ENABLEPRINTTEMPLATEHANDLE flag is set in the Flags member, hInstance is a handle to a memory object containing a dialog box template. If neither of the template flags is set in the Flags member, hInstance should be NULL. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template replaces the default dialog box template in the lower portion of the General page. The default template contains controls similar to those of the Print dialog box. This member is ignored unless the PD_ENABLEPRINTTEMPLATE flag is set in the Flags member. + + + + A pointer to an application-defined callback object. + The object should contain the class to receive messages for the child dialog box in the lower portion of the General page. + The callback object should also contain the class to receive a pointer to the interface. The PrintDlgEx function calls on the callback object for both IID_IPrintDialogCallback and IID_IObjectWithSite to determine which interfaces are supported. + If you do not want to retrieve any of the callback information, set lpCallback to NULL. + + + + The number of property page handles in thelphPropertyPages array. + + + Contains an array of property page handles to add to the Print property sheet. The additional property pages follow the General page. Use the function to create these additional pages. When the PrintDlgEx function returns, all the HPROPSHEETPAGE handles in the lphPropertyPages array have been destroyed. If nPropertyPages is zero, lphPropertyPages should be NULL. + + + The property page that is initially displayed. To display the General page, specify START_PAGE_GENERAL. Otherwise, specify the zero-based index of a property page in the array specified in the lphPropertyPages member. For consistency, it is recommended that the property sheet always be started on the General page. + + + + On input, set this member to zero. If the PrintDlgEx function returns S_OK, dwResultAction contains the outcome of the dialog. If PrintDlgEx returns an error, this member should be ignored. The dwResultAction member can be one of the following values. +

PD_RESULT_APPLY

+ The user clicked the Apply button and later clicked the Cancel button. This indicates that the user wants to apply the changes made in the property sheet, but does not want to print yet. The PRINTDLGEX structure contains the information specified by the user at the time the Apply button was clicked. +

PD_RESULT_CANCEL

+ The user clicked the Cancel button. The information in the PRINTDLGEX structure is unchanged. +

PD_RESULT_PRINT

+ The user clicked the Print button. The PRINTDLGEX structure contains the information specified by the user. +
+
+ + Contains information that the PrintDlgEx function uses to initialize the Print property sheet. After the user closes the property sheet, the system uses this structure to return information about the user's selections. + + + The structure size, in bytes. + + + A handle to the window that owns the property sheet. This member must be a valid window handle; it cannot be NULL. + + + + A handle to a movable global memory object that contains a structure. If hDevMode is not NULL on input, you must allocate a movable block of memory for the DEVMODE structure and initialize its members. The PrintDlgEx function uses the input data to initialize the controls in the property sheet. When PrintDlgEx returns, the DEVMODE members indicate the user's input. + If hDevMode is NULL on input, PrintDlgEx allocates memory for the structure, initializes its members to indicate the user's input, and returns a handle that identifies it. + For more information about the hDevMode and hDevNames members, see the Remarks section at the end of this topic. + + + + + A handle to a movable global memory object that contains a structure. If hDevNames is not NULL on input, you must allocate a movable block of memory for the DEVNAMES structure and initialize its members. The PrintDlgEx function uses the input data to initialize the controls in the property sheet. When PrintDlgEx returns, the DEVNAMES members contain information for the printer chosen by the user. You can use this information to create a device context or an information context. + The hDevNames member can be NULL, in which case, PrintDlgEx allocates memory for the structure, initializes its members to indicate the user's input, and returns a handle that identifies it. + For more information about the hDevMode and hDevNames members, see the Remarks section at the end of this topic. + + + + A handle to a device context or an information context, depending on whether the Flags member specifies the PD_RETURNDC or PC_RETURNIC flag. If neither flag is specified, the value of this member is undefined. If both flags are specified, PD_RETURNDC has priority. + + + + A set of bit flags that you can use to initialize the Print property sheet. When the PrintDlgEx function returns, it sets these flags to indicate the user's input. This member can be one or more of the following values. + To ensure that PrintDlg or PrintDlgEx returns the correct values in the dmCopies and dmCollate members of the structure, set PD_RETURNDC = TRUE and PD_USEDEVMODECOPIESANDCOLLATE = TRUE. In so doing, the nCopies member of the structure is always 1 and PD_COLLATE is always FALSE. + To ensure that PrintDlg or PrintDlgEx returns the correct values in nCopies and PD_COLLATE, set PD_RETURNDC = TRUE and PD_USEDEVMODECOPIESANDCOLLATE = FALSE. In so doing, dmCopies is always 1 and dmCollate is always FALSE. + Starting with Windows Vista, when you call PrintDlg or PrintDlgEx with PD_RETURNDC set to TRUE and PD_USEDEVMODECOPIESANDCOLLATE set to FALSE, the PrintDlg or PrintDlgEx function sets the number of copies in the nCopies member of the structure, and it sets the number of copies in the structure represented by the hDC member of the PRINTDLG structure. + When making calls to GDI, you must ignore the value of nCopies, consider the value as 1, and use the returned hDC to avoid printing duplicate copies. + + + Value + Meaning + + + + + + + PD_ALLPAGES + + + + 0x00000000 + + + + The default flag that indicates that the All radio button is initially selected. This flag is used as a placeholder to indicate that the PD_PAGENUMS, PD_SELECTION, and PD_CURRENTPAGE flags are not specified. + + + + + + + PD_COLLATE + + + + 0x00000010 + + + + If this flag is set, the Collate check box is selected.If this flag is set when the PrintDlgEx function returns, the application must simulate collation of multiple copies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag.See PD_NOPAGENUMS. + + + + + + + PD_CURRENTPAGE + + + + 0x00400000 + + + + If this flag is set, the Current Page radio button is selected. If none of the PD_PAGENUMS, PD_SELECTION, or PD_CURRENTPAGE flags is set, the All radio button is selected. + + + + + + + PD_DISABLEPRINTTOFILE + + + + 0x00080000 + + + + Disables the Print to File check box. + + + + + + + PD_ENABLEPRINTTEMPLATE + + + + 0x00004000 + + + + Indicates that the hInstance and lpPrintTemplateName members specify a replacement for the default dialog box template in the lower portion of the General page. The default template contains controls similar to those of the Print dialog box. The system uses the specified template to create a window that is a child of the General page. + + + + + + + PD_ENABLEPRINTTEMPLATEHANDLE + + + + 0x00010000 + + + + Indicates that the hInstance member identifies a data block that contains a preloaded dialog box template. This template replaces the default dialog box template in the lower portion of the General page. The system uses the specified template to create a window that is a child of the General page. The system ignores the lpPrintTemplateName member if this flag is specified. + + + + + + + PD_EXCLUSIONFLAGS + + + + 0x01000000 + + + + Indicates that the ExclusionFlags member identifies items to be excluded from the printer driver property pages. If this flag is not set, items will be excluded by default from the printer driver property pages. The exclusions prevent the duplication of items among the General page, any application-specified pages, and the printer driver pages. + + + + + + + PD_HIDEPRINTTOFILE + + + + 0x00100000 + + + + Hides the Print to File check box. + + + + + + + PD_NOCURRENTPAGE + + + + 0x00800000 + + + + Disables the Current Page radio button. + + + + + + + PD_NOPAGENUMS + + + + 0x00000008 + + + + Disables the Pages radio button and the associated edit controls. Also, it causes the Collate check box to appear in the dialog. + + + + + + + PD_NOSELECTION + + + + 0x00000004 + + + + Disables the Selection radio button. + + + + + + + PD_NOWARNING + + + + 0x00000080 + + + + Prevents the warning message from being displayed when an error occurs. + + + + + + + PD_PAGENUMS + + + + 0x00000002 + + + + If this flag is set, the Pages radio button is selected. If none of the PD_PAGENUMS, PD_SELECTION, or PD_CURRENTPAGE flags is set, the All radio button is selected. If this flag is set when the PrintDlgEx function returns, the lpPageRanges member indicates the page ranges specified by the user. + + + + + + + PD_PRINTTOFILE + + + + 0x00000020 + + + + If this flag is set, the Print to File check box is selected. If this flag is set when PrintDlgEx returns, the offset indicated by the wOutputOffset member of the structure contains the string "FILE:". When you call the function to start the printing operation, specify this "FILE:" string in the lpszOutput member of the structure. Specifying this string causes the print subsystem to query the user for the name of the output file. + + + + + + + PD_RETURNDC + + + + 0x00000100 + + + + Causes PrintDlgEx to return a device context matching the selections the user made in the property sheet. The device context is returned in hDC. + + + + + + + PD_RETURNDEFAULT + + + + 0x00000400 + + + + If this flag is set, the PrintDlgEx function does not display the property sheet. Instead, it sets the hDevNames and hDevMode members to handles to and structures that are initialized for the system default printer. Both hDevNames and hDevMode must be NULL, or PrintDlgEx returns an error. + + + + + + + PD_RETURNIC + + + + 0x00000200 + + + + Similar to the PD_RETURNDC flag, except this flag returns an information context rather than a device context. If neither PD_RETURNDC nor PD_RETURNIC is specified, hDC is undefined on output. + + + + + + + PD_SELECTION + + + + 0x00000001 + + + + If this flag is set, the Selection radio button is selected. If none of the PD_PAGENUMS, PD_SELECTION, or PD_CURRENTPAGE flags is set, the All radio button is selected. + + + + + + + PD_USEDEVMODECOPIES + + + + 0x00040000 + + + + Same as PD_USEDEVMODECOPIESANDCOLLATE. + + + + + + + PD_USEDEVMODECOPIESANDCOLLATE + + + + 0x00040000 + + + + This flag indicates whether your application supports multiple copies and collation. Set this flag on input to indicate that your application does not support multiple copies and collation. In this case, the nCopies member of the PRINTDLGEX structure always returns 1, and PD_COLLATE is never set in the Flags member.If this flag is not set, the application is responsible for printing and collating multiple copies. In this case, the nCopies member of the PRINTDLGEX structure indicates the number of copies the user wants to print, and the PD_COLLATE flag in the Flags member indicates whether the user wants collation.Regardless of whether this flag is set, an application can determine from nCopies and PD_COLLATE how many copies to render and whether to print them collated.If this flag is set and the printer driver does not support multiple copies, the Copies edit control is disabled. Similarly, if this flag is set and the printer driver does not support collation, the Collate check box is disabled.The dmCopies and dmCollate members of the structure contain the copies and collate information used by the printer driver. If this flag is set and the printer driver supports multiple copies, the dmCopies member indicates the number of copies requested by the user. If this flag is set and the printer driver supports collation, the dmCollate member of the DEVMODE structure indicates whether the user wants collation. If this flag is not set, the dmCopies member always returns 1, and the dmCollate member is always zero.In Windows versions prior to Windows Vista, if this flag is not set by the calling application and the dmCopies member of the structure is greater than 1, use that value for the number of copies; otherwise, use the value of the nCopies member of the PRINTDLGEX structure. + + + + + + + PD_USELARGETEMPLATE + + + + 0x10000000 + + + + Forces the property sheet to use a large template for the General page. The larger template provides more space for applications that specify a custom template for the lower portion of the General page. + + + + + + + + A set of bit flags that can exclude items from the printer driver property pages in the Print property sheet. This value is used only if the PD_EXCLUSIONFLAGS flag is set in the Flags member. Exclusion flags should be used only if the item to be excluded will be included on either the General page or on an application-defined page in the Print property sheet. This member can specify the following flag. +

PD_EXCL_COPIESANDCOLLATE

+ Excludes the Copies and Collate controls from the printer driver property pages in a Print property sheet. This flag should always be set when the application uses the default Copies and Collate controls provided by the lower portion of the General page of the Print property sheet. +
+
+ + On input, set this member to the initial number of page ranges specified in the lpPageRanges array. When the PrintDlgEx function returns, nPageRanges indicates the number of user-specified page ranges stored in the lpPageRanges array. If the PD_NOPAGENUMS flag is specified, this value is not valid. + + + The size, in array elements, of the lpPageRanges buffer. This value indicates the maximum number of page ranges that can be stored in the array. If the PD_NOPAGENUMS flag is specified, this value is not valid. If the PD_NOPAGENUMS flag is not specified, this value must be greater than zero. + + + Pointer to a buffer containing an array of structures. On input, the array contains the initial page ranges to display in the Pages edit control. When the PrintDlgEx function returns, the array contains the page ranges specified by the user. If the PD_NOPAGENUMS flag is specified, this value is not valid. If the PD_NOPAGENUMS flag is not specified, lpPageRanges must be non-NULL. + + + The minimum value for the page ranges specified in the Pages edit control. If the PD_NOPAGENUMS flag is specified, this value is not valid. + + + The maximum value for the page ranges specified in the Pages edit control. If the PD_NOPAGENUMS flag is specified, this value is not valid. + + + Contains the initial number of copies for the Copies edit control if hDevMode is NULL; otherwise, the dmCopies member of the structure contains the initial value. When PrintDlgEx returns, nCopies contains the actual number of copies the application must print. This value depends on whether the application or the printer driver is responsible for printing multiple copies. If the PD_USEDEVMODECOPIESANDCOLLATE flag is set in the Flags member, nCopies is always 1 on return, and the printer driver is responsible for printing multiple copies. If the flag is not set, the application is responsible for printing the number of copies specified by nCopies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag. + + + If the PD_ENABLEPRINTTEMPLATE flag is set in the Flags member, hInstance is a handle to the application or module instance that contains the dialog box template named by the lpPrintTemplateName member. If the PD_ENABLEPRINTTEMPLATEHANDLE flag is set in the Flags member, hInstance is a handle to a memory object containing a dialog box template. If neither of the template flags is set in the Flags member, hInstance should be NULL. + + + The name of the dialog box template resource in the module identified by the hInstance member. This template replaces the default dialog box template in the lower portion of the General page. The default template contains controls similar to those of the Print dialog box. This member is ignored unless the PD_ENABLEPRINTTEMPLATE flag is set in the Flags member. + + + + A pointer to an application-defined callback object. + The object should contain the class to receive messages for the child dialog box in the lower portion of the General page. + The callback object should also contain the class to receive a pointer to the interface. The PrintDlgEx function calls on the callback object for both IID_IPrintDialogCallback and IID_IObjectWithSite to determine which interfaces are supported. + If you do not want to retrieve any of the callback information, set lpCallback to NULL. + + + + The number of property page handles in thelphPropertyPages array. + + + Contains an array of property page handles to add to the Print property sheet. The additional property pages follow the General page. Use the function to create these additional pages. When the PrintDlgEx function returns, all the HPROPSHEETPAGE handles in the lphPropertyPages array have been destroyed. If nPropertyPages is zero, lphPropertyPages should be NULL. + + + The property page that is initially displayed. To display the General page, specify START_PAGE_GENERAL. Otherwise, specify the zero-based index of a property page in the array specified in the lphPropertyPages member. For consistency, it is recommended that the property sheet always be started on the General page. + + + + On input, set this member to zero. If the PrintDlgEx function returns S_OK, dwResultAction contains the outcome of the dialog. If PrintDlgEx returns an error, this member should be ignored. The dwResultAction member can be one of the following values. +

PD_RESULT_APPLY

+ The user clicked the Apply button and later clicked the Cancel button. This indicates that the user wants to apply the changes made in the property sheet, but does not want to print yet. The PRINTDLGEX structure contains the information specified by the user at the time the Apply button was clicked. +

PD_RESULT_CANCEL

+ The user clicked the Cancel button. The information in the PRINTDLGEX structure is unchanged. +

PD_RESULT_PRINT

+ The user clicked the Print button. The PRINTDLGEX structure contains the information specified by the user. +
- ExclusionFlags.PD_EXCL_COPIESANDCOLLATE
+ Excludes the Copies and Collate controls from the printer driver property pages in a Print property sheet. This flag should always be set when the application uses the default Copies and Collate controls provided by the lower portion of the General page of the Print property sheet. +
- dwResultAction.PD_RESULT_APPLY
+ The user clicked the Apply button and later clicked the Cancel button. This indicates that the user wants to apply the changes made in the property sheet, but does not want to print yet. The PRINTDLGEX structure contains the information specified by the user at the time the Apply button was clicked. +
- dwResultAction.PD_RESULT_CANCEL
+ The user clicked the Cancel button. The information in the PRINTDLGEX structure is unchanged. +
- dwResultAction.PD_RESULT_PRINT
+ The user clicked the Print button. The PRINTDLGEX structure contains the information specified by the user. +
+
+
\ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGE.xml b/sources/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGE.xml new file mode 100644 index 0000000000..b9e85e83f7 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/PRINTPAGERANGE.xml @@ -0,0 +1,14 @@ + + + + + + Represents a range of pages in a print job. A print job can have more than one page range. This information is supplied in the structure when calling the PrintDlgEx function. + + + The first page of the range. + + + The last page of the range. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/CommDlg/Windows.xml b/sources/Interop/Windows/Windows/um/CommDlg/Windows.xml new file mode 100644 index 0000000000..f0a4465d9b --- /dev/null +++ b/sources/Interop/Windows/Windows/um/CommDlg/Windows.xml @@ -0,0 +1,427 @@ + + + + + + Gets the size of a struct up to the specified member + The struct for which a size will be calculated + The member at which to stop calculating size + + + Returns a common dialog box error code. This code indicates the most recent error to occur during the execution of one of the common dialog box functions. + + If the most recent call to a common dialog box function succeeded, the return value is undefined. If the common dialog box function returned FALSE because the user closed or canceled the dialog box, the return value is zero. Otherwise, the return value is a nonzero error code. + The CommDlgExtendedError function can return general error codes for any of the common dialog box functions. In addition, there are error codes that are returned only for a specific common dialog box. All of these error codes are defined in Cderr.h. The following general error codes can be returned for any of the common dialog box functions. + + + Return code/value + Description + + + + + + + CDERR_DIALOGFAILURE + + + + 0xFFFF + + + + The dialog box could not be created. The common dialog box function's call to the function failed. For example, this error occurs if the common dialog box call specifies an invalid window handle. + + + + + + + CDERR_FINDRESFAILURE + + + + 0x0006 + + + + The common dialog box function failed to find a specified resource. + + + + + + + CDERR_INITIALIZATION + + + + 0x0002 + + + + The common dialog box function failed during initialization. This error often occurs when sufficient memory is not available. + + + + + + + CDERR_LOADRESFAILURE + + + + 0x0007 + + + + The common dialog box function failed to load a specified resource. + + + + + + + CDERR_LOADSTRFAILURE + + + + 0x0005 + + + + The common dialog box function failed to load a specified string. + + + + + + + CDERR_LOCKRESFAILURE + + + + 0x0008 + + + + The common dialog box function failed to lock a specified resource. + + + + + + + CDERR_MEMALLOCFAILURE + + + + 0x0009 + + + + The common dialog box function was unable to allocate memory for internal structures. + + + + + + + CDERR_MEMLOCKFAILURE + + + + 0x000A + + + + The common dialog box function was unable to lock the memory associated with a handle. + + + + + + + CDERR_NOHINSTANCE + + + + 0x0004 + + + + The ENABLETEMPLATE flag was set in the Flags member of the initialization structure for the corresponding common dialog box, but you failed to provide a corresponding instance handle. + + + + + + + CDERR_NOHOOK + + + + 0x000B + + + + The ENABLEHOOK flag was set in the Flags member of the initialization structure for the corresponding common dialog box, but you failed to provide a pointer to a corresponding hook procedure. + + + + + + + CDERR_NOTEMPLATE + + + + 0x0003 + + + + The ENABLETEMPLATE flag was set in the Flags member of the initialization structure for the corresponding common dialog box, but you failed to provide a corresponding template. + + + + + + + CDERR_REGISTERMSGFAIL + + + + 0x000C + + + + The function returned an error code when it was called by the common dialog box function. + + + + + + + CDERR_STRUCTSIZE + + + + 0x0001 + + + + The lStructSize member of the initialization structure for the corresponding common dialog box is invalid. + +  The following error codes can be returned for the PrintDlg function.Return code/valueDescriptionPDERR_CREATEICFAILURE0x100AThe PrintDlg function failed when it attempted to create an information context.PDERR_DEFAULTDIFFERENT0x100CYou called the PrintDlg function with the DN_DEFAULTPRN flag specified in the wDefault member of the structure, but the printer described by the other structure members did not match the current default printer. This error occurs when you store the DEVNAMES structure, and the user changes the default printer by using the Control Panel.To use the printer described by the structure, clear the DN_DEFAULTPRN flag and call PrintDlg again.To use the default printer, replace the structure (and the structure, if one exists) with NULL; and call PrintDlg again.PDERR_DNDMMISMATCH0x1009The data in the and structures describes two different printers.PDERR_GETDEVMODEFAIL0x1005The printer driver failed to initialize a structure.PDERR_INITFAILURE0x1006The PrintDlg function failed during initialization, and there is no more specific extended error code to describe the failure. This is the generic default error code for the function.PDERR_LOADDRVFAILURE0x1004The PrintDlg function failed to load the device driver for the specified printer.PDERR_NODEFAULTPRN0x1008A default printer does not exist.PDERR_NODEVICES0x1007No printer drivers were found.PDERR_PARSEFAILURE0x1002The PrintDlg function failed to parse the strings in the [devices] section of the WIN.INI file.PDERR_PRINTERNOTFOUND0x100BThe [devices] section of the WIN.INI file did not contain an entry for the requested printer.PDERR_RETDEFFAILURE0x1003The PD_RETURNDEFAULT flag was specified in the Flags member of the structure, but the hDevMode or hDevNames member was not NULL.PDERR_SETUPFAILURE0x1001The PrintDlg function failed to load the required resources. The following error codes can be returned for the ChooseFont function.Return code/valueDescriptionCFERR_MAXLESSTHANMIN0x2002The size specified in the nSizeMax member of the structure is less than the size specified in the nSizeMin member.CFERR_NOFONTS0x2001No fonts exist. The following error codes can be returned for the and functions.Return code/valueDescriptionFNERR_BUFFERTOOSMALL0x3003The buffer pointed to by the lpstrFile member of the structure is too small for the file name specified by the user. The first two bytes of the lpstrFile buffer contain an integer value specifying the size required to receive the full name, in characters.FNERR_INVALIDFILENAME0x3002A file name is invalid.FNERR_SUBCLASSFAILURE0x3001An attempt to subclass a list box failed because sufficient memory was not available. The following error code can be returned for the and functions.Return code/valueDescriptionFRERR_BUFFERLENGTHZERO0x4001A member of the structure points to an invalid buffer. + + + + ASCII version of CommDlg_OpenSave_GetFilePath +
[!WARNING] Apps should generally call CommDlg_OpenSave_GetFilePath instead of calling this method directly.
+
+
+ + + Wide string version of CommDlg_OpenSave_GetFilePath +
[!WARNING] Apps should generally call CommDlg_OpenSave_GetFilePath instead of calling this method directly.
+
+
+ + Retrieves the address of the item identifier list corresponding to the folder that an Explorer-style Open or Save As dialog box currently has open. + + + + ASCII version of CommDlg_OpenSave_GetFolderPath +
[!WARNING] Apps should generally call CommDlg_OpenSave_GetFolderPath instead of calling this method directly.
+
+
+ + + Wide string version of CommDlg_OpenSave_GetFolderPath +
[!WARNING] Apps should generally call CommDlg_OpenSave_GetFolderPath instead of calling this method directly.
+
+
+ + + ASCII version of CommDlg_OpenSave_GetSpec +
[!WARNING] Apps should generally call CommDlg_OpenSave_GetSpec instead of calling this method directly.
+
+
+ + + Wide string version of CommDlg_OpenSave_GetSpec +
[!WARNING] Apps should generally call CommDlg_OpenSave_GetSpec instead of calling this method directly.
+
+
+ + Hides the specified control in an Explorer-style Open or Save As dialog box. + + + Sets the text for the specified control in an Explorer-style Open or Save As dialog box. + + + Sets the default file name extension for an Explorer-style Open or Save As dialog box. + + + Creates a system-defined modeless Find dialog box that lets the user specify a string to search for and options to use when searching for text in a document. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with or to close the dialog box. + If the function fails, the return value is NULL. To get extended error information, call the function. CommDlgExtendedError may return one of the following error codes: + + + + Creates a system-defined modeless Find dialog box that lets the user specify a string to search for and options to use when searching for text in a document. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with or to close the dialog box. + If the function fails, the return value is NULL. To get extended error information, call the function. CommDlgExtendedError may return one of the following error codes: + + + + Creates a system-defined modeless Find dialog box that lets the user specify a string to search for and options to use when searching for text in a document. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with or to close the dialog box. + If the function fails, the return value is NULL. To get extended error information, call the function. CommDlgExtendedError may return one of the following error codes: + + + + Creates a system-defined modeless Find dialog box that lets the user specify a string to search for and options to use when searching for text in a document. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with or to close the dialog box. + If the function fails, the return value is NULL. To get extended error information, call the function. CommDlgExtendedError may return one of the following error codes: + + + + Creates a system-defined modeless Find dialog box that lets the user specify a string to search for and options to use when searching for text in a document. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with or to close the dialog box. + If the function fails, the return value is NULL. To get extended error information, call the function. CommDlgExtendedError may return one of the following error codes: + + + + Creates a system-defined modeless Find dialog box that lets the user specify a string to search for and options to use when searching for text in a document. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with or to close the dialog box. + If the function fails, the return value is NULL. To get extended error information, call the function. CommDlgExtendedError may return one of the following error codes: + + + + Retrieves the name of the specified file. + The name and location of a file. + The buffer that receives the name of the file. + The length, in characters, of the buffer pointed to by the lpszTitle parameter. + + If the function succeeds, the return value is zero. + If the file name is invalid, the return value is unknown. If there is an error, the return value is a negative number. + If the buffer pointed to by the lpszTitle parameter is too small, the return value is a positive integer that specifies the required buffer size, in characters. The required buffer size includes the terminating null character. + + + + Retrieves the name of the specified file. + The name and location of a file. + The buffer that receives the name of the file. + The length, in characters, of the buffer pointed to by the lpszTitle parameter. + + If the function succeeds, the return value is zero. + If the file name is invalid, the return value is unknown. If there is an error, the return value is a negative number. + If the buffer pointed to by the lpszTitle parameter is too small, the return value is a positive integer that specifies the required buffer size, in characters. The required buffer size includes the terminating null character. + + + + Retrieves the name of the specified file. + The name and location of a file. + The buffer that receives the name of the file. + The length, in characters, of the buffer pointed to by the lpszTitle parameter. + + If the function succeeds, the return value is zero. + If the file name is invalid, the return value is unknown. If there is an error, the return value is a negative number. + If the buffer pointed to by the lpszTitle parameter is too small, the return value is a positive integer that specifies the required buffer size, in characters. The required buffer size includes the terminating null character. + + + + Retrieves the name of the specified file. + The name and location of a file. + The buffer that receives the name of the file. + The length, in characters, of the buffer pointed to by the lpszTitle parameter. + + If the function succeeds, the return value is zero. + If the file name is invalid, the return value is unknown. If there is an error, the return value is a negative number. + If the buffer pointed to by the lpszTitle parameter is too small, the return value is a positive integer that specifies the required buffer size, in characters. The required buffer size includes the terminating null character. + + + + Retrieves the name of the specified file. + The name and location of a file. + The buffer that receives the name of the file. + The length, in characters, of the buffer pointed to by the lpszTitle parameter. + + If the function succeeds, the return value is zero. + If the file name is invalid, the return value is unknown. If there is an error, the return value is a negative number. + If the buffer pointed to by the lpszTitle parameter is too small, the return value is a positive integer that specifies the required buffer size, in characters. The required buffer size includes the terminating null character. + + + + Retrieves the name of the specified file. + The name and location of a file. + The buffer that receives the name of the file. + The length, in characters, of the buffer pointed to by the lpszTitle parameter. + + If the function succeeds, the return value is zero. + If the file name is invalid, the return value is unknown. If there is an error, the return value is a negative number. + If the buffer pointed to by the lpszTitle parameter is too small, the return value is a positive integer that specifies the required buffer size, in characters. The required buffer size includes the terminating null character. + + + + Creates a system-defined modeless dialog box that lets the user specify a string to search for and a replacement string, as well as options to control the find and replace operations. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with the dialog box or close it. + If the function fails, the return value is NULL. To get extended error information, call the function, which can return one of the following error codes: + + + + Creates a system-defined modeless dialog box that lets the user specify a string to search for and a replacement string, as well as options to control the find and replace operations. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with the dialog box or close it. + If the function fails, the return value is NULL. To get extended error information, call the function, which can return one of the following error codes: + + + + Creates a system-defined modeless dialog box that lets the user specify a string to search for and a replacement string, as well as options to control the find and replace operations. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with the dialog box or close it. + If the function fails, the return value is NULL. To get extended error information, call the function, which can return one of the following error codes: + + + + Creates a system-defined modeless dialog box that lets the user specify a string to search for and a replacement string, as well as options to control the find and replace operations. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with the dialog box or close it. + If the function fails, the return value is NULL. To get extended error information, call the function, which can return one of the following error codes: + + + + Creates a system-defined modeless dialog box that lets the user specify a string to search for and a replacement string, as well as options to control the find and replace operations. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with the dialog box or close it. + If the function fails, the return value is NULL. To get extended error information, call the function, which can return one of the following error codes: + + + + Creates a system-defined modeless dialog box that lets the user specify a string to search for and a replacement string, as well as options to control the find and replace operations. + A pointer to a structure that contains information used to initialize the dialog box. The dialog box uses this structure to send information about the user's input to your application. For more information, see the following Remarks section. + + If the function succeeds, the return value is the window handle to the dialog box. You can use the window handle to communicate with the dialog box or close it. + If the function fails, the return value is NULL. To get extended error information, call the function, which can return one of the following error codes: + + +
\ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/BMFORMAT.xml b/sources/Interop/Windows/Windows/um/icm/BMFORMAT.xml new file mode 100644 index 0000000000..c30cf66b51 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/BMFORMAT.xml @@ -0,0 +1,140 @@ + + + + + + The values of the BMFORMAT enumerated type are used by several WCS functions to indicate the format that particular bitmaps are in. + + + 16 bits per pixel. RGB color space. 5 bits per channel. The most significant bit is ignored. + + + 16 bits per pixel. CIE device-independent XYZ color space. 5 bits per channel. The most significant bit is ignored. + + + 16 bits per pixel. Yxy color space. 5 bits per channel. The most significant bit is ignored. + + + 16 bits per pixel. L*a*b color space. 5 bits per channel. The most significant bit is ignored. + + + 16 bits per pixel. G3CH color space. 5 bits per channel. The most significant bit is ignored. + + + 24 bits per pixel maximum. For three channel colors, such as Red,Green,Blue, the total size is 24 bits per pixel. For single channel colors, such as gray, the total size is 8 bits per pixel. + + + 24 bits per pixel maximum. For three channel colors, such as Red,Green,Blue, the total size is 24 bits per pixel. For single channel colors, such as gray, the total size is 8 bits per pixel. + + + + 24 bits per pixel maximum. For three channel, X, Y and Z values, the total size is 24 bits per pixel. For single channel gray scale, the total size is 8 bits per pixel. +
[!Note]
The function does not support as an input.
+
+
+ + + 24 bits per pixel maximum. For three channel, Y, x and y values, the total size is 24 bits per pixel. For single channel gray scale, the total size is 8 bits per pixel. +
[!Note]
The function does not support as an input.
+
+
+ + 24 bits per pixel maximum. For three channel, L, a and b values, the total size is 24 bits per pixel. For single channel gray scale, the total size is 8 bits per pixel. + + + 24 bits per pixel maximum. For three channel values, the total size is 24 bits per pixel. For single channel gray scale, the total size is 8 bits per pixel. + + + 40 bits per pixel. 8 bits apiece are used for each channel. + + + 48 bits per pixel. 8 bits apiece are used for each channel. + + + 56 bits per pixel. 8 bits apiece are used for each channel. + + + 64 bits per pixel. 8 bits apiece are used for each channel. + + + 32 bits per pixel. Only the 8 bit gray-scale value is used. + + + 32 bits per pixel. 8 bits are used for each color channel. The most significant byte is ignored. + + + 32 bits per pixel. 8 bits are used for each color channel. The most significant byte is ignored. + + + 32 bits per pixel. 8 bits are used for each color channel. The most significant byte is ignored. + + + 32 bits per pixel. 8 bits are used for each color channel. + + + 32 bits per pixel. 8 bits are used for each color channel. + + + 32 bits per pixel. 10 bits are used for each color channel. The 2 most significant bits are ignored. + + + 32 bits per pixel. 10 bits are used for each color channel. The 2 most significant bits are ignored. + + + 32 bits per pixel. 10 bits are used for each color channel. The 2 most significant bits are ignored. + + + 32 bits per pixel. 10 bits are used for each color channel. The 2 most significant bits are ignored. + + + 32 bits per pixel. 10 bits are used for each color channel. The 2 most significant bits are ignored. + + + 32 bits per pixel. Named color indices. Index numbering begins at 1. + + + 48 bits per pixel. Each channel uses 16 bits. + + + 48 bits per pixel. Each channel uses 16 bits. + + + 48 bits per pixel. Each channel uses 16 bits. + + + 48 bits per pixel. Each channel uses 16 bits. + + + 48 bits per pixel. Each channel uses 16 bits. + + + 16 bits per pixel. + + + 16 bits per pixel. 5 bits are used for red, 6 for green, and 5 for blue. + + + 96 bits per pixel, 32 bit per channel IEEE floating point. + + + 128 bits per pixel, 32 bit per channel IEEE floating point. + + + 48 bits per pixel, Fixed point integer ranging from -4 to +4 with a sign bit and 2 bit exponent and 13 bit mantissa. + + + 64 bits per pixel, Fixed point integer ranging from -4 to +4 with a sign bit and 2 bit exponent and 13 bit mantissa. + + + 32 bits per pixel. 10 bits are used for each color channel. The two most significant bits are alpha. + + + + 32 bits per pixel. 10 bits are used for each color channel. The 10 bits of each color channel are 2.8 fixed point with a -0.75 bias, giving a range of [-0.76 .. 1.25]. This range corresponds to [-0.5 .. 1.5] in a gamma = 1 space. The two most significant bits are preserved for alpha. + This uses an extended range (XR) sRGB color space. It has the same RGB primaries, white point, and gamma as sRGB. + + + + 64 bits per pixel. Each channel is a 16-bit float. The last WORD is alpha. + +
\ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/CMYKCOLOR.xml b/sources/Interop/Windows/Windows/um/icm/CMYKCOLOR.xml new file mode 100644 index 0000000000..26e17b06c6 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/CMYKCOLOR.xml @@ -0,0 +1,20 @@ + + + + + + Description of the CMYKCOLOR structure. + + + TBD + + + TBD + + + TBD + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/COLOR.xml b/sources/Interop/Windows/Windows/um/icm/COLOR.xml new file mode 100644 index 0000000000..db57c39008 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLOR.xml @@ -0,0 +1,41 @@ + + + + + + Description of the COLOR union. + + + TBD + + + TBD + + + TBD + + + TBD + + + TBD + + + TBD + + + TBD + + + TBD + + + TBD + + + TBD + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/COLORDATATYPE.xml b/sources/Interop/Windows/Windows/um/icm/COLORDATATYPE.xml new file mode 100644 index 0000000000..e9e8b64381 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLORDATATYPE.xml @@ -0,0 +1,32 @@ + + + + + + Used by WCS functions to indicate the data type of vector content. + + + Color data is stored as 8 bits per channel, with a value from 0 to 255, inclusive. + + + Color data is stored as 16 bits per channel, with a value from 0 to 65535, inclusive. + + + Color data is stored as 32 bits value per channel, as defined by the IEEE 32-bit floating point standard. + + + Color data is stored as 16 bits per channel, with a fixed range of -4 to +4, inclusive. A signed format is used, with 1 bit for the sign, 2 bits for the integer portion, and 13 bits for the fractional portion. + + + Color data is stored as 10 bits per channel. The two most significant bits are alpha. + + + + Color data is stored as 10 bits per channel, 32 bits per pixel. The 10 bits of each color channel are 2.8 fixed point with a -0.75 bias, giving a range of [-0.76 .. 1.25]. This range corresponds to [-0.5 .. 1.5] in a gamma = 1 space. The two most significant bits are preserved for alpha. + This uses an extended range (XR) sRGB color space. It has the same RGB primaries, white point, and gamma as sRGB. + + + + Color data is stored as 16 bits value per channel, as defined by the IEEE 16-bit floating point standard. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/COLORPROFILESUBTYPE.xml b/sources/Interop/Windows/Windows/um/icm/COLORPROFILESUBTYPE.xml new file mode 100644 index 0000000000..17693c4d58 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLORPROFILESUBTYPE.xml @@ -0,0 +1,35 @@ + + + + + + Specifies the subtype of the color profile. + + + A perceptual rendering intent for gamut map model profiles (GMMPs) defined in WCS. + + + A relative colorimetric rendering intent for GMMPs defined in WCS. + + + A saturation rendering intent for GMMPs defined in WCS. + + + An absolute colorimetric rendering intent for GMMPs defined in WCS. + + + The color profile subtype is not applicable to the selected color profile type. + + + The RGB color working space for International Color Consortium (ICC) profiles or device model profiles (DMPs) defined in WCS. + + + A custom color working space. + + + TBD + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/COLORPROFILETYPE.xml b/sources/Interop/Windows/Windows/um/icm/COLORPROFILETYPE.xml new file mode 100644 index 0000000000..7778531b21 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLORPROFILETYPE.xml @@ -0,0 +1,20 @@ + + + + + + Specifies the type of color profile. + + + An International Color Consortium (ICC) profile. If you specify this value, only the CPST_RGB_WORKING_SPACE and CPST_CUSTOM_WORKING_SPACE values of are valid. + + + A device model profile (DMP) defined in WCS. If you specify this value, only the CPST_RGB_WORKING_SPACE and CPST_CUSTOM_WORKING_SPACE values of are valid. + + + A color appearance model profile (CAMP) defined in WCS. If you specify this value, only the CPST_NONE value of is valid. + + + Specifies a WCS gamut map model profile (GMMP). If this value is specified, only the CPST_PERCEPTUAL, CPST_SATURATION, CPST_RELATIVE_COLORIMETRIC, and CPST_ABSOLUTE_COLORIMETRIC values of are valid. Any of these values may optionally be combined (in a bitwise OR operation) with CPST_DEFAULT. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/COLORTYPE.xml b/sources/Interop/Windows/Windows/um/icm/COLORTYPE.xml new file mode 100644 index 0000000000..bf96b71a0a --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/COLORTYPE.xml @@ -0,0 +1,44 @@ + + + + + + The values of the COLORTYPE enumeration are used by several WCS functions. Variables of type COLOR are defined in the color spaces enumerated by the COLORTYPE enumeration. + + + The COLOR is in the GRAYCOLOR color space. + + + The COLOR is in the RGBCOLOR color space. + + + The COLOR is in the XYZCOLOR color space. + + + The COLOR is in the YxyCOLOR color space. + + + The COLOR is in the LabCOLOR color space. + + + The COLOR is in the GENERIC3CHANNEL color space. + + + The COLOR is in the CMYKCOLOR color space. + + + The COLOR is in a five channel color space. + + + The COLOR is in a six channel color space. + + + The COLOR is in a seven channel color space. + + + The COLOR is in an eight channel color space. + + + The COLOR is in a named color space. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/GENERIC3CHANNEL.xml b/sources/Interop/Windows/Windows/um/icm/GENERIC3CHANNEL.xml new file mode 100644 index 0000000000..160e272169 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/GENERIC3CHANNEL.xml @@ -0,0 +1,17 @@ + + + + + + TBD + + + TBD + + + TBD + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/GRAYCOLOR.xml b/sources/Interop/Windows/Windows/um/icm/GRAYCOLOR.xml new file mode 100644 index 0000000000..8b648ca599 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/GRAYCOLOR.xml @@ -0,0 +1,11 @@ + + + + + + Description of the GRAYCOLOR structure. + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/HiFiCOLOR.xml b/sources/Interop/Windows/Windows/um/icm/HiFiCOLOR.xml new file mode 100644 index 0000000000..fbfffad171 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/HiFiCOLOR.xml @@ -0,0 +1,11 @@ + + + + + + Description of the HiFiCOLOR structure. + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/LabCOLOR.xml b/sources/Interop/Windows/Windows/um/icm/LabCOLOR.xml new file mode 100644 index 0000000000..049e16b20d --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/LabCOLOR.xml @@ -0,0 +1,17 @@ + + + + + + TBD + + + TBD + + + TBD + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/NAMEDCOLOR.xml b/sources/Interop/Windows/Windows/um/icm/NAMEDCOLOR.xml new file mode 100644 index 0000000000..3a2d21d246 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/NAMEDCOLOR.xml @@ -0,0 +1,11 @@ + + + + + + TBD + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFO.xml b/sources/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFO.xml new file mode 100644 index 0000000000..2e14f7cd45 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/NAMED_PROFILE_INFO.xml @@ -0,0 +1,23 @@ + + + + + + The NAMED_PROFILE_INFO structure is used to store information about a named color profile. + + + Not currently used by the default CMM. + + + Total number of named colors in the profile. + + + Total number of device coordinates for each named color. + + + Pointer to a string containing the prefix for each color name. + + + Pointer to a string containing the suffix for each color name. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/PCOLORMATCHSETUPA.xml b/sources/Interop/Windows/Windows/um/icm/PCOLORMATCHSETUPA.xml new file mode 100644 index 0000000000..a9eb6c151e --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/PCOLORMATCHSETUPA.xml @@ -0,0 +1,87 @@ + + + + + + The COLORMATCHSETUP structure contains information that the function uses to initialize the ColorManagement dialog box. After the user closes the dialog box, SetupColorMatching returns information about the user's selection in this structure. + + + Size of the structure. Should be set to sizeof ( COLORMATCHSETUP ). + + + Version of the COLORMATCHSETUP structure. This should be set to COLOR_MATCH_VERSION. + + + + A set of bit flags used to initialize the dialog box. If set to 0 on entry, all controls assume their default states. + When the dialog box returns, these flags are set to indicate the user's input. + This member can be set using a combination of the following flags. + | Flag | Meaning | |-|-| | CMS_DISABLEICM | If set on entry, this flag indicates that the "Enable Color Management" check box is cleared, disabling all other controls. If set on exit, it means that the user does not wish color management performed. | | CMS_ENABLEPROOFING | If set on entry, this flag indicates that the Proofing controls are to be enabled, and the Proofing check box is checked. If set on exit, it means that the user wishes to perform color management for a different target device than the selected printer. | | CMS_SETRENDERINTENT | If set on entry, this flag indicates that the dwRenderIntent member contains the value to use to initialize the Rendering Intent control. Otherwise, the control defaults to Picture rendering. This flag is set on exit if WCS is enabled. | | CMS_SETPROOFINTENT | Ignored unless CMS_ENABLEPROOFING is also set. If set on entry, and CMS_ENABLEPROOFING is also set, this flag indicates that the dwProofingIntent member is to be used to initialize the Target Rendering Intent control. Otherwise, the control defaults to Picture rendering. This flag is set on exit if proofing is enabled. | | CMS_SETMONITORPROFILE | If set on entry, this flag indicates that the color management profile named in the pMonitorProfile member is to be the initial selection in the monitor profile control. If the specified profile is not associated with the monitor, this flag is ignored, and the default profile for the monitor is used. | | CMS_SETPRINTERPROFILE | If set on entry, this flag indicates that the color management profile named in the pPrinterProfile member is to be the initial selection in the printer profile control. If the specified profile is not associated with the printer, this flag is ignored, and the default profile for the printer is used. | | CMS_SETTARGETPROFILE | If set on entry, this flag indicates that the color profile named in the pTargetProfile member is to be the initial selection in the target profile control. If the specified profile is not installed, this flag is ignored, and the default profile for the printer is used. If the printer has no default profile, then the first profile in alphabetical order will be displayed. | | CMS_USEHOOK | This flag specifies that the lpfnHook member contains the address of a hook procedure, and the lParam member contains a value to be passed to the hook procedure when the WM_INITDIALOG message is sent. | | CMS_MONITOROVERFLOW | This flag is set on exit if color management is to be enabled and the buffer size given in ccMonitorProfile is insufficient for the selected profile name. GetLastError returns ERROR_INSUFFICIENT_BUFFER in such a case. | | CMS_PRINTERROVERFLOW | This flag is set on exit if color management is to be enabled and the buffer size given in ccPrinterProfile is insufficient for the selected profile name. GetLastError returns ERROR_INSUFFICIENT_BUFFER in such a case. | | CMS_TARGETOVERFLOW | This flag is set on exit if proofing is to be enabled and the buffer size given in ccTargetProfile is insufficient for the selected profile name. GetLastError returns ERROR_INSUFFICIENT_BUFFER in such a case. | | CMS_USEAPPLYCALLBACK | If set on entry, this flag indicates that the SetupColorMatching function should call the function PCMSCALLBACKW. The address of the callback function is contained in lpfnApplyCallback. | | CMS_USEDESCRIPTION | If set on entry, this flag instructs the SetupColorMatching function to retrieve the profile description contained in the profile description tags (See ICC Profile Format Specification v3.4). It will insert them into the Monitor Profile, Printer Profile, Emulated Device Profile edit boxes in the Color Management common dialog box. | + + + + The window handle to the owner of the dialog box, or NULL if the dialog box has no owner. + + + Pointer to an application-specified string which describes the source profile of the item for which color management is to be performed. If this is NULL, the Image Source control displays the name of the Windows default color profile. + + + Points to a string naming the monitor to be used for color management. If this is not the name of a valid monitor, the first enumerated monitor is used. + + + Points to a string naming the printer on which the image is to be rendered. If this is not a valid printer name, the default printer is used and named in the dialog. + + + + The type of color management desired. Valid values are: + INTENT_PERCEPTUAL + INTENT_SATURATION + INTENT_RELATIVE_COLORIMETRIC + INTENT_ABSOLUTE_COLORIMETRIC + For more information, see Rendering intents. + + + + + The type of color management desired for the proofed image. Valid values are: + INTENT_PERCEPTUAL + INTENT_SATURATION + INTENT_RELATIVE_COLORIMETRIC + INTENT_ABSOLUTE_COLORIMETRIC + For more information, see Rendering intents. + + + + Pointer to a buffer in which to place the name of the user-selected monitor profile. If the CMS_SETMONITORPROFILE flag is used, this flag can also be used to select a profile other than the monitor default when the dialog is first displayed. + + + The size of the buffer pointed to by the pMonitorProfile member, in characters. If the buffer is not large enough to hold the selected name, the name is truncated to this size, and ERROR_INSUFFICIENT_BUFFER is returned. A buffer of MAX_PATH size always works. + + + Points to a buffer in which to place the name of the user-selected printer profile. If the CMS_SETPRINTERPROFILE flag is used, this flag can also be used to select a profile other than the printer default when the dialog is first displayed. + + + The size of the buffer pointed to by the pPrinterProfile member, in characters. If the buffer is not large enough to hold the selected name, the name is truncated to this size, and ERROR_INSUFFICIENT_BUFFER is returned. A buffer of MAX_PATH size always works. + + + Points to a buffer in which to place the name of the user-selected target profile for proofing. If the CMS_SETTARGETPROFILE flag is used, this flag can also be used to select a profile other than the printer default when the dialog is first displayed. + + + The size of the buffer pointed to by the pTargetProfile member, in characters. If the buffer is not large enough to hold the selected name, the name is truncated to this size, and ERROR_INSUFFICIENT_BUFFER is returned. A buffer of MAX_PATH size always works. + + + + If the CMS_USEHOOK flag is set, this member is the address of a dialog procedure (see DialogProc ) that can filter or handle messages for the dialog. The hook procedure receives no messages issued before WM_INITDIALOG. It is called on the WM_INITDIALOG message after the system-provided dialog procedure has processed the message. On all other messages, the hook procedure receives the message before the system-provided procedure. If the hook procedure returns TRUE to these messages, the system-provided procedure is not called. + The hook procedure may call the EndDialog function. + + + + If the CMS_USEHOOK flag is set, this member is passed to the application-provided hook procedure as the lParam parameter when the WM_INITDIALOG message is processed. + + + Contains a pointer to a callback function that is invoked when the Apply button of the Color Management dialog box is selected. If no callback function is provided, this member should be set to NULL. See PCMSCALLBACKW. + + + Contains a value that will be passed to the function ApplyCallbackFunction through its lParam parameter. The meaning and content of the value is specified by the application. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/PCOLORMATCHSETUPW.xml b/sources/Interop/Windows/Windows/um/icm/PCOLORMATCHSETUPW.xml new file mode 100644 index 0000000000..c6f0e8b7f4 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/PCOLORMATCHSETUPW.xml @@ -0,0 +1,87 @@ + + + + + + The COLORMATCHSETUP structure contains information that the function uses to initialize the ColorManagement dialog box. After the user closes the dialog box, SetupColorMatching returns information about the user's selection in this structure. + + + Size of the structure. Should be set to sizeof ( COLORMATCHSETUP ). + + + Version of the COLORMATCHSETUP structure. This should be set to COLOR_MATCH_VERSION. + + + + A set of bit flags used to initialize the dialog box. If set to 0 on entry, all controls assume their default states. + When the dialog box returns, these flags are set to indicate the user's input. + This member can be set using a combination of the following flags. + | Flag | Meaning | |-|-| | CMS_DISABLEICM | If set on entry, this flag indicates that the "Enable Color Management" check box is cleared, disabling all other controls. If set on exit, it means that the user does not wish color management performed. | | CMS_ENABLEPROOFING | If set on entry, this flag indicates that the Proofing controls are to be enabled, and the Proofing check box is checked. If set on exit, it means that the user wishes to perform color management for a different target device than the selected printer. | | CMS_SETRENDERINTENT | If set on entry, this flag indicates that the dwRenderIntent member contains the value to use to initialize the Rendering Intent control. Otherwise, the control defaults to Picture rendering. This flag is set on exit if WCS is enabled. | | CMS_SETPROOFINTENT | Ignored unless CMS_ENABLEPROOFING is also set. If set on entry, and CMS_ENABLEPROOFING is also set, this flag indicates that the dwProofingIntent member is to be used to initialize the Target Rendering Intent control. Otherwise, the control defaults to Picture rendering. This flag is set on exit if proofing is enabled. | | CMS_SETMONITORPROFILE | If set on entry, this flag indicates that the color management profile named in the pMonitorProfile member is to be the initial selection in the monitor profile control. If the specified profile is not associated with the monitor, this flag is ignored, and the default profile for the monitor is used. | | CMS_SETPRINTERPROFILE | If set on entry, this flag indicates that the color management profile named in the pPrinterProfile member is to be the initial selection in the printer profile control. If the specified profile is not associated with the printer, this flag is ignored, and the default profile for the printer is used. | | CMS_SETTARGETPROFILE | If set on entry, this flag indicates that the color profile named in the pTargetProfile member is to be the initial selection in the target profile control. If the specified profile is not installed, this flag is ignored, and the default profile for the printer is used. If the printer has no default profile, then the first profile in alphabetical order will be displayed. | | CMS_USEHOOK | This flag specifies that the lpfnHook member contains the address of a hook procedure, and the lParam member contains a value to be passed to the hook procedure when the WM_INITDIALOG message is sent. | | CMS_MONITOROVERFLOW | This flag is set on exit if color management is to be enabled and the buffer size given in ccMonitorProfile is insufficient for the selected profile name. GetLastError returns ERROR_INSUFFICIENT_BUFFER in such a case. | | CMS_PRINTERROVERFLOW | This flag is set on exit if color management is to be enabled and the buffer size given in ccPrinterProfile is insufficient for the selected profile name. GetLastError returns ERROR_INSUFFICIENT_BUFFER in such a case. | | CMS_TARGETOVERFLOW | This flag is set on exit if proofing is to be enabled and the buffer size given in ccTargetProfile is insufficient for the selected profile name. GetLastError returns ERROR_INSUFFICIENT_BUFFER in such a case. | | CMS_USEAPPLYCALLBACK | If set on entry, this flag indicates that the SetupColorMatching function should call the function PCMSCALLBACKW. The address of the callback function is contained in lpfnApplyCallback. | | CMS_USEDESCRIPTION | If set on entry, this flag instructs the SetupColorMatching function to retrieve the profile description contained in the profile description tags (See ICC Profile Format Specification v3.4). It will insert them into the Monitor Profile, Printer Profile, Emulated Device Profile edit boxes in the Color Management common dialog box. | + + + + The window handle to the owner of the dialog box, or NULL if the dialog box has no owner. + + + Pointer to an application-specified string which describes the source profile of the item for which color management is to be performed. If this is NULL, the Image Source control displays the name of the Windows default color profile. + + + Points to a string naming the monitor to be used for color management. If this is not the name of a valid monitor, the first enumerated monitor is used. + + + Points to a string naming the printer on which the image is to be rendered. If this is not a valid printer name, the default printer is used and named in the dialog. + + + + The type of color management desired. Valid values are: + INTENT_PERCEPTUAL + INTENT_SATURATION + INTENT_RELATIVE_COLORIMETRIC + INTENT_ABSOLUTE_COLORIMETRIC + For more information, see Rendering intents. + + + + + The type of color management desired for the proofed image. Valid values are: + INTENT_PERCEPTUAL + INTENT_SATURATION + INTENT_RELATIVE_COLORIMETRIC + INTENT_ABSOLUTE_COLORIMETRIC + For more information, see Rendering intents. + + + + Pointer to a buffer in which to place the name of the user-selected monitor profile. If the CMS_SETMONITORPROFILE flag is used, this flag can also be used to select a profile other than the monitor default when the dialog is first displayed. + + + The size of the buffer pointed to by the pMonitorProfile member, in characters. If the buffer is not large enough to hold the selected name, the name is truncated to this size, and ERROR_INSUFFICIENT_BUFFER is returned. A buffer of MAX_PATH size always works. + + + Points to a buffer in which to place the name of the user-selected printer profile. If the CMS_SETPRINTERPROFILE flag is used, this flag can also be used to select a profile other than the printer default when the dialog is first displayed. + + + The size of the buffer pointed to by the pPrinterProfile member, in characters. If the buffer is not large enough to hold the selected name, the name is truncated to this size, and ERROR_INSUFFICIENT_BUFFER is returned. A buffer of MAX_PATH size always works. + + + Points to a buffer in which to place the name of the user-selected target profile for proofing. If the CMS_SETTARGETPROFILE flag is used, this flag can also be used to select a profile other than the printer default when the dialog is first displayed. + + + The size of the buffer pointed to by the pTargetProfile member, in characters. If the buffer is not large enough to hold the selected name, the name is truncated to this size, and ERROR_INSUFFICIENT_BUFFER is returned. A buffer of MAX_PATH size always works. + + + + If the CMS_USEHOOK flag is set, this member is the address of a dialog procedure (see DialogProc ) that can filter or handle messages for the dialog. The hook procedure receives no messages issued before WM_INITDIALOG. It is called on the WM_INITDIALOG message after the system-provided dialog procedure has processed the message. On all other messages, the hook procedure receives the message before the system-provided procedure. If the hook procedure returns TRUE to these messages, the system-provided procedure is not called. + The hook procedure may call the EndDialog function. + + + + If the CMS_USEHOOK flag is set, this member is passed to the application-provided hook procedure as the lParam parameter when the WM_INITDIALOG message is processed. + + + Contains a pointer to a callback function that is invoked when the Apply button of the Color Management dialog box is selected. If no callback function is provided, this member should be set to NULL. See PCMSCALLBACKW. + + + Contains a value that will be passed to the function ApplyCallbackFunction through its lParam parameter. The meaning and content of the value is specified by the application. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/PENUMTYPEA.xml b/sources/Interop/Windows/Windows/um/icm/PENUMTYPEA.xml new file mode 100644 index 0000000000..240f63ea6d --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/PENUMTYPEA.xml @@ -0,0 +1,113 @@ + + + + + + Contains information that defines the profile enumeration constraints. + + + The size of this structure in bytes. + + + The version number of the ENUMTYPE structure. Should be set to ENUM_TYPE_VERSION. + + + + Indicates which fields in this structure are being used. Can be set to any combination of the following constant values. + ET_DEVICENAME + ET_MEDIATYPE + ET_DITHERMODE + ET_RESOLUTION + ET_CMMTYPE + ET_CLASS + ET_DATACOLORSPACE + ET_CONNECTIONSPACE + ET_SIGNATURE + ET_PLATFORM + ET_PROFILEFLAGS + ET_MANUFACTURER + ET_MODEL + ET_ATTRIBUTES + ET_RENDERINGINTENT + ET_CREATOR + ET_DEVICECLASS + + + + User friendly name of the device. + + + Indicates which type of media is associated with the profile, such as a printer or screen. + + + Indicates the style of dithering that will be used when an image is displayed. + + + The horizontal (x) and vertical (y) resolution in pixels of the device on which the image will be displayed. The x resolution is stored in dwResolution[0], and the y resolution is kept in dwResolution[1]. + + + The identification number of the CMM that is used in the profile. Identification numbers are registered with the ICC. + + + + Indicates the profile class. For a description of profile classes, see Using Device Profiles with WCS. A profile class may have any of the following values. + | Profile Class | Signature | |--------------------------------|-------------------| | Input Device Profile | CLASS_SCANNER | | Display Device Profile | CLASS_MONITOR | | Output Device Profile | CLASS_PRINTER | | Device Link Profile | CLASS_LINK | | Color Space Conversion Profile | CLASS_COLORSPACE | | Abstract Profile | CLASS_ABSTRACT | | Named Color Profile | CLASS_NAMED | | Color Appearance Model Profile | CLASS_CAMP | | Color Gamut Map Model Profile | CLASS_GMMP | + + + + A signature value that indicates the color space in which the profile data is defined. Can be any value from the Color Space Constants. + + + + A signature value that indicates the color space in which the profile connection space (PCS) is defined. Can be any of the following values. + | Profile Class | Signature | |---------------|------------| | XYZ | SPACE_XYZ | | Lab | SPACE_Lab | + When the dwClass member is set to CLASS_LINK, the PCS is taken from the dwDataColorSpace member. + + + + Reserved for internal use. + + + + The primary platform for which the profile was created. The member can be set to any of the following values. + | Platform | Value | |------------------------|--------| | Apple Computer, Inc. | 'APPL' | | Microsoft Corp. | 'MSFT' | | Silicon Graphics, Inc. | 'SGI' | | Sun Microsystems, Inc. | 'SUNW' | | Taligent | 'TGNT' | + + + + + Bit flags containing hints that the CMM uses to interpret the profile data and can be set to one of the following values. + | Constant | Meaning | |-----------------------|--------------------------------------------------------------------------------------------------------------------------| | FLAG_EMBEDDEDPROFILE | The profile is embedded in a bitmap file. | | FLAG_DEPENDENTONDATA | The profile can't be used independently of the embedded color data. Used for profiles that are embedded in bitmap files. | + + + + The identification number of the device profile manufacturer. All manufacturer identification numbers are registered with the ICC. + + + The device manufacturer's device model number. All model identification numbers are registered with the ICC. + + + + Attributes of profile that can be any of the following values. + | Constant | Meaning | |----------------------|------------------------------------------------------------------------------------------| | ATTRIB_TRANSPARENCY | Turns transparency on. If this flag is not used, the attribute is reflective by default. | | ATTRIB_MATTE | Turns matte display on. If this flag is not used, the attribute is glossy by default. | + + + + + The profile rendering intent that can be set to one of the following values: + INTENT_PERCEPTUAL + INTENT_SATURATION + INTENT_RELATIVE_COLORIMETRIC + INTENT_ABSOLUTE_COLORIMETRIC + For more information, see Rendering intents. + + + + Signature of the software that created the profile. Signatures are registered with the ICC. + + + + Indicates the device class. A device class may have one of the following values. + | Profile Class | Signature | |------------------------|----------------| | Input Device Profile | CLASS_SCANNER | | Display Device Profile | CLASS_MONITOR | | Output Device Profile | CLASS_PRINTER | + + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/PENUMTYPEW.xml b/sources/Interop/Windows/Windows/um/icm/PENUMTYPEW.xml new file mode 100644 index 0000000000..0021aff31d --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/PENUMTYPEW.xml @@ -0,0 +1,113 @@ + + + + + + Contains information that defines the profile enumeration constraints. + + + The size of this structure in bytes. + + + The version number of the ENUMTYPE structure. Should be set to ENUM_TYPE_VERSION. + + + + Indicates which fields in this structure are being used. Can be set to any combination of the following constant values. + ET_DEVICENAME + ET_MEDIATYPE + ET_DITHERMODE + ET_RESOLUTION + ET_CMMTYPE + ET_CLASS + ET_DATACOLORSPACE + ET_CONNECTIONSPACE + ET_SIGNATURE + ET_PLATFORM + ET_PROFILEFLAGS + ET_MANUFACTURER + ET_MODEL + ET_ATTRIBUTES + ET_RENDERINGINTENT + ET_CREATOR + ET_DEVICECLASS + + + + User friendly name of the device. + + + Indicates which type of media is associated with the profile, such as a printer or screen. + + + Indicates the style of dithering that will be used when an image is displayed. + + + The horizontal (x) and vertical (y) resolution in pixels of the device on which the image will be displayed. The x resolution is stored in dwResolution[0], and the y resolution is kept in dwResolution[1]. + + + The identification number of the CMM that is used in the profile. Identification numbers are registered with the ICC. + + + + Indicates the profile class. For a description of profile classes, see Using Device Profiles with WCS. A profile class may have any of the following values. + | Profile Class | Signature | |--------------------------------|-------------------| | Input Device Profile | CLASS_SCANNER | | Display Device Profile | CLASS_MONITOR | | Output Device Profile | CLASS_PRINTER | | Device Link Profile | CLASS_LINK | | Color Space Conversion Profile | CLASS_COLORSPACE | | Abstract Profile | CLASS_ABSTRACT | | Named Color Profile | CLASS_NAMED | | Color Appearance Model Profile | CLASS_CAMP | | Color Gamut Map Model Profile | CLASS_GMMP | + + + + A signature value that indicates the color space in which the profile data is defined. Can be any value from the Color Space Constants. + + + + A signature value that indicates the color space in which the profile connection space (PCS) is defined. Can be any of the following values. + | Profile Class | Signature | |---------------|------------| | XYZ | SPACE_XYZ | | Lab | SPACE_Lab | + When the dwClass member is set to CLASS_LINK, the PCS is taken from the dwDataColorSpace member. + + + + Reserved for internal use. + + + + The primary platform for which the profile was created. The member can be set to any of the following values. + | Platform | Value | |------------------------|--------| | Apple Computer, Inc. | 'APPL' | | Microsoft Corp. | 'MSFT' | | Silicon Graphics, Inc. | 'SGI' | | Sun Microsystems, Inc. | 'SUNW' | | Taligent | 'TGNT' | + + + + + Bit flags containing hints that the CMM uses to interpret the profile data and can be set to one of the following values. + | Constant | Meaning | |-----------------------|--------------------------------------------------------------------------------------------------------------------------| | FLAG_EMBEDDEDPROFILE | The profile is embedded in a bitmap file. | | FLAG_DEPENDENTONDATA | The profile can't be used independently of the embedded color data. Used for profiles that are embedded in bitmap files. | + + + + The identification number of the device profile manufacturer. All manufacturer identification numbers are registered with the ICC. + + + The device manufacturer's device model number. All model identification numbers are registered with the ICC. + + + + Attributes of profile that can be any of the following values. + | Constant | Meaning | |----------------------|------------------------------------------------------------------------------------------| | ATTRIB_TRANSPARENCY | Turns transparency on. If this flag is not used, the attribute is reflective by default. | | ATTRIB_MATTE | Turns matte display on. If this flag is not used, the attribute is glossy by default. | + + + + + The profile rendering intent that can be set to one of the following values: + INTENT_PERCEPTUAL + INTENT_SATURATION + INTENT_RELATIVE_COLORIMETRIC + INTENT_ABSOLUTE_COLORIMETRIC + For more information, see Rendering intents. + + + + Signature of the software that created the profile. Signatures are registered with the ICC. + + + + Indicates the device class. A device class may have one of the following values. + | Profile Class | Signature | |------------------------|----------------| | Input Device Profile | CLASS_SCANNER | | Display Device Profile | CLASS_MONITOR | | Output Device Profile | CLASS_PRINTER | + + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/PROFILE.xml b/sources/Interop/Windows/Windows/um/icm/PROFILE.xml new file mode 100644 index 0000000000..3cb1709fa0 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/PROFILE.xml @@ -0,0 +1,20 @@ + + + + + + Contains information that defines a color profile. See Using device profiles with WCS for more information. + + + + Must be set to one of the following values. + | Value | Meaning | |--------------------|----------------------------------------------------------------------------------------------------------------------------| | PROFILE_FILENAME | Indicates that the pProfileData member contains a null-terminated string that holds the name of a device profile file. | | PROFILE_MEMBUFFER | Indicates that the pProfileData member contains a pointer to a device profile in a memory buffer. | + + + + The contents of this member is indicated by the dwTYPE member. It will either be a pointer to a null-terminated string containing the file name of the device profile, or it will be a pointer to a buffer in memory containing the device profile data. + + + The size in bytes of the data buffer pointed to by the pProfileData member. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/PROFILEHEADER.xml b/sources/Interop/Windows/Windows/um/icm/PROFILEHEADER.xml new file mode 100644 index 0000000000..1d7d7fe20b --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/PROFILEHEADER.xml @@ -0,0 +1,84 @@ + + + + + + Contains information that describes the contents of a device profile file. This header occurs at the beginning of a device profile file. + + + The size of the profile in bytes. + + + The identification number of the CMM that is used in the profile. Identification numbers are registered with the ICC. + + + + The version number of the profile. The version number is determined by the ICC. The current major version number is 02h. The current minor version number is 10h. The major and minor version numbers are in binary coded decimal (BCD). They must be stored in the following format. + | Byte Number | Contents | |-------------|---------------------------------------------------------------------------------------------------------------------------| | 0 | Major version number in BCD. | | 1 | Minor version number in the most significant nibble of this byte. Bug fix version number in the least significant nibble. | | 2 | Reserved. Must be set to 0. | | 3 | Reserved. Must be set to 0. | + + + + + Indicates the profile class. For a description of profile classes, see Using Device Profiles with WCS. A profile class may have any of the following values. + | Profile Class | Signature | |--------------------------------|-------------------| | Input Device Profile | CLASS_SCANNER | | Display Device Profile | CLASS_MONITOR | | Output Device Profile | CLASS_PRINTER | | Device Link Profile | CLASS_LINK | | Color Space Conversion Profile | CLASS_COLORSPACE | | Abstract Profile | CLASS_ABSTRACT | | Named Color Profile | CLASS_NAMED | | Color Appearance Model Profile | CLASS_CAMP | | Color Gamut Map Model Profile | CLASS_GMMP | + + + + A signature value that indicates the color space in which the profile data is defined. The member can be any of value from the Color Space Constants. + + + + A signature value that indicates the color space in which the profile connection space (PCS) is defined. The member can be any of the following values. + | Profile Class | Signature | |---------------|------------| | XYZ | SPACE_XYZ | | Lab | SPACE_Lab | + When the phClass member is set to CLASS_LINK, the PCS is taken from the phDataColorSpace member. + + + + The date and time that the profile was created. + + + Reserved for internal use. + + + + The primary platform for which the profile was created. The primary platform can be set to any of the following values. + | Platform | Value | |------------------------|--------| | Apple Computer, Inc. | 'APPL' | | Microsoft Corp. | 'MSFT' | | Silicon Graphics, Inc. | 'SGI' | | Sun Microsystems, Inc. | 'SUNW' | | Taligent | 'TGNT' | + + + + + Bit flags containing hints that the CMM uses to interpret the profile data. The member can be set to the following values. + + + + The identification number of the device profile manufacturer. All manufacturer identification numbers are registered with the ICC. + + + The device manufacturer's device model number. All model identification numbers are registered with the ICC. + + + + Attributes of profile. The profile attributes can be any of the following values. + | Constant | Meaning | |----------------------|------------------------------------------------------------------------------------------| | ATTRIB_TRANSPARENCY | Turns transparency on. If this flag is not used, the attribute is reflective by default. | | ATTRIB_MATTE | Turns matte display on. If this flag is not used, the attribute is glossy by default. | + + + + + The profile rendering intent. The member can be set to one of the following values: + INTENT_PERCEPTUAL + INTENT_SATURATION + INTENT_RELATIVE_COLORIMETRIC + INTENT_ABSOLUTE_COLORIMETRIC + For more information, see Rendering intents. + + + + Profile illuminant. + + + Signature of the software that created the profile. Signatures are registered with the ICC. + + + Reserved. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/RGBCOLOR.xml b/sources/Interop/Windows/Windows/um/icm/RGBCOLOR.xml new file mode 100644 index 0000000000..308dfacf3f --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/RGBCOLOR.xml @@ -0,0 +1,17 @@ + + + + + + TBD + + + TBD + + + TBD + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/WCS_PROFILE_MANAGEMENT_SCOPE.xml b/sources/Interop/Windows/Windows/um/icm/WCS_PROFILE_MANAGEMENT_SCOPE.xml new file mode 100644 index 0000000000..8668b76bf4 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/WCS_PROFILE_MANAGEMENT_SCOPE.xml @@ -0,0 +1,14 @@ + + + + + + Specifies the scope of a profile management operation, such as associating a profile with a device. + + + Indicates that the profile management operation affects all users. + + + Indicates that the profile management operation affects only the current user. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/Windows.xml b/sources/Interop/Windows/Windows/um/icm/Windows.xml new file mode 100644 index 0000000000..683055bea4 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/Windows.xml @@ -0,0 +1,1703 @@ + + + + + + + Associates a specified color profile with a specified device. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ Reserved. Must be NULL. This parameter is intended to point to the name of the machine on which to associate the specified profile and device. A NULL pointer indicates the local machine. + Points to the file name of the profile to associate. + Points to the name of the device to associate. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + +
+ + + Associates a specified color profile with a specified device. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ Reserved. Must be NULL. This parameter is intended to point to the name of the machine on which to associate the specified profile and device. A NULL pointer indicates the local machine. + Points to the file name of the profile to associate. + Points to the name of the device to associate. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + +
+ + + Associates a specified color profile with a specified device. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ Reserved. Must be NULL. This parameter is intended to point to the name of the machine on which to associate the specified profile and device. A NULL pointer indicates the local machine. + Points to the file name of the profile to associate. + Points to the name of the device to associate. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + +
+ + + Associates a specified color profile with a specified device. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ Reserved. Must be NULL. This parameter is intended to point to the name of the machine on which to associate the specified profile and device. A NULL pointer indicates the local machine. + Points to the file name of the profile to associate. + Points to the name of the device to associate. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + +
+ + Checks whether the pixels in a specified bitmap lie within the output gamut of a specified transform. + Handle to the color transform to use. + Pointer to the bitmap to check against the output gamut. + Specifies the format of the bitmap. Must be set to one of the values of the enumerated type. + Specifies the number of pixels per scan line of the bitmap. + Specifies the number of scan lines of the bitmap. + Specifies the number of bytes from the beginning one scan line to the beginning of the next one. If set to zero, the bitmap scan lines are assumed to be padded so as to be DWORD-aligned. + Pointer to an array of bytes where the test results are to be placed. This results buffer must contain at least as many bytes as there are pixels in the bitmap. + Pointer to a callback function called periodically by CheckBitmapBits to report progress and allow the calling process to cancel the bitmap test. (See ICMProgressProcCallback). + Data passed back to the callback function, for example, to identify the bitmap test about which progress is being reported. + + If this function succeeds, the return value is a nonzero value. + If this function fails, the return value is zero. For extended error information, call GetLastError. + + + + Determines whether the colors in an array lie within the output gamut of a specified transform. + Handle to the color transform to use. + Pointer to an array of nColors structures to translate. + Contains the number of elements in the arrays pointed to by paInputColors and paResult. + Specifies the input color type. + Pointer to an array of nColors bytes that receives the results of the test. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Closes an open profile handle. + Handle to the profile to be closed. The function determines whether the HPROFILE contains ICC or WCS profile information. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + + + + Determines whether given colors lie within the output gamut of a specified transform. + Handle to the color transform to use. + Pointer to an array of structures to check against the output gamut. + Specifies the number of elements in the array. + Specifies the input color type. + Pointer to a buffer in which to place an array of bytes containing the test results. Each byte in the buffer corresponds to a COLOR structure, and on exit has been set to an unsigned value between 0 and 255. The value 0 denotes that the color is in gamut, while a nonzero value indicates that it is out of gamut. For any integer n such that 0 < n < 255, a result value of n + 1 indicates that the corresponding color is at least as far out of gamut as would be indicated by a result value of n. These values are usually generated from the gamutTag in the ICC profile. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. If the function is not successful, the CMM should call to set the last error to a valid error value defined in Winerror.h. + + + + + [CMCheckColorsInGamut is no longer available for use as of Windows Vista.] + Determines whether specified RGB triples lie in the output gamut of a specified transform. + + Specifies the transform to use. + Points to an array of RGB triples to check. + + Points to the buffer in which to put results. + The results are represented by an array of bytes. Each byte in the array corresponds to an RGB triple and has an unsigned value between 0 and 255. The value 0 denotes that the color is in gamut, while a nonzero value denotes that it is out of gamut. For any integer n in the range 0 < n < 255, a result value of n + 1 indicates that the corresponding color is at least as far out of gamut as would be indicated by a result value of n. + + Specifies the number of elements in the array. + + Beginning with Windows Vista, the default CMM (Icm32.dll) will return FALSE and will report ERROR_NOT_SUPPORTED. + + Windows Server 2003, Windows XP and Windows 2000: + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. Call to retrieve the error. + + + + Checks bitmap colors against an output gamut. + + + Converts color names in a named color space to index numbers in a color profile. + The handle to a named color profile. + Pointer to an array of color name structures. + Pointer to an array of DWORDS that this function fills with the indices. + The number of color names to convert. + + If this function succeeds with the conversion, the return value is TRUE. + If this function fails, the return value is FALSE. When this occurs, the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h. + + + + Transforms indices in a color space to an array of names in a named color space. + The handle to a color space profile. + Pointer to an array of color-space index numbers. + Pointer to an array of color name structures. + The number of indices to convert. + + If this conversion function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. When this occurs, the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h. + + + + Creates a device link profile in the format specified by the International Color Consortium in its ICC Profile Format Specification. + Pointer to an array of profile handles. + Specifies the number of profiles in the array. + An array of rendering intents. + The number of elements in the array of intents. + Specifies flags to used control creation of the transform. For details, see CMM Transform Creation Flags. + Pointer to a pointer to a buffer. If successful the function allocates and fills this buffer. The calling application must free this buffer when it is no longer needed. Use the GlobalFree function to free this buffer. + + If the function succeeds, the return value is a nonzero value. + If this function fails, the return value is zero. If the function is not successful, the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h. + + + + Accepts an array of profiles or a single device link profile and creates a color transform. This transform is a mapping from the color space specified by the first profile to that of the second profile and so on to the last one. + Points to an array of profile handles. + Specifies the number of profiles in the array. + + Points to an array of rendering intents. Each rendering intent is represented by one of the following values: + INTENT_PERCEPTUAL
INTENT_SATURATION
INTENT_RELATIVE_COLORIMETRIC
INTENT_ABSOLUTE_COLORIMETRIC
+ For more information, see Rendering intents. + + Specifies the number of intents in the intent array. Can be 1, or the same value as nProfiles. + Specifies flags to used control creation of the transform. For details, see CMM Transform Creation Flags. + + If this function succeeds, the return value is a color transform in the range 256 to 65,535. Since only the low WORD of the transform is retained, valid transforms cannot exceed this range. + If this function fails, the return value is an error code having a value less than 256. When the return value is less than 256, signaling an error, the CMM should use SetLastError to set the last error to a valid error value as defined in Winerror.h. + +
+ + + [CMCreateProfile is no longer available for use as of Windows Vista.] + Creates a display color profile from a structure. + + Pointer to a color logical space, of which the lcsFilename member will be NULL. + Pointer to a pointer to a buffer. If successful the function allocates and fills this buffer. It is the calling application's responsibility to free this buffer when it is no longer needed. + + Beginning with Windows Vista, the default CMM (Icm32.dll) will return FALSE and will report ERROR_NOT_SUPPORTED. + + Windows Server 2003, Windows XP and Windows 2000: + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. Call to retrieve the error. + + + + + [CMCreateProfileW is no longer available for use as of Windows Vista.] + Creates a display color profile from a structure. + + Pointer to a color logical space, of which the lcsFilename member will be NULL. + Pointer to a pointer to a buffer. If successful the function allocates and fills this buffer. It is the calling application's responsibility to free this buffer when it is no longer needed. + + Beginning with Windows Vista, the default CMM (Icm32.dll) will return FALSE and will report ERROR_NOT_SUPPORTED. + + Windows Server 2003, Windows XP and Windows 2000: + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. Call to retrieve the error. + + + + Deprecated. There is no replacement API because this one was no longer being used. Developers of alternate CMM modules are not required to implement it. + + + Creates a color transform that maps from an input to an optional target space and then to an output device, using a set of flags that define how the transform should be created. + Pointer to an input logical color space structure. + Pointer to a memory-mapped device profile. + Pointer to a memory-mapped target profile. + Specifies flags to used control creation of the transform. For details, see CMM transform creation flags. + + If this function succeeds, the return value is a color transform in the range 256 to 65,535. Since only the low WORD of the transform is retained, valid transforms cannot exceed this range. + If this function fails, the return value is an error code having a value less than 256. When the return value is less than 256, signaling an error, the CMM should use SetLastError to set the last error to a valid error value as defined in Winerror.h. + + + + Creates a color transform that maps from an input to an optional target space and then to an output device, using a set of flags that define how the transform should be created. + Pointer to an input logical color space structure. + Pointer to a memory-mapped device profile. + Pointer to a memory-mapped target profile. + Specifies flags to used control creation of the transform. For details, see CMM transform creation flags. + + If this function succeeds, the return value is a color transform in the range 256 to 65,535. Since only the low WORD of the transform is retained, valid transforms cannot exceed this range. + If this function fails, the return value is an error code having a value less than 256. When the return value is less than 256, signaling an error, the CMM should use SetLastError to set the last error to a valid error value as defined in Winerror.h. + + + + Deprecated. There is no replacement API because this one was no longer being used. Developers of alternate CMM modules are not required to implement it. + + + Deletes a specified color transform, and frees any memory associated with it. + Identifies the color transform to be deleted. + + If this function succeeds, the return value is TRUE. + If the function fails, the return value is FALSE. If the CMDeleteTransform function is not successful, the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h. + + + + + Retrieves various information about the color management module (CMM). + Every CMM is required to export this function. + + + Specifies what information should be retrieved. This parameter can take one of the following constant values. + + If this function succeeds, the return value is the same nonzero value that was passed in through the dwInfo parameter. If the function fails, the return value is zero. + + + Retrieves information about the specified named color profile. + The handle to the profile from which the information will be retrieved. + A pointer to a NAMED_PROFILE_INFO structure. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. When this occurs, the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h. + + + + + Retrieves the PostScript Level 2 color rendering intent from a profile. + Specifies the profile to use. + + Specifies the desired rendering intent to retrieve. Can be one of the following values: + INTENT_PERCEPTUAL
INTENT_SATURATION
INTENT_RELATIVE_COLORIMETRIC
INTENT_ABSOLUTE_COLORIMETRIC
+ For more information, see Rendering Intents. + + Points to a buffer in which the color rendering intent is to be placed. If the pointer is NULL, the function returns the size required for this buffer in *lpcbSize. + Points to a variable specifying the size of the buffer. On return, the variable contains has the number of bytes actually copied to the buffer. + + If this function succeeds, the return value is TRUE. It also returns TRUE if it is called with lpBuffer set to NULL and the size of the required buffer is copied into lpcbSize. + If this function fails, the return value is FALSE. When this occurs, the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h. + +
+ + + Reports whether the given profile is a valid ICC profile that can be used for color management. + Specifies the profile to check. + Pointer to a variable that is set on exit to TRUE if the profile is a valid ICC profile, or FALSE if not. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. If the function fails, the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h. + + + + Translates an array of colors from a source color space to a destination color space using a color transform. + Specifies the color transform to use. + Points to an array of structures to translate. + Specifies the number of elements in the array. + Specifies the color type of the input. + Points to a buffer in which an array of translated COLOR structures is to be placed. + Specifies the output color type. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. The CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h. + + + + Translates an application-supplied RGBQuad into the device color space. + Specifies the transform to be used. + The RGBQuad to translate. + Points to a buffer in which to place the translation. + + Specifies how the transform should be used to make the translation. This parameter can take one of the following meanings. + + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. The CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h. + + + + + [CMTranslateRGBs is no longer available for use as of Windows Vista.] + Translates a bitmap from one color space to another using a color transform. + + Specifies the color transform to use. + Points to the bitmap to translate. + Specifies the input bitmap format. + Specifies the number of pixels per scan line in the input bitmap. + Specifies the number of scan lines in the input bitmap. + Specifies the number of bytes from the beginning of one scan line to the beginning of the next in the input bitmap. If dwStride is set to zero, the CMM should assume that scan lines are padded so as to be DWORD-aligned. + Points to a destination buffer in which to place the translated bitmap. + Specifies the output bitmap format. + + Specifies the direction of the transform being used for the translation. This parameter must take one of the following values. + + + Beginning with Windows Vista, the default CMM (Icm32.dll) will return FALSE and will report ERROR_NOT_SUPPORTED. + + Windows Server 2003, Windows XP and Windows 2000: + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. If the function is not successful, the CMM should call to set the last error to a valid error value defined in Winerror.h. + + + + Translates a bitmap from one defined format into a different defined format and calls a callback function periodically, if one is specified, to report progress and permit the calling application to terminate the translation. + Specifies the color transform to use. + Pointer to the bitmap to translate. + Specifies the input bitmap format. + Specifies the number of pixels per scan line in the input bitmap. + Specifies the number of scan lines in the input bitmap. + Specifies the number of bytes from the beginning of one scan line to the beginning of the next in the input bitmap. If dwInputStride is set to zero, the CMM should assume that scan lines are padded so as to be DWORD-aligned. + Points to a destination buffer in which to place the translated bitmap. + Specifies the output bitmap format. + Specifies the number of bytes from the beginning of one scan line to the beginning of the next in the input bitmap. If dwOutputStride is set to zero, the CMM should pad scan lines so that they are DWORD-aligned. + Pointer to an application-supplied callback function called periodically by CMTranslateRGBsExt to report progress and allow the calling process to cancel the translation. (See ICMProgressProcCallback.) + Data passed back to the callback function, for example to identify the translation that is reporting progress. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE and the CMM should call SetLastError to set the last error to a valid error value defined in Winerror.h. + + + + Associates an installed color profile with a specified display in the given scope. + Specifies the association as system-wide or the current user. + Identifies the installed profile to associate. + An identifier assigned to the adapter (e.g. GPU) of the target display. See Remarks for more details. + An identifier assigned to the source of the display. See Remarks for more details. + Whether or not to set the newly associated profile as the default. + Specifies to which association list the new profile is added. + + S_OK for success, or a failure HRESULT value + + + Gets the default color profile for a given display in the specified scope. + Specifies the association as system-wide or the current user. + An identifier assigned to the adapter (e.g. GPU) of the target display. See Remarks for more details. + An identifier assigned to the source of the display. See Remarks for more details. + The type of color profile to return (currently only CPT_ICC is supported). + The subtype of the color profile to return. + Receives a pointer to the default color profile name, which must be freed with . + + + Retrieves the list of profiles associated with a given display in the specified scope. + Specifies the association as system-wide or the current user. + An identifier assigned to the adapter (e.g. GPU) of the target display. See Remarks for more details. + An identifier assigned to the source of the display. See Remarks for more details. + Pointer to a buffer where the profile names are placed, must be freed with . + Receives the number of profiles names copied into profileList. + + S_OK for success, or a failure HRESULT value + + + Gets the currently selected color profile scope of the provided display - either user or system. + An identifier assigned to the adapter (e.g. GPU) of the target display. See Remarks for more details. + An identifier assigned to the source of the display. See Remarks for more details. + Returns the scope of the currently selected color profile - either the current user or system. + + S_OK for success, or a failure HRESULT value + + + Disassociates an installed color profile from a specified display in the given scope. + Specifies the association as system-wide or the current user. + Identifies the installed profile to associate. + An identifier assigned to the adapter (e.g. GPU) of the target display. See Remarks for more details. + An identifier assigned to the source of the display. See Remarks for more details. + Specifies to which association list the new profile is added. + + S_OK for success, or a failure HRESULT value + + + Sets an installed color profile as the default profile for a specified display in the given scope. + Specifies the association as system-wide or the current user. + Identifies the installed profile to associate. + The type of color profile to set as default (currently only CPT_ICC is supported). + The subtype of the color profile to set as default. + An identifier assigned to the adapter (e.g. GPU) of the target display. See Remarks for more details. + An identifier assigned to the source of the display. See Remarks for more details. + + S_OK for success, or a failure HRESULT value + + + Converts color names in a named color space to index numbers in an International Color Consortium (ICC) color profile. + The handle to an ICC named color profile. + Pointer to an array of color name structures. + Pointer to an array of DWORDS that this function fills with the indices. The indices begin with one, not zero. + The number of color names to convert. + + If this function succeeds with the conversion, the return value is TRUE. + If the conversion function fails, the return value is FALSE. + + + + Transforms indices in a color space to an array of names in a named color space. + The handle to an International Color Consortium (ICC) color space profile. + Pointer to an array of color-space index numbers. The indices begin with one, not zero. + Pointer to an array of color name structures. + The number of indices to convert. + + If this conversion function succeeds, the return value is TRUE. + If this conversion function fails, the return value is FALSE. + + + + Creates a color transform that applications can use to perform color management. + Pointer to the input . + Handle to the profile of the destination device. The function determines whether the HPROFILE contains International Color Consortium (ICC) or Windows Color System (WCS) profile information. + Handle to the profile of the target device. The function determines whether the HPROFILE contains ICC or WCS profile information. + Specifies flags to used control creation of the transform. See Remarks. + + If this function succeeds, the return value is a handle to the color transform. + If this function fails, the return value is NULL. For extended error information, call GetLastError. + + + + Creates a color transform that applications can use to perform color management. + Pointer to the input . + Handle to the profile of the destination device. The function determines whether the HPROFILE contains International Color Consortium (ICC) or Windows Color System (WCS) profile information. + Handle to the profile of the target device. The function determines whether the HPROFILE contains ICC or WCS profile information. + Specifies flags to used control creation of the transform. See Remarks. + + If this function succeeds, the return value is a handle to the color transform. + If this function fails, the return value is NULL. For extended error information, call GetLastError. + + + + Creates a color transform that applications can use to perform color management. + Pointer to the input . + Handle to the profile of the destination device. The function determines whether the HPROFILE contains International Color Consortium (ICC) or Windows Color System (WCS) profile information. + Handle to the profile of the target device. The function determines whether the HPROFILE contains ICC or WCS profile information. + Specifies flags to used control creation of the transform. See Remarks. + + If this function succeeds, the return value is a handle to the color transform. + If this function fails, the return value is NULL. For extended error information, call GetLastError. + + + + Creates a color transform that applications can use to perform color management. + Pointer to the input . + Handle to the profile of the destination device. The function determines whether the HPROFILE contains International Color Consortium (ICC) or Windows Color System (WCS) profile information. + Handle to the profile of the target device. The function determines whether the HPROFILE contains ICC or WCS profile information. + Specifies flags to used control creation of the transform. See Remarks. + + If this function succeeds, the return value is a handle to the color transform. + If this function fails, the return value is NULL. For extended error information, call GetLastError. + + + + Creates an International Color Consortium (ICC) device link profile from a set of color profiles, using the specified intents. + Pointer to an array of handles of the color profiles to be used. The function determines whether the HPROFILEs contain ICC profile information and, if so, it processes them appropriately. + Specifies the number of profiles in the array pointed to by hProfile. + Pointer to an array of DWORDS containing the intents to be used. See Rendering intents. + The number of intents in the array pointed to by padwIntent. + Specifies flags to used control creation of the transform. For details, see CMM Transform Creation Flags. + Pointer to a pointer to a buffer. If successful, this function allocates the buffer, places its address in *pProfileData, and fills it with a device link profile. If the function succeeds, the calling application must free the buffer after it is no longer needed. + Specifies the one-based index of the color profile that indicates what color management module (CMM) to use. The application developer may allow Windows to choose the CMM by setting this parameter to INDEX_DONT_CARE. See Using Color Management Modules (CMM). + + If this function succeeds, the return value is a nonzero value. + If this function fails, the return value is zero. For extended error information, call GetLastError. + + + + Accepts an array of profiles or a single device link profile and creates a color transform that applications can use to perform color mapping. + Pointer to an array of handles to the profiles to be used. The function determines whether the HPROFILEs contain International Color Consortium (ICC) or Windows Color System (WCS) profile information and processes them appropriately. When valid WCS profiles are returned by and WcsOpenColorProfileW, these profile handles contain the combination of DMP, CAMP, and GMMP profiles. + Specifies the number of profiles in the array. The maximum is 10. + + Pointer to an array of intents to use. Each intent is one of the following values: + + + + INTENT_PERCEPTUAL + + + + + INTENT_SATURATION + + + + + INTENT_RELATIVE_COLORIMETRIC + + + + + INTENT_ABSOLUTE_COLORIMETRIC + + + + GMMPs are a generalization of intents. There are two possible sources of intents: the "destination" profile and the intent list parameter to CreateMultiProfileTransform. The term "destination" is not used since all but two of the profiles in the profile list parameter will serve as first destination and then source. + For more information, see Rendering Intents. + + Specifies the number of elements in the intents array: can either be 1 or the same value as nProfiles. For profile arrays that contain any WCS profiles, the first rendering intent is ignored and only nProfiles -1 elements are used for these profile arrays. The maximum number of nIntents is 10. + Specifies flags used to control creation of the transform. See Remarks. + Specifies the one-based index of the color profile that indicates what color management module (CMM) to use. The application developer may allow Windows to choose the CMM by setting this parameter to INDEX_DONT_CARE. See Using Color Management Modules (CMM) Third party CMMs are only available for ICC workflows. Profile arrays containing WCS profiles will ignore this flag. It is also ignored when only ICC profiles are used and when the WCS_ALWAYS flag is used. + + If this function succeeds, the return value is a handle to the color transform. + If this function fails, the return value is NULL. For extended error information, call GetLastError. + + + + Converts a logical color space to a device profile. + A pointer to a logical color space structure. See for details. The lcsFilename [0] member of the structure must be set to the null character ('\0') or this function call will fail with the return value of INVALID_PARAMETER. + A pointer to a pointer to a buffer where the device profile will be created. This function allocates the buffer and fills it with profile information if it is successful. If not, the pointer is set to NULL. The caller is responsible for freeing this buffer when it is no longer needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. + If the lcsFilename [0] member if the structure pointed to by pLogColorSpace is not '\0', this function returns INVALID_PARAMETER. + + + + Converts a logical color space to a device profile. + A pointer to a logical color space structure. See for details. The lcsFilename [0] member of the structure must be set to the null character ('\0') or this function call will fail with the return value of INVALID_PARAMETER. + A pointer to a pointer to a buffer where the device profile will be created. This function allocates the buffer and fills it with profile information if it is successful. If not, the pointer is set to NULL. The caller is responsible for freeing this buffer when it is no longer needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. + If the lcsFilename [0] member if the structure pointed to by pLogColorSpace is not '\0', this function returns INVALID_PARAMETER. + + + + Converts a logical color space to a device profile. + A pointer to a logical color space structure. See for details. The lcsFilename [0] member of the structure must be set to the null character ('\0') or this function call will fail with the return value of INVALID_PARAMETER. + A pointer to a pointer to a buffer where the device profile will be created. This function allocates the buffer and fills it with profile information if it is successful. If not, the pointer is set to NULL. The caller is responsible for freeing this buffer when it is no longer needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. + If the lcsFilename [0] member if the structure pointed to by pLogColorSpace is not '\0', this function returns INVALID_PARAMETER. + + + + Converts a logical color space to a device profile. + A pointer to a logical color space structure. See for details. The lcsFilename [0] member of the structure must be set to the null character ('\0') or this function call will fail with the return value of INVALID_PARAMETER. + A pointer to a pointer to a buffer where the device profile will be created. This function allocates the buffer and fills it with profile information if it is successful. If not, the pointer is set to NULL. The caller is responsible for freeing this buffer when it is no longer needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. + If the lcsFilename [0] member if the structure pointed to by pLogColorSpace is not '\0', this function returns INVALID_PARAMETER. + + + + Deletes a given color transform. + Identifies the color transform to delete. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + + Disassociates a specified color profile with a specified device on a specified computer. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to disassociate the specified profile and device. A NULL pointer indicates the local computer. + Pointer to the file name of the profile to disassociate. + Pointer to the name of the device to disassociate. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + + Disassociates a specified color profile with a specified device on a specified computer. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to disassociate the specified profile and device. A NULL pointer indicates the local computer. + Pointer to the file name of the profile to disassociate. + Pointer to the name of the device to disassociate. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + + Disassociates a specified color profile with a specified device on a specified computer. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to disassociate the specified profile and device. A NULL pointer indicates the local computer. + Pointer to the file name of the profile to disassociate. + Pointer to the name of the device to disassociate. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + + Disassociates a specified color profile with a specified device on a specified computer. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to disassociate the specified profile and device. A NULL pointer indicates the local computer. + Pointer to the file name of the profile to disassociate. + Pointer to the name of the device to disassociate. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + Enumerates all the profiles satisfying the given enumeration criteria. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to enumerate profiles. A NULL pointer indicates the local computer. + Pointer to a structure specifying the enumeration criteria. + Pointer to a buffer in which the profiles are to be enumerated. A MULTI_SZ string of profile names satisfying the criteria specified in *pEnumRecord will be placed in this buffer. + Pointer to a variable containing the size of the buffer pointed to by pBuffer. On return, *pdwSize contains the size of buffer actually used or needed. + Pointer to a variable that will contain, on return, the number of profile names actually copied to the buffer. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + + + + Enumerates all the profiles satisfying the given enumeration criteria. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to enumerate profiles. A NULL pointer indicates the local computer. + Pointer to a structure specifying the enumeration criteria. + Pointer to a buffer in which the profiles are to be enumerated. A MULTI_SZ string of profile names satisfying the criteria specified in *pEnumRecord will be placed in this buffer. + Pointer to a variable containing the size of the buffer pointed to by pBuffer. On return, *pdwSize contains the size of buffer actually used or needed. + Pointer to a variable that will contain, on return, the number of profile names actually copied to the buffer. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + + + + Enumerates all the profiles satisfying the given enumeration criteria. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to enumerate profiles. A NULL pointer indicates the local computer. + Pointer to a structure specifying the enumeration criteria. + Pointer to a buffer in which the profiles are to be enumerated. A MULTI_SZ string of profile names satisfying the criteria specified in *pEnumRecord will be placed in this buffer. + Pointer to a variable containing the size of the buffer pointed to by pBuffer. On return, *pdwSize contains the size of buffer actually used or needed. + Pointer to a variable that will contain, on return, the number of profile names actually copied to the buffer. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + + + + Enumerates all the profiles satisfying the given enumeration criteria. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to enumerate profiles. A NULL pointer indicates the local computer. + Pointer to a structure specifying the enumeration criteria. + Pointer to a buffer in which the profiles are to be enumerated. A MULTI_SZ string of profile names satisfying the criteria specified in *pEnumRecord will be placed in this buffer. + Pointer to a variable containing the size of the buffer pointed to by pBuffer. On return, *pdwSize contains the size of buffer actually used or needed. + Pointer to a variable that will contain, on return, the number of profile names actually copied to the buffer. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + + + + Retrieves various information about the color management module (CMM) that created the specified color transform. + Identifies the transform for which to find CMM information. + + Specifies the information to be retrieved. This parameter can take one of the following constant values. + | Value | Meaning | |-|-| | CMM_WIN_VERSION | Retrieves the version of Windows targeted by the color management module (CMM).
| | CMM_DLL_VERSION | Retrieves the version number of the CMM.
| | CMM_IDENT | Retrieves the CMM signature registered with the International Color Consortium (ICC).
|
+ + + If this function succeeds, the return value is the information specified in dwInfo. + If this function fails, the return value is zero. + +
+ + +
+ [!NOTE] This API may be unavailable in future releases. We encourage new and existing software to use other APIs for color profile interactions. Please refer to the below table for some examples. + | Scenario | Mechanism | | :------: | :------: | | Enumerating all installed profiles | Use and , or | | Installing/Uninstalling color profiles | Use / | | Opening a color profile file directly | Use with dwType=PROFILE_FILENAME in the PROFILE struct parameter.
Or use . contains many APIs that accept the returned HPROFILE for color profile manipulation |
+
+ +
+
+ Retrieves the path of the Windows COLOR directory on a specified machine. +
+ Reserved; must be NULL. This parameter is intended to point to the name of the machine on which the profile is to be installed. A NULL pointer indicates the local machine. + Points to the buffer in which the color directory path is to be placed. + Points to a variable containing the size in bytes of the buffer pointed to by pBuffer. On return, the variable contains the size of the buffer actually used or needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + +
+ [!NOTE] This API may be unavailable in future releases. We encourage new and existing software to use other APIs for color profile interactions. Please refer to the below table for some examples. + | Scenario | Mechanism | | :------: | :------: | | Enumerating all installed profiles | Use and , or | | Installing/Uninstalling color profiles | Use / | | Opening a color profile file directly | Use with dwType=PROFILE_FILENAME in the PROFILE struct parameter.
Or use . contains many APIs that accept the returned HPROFILE for color profile manipulation |
+
+ +
+
+ Retrieves the path of the Windows COLOR directory on a specified machine. +
+ Reserved; must be NULL. This parameter is intended to point to the name of the machine on which the profile is to be installed. A NULL pointer indicates the local machine. + Points to the buffer in which the color directory path is to be placed. + Points to a variable containing the size in bytes of the buffer pointed to by pBuffer. On return, the variable contains the size of the buffer actually used or needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + +
+ [!NOTE] This API may be unavailable in future releases. We encourage new and existing software to use other APIs for color profile interactions. Please refer to the below table for some examples. + | Scenario | Mechanism | | :------: | :------: | | Enumerating all installed profiles | Use and , or | | Installing/Uninstalling color profiles | Use / | | Opening a color profile file directly | Use with dwType=PROFILE_FILENAME in the PROFILE struct parameter.
Or use . contains many APIs that accept the returned HPROFILE for color profile manipulation |
+
+ +
+
+ Retrieves the path of the Windows COLOR directory on a specified machine. +
+ Reserved; must be NULL. This parameter is intended to point to the name of the machine on which the profile is to be installed. A NULL pointer indicates the local machine. + Points to the buffer in which the color directory path is to be placed. + Points to a variable containing the size in bytes of the buffer pointed to by pBuffer. On return, the variable contains the size of the buffer actually used or needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + +
+ [!NOTE] This API may be unavailable in future releases. We encourage new and existing software to use other APIs for color profile interactions. Please refer to the below table for some examples. + | Scenario | Mechanism | | :------: | :------: | | Enumerating all installed profiles | Use and , or | | Installing/Uninstalling color profiles | Use / | | Opening a color profile file directly | Use with dwType=PROFILE_FILENAME in the PROFILE struct parameter.
Or use . contains many APIs that accept the returned HPROFILE for color profile manipulation |
+
+ +
+
+ Retrieves the path of the Windows COLOR directory on a specified machine. +
+ Reserved; must be NULL. This parameter is intended to point to the name of the machine on which the profile is to be installed. A NULL pointer indicates the local machine. + Points to the buffer in which the color directory path is to be placed. + Points to a variable containing the size in bytes of the buffer pointed to by pBuffer. On return, the variable contains the size of the buffer actually used or needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + Copies data from a specified tagged profile element of a specified color profile into a buffer. + Specifies a handle to the International Color Consortium (ICC) color profile in question. + Identifies the tagged element from which to copy. + Specifies the offset from the first byte of the tagged element data at which to begin copying. + Pointer to a variable specifying the number of bytes to copy. On return, the variable contains the number of bytes actually copied. + Pointer to a buffer into which the tagged element data is to be copied. The buffer must contain at least as many bytes as are specified by the variable pointed to by pcbSize. If the pBuffer pointer is set to NULL, the size of the entire tagged element data in bytes is returned in the memory location pointed to by pcbSize, and dwOffset is ignored. In this case, the function will return FALSE. + Points to a Boolean value that is set to TRUE if more than one tag in the color profile refers to the same data as the specified tag refers to, or FALSE if not. + + If this function succeeds, the return value is nonzero. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Retrieves the tag name specified by dwIndex in the tag table of a given International Color Consortium (ICC) color profile, where dwIndex is a one-based index into that table. + Specifies a handle to the ICC color profile in question. + Specifies the one-based index of the tag to retrieve. + Pointer to a variable in which the tag name is to be placed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Given a handle to an open color profile, the GetColorProfileFromHandle function copies the contents of the profile into a buffer supplied by the application. If the handle is a Windows Color System (WCS) handle, then the DMP is returned and the CAMP and GMMP associated with the HPROFILE are ignored. + Handle to an open color profile. The function determines whether the HPROFILE contains ICC or WCS profile information. + Pointer to buffer to receive raw ICC or DMP profile data. Can be NULL. If it is, the size required for the buffer will be stored in the memory location pointed to by pcbSize. The buffer can be allocated to the appropriate size, and this function called again with pBuffer containing the address of the buffer. + Pointer to a DWORD that holds the size of buffer pointed at by pBuffer. On return it is filled with size of buffer that was actually used if the function succeeds. If this function is called with pBuffer set to NULL, this parameter will contain the size of the buffer required. + + If this function succeeds, the return value is TRUE. It returns FALSE if the pBuffer parameter is NULL and the size required for the buffer is copied into pcbSize. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Retrieves or derives ICC header structure from either ICC color profile or WCS XML profile. Drivers and applications should assume returning TRUE only indicates that a properly structured header is returned. Each tag will still need to be validated independently using either legacy ICM2 APIs or XML schema APIs. + Specifies a handle to the color profile in question. + Points to a variable in which the ICC header structure is to be placed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. This function will fail is an invalid ICC or WCS XML profile is referenced in the hProfile parameter. For extended error information, call GetLastError. + + + + Retrieves the number of tagged elements in a given color profile. + Specifies a handle to the profile in question. + Pointer to a variable in which to place the number of tagged elements in the profile. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Retrieves information about the International Color Consortium (ICC) named color profile that is specified in the first parameter. + The handle to the ICC profile from which the information will be retrieved. + A pointer to a NAMED_PROFILE_INFO structure. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. + + + + Retrieves the PostScript Level 2 color rendering dictionary from the specified ICC color profile. + Specifies a handle to the ICC color profile in question. + + Specifies the desired rendering intent for the color rendering dictionary. Valid values are: + + + INTENT_PERCEPTUAL + + + INTENT_SATURATION + + + INTENT_RELATIVE_COLORIMETRIC + + + INTENT_ABSOLUTE_COLORIMETRIC + + + For more information, see Rendering intents. + + Pointer to a buffer in which the color rendering dictionary is to be placed. If the pBuffer pointer is set to NULL, the required buffer size is returned in *pcbSize. + Pointer to a variable containing the size of the buffer in bytes. On return, the variable contains the number of bytes actually copied. + Pointer to a Boolean variable. If TRUE, the color rendering dictionary could be copied in binary form. If FALSE, the dictionary will be encoded in ASCII85 form. On return, this Boolean variable indicates whether the dictionary was actually binary (TRUE) or ASCII85 (FALSE). + + If this function succeeds, the return value is TRUE. It also returns TRUE if the pBuffer parameter is NULL and the size required for the buffer is copied into pcbSize. + If this function fails, the return value is FALSE. + + + + Retrieves the PostScript Level 2 color rendering intent from an ICC color profile. + Specifies a handle to the ICC color profile in question. + + Specifies the desired rendering intent to retrieve. Valid values are: + INTENT_PERCEPTUAL + INTENT_SATURATION + INTENT_RELATIVE_COLORIMETRIC + INTENT_ABSOLUTE_COLORIMETRIC + For more information, see Rendering Intents. + + Points to a buffer in which the color rendering intent is to be placed. If the pBuffer pointer is set to NULL, the buffer size required is returned in *pcbSize. + Points to a variable containing the buffer size in bytes. On return, this variable contains the number of bytes actually copied. + + If this function succeeds, the return value is TRUE. If this function succeeds, the return value is TRUE. It also returns TRUE if the pBuffer parameter is NULL and the size required for the buffer is copied into pcbSize. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Retrieves the PostScript Level 2 color space array from an ICC color profile. + Specifies a handle to the ICC profile from which to retrieve the PostScript Level 2 color space array. + + Specifies the desired rendering intent for the color space array. This field may take one of the following values: + INTENT_PERCEPTUAL + INTENT_SATURATION + INTENT_RELATIVE_COLORIMETRIC + INTENT_ABSOLUTE_COLORIMETRIC + For more information, see Rendering Intents. + + Specifies the type of color space array. See Color Space Type Identifiers. + Pointer to a buffer in which the color space array is to be placed. If the pBuffer pointer is set to NULL, the function returns the required size of the buffer in the memory location pointed to by pcbSize. + Pointer to a variable containing the size of the buffer in bytes. On return, it contains the number of bytes copied into the buffer. + Pointer to a Boolean variable. If set to TRUE, the data copied could be binary. If set to FALSE, data should be encoded as ASCII85. On return, the memory location pointed to by pbBinary indicates whether the data returned actually is binary (TRUE) or ASCII85 (FALSE). + + If this function succeeds, the return value is TRUE. It also returns TRUE if the pBuffer parameter is NULL and the size required for the buffer is copied into pcbSize. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Retrieves the color profile registered for the specified standard color space. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to get a standard color space profile. A NULL pointer indicates the local machine. + Specifies the ID value of the standard color space for which to retrieve the profile. The only valid values for this parameter are LCS_sRGB and LCS_WINDOWS_COLOR_SPACE. + Pointer to the buffer in which the name of the profile is to be placed. If NULL, the call will return TRUE and the required size of the buffer is placed in pdwSize. + Pointer to a variable containing the size in bytes of the buffer pointed to by pProfileName. On return, the variable contains the size of the buffer actually used or needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Retrieves the color profile registered for the specified standard color space. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to get a standard color space profile. A NULL pointer indicates the local machine. + Specifies the ID value of the standard color space for which to retrieve the profile. The only valid values for this parameter are LCS_sRGB and LCS_WINDOWS_COLOR_SPACE. + Pointer to the buffer in which the name of the profile is to be placed. If NULL, the call will return TRUE and the required size of the buffer is placed in pdwSize. + Pointer to a variable containing the size in bytes of the buffer pointed to by pProfileName. On return, the variable contains the size of the buffer actually used or needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Retrieves the color profile registered for the specified standard color space. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to get a standard color space profile. A NULL pointer indicates the local machine. + Specifies the ID value of the standard color space for which to retrieve the profile. The only valid values for this parameter are LCS_sRGB and LCS_WINDOWS_COLOR_SPACE. + Pointer to the buffer in which the name of the profile is to be placed. If NULL, the call will return TRUE and the required size of the buffer is placed in pdwSize. + Pointer to a variable containing the size in bytes of the buffer pointed to by pProfileName. On return, the variable contains the size of the buffer actually used or needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Retrieves the color profile registered for the specified standard color space. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which to get a standard color space profile. A NULL pointer indicates the local machine. + Specifies the ID value of the standard color space for which to retrieve the profile. The only valid values for this parameter are LCS_sRGB and LCS_WINDOWS_COLOR_SPACE. + Pointer to the buffer in which the name of the profile is to be placed. If NULL, the call will return TRUE and the required size of the buffer is placed in pdwSize. + Pointer to a variable containing the size in bytes of the buffer pointed to by pProfileName. On return, the variable contains the size of the buffer actually used or needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Installs a given profile for use on a specified machine. The profile is also copied to the COLOR directory. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which the profile is to be installed. A NULL pointer indicates the local computer. + Pointer to the fully qualified path name of the profile to install. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Installs a given profile for use on a specified machine. The profile is also copied to the COLOR directory. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which the profile is to be installed. A NULL pointer indicates the local computer. + Pointer to the fully qualified path name of the profile to install. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Installs a given profile for use on a specified machine. The profile is also copied to the COLOR directory. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which the profile is to be installed. A NULL pointer indicates the local computer. + Pointer to the fully qualified path name of the profile to install. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Installs a given profile for use on a specified machine. The profile is also copied to the COLOR directory. + Reserved. Must be NULL. This parameter is intended to point to the name of the computer on which the profile is to be installed. A NULL pointer indicates the local computer. + Pointer to the fully qualified path name of the profile to install. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Reports whether a specified International Color Consortium (ICC) tag is present in the specified color profile. + Specifies a handle to the ICC profile in question. + Specifies the ICC tag to check. + Pointer to a variable that is set to TRUE on return if the specified ICC tag is present, or FALSE if not. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Allows you to determine whether the specified profile is a valid International Color Consortium (ICC) profile, or a valid Windows Color System (WCS) profile handle that can be used for color management. WCS profile validation doesn't invoke the underlying device models, but instead simply validates against the XML schema and the schema element range limits. + Specifies a handle to the profile to be validated. The function determines whether the HPROFILE contains ICC or WCS profile information. + Pointer to a variable that is set to TRUE on return if the operation succeeds and the profile is a valid ICC or WCS profile. If the operation fails or the profile is not valid the variable is FALSE. + + If this function succeeds and the profile is valid, the return value is TRUE. + If this function fails (or succeeds and the profile is not valid), the return value is FALSE. For extended error information, call GetLastError. + + + + Creates a handle to a specified color profile. The handle can then be used in other profile management functions. + Pointer to a color profile structure specifying the profile. The pProfile pointer can be freed as soon as the handle is created. + + Specifies how to access the given profile. This parameter must take one the following constant values. + | Value | Meaning | |-|-| | PROFILE_READ | Opens the profile for read access.
| | PROFILE_READWRITE | Opens the profile for both read and write access. Has no effect for WCS XML profiles.
|
+ + + Specifies how the profile should be shared, if the profile is contained in a file. A value of zero prevents the profile from being shared at all. The parameter can contain one or both of the following constants (combined by addition or logical OR). + | Value | Meaning | |-|-| | FILE_SHARE_READ | Other open operations can be performed on the profile for read access.
| | FILE_SHARE_WRITE | Other open operations can be performed on the profile for write access. Has no effect for WCS XML profiles.
|
+ + + Specifies which actions to take on the profile while opening it, if it is contained in a file. This parameter must take one of the following constant values. + | Value | Meaning | |-|-| | CREATE_NEW | Creates a new profile. Fails if the profile already exists.
| | CREATE_ALWAYS | Creates a new profile. Overwrites the profile if it exists.
| | OPEN_EXISTING | Opens the profile. Fails if it does not exist
| | OPEN_ALWAYS | Opens the profile if it exists. For ICC profiles, if the profile does not exist, creates the profile. For WCS XML profiles, if the profile does not exist, returns an error.
| | TRUNCATE_EXISTING | Opens the profile, and truncates it to zero bytes, returning a blank ICC profile. Fails if the profile doesn't exist.
|
+ + + If this function succeeds, the return value is the handle of the color profile that is opened. For ICC and WCS profiles, a CAMP and GMMP are provided by the function based on the current default CAMP and GMMP in the registry. + When OpenColorProfile encounters an ICC profile with an embedded WCS profile, and if the dwType member within the Profile structure does not take the value DONT_USE_EMBEDDED_WCS_PROFILES, it should extract and use the WCS profile(s) contained in this WcsProfilesTag. The HPROFILE returned would be a WCS HPROFILE. + If this function fails, the return value is NULL. For extended error information, call GetLastError. + +
+ + Creates a handle to a specified color profile. The handle can then be used in other profile management functions. + Pointer to a color profile structure specifying the profile. The pProfile pointer can be freed as soon as the handle is created. + + Specifies how to access the given profile. This parameter must take one the following constant values. + | Value | Meaning | |-|-| | PROFILE_READ | Opens the profile for read access.
| | PROFILE_READWRITE | Opens the profile for both read and write access. Has no effect for WCS XML profiles.
|
+ + + Specifies how the profile should be shared, if the profile is contained in a file. A value of zero prevents the profile from being shared at all. The parameter can contain one or both of the following constants (combined by addition or logical OR). + | Value | Meaning | |-|-| | FILE_SHARE_READ | Other open operations can be performed on the profile for read access.
| | FILE_SHARE_WRITE | Other open operations can be performed on the profile for write access. Has no effect for WCS XML profiles.
|
+ + + Specifies which actions to take on the profile while opening it, if it is contained in a file. This parameter must take one of the following constant values. + | Value | Meaning | |-|-| | CREATE_NEW | Creates a new profile. Fails if the profile already exists.
| | CREATE_ALWAYS | Creates a new profile. Overwrites the profile if it exists.
| | OPEN_EXISTING | Opens the profile. Fails if it does not exist
| | OPEN_ALWAYS | Opens the profile if it exists. For ICC profiles, if the profile does not exist, creates the profile. For WCS XML profiles, if the profile does not exist, returns an error.
| | TRUNCATE_EXISTING | Opens the profile, and truncates it to zero bytes, returning a blank ICC profile. Fails if the profile doesn't exist.
|
+ + + If this function succeeds, the return value is the handle of the color profile that is opened. For ICC and WCS profiles, a CAMP and GMMP are provided by the function based on the current default CAMP and GMMP in the registry. + When OpenColorProfile encounters an ICC profile with an embedded WCS profile, and if the dwType member within the Profile structure does not take the value DONT_USE_EMBEDDED_WCS_PROFILES, it should extract and use the WCS profile(s) contained in this WcsProfilesTag. The HPROFILE returned would be a WCS HPROFILE. + If this function fails, the return value is NULL. For extended error information, call GetLastError. + +
+ + Creates a handle to a specified color profile. The handle can then be used in other profile management functions. + Pointer to a color profile structure specifying the profile. The pProfile pointer can be freed as soon as the handle is created. + + Specifies how to access the given profile. This parameter must take one the following constant values. + | Value | Meaning | |-|-| | PROFILE_READ | Opens the profile for read access.
| | PROFILE_READWRITE | Opens the profile for both read and write access. Has no effect for WCS XML profiles.
|
+ + + Specifies how the profile should be shared, if the profile is contained in a file. A value of zero prevents the profile from being shared at all. The parameter can contain one or both of the following constants (combined by addition or logical OR). + | Value | Meaning | |-|-| | FILE_SHARE_READ | Other open operations can be performed on the profile for read access.
| | FILE_SHARE_WRITE | Other open operations can be performed on the profile for write access. Has no effect for WCS XML profiles.
|
+ + + Specifies which actions to take on the profile while opening it, if it is contained in a file. This parameter must take one of the following constant values. + | Value | Meaning | |-|-| | CREATE_NEW | Creates a new profile. Fails if the profile already exists.
| | CREATE_ALWAYS | Creates a new profile. Overwrites the profile if it exists.
| | OPEN_EXISTING | Opens the profile. Fails if it does not exist
| | OPEN_ALWAYS | Opens the profile if it exists. For ICC profiles, if the profile does not exist, creates the profile. For WCS XML profiles, if the profile does not exist, returns an error.
| | TRUNCATE_EXISTING | Opens the profile, and truncates it to zero bytes, returning a blank ICC profile. Fails if the profile doesn't exist.
|
+ + + If this function succeeds, the return value is the handle of the color profile that is opened. For ICC and WCS profiles, a CAMP and GMMP are provided by the function based on the current default CAMP and GMMP in the registry. + When OpenColorProfile encounters an ICC profile with an embedded WCS profile, and if the dwType member within the Profile structure does not take the value DONT_USE_EMBEDDED_WCS_PROFILES, it should extract and use the WCS profile(s) contained in this WcsProfilesTag. The HPROFILE returned would be a WCS HPROFILE. + If this function fails, the return value is NULL. For extended error information, call GetLastError. + +
+ + Creates a handle to a specified color profile. The handle can then be used in other profile management functions. + Pointer to a color profile structure specifying the profile. The pProfile pointer can be freed as soon as the handle is created. + + Specifies how to access the given profile. This parameter must take one the following constant values. + | Value | Meaning | |-|-| | PROFILE_READ | Opens the profile for read access.
| | PROFILE_READWRITE | Opens the profile for both read and write access. Has no effect for WCS XML profiles.
|
+ + + Specifies how the profile should be shared, if the profile is contained in a file. A value of zero prevents the profile from being shared at all. The parameter can contain one or both of the following constants (combined by addition or logical OR). + | Value | Meaning | |-|-| | FILE_SHARE_READ | Other open operations can be performed on the profile for read access.
| | FILE_SHARE_WRITE | Other open operations can be performed on the profile for write access. Has no effect for WCS XML profiles.
|
+ + + Specifies which actions to take on the profile while opening it, if it is contained in a file. This parameter must take one of the following constant values. + | Value | Meaning | |-|-| | CREATE_NEW | Creates a new profile. Fails if the profile already exists.
| | CREATE_ALWAYS | Creates a new profile. Overwrites the profile if it exists.
| | OPEN_EXISTING | Opens the profile. Fails if it does not exist
| | OPEN_ALWAYS | Opens the profile if it exists. For ICC profiles, if the profile does not exist, creates the profile. For WCS XML profiles, if the profile does not exist, returns an error.
| | TRUNCATE_EXISTING | Opens the profile, and truncates it to zero bytes, returning a blank ICC profile. Fails if the profile doesn't exist.
|
+ + + If this function succeeds, the return value is the handle of the color profile that is opened. For ICC and WCS profiles, a CAMP and GMMP are provided by the function based on the current default CAMP and GMMP in the registry. + When OpenColorProfile encounters an ICC profile with an embedded WCS profile, and if the dwType member within the Profile structure does not take the value DONT_USE_EMBEDDED_WCS_PROFILES, it should extract and use the WCS profile(s) contained in this WcsProfilesTag. The HPROFILE returned would be a WCS HPROFILE. + If this function fails, the return value is NULL. For extended error information, call GetLastError. + +
+ + Associates a specified identification value with the specified color management module dynamic link library (CMM DLL). When this ID appears in a color profile, Windows can then locate the corresponding CMM so as to create a transform. + Reserved; must currently be set to NULL, until non-local registration is supported. This parameter is intended to point to the name of the machine on which a CMM DLL should be registered. A NULL pointer indicates the local machine. + Specifies the ID signature of the CMM registered with the International Color Consortium (ICC). + Pointer to the fully qualified path name of the CMM DLL. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Associates a specified identification value with the specified color management module dynamic link library (CMM DLL). When this ID appears in a color profile, Windows can then locate the corresponding CMM so as to create a transform. + Reserved; must currently be set to NULL, until non-local registration is supported. This parameter is intended to point to the name of the machine on which a CMM DLL should be registered. A NULL pointer indicates the local machine. + Specifies the ID signature of the CMM registered with the International Color Consortium (ICC). + Pointer to the fully qualified path name of the CMM DLL. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Associates a specified identification value with the specified color management module dynamic link library (CMM DLL). When this ID appears in a color profile, Windows can then locate the corresponding CMM so as to create a transform. + Reserved; must currently be set to NULL, until non-local registration is supported. This parameter is intended to point to the name of the machine on which a CMM DLL should be registered. A NULL pointer indicates the local machine. + Specifies the ID signature of the CMM registered with the International Color Consortium (ICC). + Pointer to the fully qualified path name of the CMM DLL. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Associates a specified identification value with the specified color management module dynamic link library (CMM DLL). When this ID appears in a color profile, Windows can then locate the corresponding CMM so as to create a transform. + Reserved; must currently be set to NULL, until non-local registration is supported. This parameter is intended to point to the name of the machine on which a CMM DLL should be registered. A NULL pointer indicates the local machine. + Specifies the ID signature of the CMM registered with the International Color Consortium (ICC). + Pointer to the fully qualified path name of the CMM DLL. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Allows you to select the preferred color management module (CMM) to use. + + Specifies the signature of the desired CMM as registered with the International Color Consortium (ICC). + + Windows 2000 only: Setting this parameter to NULL causes the WCS system to select the default CMM. + + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Sets the element data for a tagged profile element in an ICC color profile. + Specifies a handle to the ICC profile in question. + Identifies the tagged element. + Specifies the offset from the first byte of the tagged element data at which to start writing. + Pointer to a variable containing the number of bytes of data to write. On return, it contains the number of bytes actually written. + Pointer to a buffer containing the data to write to the tagged element in the color profile. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Creates in a specified ICC color profile a new tag that references the same data as an existing tag. + Specifies a handle to the ICC color profile in question. + Identifies the new tag to create. + Identifies the existing tag whose data is to be referenced by the new tag. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Sets the size of a tagged element in an ICC color profile. + Specifies a handle to the ICC color profile in question. + Identifies the tagged element. + Specifies the size to set the tagged element to. If cbSize is zero, this function deletes the specified tagged element. If the tag is a reference, only the tag table entry is deleted, not the data. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Sets the header data in a specified ICC color profile. + Specifies a handle to the ICC color profile in question. + Pointer to the profile header data to write to the specified profile. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Registers a specified profile for a given standard color space. The profile can be queried using . + Reserved. Must be NULL. This parameter is intended to point to the name of the machine on which to set a standard color space profile. A NULL pointer indicates the local machine. + Specifies the ID value of the standard color space that the given profile represents. This is a custom ID value used to uniquely identify the color space profile within your application. + Points to a fully qualified path to the profile file. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + + + + Registers a specified profile for a given standard color space. The profile can be queried using . + Reserved. Must be NULL. This parameter is intended to point to the name of the machine on which to set a standard color space profile. A NULL pointer indicates the local machine. + Specifies the ID value of the standard color space that the given profile represents. This is a custom ID value used to uniquely identify the color space profile within your application. + Points to a fully qualified path to the profile file. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + + + + Registers a specified profile for a given standard color space. The profile can be queried using . + Reserved. Must be NULL. This parameter is intended to point to the name of the machine on which to set a standard color space profile. A NULL pointer indicates the local machine. + Specifies the ID value of the standard color space that the given profile represents. This is a custom ID value used to uniquely identify the color space profile within your application. + Points to a fully qualified path to the profile file. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + + + + Registers a specified profile for a given standard color space. The profile can be queried using . + Reserved. Must be NULL. This parameter is intended to point to the name of the machine on which to set a standard color space profile. A NULL pointer indicates the local machine. + Specifies the ID value of the standard color space that the given profile represents. This is a custom ID value used to uniquely identify the color space profile within your application. + Points to a fully qualified path to the profile file. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + + + + Creates a Color Management dialog box that lets the user choose whether to enable color management and, if so, provides control over the color profiles used and over the rendering intent. + + Pointer to a structure that on entry contains information used to initialize the dialog box. + When SetupColorMatching returns, if the user clicked the OK button, this structure contains information about the user's selection. Otherwise, if an error occurred or the user canceled the dialog box, the structure is left unchanged. + + + If this function succeeds, the return value is TRUE indicating that no errors occurred and the user clicked the OK button. + If this function fails, the return value is FALSE indicating that an error occurred or the dialog was canceled. For extended error information, call GetLastError. + + + + Creates a Color Management dialog box that lets the user choose whether to enable color management and, if so, provides control over the color profiles used and over the rendering intent. + + Pointer to a structure that on entry contains information used to initialize the dialog box. + When SetupColorMatching returns, if the user clicked the OK button, this structure contains information about the user's selection. Otherwise, if an error occurred or the user canceled the dialog box, the structure is left unchanged. + + + If this function succeeds, the return value is TRUE indicating that no errors occurred and the user clicked the OK button. + If this function fails, the return value is FALSE indicating that an error occurred or the dialog was canceled. For extended error information, call GetLastError. + + + + Creates a Color Management dialog box that lets the user choose whether to enable color management and, if so, provides control over the color profiles used and over the rendering intent. + + Pointer to a structure that on entry contains information used to initialize the dialog box. + When SetupColorMatching returns, if the user clicked the OK button, this structure contains information about the user's selection. Otherwise, if an error occurred or the user canceled the dialog box, the structure is left unchanged. + + + If this function succeeds, the return value is TRUE indicating that no errors occurred and the user clicked the OK button. + If this function fails, the return value is FALSE indicating that an error occurred or the dialog was canceled. For extended error information, call GetLastError. + + + + Creates a Color Management dialog box that lets the user choose whether to enable color management and, if so, provides control over the color profiles used and over the rendering intent. + + Pointer to a structure that on entry contains information used to initialize the dialog box. + When SetupColorMatching returns, if the user clicked the OK button, this structure contains information about the user's selection. Otherwise, if an error occurred or the user canceled the dialog box, the structure is left unchanged. + + + If this function succeeds, the return value is TRUE indicating that no errors occurred and the user clicked the OK button. + If this function fails, the return value is FALSE indicating that an error occurred or the dialog was canceled. For extended error information, call GetLastError. + + + + Translates the colors of a bitmap having a defined format so as to produce another bitmap in a requested format. + Identifies the color transform to use. + Pointer to the bitmap to translate. + + Specifies the format of the input bitmap. Must be set to one of the values of the enumerated type. +
[!Note]
This function doesn't support or BM_YxyTRIPLETS as inputs.
+ + Specifies the number of pixels per scan line in the input bitmap. + Specifies the number of scan lines in the input bitmap. + Specifies the number of bytes from the beginning of one scan line to the beginning of the next in the input bitmap; if set to zero, the function assumes that scan lines are padded so as to be DWORD-aligned. + Pointer to the buffer in which to place the translated bitmap. + Specifies the format of the output bitmap. Must be set to one of the values of the enumerated type. + Specifies the number of bytes from the beginning of one scan line to the beginning of the next in the output bitmap; if set to zero, the function assumes that scan lines should be padded to be DWORD-aligned. + Pointer to a callback function called periodically by TranslateBitmapBits to report progress and allow the calling process to cancel the translation. (See ICMProgressProcCallback ) + Data passed back to the callback function, for example, to identify the translation that is reporting progress. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + Translates an array of colors from the source color space to the destination color space as defined by a color transform. + Identifies the color transform to use. + Pointer to an array of nColors structures to translate. + Contains the number of elements in the arrays pointed to by paInputColors and paOutputColors. + Specifies the input color type. + Pointer to an array of nColorsCOLOR structures that receive the translated colors. + Specifies the output color type. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Removes a specified color profile from a specified computer. Associated files are optionally deleted from the system. + Reserved. Must be NULL. This parameter is intended to point to the name of the machine from which to uninstall the specified profile. A NULL pointer indicates the local machine. + Points to the file name of the profile to uninstall. + If set to TRUE, the function deletes the profile from the COLOR directory. If set to FALSE, this function has no effect. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Removes a specified color profile from a specified computer. Associated files are optionally deleted from the system. + Reserved. Must be NULL. This parameter is intended to point to the name of the machine from which to uninstall the specified profile. A NULL pointer indicates the local machine. + Points to the file name of the profile to uninstall. + If set to TRUE, the function deletes the profile from the COLOR directory. If set to FALSE, this function has no effect. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Removes a specified color profile from a specified computer. Associated files are optionally deleted from the system. + Reserved. Must be NULL. This parameter is intended to point to the name of the machine from which to uninstall the specified profile. A NULL pointer indicates the local machine. + Points to the file name of the profile to uninstall. + If set to TRUE, the function deletes the profile from the COLOR directory. If set to FALSE, this function has no effect. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Removes a specified color profile from a specified computer. Associated files are optionally deleted from the system. + Reserved. Must be NULL. This parameter is intended to point to the name of the machine from which to uninstall the specified profile. A NULL pointer indicates the local machine. + Points to the file name of the profile to uninstall. + If set to TRUE, the function deletes the profile from the COLOR directory. If set to FALSE, this function has no effect. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Dissociates a specified ID value from a given color management module dynamic-link library (CMM DLL). + Reserved; must currently be set to NULL, until non-local registration is supported. This parameter is intended to point to the name of the computer on which a CMM DLLs registration should be removed. A NULL pointer indicates the local computer. + Specifies the ID value identifying the CMM whose registration is to be removed. This is the signature of the CMM registered with the International Color Consortium (ICC). + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Dissociates a specified ID value from a given color management module dynamic-link library (CMM DLL). + Reserved; must currently be set to NULL, until non-local registration is supported. This parameter is intended to point to the name of the computer on which a CMM DLLs registration should be removed. A NULL pointer indicates the local computer. + Specifies the ID value identifying the CMM whose registration is to be removed. This is the signature of the CMM registered with the International Color Consortium (ICC). + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Dissociates a specified ID value from a given color management module dynamic-link library (CMM DLL). + Reserved; must currently be set to NULL, until non-local registration is supported. This parameter is intended to point to the name of the computer on which a CMM DLLs registration should be removed. A NULL pointer indicates the local computer. + Specifies the ID value identifying the CMM whose registration is to be removed. This is the signature of the CMM registered with the International Color Consortium (ICC). + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Dissociates a specified ID value from a given color management module dynamic-link library (CMM DLL). + Reserved; must currently be set to NULL, until non-local registration is supported. This parameter is intended to point to the name of the computer on which a CMM DLLs registration should be removed. A NULL pointer indicates the local computer. + Specifies the ID value identifying the CMM whose registration is to be removed. This is the signature of the CMM registered with the International Color Consortium (ICC). + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + + Associates a specified WCS color profile with a specified device. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ A value that specifies the scope of this profile management operation, which could be system-wide or for the current user. + A pointer to the file name of the profile to associate. + A pointer to the name of the device with which the profile is to be associated. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + Determines whether the colors in an array are within the output gamut of a specified WCS color transform. + A handle to the specified WCS color transform. + The number of elements in the array pointed to by pInputData and paResult. + The number of channels per element in the array pointed to by pInputData. + The input COLORDATATYPE color data type. + The buffer size of pInputData. + A pointer to an array of input colors. Colors in this array correspond to the color space of the source profile. The size of the buffer for this array will be the number of bytes indicated by cbInput. + A pointer to an array of nColors bytes that receives the results of the test. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Converts a WCS profile into an International Color Consortium (ICC) profile. + A handle to the WCS color profile that is converted. See Remarks. + + A flag value that specifies the profile conversion options. + By default, the original WCS profiles used for the conversion are embedded in the output ICC profile in a Microsoft private tag, WcsProfilesTag (with signature "MS000". This produces an ICC profile that is compatible with ICC software, yet retains the original WCS profile data available to code designed to parse it. + The possible values of this parameter are as follows. Any bits not defined in this list are reserved and should be set to zero: + | Value | Description | |--------------|------------------------------------------------------------------------------------------------------------| | WCS_DEFAULT | Specifies that the new ICC profile contains the original WCS profile in a private WcsProfilesTag. | | WCS_ICCONLY | Specifies that the new ICC profile does not contain either the WcsProfilesTag or the original WCS profile. | + + + If this function succeeds, the return value is the handle of the new color profile. + If this function fails, the return value is NULL. For extended error information, call . + + + + + Disassociates a specified WCS color profile from a specified device on a computer. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ A value that specifies the scope of this profile management operation, which could be system-wide or for the current user. + A pointer to the file name of the profile to disassociate. + A pointer to the name of the device from which to disassociate the profile. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + + Enumerates color profiles associated with any device, in the specified scope. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ A value specifying the scope of this profile management operation. + A pointer to a structure specifying the enumeration criteria. + A pointer to a buffer in which the profile names are to be enumerated. The WcsEnumColorProfiles function places, in this buffer, a MULTI_SZ string that consists of profile names that satisfy the criteria specified in *pEnumRecord. + A variable that contains the size, in bytes, of the buffer that is pointed to by pBuffer. See Remarks. + An optional pointer to a variable that receives the number of profile names that are copied to the buffer to which pBuffer points. Can be NULL if this information is not needed. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + + Returns the size, in bytes, of the buffer that is required by the function to enumerate color profiles. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ A value that specifies the scope of the profile management operation that is performed by this function. + A pointer to a structure that specifies the enumeration criteria. + A pointer to a variable that receives the size of the buffer that is required to receive all enumerated profile names. This value is used by the dwSize parameter of the function. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + Determines whether system management of the display calibration state is enabled. + + TRUE if system management of the display calibration state is enabled; otherwise FALSE. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. + + + + + Retrieves the default color profile for a device, or for a device-independent default if the device is not specified. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ A value specifying the scope of this profile management operation. + A pointer to the name of the device for which the default color profile is obtained. If NULL, a device-independent default profile is obtained. + A value specifying the color profile type. + A value specifying the color profile subtype. + The ID of the color space that the color profile represents. + The buffer size, in bytes, of the buffer that is pointed to by pProfileName. + A pointer to a buffer to receive the name of the color profile. The size of the buffer, in bytes, will be the indicated by cbProfileName. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + + Returns the size, in bytes, of the default color profile name (including the NULL terminator), for a device. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ A value that specifies the scope of this profile management operation. + A pointer to the name of the device for which the default color profile is to be obtained. If NULL, a device-independent default profile will be used. + A value specifying the color profile type. + A value specifying the color profile subtype. + The ID of the color space that the color profile represents. + A pointer to a location that receives the size, in bytes, of the path name of the default color profile, including the NULL terminator. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + +
+ + Retrieves the default rendering intent in the specified profile management scope. + The profile management scope for this operation, which can be system-wide or the current user only. + + A pointer to the variable that will hold the rendering intent. + For more information, see Rendering intents. + + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Determines whether the user chose to use a per-user profile association list for the specified device. + A pointer to a string containing the user-friendly name of the device. + + A flag value specifying the class of the device. This parameter must take one of the following values. + | Value | Description | |----------------|------------------------------------| | CLASS_MONITOR | Specifies a display device. | | CLASS_PRINTER | Specifies a printer. | | CLASS_SCANNER | Specifies an image-capture device. | + + A pointer to a location to receive a Boolean value that is TRUE if the user chose to use a per-user profile association list for the specified device; otherwise FALSE. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Creates a handle to a specified color profile. + Pointer to a WCS DMP or an ICC color profile structure specifying the profile. You can free the pCDMPProfile pointer after you create the handle. If the profile is ICC and its dwType member is set to DONT_USE_EMBEDDED_WCS_PROFILES, WcsOpenColorProfile ignores any embedded WCS profile within the ICC profile. + A pointer to a profile structure that specifies a WCS color appearance model profile (CAMP). You can free the pCAMPProfile pointer after you create the handle. If NULL, the default CAMP is used, and the current user setting, WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER, is used while querying the default CAMP. + A pointer to a profile structure that specifies a WCS gamut map model profile (GMMP). You can free the pGMMPProfile pointer after you create the handle. If NULL, the default GMMP for the default rendering intent is used, and the current user setting, WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER, is used while querying the default GMMP. For a description of rendering intents, see Rendering Intents. + + A flag value that specifies how to access the specified color profile. This parameter must take one of the following values: + | Value | Description | |-|-| | PROFILE_READ | Specifies that the color profile opens for read-only access. | | PROFILE_READWRITE | Specifies that the color profile opens for both read and write access. The value of this flag is ignored if the profile is a WCS profile. | + + + A flag value that specifies actions to take while opening a color profile contained in a file. This parameter must take one of the following values, which are defined in winnt.h: + | Value | Description | |-|-| | FILE_SHARE_READ | Specifies that you can perform other open (for read access) operations on the profile. | | FILE_SHARE_WRITE | Specifies that you can perform other open (for write access) operations on the profile. This flag value is ignored when a WCS profile is opened. | + + + A flag value that specifies the actions to take while opening a color profile if it is contained in a file. This parameter must take one of the following values, which are defined in winbase.h: + | Value | Description | |-|-| | CREATE_NEW | Specifies that a new profile is created. This function fails if the profile already exists. | | CREATE_ALWAYS | Specifies that a new profile is created. If a profile already exists, it is overwritten. | | OPEN_EXISTING | Specifies that the profile is opened. This function fails if the profile does not exist. | | OPEN_ALWAYS | Specifies that the profile is to be opened if an International Color Consortium (ICC) file exists. If an ICC profile does not exist, WCS creates a new ICC profile. The function will fail for WCS profiles if this flag is set and a WCS profile does not exist. | | TRUNCATE_EXISTING | Specifies that the profile is to be opened and truncated to zero bytes. The function fails if the profile does not exist. | + + + A flag value that specifies whether to use the embedded WCS profile. This parameter has no effect unless pCDMProfile specifies an ICC profile that contains an embedded WCS profile. + This parameter takes one of the following values: + | Value | Description | |-|-| | 0 | Specifies that the embedded WCS profile will be used and the ICC profile specfied by pCDMPProfile will be ignored. | | DONT_USE_EMBEDDED_WCS_PROFILES | Specifies that the ICC profile specified by pCDMPProfile will be used and the embedded WCS profile will be ignored. | + + + If this function succeeds, the return value is the handle of the color profile that is opened. + If this function fails, the return value is NULL. + + + + Creates a handle to a specified color profile. + Pointer to a WCS DMP or an ICC color profile structure specifying the profile. You can free the pCDMPProfile pointer after you create the handle. If the profile is ICC and its dwType member is set to DONT_USE_EMBEDDED_WCS_PROFILES, WcsOpenColorProfile ignores any embedded WCS profile within the ICC profile. + A pointer to a profile structure that specifies a WCS color appearance model profile (CAMP). You can free the pCAMPProfile pointer after you create the handle. If NULL, the default CAMP is used, and the current user setting, WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER, is used while querying the default CAMP. + A pointer to a profile structure that specifies a WCS gamut map model profile (GMMP). You can free the pGMMPProfile pointer after you create the handle. If NULL, the default GMMP for the default rendering intent is used, and the current user setting, WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER, is used while querying the default GMMP. For a description of rendering intents, see Rendering Intents. + + A flag value that specifies how to access the specified color profile. This parameter must take one of the following values: + | Value | Description | |-|-| | PROFILE_READ | Specifies that the color profile opens for read-only access. | | PROFILE_READWRITE | Specifies that the color profile opens for both read and write access. The value of this flag is ignored if the profile is a WCS profile. | + + + A flag value that specifies actions to take while opening a color profile contained in a file. This parameter must take one of the following values, which are defined in winnt.h: + | Value | Description | |-|-| | FILE_SHARE_READ | Specifies that you can perform other open (for read access) operations on the profile. | | FILE_SHARE_WRITE | Specifies that you can perform other open (for write access) operations on the profile. This flag value is ignored when a WCS profile is opened. | + + + A flag value that specifies the actions to take while opening a color profile if it is contained in a file. This parameter must take one of the following values, which are defined in winbase.h: + | Value | Description | |-|-| | CREATE_NEW | Specifies that a new profile is created. This function fails if the profile already exists. | | CREATE_ALWAYS | Specifies that a new profile is created. If a profile already exists, it is overwritten. | | OPEN_EXISTING | Specifies that the profile is opened. This function fails if the profile does not exist. | | OPEN_ALWAYS | Specifies that the profile is to be opened if an International Color Consortium (ICC) file exists. If an ICC profile does not exist, WCS creates a new ICC profile. The function will fail for WCS profiles if this flag is set and a WCS profile does not exist. | | TRUNCATE_EXISTING | Specifies that the profile is to be opened and truncated to zero bytes. The function fails if the profile does not exist. | + + + A flag value that specifies whether to use the embedded WCS profile. This parameter has no effect unless pCDMProfile specifies an ICC profile that contains an embedded WCS profile. + This parameter takes one of the following values: + | Value | Description | |-|-| | 0 | Specifies that the embedded WCS profile will be used and the ICC profile specfied by pCDMPProfile will be ignored. | | DONT_USE_EMBEDDED_WCS_PROFILES | Specifies that the ICC profile specified by pCDMPProfile will be used and the embedded WCS profile will be ignored. | + + + If this function succeeds, the return value is the handle of the color profile that is opened. + If this function fails, the return value is NULL. + + + + Creates a handle to a specified color profile. + Pointer to a WCS DMP or an ICC color profile structure specifying the profile. You can free the pCDMPProfile pointer after you create the handle. If the profile is ICC and its dwType member is set to DONT_USE_EMBEDDED_WCS_PROFILES, WcsOpenColorProfile ignores any embedded WCS profile within the ICC profile. + A pointer to a profile structure that specifies a WCS color appearance model profile (CAMP). You can free the pCAMPProfile pointer after you create the handle. If NULL, the default CAMP is used, and the current user setting, WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER, is used while querying the default CAMP. + A pointer to a profile structure that specifies a WCS gamut map model profile (GMMP). You can free the pGMMPProfile pointer after you create the handle. If NULL, the default GMMP for the default rendering intent is used, and the current user setting, WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER, is used while querying the default GMMP. For a description of rendering intents, see Rendering Intents. + + A flag value that specifies how to access the specified color profile. This parameter must take one of the following values: + | Value | Description | |-|-| | PROFILE_READ | Specifies that the color profile opens for read-only access. | | PROFILE_READWRITE | Specifies that the color profile opens for both read and write access. The value of this flag is ignored if the profile is a WCS profile. | + + + A flag value that specifies actions to take while opening a color profile contained in a file. This parameter must take one of the following values, which are defined in winnt.h: + | Value | Description | |-|-| | FILE_SHARE_READ | Specifies that you can perform other open (for read access) operations on the profile. | | FILE_SHARE_WRITE | Specifies that you can perform other open (for write access) operations on the profile. This flag value is ignored when a WCS profile is opened. | + + + A flag value that specifies the actions to take while opening a color profile if it is contained in a file. This parameter must take one of the following values, which are defined in winbase.h: + | Value | Description | |-|-| | CREATE_NEW | Specifies that a new profile is created. This function fails if the profile already exists. | | CREATE_ALWAYS | Specifies that a new profile is created. If a profile already exists, it is overwritten. | | OPEN_EXISTING | Specifies that the profile is opened. This function fails if the profile does not exist. | | OPEN_ALWAYS | Specifies that the profile is to be opened if an International Color Consortium (ICC) file exists. If an ICC profile does not exist, WCS creates a new ICC profile. The function will fail for WCS profiles if this flag is set and a WCS profile does not exist. | | TRUNCATE_EXISTING | Specifies that the profile is to be opened and truncated to zero bytes. The function fails if the profile does not exist. | + + + A flag value that specifies whether to use the embedded WCS profile. This parameter has no effect unless pCDMProfile specifies an ICC profile that contains an embedded WCS profile. + This parameter takes one of the following values: + | Value | Description | |-|-| | 0 | Specifies that the embedded WCS profile will be used and the ICC profile specfied by pCDMPProfile will be ignored. | | DONT_USE_EMBEDDED_WCS_PROFILES | Specifies that the ICC profile specified by pCDMPProfile will be used and the embedded WCS profile will be ignored. | + + + If this function succeeds, the return value is the handle of the color profile that is opened. + If this function fails, the return value is NULL. + + + + Creates a handle to a specified color profile. + Pointer to a WCS DMP or an ICC color profile structure specifying the profile. You can free the pCDMPProfile pointer after you create the handle. If the profile is ICC and its dwType member is set to DONT_USE_EMBEDDED_WCS_PROFILES, WcsOpenColorProfile ignores any embedded WCS profile within the ICC profile. + A pointer to a profile structure that specifies a WCS color appearance model profile (CAMP). You can free the pCAMPProfile pointer after you create the handle. If NULL, the default CAMP is used, and the current user setting, WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER, is used while querying the default CAMP. + A pointer to a profile structure that specifies a WCS gamut map model profile (GMMP). You can free the pGMMPProfile pointer after you create the handle. If NULL, the default GMMP for the default rendering intent is used, and the current user setting, WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER, is used while querying the default GMMP. For a description of rendering intents, see Rendering Intents. + + A flag value that specifies how to access the specified color profile. This parameter must take one of the following values: + | Value | Description | |-|-| | PROFILE_READ | Specifies that the color profile opens for read-only access. | | PROFILE_READWRITE | Specifies that the color profile opens for both read and write access. The value of this flag is ignored if the profile is a WCS profile. | + + + A flag value that specifies actions to take while opening a color profile contained in a file. This parameter must take one of the following values, which are defined in winnt.h: + | Value | Description | |-|-| | FILE_SHARE_READ | Specifies that you can perform other open (for read access) operations on the profile. | | FILE_SHARE_WRITE | Specifies that you can perform other open (for write access) operations on the profile. This flag value is ignored when a WCS profile is opened. | + + + A flag value that specifies the actions to take while opening a color profile if it is contained in a file. This parameter must take one of the following values, which are defined in winbase.h: + | Value | Description | |-|-| | CREATE_NEW | Specifies that a new profile is created. This function fails if the profile already exists. | | CREATE_ALWAYS | Specifies that a new profile is created. If a profile already exists, it is overwritten. | | OPEN_EXISTING | Specifies that the profile is opened. This function fails if the profile does not exist. | | OPEN_ALWAYS | Specifies that the profile is to be opened if an International Color Consortium (ICC) file exists. If an ICC profile does not exist, WCS creates a new ICC profile. The function will fail for WCS profiles if this flag is set and a WCS profile does not exist. | | TRUNCATE_EXISTING | Specifies that the profile is to be opened and truncated to zero bytes. The function fails if the profile does not exist. | + + + A flag value that specifies whether to use the embedded WCS profile. This parameter has no effect unless pCDMProfile specifies an ICC profile that contains an embedded WCS profile. + This parameter takes one of the following values: + | Value | Description | |-|-| | 0 | Specifies that the embedded WCS profile will be used and the ICC profile specfied by pCDMPProfile will be ignored. | | DONT_USE_EMBEDDED_WCS_PROFILES | Specifies that the ICC profile specified by pCDMPProfile will be used and the embedded WCS profile will be ignored. | + + + If this function succeeds, the return value is the handle of the color profile that is opened. + If this function fails, the return value is NULL. + + + + Enables or disables system management of the display calibration state. + + TRUE to enable system management of the display calibration state. FALSE to disable system management of the display calibration state. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. + + + + + Sets the default color profile name for the specified profile type in the specified profile management scope. +
[!NOTE] This API does not support "advanced color" profiles for HDR monitors. Use for managing advanced color profiles.
+
+ A value that specifies the scope of this profile management operation. + A pointer to the name of the device for which the default color profile is to be set. If NULL, a device-independent default profile is used. + A value that specifies the color profile type. + A value that specifies the color profile subtype. + The ID of the color space that the color profile represents. This is a custom ID value used to uniquely identify the color space profile within your application. + A pointer to a buffer that holds the name of the color profile. See Remarks. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call . + +
+ + Sets the default rendering intent in the specified profile management scope. + The profile management scope for this operation, which can be system-wide or the current user only. + + The rendering intent. It can be set to one of the following values: + INTENT_PERCEPTUAL + INTENT_RELATIVE_COLORIMETRIC + INTENT_SATURATION + INTENT_ABSOLUTE_COLORIMETRIC + DWORD_MAX + If dwRenderingIntent is DWORD_MAX and scope is WCS_PROFILE_MANAGEMENT_SCOPE_CURRENT_USER, the default rendering intent for the current user reverts to the system-wide default. + For more information, see Rendering intents. + + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Enables a user to specify whether or not to use a per-user profile association list for the specified device. + A pointer to a string that contains the user-friendly name of the device. + + A flag value that specifies the class of the device. This parameter must take one of the following values: + | Value | Description | |----------------|------------------------------------| | CLASS_MONITOR | Specifies a display device. | | CLASS_PRINTER | Specifies a printer. | | CLASS_SCANNER | Specifies an image capture device. | + + A Boolean value that is TRUE if the user wants to use a per-user profile association list for the specified device; otherwise FALSE. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + + + Translates an array of colors from the source color space to the destination color space as defined by a color transform. + A handle for the WCS color transform. + The number of elements in the array to which pInputData and pOutputData point. + The number of channels per element in the array to which pInputData points. + The input color data type. + The buffer size, in bytes, of pInputData. + A pointer to an array of input colors. The size of the buffer for this array, in bytes, is the DWORD value of cbInput. + The number of channels per element in the array to which pOutputData points. + The output that specified the color data type. + The buffer size, in bytes, of pOutputData. + A pointer to an array of colors that receives the results of the color translation.The size of the buffer for this array, in bytes, is the DWORD value of cbOutput. + + If this function succeeds, the return value is TRUE. + If this function fails, the return value is FALSE. For extended error information, call GetLastError. + + +
\ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/XYZCOLOR.xml b/sources/Interop/Windows/Windows/um/icm/XYZCOLOR.xml new file mode 100644 index 0000000000..ad3b19c7af --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/XYZCOLOR.xml @@ -0,0 +1,17 @@ + + + + + + TBD + + + TBD + + + TBD + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/icm/YxyCOLOR.xml b/sources/Interop/Windows/Windows/um/icm/YxyCOLOR.xml new file mode 100644 index 0000000000..e5e60e84cd --- /dev/null +++ b/sources/Interop/Windows/Windows/um/icm/YxyCOLOR.xml @@ -0,0 +1,17 @@ + + + + + + TBD + + + TBD + + + TBD + + + TBD + + \ No newline at end of file From 404a05616cdf1a1ab9412e8dd3528c6eccdc671b Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 22 Jun 2023 17:17:27 -0700 Subject: [PATCH 5/8] Generating bindings for um/wcsplugin --- TerraFX.Interop.Windows.sln | 8 + generation/Windows/um/wcsplugin/generate.rsp | 14 ++ generation/Windows/um/wcsplugin/header.txt | 4 + .../Windows/um/wcsplugin/um-wcsplugin.h | 2 + generation/remap-types.rsp | 9 + .../Windows/um/wcsplugin/BlackInformation.cs | 16 ++ .../Windows/um/wcsplugin/BlackInformation.xml | 24 ++ .../Windows/Windows/um/wcsplugin/CATID.cs | 39 ++++ .../um/wcsplugin/GamutBoundaryDescription.cs | 28 +++ .../um/wcsplugin/GamutBoundaryDescription.xml | 29 +++ .../Windows/um/wcsplugin/GamutShell.cs | 28 +++ .../Windows/um/wcsplugin/GamutShell.xml | 29 +++ .../um/wcsplugin/GamutShellTriangle.cs | 14 ++ .../um/wcsplugin/GamutShellTriangle.xml | 11 + .../um/wcsplugin/IDeviceModelPlugIn.cs | 218 ++++++++++++++++++ .../um/wcsplugin/IDeviceModelPlugIn.xml | 175 ++++++++++++++ .../um/wcsplugin/IGamutMapModelPlugIn.cs | 92 ++++++++ .../um/wcsplugin/IGamutMapModelPlugIn.xml | 44 ++++ .../Windows/Windows/um/wcsplugin/IID.cs | 60 +++++ .../Windows/Windows/um/wcsplugin/JChColorF.cs | 19 ++ .../Windows/um/wcsplugin/JChColorF.xml | 17 ++ .../Windows/Windows/um/wcsplugin/JabColorF.cs | 19 ++ .../Windows/um/wcsplugin/JabColorF.xml | 17 ++ .../Windows/um/wcsplugin/PrimaryJabColors.cs | 34 +++ .../Windows/um/wcsplugin/PrimaryJabColors.xml | 32 +++ .../Windows/um/wcsplugin/PrimaryXYZColors.cs | 34 +++ .../Windows/um/wcsplugin/PrimaryXYZColors.xml | 32 +++ .../Windows/Windows/um/wcsplugin/XYZColorF.cs | 19 ++ .../Windows/um/wcsplugin/XYZColorF.xml | 17 ++ .../um/wcsplugin/BlackInformationTests.cs | 34 +++ .../Windows/um/wcsplugin/CATIDTests.cs | 21 ++ .../GamutBoundaryDescriptionTests.cs | 42 ++++ .../Windows/um/wcsplugin/GamutShellTests.cs | 42 ++++ .../um/wcsplugin/GamutShellTriangleTests.cs | 34 +++ .../um/wcsplugin/IDeviceModelPlugInTests.cs | 50 ++++ .../um/wcsplugin/IGamutMapModelPlugInTests.cs | 50 ++++ .../Windows/um/wcsplugin/JChColorFTests.cs | 34 +++ .../Windows/um/wcsplugin/JabColorFTests.cs | 34 +++ .../um/wcsplugin/PrimaryJabColorsTests.cs | 34 +++ .../um/wcsplugin/PrimaryXYZColorsTests.cs | 34 +++ .../Windows/um/wcsplugin/XYZColorFTests.cs | 34 +++ 41 files changed, 1527 insertions(+) create mode 100644 generation/Windows/um/wcsplugin/generate.rsp create mode 100644 generation/Windows/um/wcsplugin/header.txt create mode 100644 generation/Windows/um/wcsplugin/um-wcsplugin.h create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/BlackInformation.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/BlackInformation.xml create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/CATID.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescription.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescription.xml create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/GamutShell.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/GamutShell.xml create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangle.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangle.xml create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugIn.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugIn.xml create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugIn.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugIn.xml create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/IID.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/JChColorF.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/JChColorF.xml create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/JabColorF.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/JabColorF.xml create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColors.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColors.xml create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColors.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColors.xml create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/XYZColorF.cs create mode 100644 sources/Interop/Windows/Windows/um/wcsplugin/XYZColorF.xml create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/BlackInformationTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/CATIDTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescriptionTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/GamutShellTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangleTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugInTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugInTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/JChColorFTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/JabColorFTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColorsTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColorsTests.cs create mode 100644 tests/Interop/Windows/Windows/um/wcsplugin/XYZColorFTests.cs diff --git a/TerraFX.Interop.Windows.sln b/TerraFX.Interop.Windows.sln index 5002de9671..b275c8633b 100644 --- a/TerraFX.Interop.Windows.sln +++ b/TerraFX.Interop.Windows.sln @@ -3082,6 +3082,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "icm", "icm", "{CA0728D0-571 generation\Windows\um\icm\um-icm.h = generation\Windows\um\icm\um-icm.h EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wcsplugin", "wcsplugin", "{E48684EC-CF86-47D0-B848-D99F365DBA69}" + ProjectSection(SolutionItems) = preProject + generation\Windows\um\wcsplugin\generate.rsp = generation\Windows\um\wcsplugin\generate.rsp + generation\Windows\um\wcsplugin\header.txt = generation\Windows\um\wcsplugin\header.txt + generation\Windows\um\wcsplugin\um-wcsplugin.h = generation\Windows\um\wcsplugin\um-wcsplugin.h + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -3554,6 +3561,7 @@ Global {635B5075-171E-4AE9-B25D-F2E3C36E2F7E} = {849C4129-3383-468E-9CFA-B709015C0BE2} {10FB9457-4DE3-4E4C-9229-2C3C58D07346} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE} {CA0728D0-571F-48A0-A4A9-4681A76D120C} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE} + {E48684EC-CF86-47D0-B848-D99F365DBA69} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {2FE36DF8-2D9C-4F20-8787-45DC74B57461} diff --git a/generation/Windows/um/wcsplugin/generate.rsp b/generation/Windows/um/wcsplugin/generate.rsp new file mode 100644 index 0000000000..c02efb9849 --- /dev/null +++ b/generation/Windows/um/wcsplugin/generate.rsp @@ -0,0 +1,14 @@ +@../../../settings.rsp +@../../../remap.rsp +--file +um-wcsplugin.h +--methodClassName +Windows +--namespace +TerraFX.Interop.Windows +--output +../../../../sources/Interop/Windows/Windows/um/wcsplugin +--test-output +../../../../tests/Interop/Windows/Windows/um/wcsplugin +--traverse +C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um/wcsplugin.h diff --git a/generation/Windows/um/wcsplugin/header.txt b/generation/Windows/um/wcsplugin/header.txt new file mode 100644 index 0000000000..6df0b2648e --- /dev/null +++ b/generation/Windows/um/wcsplugin/header.txt @@ -0,0 +1,4 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. diff --git a/generation/Windows/um/wcsplugin/um-wcsplugin.h b/generation/Windows/um/wcsplugin/um-wcsplugin.h new file mode 100644 index 0000000000..6e384def25 --- /dev/null +++ b/generation/Windows/um/wcsplugin/um-wcsplugin.h @@ -0,0 +1,2 @@ +#include "..\..\..\TerraFX.h" +#include diff --git a/generation/remap-types.rsp b/generation/remap-types.rsp index 81cf8dbf15..749b6e0a44 100644 --- a/generation/remap-types.rsp +++ b/generation/remap-types.rsp @@ -1440,6 +1440,7 @@ _BIN_COUNT=BIN_COUNT _BIN_RANGE=BIN_RANGE _BIN_RESULTS=BIN_RESULTS _BIN_TYPES=BIN_TYPES +_BlackInformation=BlackInformation _BLENDFUNCTION=BLENDFUNCTION _bodyScroll=bodyScroll _BoolValue=BoolValue @@ -2647,6 +2648,9 @@ _FS_BPIO_OUTFLAGS=FS_BPIO_OUTFLAGS _FS_BPIO_OUTPUT=FS_BPIO_OUTPUT _FS_BPIO_RESULTS=FS_BPIO_RESULTS _FULL_PTR_XLAT_TABLES=FULL_PTR_XLAT_TABLES +_GamutBoundaryDescription=GamutBoundaryDescription +_GamutShell=GamutShell +_GamutShellTriangle=GamutShellTriangle _GDI_NONREMOTE=GDI_NONREMOTE _GDI_OBJECT=GDI_OBJECT _GENERIC_BINDING_ROUTINE_PAIR=GENERIC_BINDING_ROUTINE_PAIR @@ -2955,6 +2959,8 @@ _IP_UNIDIRECTIONAL_ADAPTER_ADDRESS=IP_UNIDIRECTIONAL_ADAPTER_ADDRESS _IsolatedAppLauncherTelemetryParameters=IsolatedAppLauncherTelemetryParameters _ITEMIDLIST=ITEMIDLIST _ITEMSPACING=ITEMSPACING +_JabColorF=JabColorF +_JChColorF=JChColorF _JIT_DEBUG_INFO=JIT_DEBUG_INFO _JOBOBJECTINFOCLASS=JOBOBJECTINFOCLASS _JOBOBJECT_ASSOCIATE_COMPLETION_PORT=JOBOBJECT_ASSOCIATE_COMPLETION_PORT @@ -3861,6 +3867,8 @@ _POWER_SESSION_TIMEOUTS=POWER_SESSION_TIMEOUTS _POWER_SESSION_WINLOGON=POWER_SESSION_WINLOGON _POWER_USER_PRESENCE=POWER_USER_PRESENCE _PREVENT_MEDIA_REMOVAL=PREVENT_MEDIA_REMOVAL +_PrimaryJabColors=PrimaryJabColors +_PrimaryXYZColors=PrimaryXYZColors _PRINTER_CONNECTION_INFO_1A=PRINTER_CONNECTION_INFO_1A _PRINTER_CONNECTION_INFO_1W=PRINTER_CONNECTION_INFO_1W _PRINTER_DEFAULTSA=PRINTER_DEFAULTSA @@ -5492,6 +5500,7 @@ _XSTATE_CONFIGURATION=XSTATE_CONFIGURATION _XSTATE_CONFIG_FEATURE_MSC_INFO=XSTATE_CONFIG_FEATURE_MSC_INFO _XSTATE_CONTEXT=XSTATE_CONTEXT _XSTATE_FEATURE=XSTATE_FEATURE +_XYZColorF=XYZColorF _ZONEATTRIBUTES=ZONEATTRIBUTES __AnonymousEnum_d2d1_L89_C1=@D2D1_INTERPOLATION_MODE_DEFINITION __BCRYPT_KEY_LENGTHS_STRUCT=BCRYPT_KEY_LENGTHS_STRUCT diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/BlackInformation.cs b/sources/Interop/Windows/Windows/um/wcsplugin/BlackInformation.cs new file mode 100644 index 0000000000..5cb475ea17 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/BlackInformation.cs @@ -0,0 +1,16 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct BlackInformation +{ + /// + public BOOL fBlackOnly; + + /// + public float blackWeight; +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/BlackInformation.xml b/sources/Interop/Windows/Windows/um/wcsplugin/BlackInformation.xml new file mode 100644 index 0000000000..8d25712c51 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/BlackInformation.xml @@ -0,0 +1,24 @@ + + + + + + Contains information for device models that have a black color channel. + + + + + A value between 0.0 and 1.0 that indicates the relative amount of black to use in the output. A value of 0.0 means that no black is used; a value of 1.0 means that the maximum amount of black is used. +

- bBlackOnly

+ An indicator whether the source color contains only black. This value can only be true if both of the following apply: + + + the source device has a black channel + + + the PRESERVEBLACK flag is set to true. This flag is in the dwFlags parameter of a Color Management Module (CMM) transform function. + + +
+
+
\ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/CATID.cs b/sources/Interop/Windows/Windows/um/wcsplugin/CATID.cs new file mode 100644 index 0000000000..05a9a82085 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/CATID.cs @@ -0,0 +1,39 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows; + +public static partial class CATID +{ + [NativeTypeName("const GUID")] + public static ref readonly Guid CATID_WcsPlugin + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ReadOnlySpan data = new byte[] { + 0xE0, 0x02, 0xB4, 0xA0, + 0x40, 0x82, + 0x5F, 0x40, + 0x8A, + 0x16, + 0x8A, + 0x5B, + 0x4D, + 0xF2, + 0xF0, + 0xDD + }; + + Debug.Assert(data.Length == Unsafe.SizeOf()); + return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); + } + } +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescription.cs b/sources/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescription.cs new file mode 100644 index 0000000000..033070c7e6 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescription.cs @@ -0,0 +1,28 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct GamutBoundaryDescription +{ + /// + public PrimaryJabColors* pPrimaries; + + /// + public uint cNeutralSamples; + + /// + public JabColorF* pNeutralSamples; + + /// + public GamutShell* pReferenceShell; + + /// + public GamutShell* pPlausibleShell; + + /// + public GamutShell* pPossibleShell; +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescription.xml b/sources/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescription.xml new file mode 100644 index 0000000000..b6334559eb --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescription.xml @@ -0,0 +1,29 @@ + + + + + + Defines a gamut boundary. + + + + The number of neutral samples. + + + + + + +

- *pNeutralSamples

+ A pointer to the neutral samples. +

- *pPlausibleShell

+ A pointer to the plausible shell. +

- *pPossibleShell

+ A pointer to the possible shell. +

- *pReferenceShell

+ A pointer to the reference shell. +

- primaries

+ The primary colors. +
+
+
\ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/GamutShell.cs b/sources/Interop/Windows/Windows/um/wcsplugin/GamutShell.cs new file mode 100644 index 0000000000..31cb8c54fa --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/GamutShell.cs @@ -0,0 +1,28 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct GamutShell +{ + /// + public float JMin; + + /// + public float JMax; + + /// + public uint cVertices; + + /// + public uint cTriangles; + + /// + public JabColorF* pVertices; + + /// + public GamutShellTriangle* pTriangles; +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/GamutShell.xml b/sources/Interop/Windows/Windows/um/wcsplugin/GamutShell.xml new file mode 100644 index 0000000000..e5a09e1033 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/GamutShell.xml @@ -0,0 +1,29 @@ + + + + + + Contains information that defines a gamut shell, which is represented by a list of indexed triangles. The vertex buffer contains the vertices data. + + + The minimum lightness of the shell. + + + The maximum lightness of the shell. + + + The number of vertices in the shell. + + + The number of triangles in the shell. + + + + +

- *pTriangles

+ A pointer to the indexed triangles. +

- *pVertices

+ A pointer to the vertices data. +
+
+
\ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangle.cs b/sources/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangle.cs new file mode 100644 index 0000000000..97965bfe20 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangle.cs @@ -0,0 +1,14 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public unsafe partial struct GamutShellTriangle +{ + /// + [NativeTypeName("UINT[3]")] + public fixed uint aVertexIndex[3]; +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangle.xml b/sources/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangle.xml new file mode 100644 index 0000000000..3d05bb7461 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangle.xml @@ -0,0 +1,11 @@ + + + + + + Contains three vertex indices for accessing a vertex buffer. + + + An array of three vertex indices that are used for accessing a vertex buffer. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugIn.cs b/sources/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugIn.cs new file mode 100644 index 0000000000..8dc2a266c7 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugIn.cs @@ -0,0 +1,218 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows.IID; + +namespace TerraFX.Interop.Windows; + +/// +[Guid("1CD63475-07C4-46FE-A903-D655316D11FD")] +[NativeTypeName("struct IDeviceModelPlugIn : IUnknown")] +[NativeInheritance("IUnknown")] +public unsafe partial struct IDeviceModelPlugIn : IDeviceModelPlugIn.Interface, INativeGuid +{ + static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IDeviceModelPlugIn)); + + public void** lpVtbl; + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(0)] + public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(1)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(2)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(3)] + public HRESULT Initialize([NativeTypeName("BSTR")] ushort* bstrXml, uint cNumModels, uint iModelPosition) + { + return ((delegate* unmanaged)(lpVtbl[3]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), bstrXml, cNumModels, iModelPosition); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(4)] + public HRESULT GetNumChannels(uint* pNumChannels) + { + return ((delegate* unmanaged)(lpVtbl[4]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), pNumChannels); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(5)] + public HRESULT DeviceToColorimetricColors(uint cColors, uint cChannels, [NativeTypeName("const FLOAT *")] float* pDeviceValues, XYZColorF* pXYZColors) + { + return ((delegate* unmanaged)(lpVtbl[5]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), cColors, cChannels, pDeviceValues, pXYZColors); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(6)] + public HRESULT ColorimetricToDeviceColors(uint cColors, uint cChannels, [NativeTypeName("const XYZColorF *")] XYZColorF* pXYZColors, float* pDeviceValues) + { + return ((delegate* unmanaged)(lpVtbl[6]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), cColors, cChannels, pXYZColors, pDeviceValues); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(7)] + public HRESULT ColorimetricToDeviceColorsWithBlack(uint cColors, uint cChannels, [NativeTypeName("const XYZColorF *")] XYZColorF* pXYZColors, [NativeTypeName("const BlackInformation *")] BlackInformation* pBlackInformation, float* pDeviceValues) + { + return ((delegate* unmanaged)(lpVtbl[7]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), cColors, cChannels, pXYZColors, pBlackInformation, pDeviceValues); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(8)] + public HRESULT SetTransformDeviceModelInfo(uint iModelPosition, IDeviceModelPlugIn* pIDeviceModelOther) + { + return ((delegate* unmanaged)(lpVtbl[8]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), iModelPosition, pIDeviceModelOther); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(9)] + public HRESULT GetPrimarySamples(PrimaryXYZColors* pPrimaryColor) + { + return ((delegate* unmanaged)(lpVtbl[9]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), pPrimaryColor); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(10)] + public HRESULT GetGamutBoundaryMeshSize(uint* pNumVertices, uint* pNumTriangles) + { + return ((delegate* unmanaged)(lpVtbl[10]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), pNumVertices, pNumTriangles); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(11)] + public HRESULT GetGamutBoundaryMesh(uint cChannels, uint cVertices, uint cTriangles, float* pVertices, GamutShellTriangle* pTriangles) + { + return ((delegate* unmanaged)(lpVtbl[11]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), cChannels, cVertices, cTriangles, pVertices, pTriangles); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(12)] + public HRESULT GetNeutralAxisSize(uint* pcColors) + { + return ((delegate* unmanaged)(lpVtbl[12]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), pcColors); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(13)] + public HRESULT GetNeutralAxis(uint cColors, XYZColorF* pXYZColors) + { + return ((delegate* unmanaged)(lpVtbl[13]))((IDeviceModelPlugIn*)Unsafe.AsPointer(ref this), cColors, pXYZColors); + } + + public interface Interface : IUnknown.Interface + { + [VtblIndex(3)] + HRESULT Initialize([NativeTypeName("BSTR")] ushort* bstrXml, uint cNumModels, uint iModelPosition); + + [VtblIndex(4)] + HRESULT GetNumChannels(uint* pNumChannels); + + [VtblIndex(5)] + HRESULT DeviceToColorimetricColors(uint cColors, uint cChannels, [NativeTypeName("const FLOAT *")] float* pDeviceValues, XYZColorF* pXYZColors); + + [VtblIndex(6)] + HRESULT ColorimetricToDeviceColors(uint cColors, uint cChannels, [NativeTypeName("const XYZColorF *")] XYZColorF* pXYZColors, float* pDeviceValues); + + [VtblIndex(7)] + HRESULT ColorimetricToDeviceColorsWithBlack(uint cColors, uint cChannels, [NativeTypeName("const XYZColorF *")] XYZColorF* pXYZColors, [NativeTypeName("const BlackInformation *")] BlackInformation* pBlackInformation, float* pDeviceValues); + + [VtblIndex(8)] + HRESULT SetTransformDeviceModelInfo(uint iModelPosition, IDeviceModelPlugIn* pIDeviceModelOther); + + [VtblIndex(9)] + HRESULT GetPrimarySamples(PrimaryXYZColors* pPrimaryColor); + + [VtblIndex(10)] + HRESULT GetGamutBoundaryMeshSize(uint* pNumVertices, uint* pNumTriangles); + + [VtblIndex(11)] + HRESULT GetGamutBoundaryMesh(uint cChannels, uint cVertices, uint cTriangles, float* pVertices, GamutShellTriangle* pTriangles); + + [VtblIndex(12)] + HRESULT GetNeutralAxisSize(uint* pcColors); + + [VtblIndex(13)] + HRESULT GetNeutralAxis(uint cColors, XYZColorF* pXYZColors); + } + + public partial struct Vtbl + where TSelf : unmanaged, Interface + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public delegate* unmanaged QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public delegate* unmanaged AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public delegate* unmanaged Release; + + [NativeTypeName("HRESULT (BSTR, UINT, UINT) __attribute__((stdcall))")] + public delegate* unmanaged Initialize; + + [NativeTypeName("HRESULT (UINT *) __attribute__((stdcall))")] + public delegate* unmanaged GetNumChannels; + + [NativeTypeName("HRESULT (UINT, UINT, const FLOAT *, XYZColorF *) __attribute__((stdcall))")] + public delegate* unmanaged DeviceToColorimetricColors; + + [NativeTypeName("HRESULT (UINT, UINT, const XYZColorF *, FLOAT *) __attribute__((stdcall))")] + public delegate* unmanaged ColorimetricToDeviceColors; + + [NativeTypeName("HRESULT (UINT, UINT, const XYZColorF *, const BlackInformation *, FLOAT *) __attribute__((stdcall))")] + public delegate* unmanaged ColorimetricToDeviceColorsWithBlack; + + [NativeTypeName("HRESULT (UINT, IDeviceModelPlugIn *) __attribute__((stdcall))")] + public delegate* unmanaged SetTransformDeviceModelInfo; + + [NativeTypeName("HRESULT (PrimaryXYZColors *) __attribute__((stdcall))")] + public delegate* unmanaged GetPrimarySamples; + + [NativeTypeName("HRESULT (UINT *, UINT *) __attribute__((stdcall))")] + public delegate* unmanaged GetGamutBoundaryMeshSize; + + [NativeTypeName("HRESULT (UINT, UINT, UINT, FLOAT *, GamutShellTriangle *) __attribute__((stdcall))")] + public delegate* unmanaged GetGamutBoundaryMesh; + + [NativeTypeName("HRESULT (UINT *) __attribute__((stdcall))")] + public delegate* unmanaged GetNeutralAxisSize; + + [NativeTypeName("HRESULT (UINT, XYZColorF *) __attribute__((stdcall))")] + public delegate* unmanaged GetNeutralAxis; + } +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugIn.xml b/sources/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugIn.xml new file mode 100644 index 0000000000..402c49509e --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugIn.xml @@ -0,0 +1,175 @@ + + + + + + Returns the appropriate XYZ colors in response to the specified number of colors, channels, device colors and the proprietary plug-in algorithms. + The number of colors in the pXYZColors and pDeviceValues arrays. + The number of color channels in the pDeviceValues arrays. + The pointer to the array of incoming XYZColors to convert to device colors. + The pointer to an array that contains the resulting outgoing device color values. + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. + + + + Returns the appropriate device colors in response to the incoming number of colors, channels, black information, Commission Internationale l'Eclairge XYZ (CIEXYZ) colors and the proprietary plug-in algorithms. + The number of colors in the pXYZColors and pDeviceValues arrays. + The number of color channels in the pDeviceValues arrays. + A pointer to the array of outgoing structures. + A pointer to the . + A pointer to the array of incoming device colors that are to be converted to structures. + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. For extended error information, call GetLastError. + + + + Returns the appropriate XYZ colors in response to the specified number of colors, channels, device colors and the proprietary plug-in algorithms. + The number of colors in the pXYZColors and pDeviceValues arrays. + The number of color channels in the pDeviceValues arrays. + A pointer to the array of outgoing XYZColors. + A pointer to the array of incoming device colors to convert to XYZColors. + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. For extended error information, call GetLastError. + + + + Returns the triangular mesh from the plug-in. This function is used to compute the GamutBoundaryDescription. + The number of channels. + The number of vertices. + The number of triangles. + A pointer to the array of vertices in the plug-in model gamut shell. + A pointer to the array of triangles in the plug-in model gamut shell. + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. + + + + Returns the required data structure sizes for the GetGamutBoundaryMesh function. + The required number of vertices. + The required number of triangles. + + If this function succeeds, the return value is S_OK. + If the plug-in device model wants WCS to compute its gamut boundary mesh, the return value is S_FALSE. + If this function fails, the return value is E_FAIL. + + + + The return the XYZ colorimetry of sample points along the device's neutral axis. + The number of points that are returned. + A pointer to an array of structures. + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. + + + + The function returns the number of data points along the neutral axis that are returned by the GetNeutralAxis function. It is provided so that a Color Management Module (CMM) can allocate an appropriately sized buffer. + The number of points that will be returned by a call to GetNeutralAxis. Minimum is 2 (black and white). + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. + + + + Returns the number of device channels in the parameter pNumChannels. + A pointer to an unsigned integer representing the number of color channels for your device. + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. + + + + Returns the measurement color for the primary sample. + The primary color type, which is determined by using the hue circle order. If the plugin device model does not natively support primaries for red, yellow, green, cyan, blue, magenta, black and white, it must still return virtual primary data. + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. + + + + Takes a pointer to a Stream that contains the whole device model plug-in as input, and initializes any internal parameters required by the plug-in. + A string that contains the BSTR XML device model plug-in profile. This parameter stores data as little-endian Unicode XML; however, it may have no leading bytes to tag it as such. Also, the encoding keyword in the XML may not reflect that this is formatted as little-endian Unicode. Furthermore, due to the action of the MSXML engine, the BSTR XML file is processed and might not have exactly the same contents as the original XML file. + The number of total models in the transform sequence. + The one-based model position of the other device model in the workflow of uiNumModels as provided in the Initialize function. + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. + + + + Provides the plug-in with parameters to determine where in the transform sequence the specific plug-in occurs. + The one-based model position of the other device model in the workflow of uiNumModels, as provided in the Initialize function. + A pointer to a IDeviceModelPlugIn interface that contains the other device model in the transform sequence. + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. + + + + + Describes the methods that are defined for the IDeviceModelPlugIn Component Object Model (COM) interface. + + + + ColorimetricToDeviceColors + + + + + + + + + + DeviceToColorimetricColorsWithBlack + + + + + GetGamutBoundaryMesh + + + + + GetGamutBoundaryMeshSize + + + + + GetNeutralAxis + + + + + GetNeutralAxisSize + + + + + GetNumChannels + + + + + GetPrimarySamples + + + + + Initialize + + + + + SetTransformDeviceModelInfo + + + + + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugIn.cs b/sources/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugIn.cs new file mode 100644 index 0000000000..4281fb7d09 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugIn.cs @@ -0,0 +1,92 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows.IID; + +namespace TerraFX.Interop.Windows; + +/// +[Guid("2DD80115-AD1E-41F6-A219-A4F4B583D1F9")] +[NativeTypeName("struct IGamutMapModelPlugIn : IUnknown")] +[NativeInheritance("IUnknown")] +public unsafe partial struct IGamutMapModelPlugIn : IGamutMapModelPlugIn.Interface, INativeGuid +{ + static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IGamutMapModelPlugIn)); + + public void** lpVtbl; + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(0)] + public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) + { + return ((delegate* unmanaged)(lpVtbl[0]))((IGamutMapModelPlugIn*)Unsafe.AsPointer(ref this), riid, ppvObject); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(1)] + [return: NativeTypeName("ULONG")] + public uint AddRef() + { + return ((delegate* unmanaged)(lpVtbl[1]))((IGamutMapModelPlugIn*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(2)] + [return: NativeTypeName("ULONG")] + public uint Release() + { + return ((delegate* unmanaged)(lpVtbl[2]))((IGamutMapModelPlugIn*)Unsafe.AsPointer(ref this)); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(3)] + public HRESULT Initialize([NativeTypeName("BSTR")] ushort* bstrXml, IDeviceModelPlugIn* pSrcPlugIn, IDeviceModelPlugIn* pDestPlugIn, GamutBoundaryDescription* pSrcGBD, GamutBoundaryDescription* pDestGBD) + { + return ((delegate* unmanaged)(lpVtbl[3]))((IGamutMapModelPlugIn*)Unsafe.AsPointer(ref this), bstrXml, pSrcPlugIn, pDestPlugIn, pSrcGBD, pDestGBD); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [VtblIndex(4)] + public HRESULT SourceToDestinationAppearanceColors(uint cColors, [NativeTypeName("const JChColorF *")] JChColorF* pInputColors, JChColorF* pOutputColors) + { + return ((delegate* unmanaged)(lpVtbl[4]))((IGamutMapModelPlugIn*)Unsafe.AsPointer(ref this), cColors, pInputColors, pOutputColors); + } + + public interface Interface : IUnknown.Interface + { + [VtblIndex(3)] + HRESULT Initialize([NativeTypeName("BSTR")] ushort* bstrXml, IDeviceModelPlugIn* pSrcPlugIn, IDeviceModelPlugIn* pDestPlugIn, GamutBoundaryDescription* pSrcGBD, GamutBoundaryDescription* pDestGBD); + + [VtblIndex(4)] + HRESULT SourceToDestinationAppearanceColors(uint cColors, [NativeTypeName("const JChColorF *")] JChColorF* pInputColors, JChColorF* pOutputColors); + } + + public partial struct Vtbl + where TSelf : unmanaged, Interface + { + [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")] + public delegate* unmanaged QueryInterface; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public delegate* unmanaged AddRef; + + [NativeTypeName("ULONG () __attribute__((stdcall))")] + public delegate* unmanaged Release; + + [NativeTypeName("HRESULT (BSTR, IDeviceModelPlugIn *, IDeviceModelPlugIn *, GamutBoundaryDescription *, GamutBoundaryDescription *) __attribute__((stdcall))")] + public delegate* unmanaged Initialize; + + [NativeTypeName("HRESULT (UINT, const JChColorF *, JChColorF *) __attribute__((stdcall))")] + public delegate* unmanaged SourceToDestinationAppearanceColors; + } +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugIn.xml b/sources/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugIn.xml new file mode 100644 index 0000000000..c25f0b6c4f --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugIn.xml @@ -0,0 +1,44 @@ + + + + + + Initializes a gamut map model profile (GMMP) by using the specified source and destination gamut boundary descriptions and optional source and destination device model plug-ins. + A string that contains the BSTR XML GMMP profile. This is little-endian Unicode XML, but without the leading bytes to tag it as such. Also, the encoding keyword in the XML may not reflect this format. + A pointer to a source IDeviceModelPlugIn. If NULL, it indicates the source device model profile is not a plug-in profile. + A pointer to a destination IDeviceModelPlugIn. If NULL, it indicates the destination device model profile is not a plug-in profile. + A pointer to a source . + A pointer to a destination . + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. + + + + Returns the appropriate gamut-mapped appearance colors in response to the specified number of colors and the colors. + The number of colors in the pXYZColors and pDeviceValues arrays. + A pointer to the array of incoming colors to be gamut mapped. + A pointer to the array of outgoing colors. + + If this function succeeds, the return value is S_OK. + If this function fails, the return value is E_FAIL. + + + + + Describes the methods that are defined for the IGamutMapModelPlugIn Component Object Model (COM) interface. + + + + IGamutMapModelPlugIn.Initialize + + + + + IGamutMapModelPlugIn.SourceToDestinationAppearanceColors + + + + + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/IID.cs b/sources/Interop/Windows/Windows/um/wcsplugin/IID.cs new file mode 100644 index 0000000000..b7b7ad2c78 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/IID.cs @@ -0,0 +1,60 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows; + +public static partial class IID +{ + public static ref readonly Guid IID_IDeviceModelPlugIn + { + get + { + ReadOnlySpan data = new byte[] { + 0x75, 0x34, 0xD6, 0x1C, + 0xC4, 0x07, + 0xFE, 0x46, + 0xA9, + 0x03, + 0xD6, + 0x55, + 0x31, + 0x6D, + 0x11, + 0xFD + }; + + Debug.Assert(data.Length == Unsafe.SizeOf()); + return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); + } + } + + public static ref readonly Guid IID_IGamutMapModelPlugIn + { + get + { + ReadOnlySpan data = new byte[] { + 0x15, 0x01, 0xD8, 0x2D, + 0x1E, 0xAD, + 0xF6, 0x41, + 0xA2, + 0x19, + 0xA4, + 0xF4, + 0xB5, + 0x83, + 0xD1, + 0xF9 + }; + + Debug.Assert(data.Length == Unsafe.SizeOf()); + return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); + } + } +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/JChColorF.cs b/sources/Interop/Windows/Windows/um/wcsplugin/JChColorF.cs new file mode 100644 index 0000000000..e8ae7e4df5 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/JChColorF.cs @@ -0,0 +1,19 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct JChColorF +{ + /// + public float J; + + /// + public float C; + + /// + public float h; +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/JChColorF.xml b/sources/Interop/Windows/Windows/um/wcsplugin/JChColorF.xml new file mode 100644 index 0000000000..711418f0f7 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/JChColorF.xml @@ -0,0 +1,17 @@ + + + + + + TBD + + + TBD + + + TBD + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/JabColorF.cs b/sources/Interop/Windows/Windows/um/wcsplugin/JabColorF.cs new file mode 100644 index 0000000000..ec996d8d9b --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/JabColorF.cs @@ -0,0 +1,19 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct JabColorF +{ + /// + public float J; + + /// + public float a; + + /// + public float b; +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/JabColorF.xml b/sources/Interop/Windows/Windows/um/wcsplugin/JabColorF.xml new file mode 100644 index 0000000000..7af287d092 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/JabColorF.xml @@ -0,0 +1,17 @@ + + + + + + TBD + + + TBD + + + TBD + + + TBD + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColors.cs b/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColors.cs new file mode 100644 index 0000000000..331acecc2e --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColors.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct PrimaryJabColors +{ + /// + public JabColorF red; + + /// + public JabColorF yellow; + + /// + public JabColorF green; + + /// + public JabColorF cyan; + + /// + public JabColorF blue; + + /// + public JabColorF magenta; + + /// + public JabColorF black; + + /// + public JabColorF white; +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColors.xml b/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColors.xml new file mode 100644 index 0000000000..57057973ec --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColors.xml @@ -0,0 +1,32 @@ + + + + + + This structure contains eight primary colors in Jab coordinates. + + + Red primary. + + + Yellow primary. + + + Green primary. + + + Cyan primary. + + + Blue primary. + + + Magenta primary. + + + Black primary. + + + White primary. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColors.cs b/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColors.cs new file mode 100644 index 0000000000..dc0aed27e2 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColors.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct PrimaryXYZColors +{ + /// + public XYZColorF red; + + /// + public XYZColorF yellow; + + /// + public XYZColorF green; + + /// + public XYZColorF cyan; + + /// + public XYZColorF blue; + + /// + public XYZColorF magenta; + + /// + public XYZColorF black; + + /// + public XYZColorF white; +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColors.xml b/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColors.xml new file mode 100644 index 0000000000..ca81773243 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColors.xml @@ -0,0 +1,32 @@ + + + + + + This structure contains eight primary colors in XYZ coordinates. + + + Red primary. + + + Yellow primary. + + + Green primary. + + + Cyan primary. + + + Blue primary. + + + Magenta primary. + + + Black primary. + + + White primary. + + \ No newline at end of file diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/XYZColorF.cs b/sources/Interop/Windows/Windows/um/wcsplugin/XYZColorF.cs new file mode 100644 index 0000000000..6e288e9ce5 --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/XYZColorF.cs @@ -0,0 +1,19 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +namespace TerraFX.Interop.Windows; + +/// +public partial struct XYZColorF +{ + /// + public float X; + + /// + public float Y; + + /// + public float Z; +} diff --git a/sources/Interop/Windows/Windows/um/wcsplugin/XYZColorF.xml b/sources/Interop/Windows/Windows/um/wcsplugin/XYZColorF.xml new file mode 100644 index 0000000000..293006083a --- /dev/null +++ b/sources/Interop/Windows/Windows/um/wcsplugin/XYZColorF.xml @@ -0,0 +1,17 @@ + + + + + + TBD + + + TBD + + + TBD + + + TBD + + \ No newline at end of file diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/BlackInformationTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/BlackInformationTests.cs new file mode 100644 index 0000000000..45f1c41c04 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/BlackInformationTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class BlackInformationTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(BlackInformation))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(BlackInformation).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(BlackInformation), Is.EqualTo(8)); + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/CATIDTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/CATIDTests.cs new file mode 100644 index 0000000000..57d6235bb7 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/CATIDTests.cs @@ -0,0 +1,21 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using static TerraFX.Interop.Windows.CATID; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the class. +public static partial class CATIDTests +{ + /// Validates that the value of the property is correct. + [Test] + public static void CATID_WcsPluginTest() + { + Assert.That(CATID_WcsPlugin, Is.EqualTo(new Guid(0xa0b402e0, 0x8240, 0x405f, 0x8a, 0x16, 0x8a, 0x5b, 0x4d, 0xf2, 0xf0, 0xdd))); + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescriptionTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescriptionTests.cs new file mode 100644 index 0000000000..ea180ce877 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/GamutBoundaryDescriptionTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class GamutBoundaryDescriptionTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(GamutBoundaryDescription))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(GamutBoundaryDescription).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(GamutBoundaryDescription), Is.EqualTo(48)); + } + else + { + Assert.That(sizeof(GamutBoundaryDescription), Is.EqualTo(24)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/GamutShellTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/GamutShellTests.cs new file mode 100644 index 0000000000..b938c71e5b --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/GamutShellTests.cs @@ -0,0 +1,42 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class GamutShellTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(GamutShell))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(GamutShell).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(GamutShell), Is.EqualTo(32)); + } + else + { + Assert.That(sizeof(GamutShell), Is.EqualTo(24)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangleTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangleTests.cs new file mode 100644 index 0000000000..81797bdf47 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/GamutShellTriangleTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class GamutShellTriangleTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(GamutShellTriangle))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(GamutShellTriangle).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(GamutShellTriangle), Is.EqualTo(12)); + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugInTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugInTests.cs new file mode 100644 index 0000000000..cd7b7f170a --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/IDeviceModelPlugInTests.cs @@ -0,0 +1,50 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows.IID; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class IDeviceModelPlugInTests +{ + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IDeviceModelPlugIn).GUID, Is.EqualTo(IID_IDeviceModelPlugIn)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IDeviceModelPlugIn))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IDeviceModelPlugIn).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IDeviceModelPlugIn), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IDeviceModelPlugIn), Is.EqualTo(4)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugInTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugInTests.cs new file mode 100644 index 0000000000..8c34ebb6c3 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/IGamutMapModelPlugInTests.cs @@ -0,0 +1,50 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System; +using System.Runtime.InteropServices; +using static TerraFX.Interop.Windows.IID; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class IGamutMapModelPlugInTests +{ + /// Validates that the of the struct is correct. + [Test] + public static void GuidOfTest() + { + Assert.That(typeof(IGamutMapModelPlugIn).GUID, Is.EqualTo(IID_IGamutMapModelPlugIn)); + } + + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(IGamutMapModelPlugIn))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(IGamutMapModelPlugIn).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) + { + Assert.That(sizeof(IGamutMapModelPlugIn), Is.EqualTo(8)); + } + else + { + Assert.That(sizeof(IGamutMapModelPlugIn), Is.EqualTo(4)); + } + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/JChColorFTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/JChColorFTests.cs new file mode 100644 index 0000000000..7423dd39f9 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/JChColorFTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class JChColorFTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(JChColorF))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(JChColorF).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(JChColorF), Is.EqualTo(12)); + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/JabColorFTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/JabColorFTests.cs new file mode 100644 index 0000000000..a88c116620 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/JabColorFTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class JabColorFTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(JabColorF))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(JabColorF).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(JabColorF), Is.EqualTo(12)); + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColorsTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColorsTests.cs new file mode 100644 index 0000000000..b7e0351080 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/PrimaryJabColorsTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PrimaryJabColorsTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PrimaryJabColors))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PrimaryJabColors).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(PrimaryJabColors), Is.EqualTo(96)); + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColorsTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColorsTests.cs new file mode 100644 index 0000000000..7c1a126276 --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/PrimaryXYZColorsTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class PrimaryXYZColorsTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(PrimaryXYZColors))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(PrimaryXYZColors).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(PrimaryXYZColors), Is.EqualTo(96)); + } +} diff --git a/tests/Interop/Windows/Windows/um/wcsplugin/XYZColorFTests.cs b/tests/Interop/Windows/Windows/um/wcsplugin/XYZColorFTests.cs new file mode 100644 index 0000000000..277820384e --- /dev/null +++ b/tests/Interop/Windows/Windows/um/wcsplugin/XYZColorFTests.cs @@ -0,0 +1,34 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from um/wcsplugin.h in the Windows SDK for Windows 10.0.22621.0 +// Original source is Copyright © Microsoft. All rights reserved. + +using NUnit.Framework; +using System.Runtime.InteropServices; + +namespace TerraFX.Interop.Windows.UnitTests; + +/// Provides validation of the struct. +public static unsafe partial class XYZColorFTests +{ + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() + { + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(XYZColorF))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutSequentialTest() + { + Assert.That(typeof(XYZColorF).IsLayoutSequential, Is.True); + } + + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + Assert.That(sizeof(XYZColorF), Is.EqualTo(12)); + } +} From 9b9d2e410a262eeb010dc945f179357ef88bdd10 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 22 Jun 2023 17:23:29 -0700 Subject: [PATCH 6/8] Resolve generation conflicts between headers --- generation/Windows/um/CommCtrl/generate.rsp | 2 + generation/remap-structs.rsp | 1 + generation/remap-transparent.rsp | 2 +- .../other/helper-types/HCMTRANSFORM.cs | 101 +++++++++++ .../Windows/Windows/um/CommCtrl/CDN.cs | 15 -- .../Windows/Windows/um/WinUser/COLOR.cs | 2 +- .../Interop/Windows/Windows/um/icm/COLOR.cs | 161 +++++++++--------- .../Interop/Windows/Windows/um/icm/Windows.cs | 4 - .../Windows/Windows/um/wingdi/COLOR.cs | 2 +- .../Windows/Windows/um/icm/COLORTests.cs | 48 +++--- 10 files changed, 208 insertions(+), 130 deletions(-) create mode 100644 sources/Interop/Windows/Windows/other/helper-types/HCMTRANSFORM.cs delete mode 100644 sources/Interop/Windows/Windows/um/CommCtrl/CDN.cs diff --git a/generation/Windows/um/CommCtrl/generate.rsp b/generation/Windows/um/CommCtrl/generate.rsp index 7c0c5327bf..e6ebabd6e3 100644 --- a/generation/Windows/um/CommCtrl/generate.rsp +++ b/generation/Windows/um/CommCtrl/generate.rsp @@ -23,6 +23,8 @@ Button_SetNote Button_SetSplitInfo Button_SetTextMargin CCSIZEOF_STRUCT +CDN_FIRST +CDN_LAST ComboBox_GetCueBannerText ComboBox_GetMinVisible ComboBox_SetCueBannerText diff --git a/generation/remap-structs.rsp b/generation/remap-structs.rsp index 31938bc09d..f71b9fc9e1 100644 --- a/generation/remap-structs.rsp +++ b/generation/remap-structs.rsp @@ -1,4 +1,5 @@ --with-type +COLOR=struct DDBLTFX=struct DDSCAPS=struct DDSCAPS2=struct diff --git a/generation/remap-transparent.rsp b/generation/remap-transparent.rsp index 909f876dc9..1cd6002575 100644 --- a/generation/remap-transparent.rsp +++ b/generation/remap-transparent.rsp @@ -20,6 +20,7 @@ HCERTCHAINENGINE=void*;HandleWin32 HCERTSTORE=void*;HandleWin32 HCERTSTOREPROV=void*;HandleWin32 HCERT_SERVER_OCSP_RESPONSE=void*;HandleWin32 +HCMTRANSFORM=void*;HandleWin32 HCOLORSPACE=void*;HandleWin32 HCOMDB=void*;HandleWin32 HCRYPTASYNC=void*;HandleWin32 @@ -171,7 +172,6 @@ HBODY=HBODY HCATINFO=HCATINFO HCHARSET=HCHARSET HCMNOTIFICATION=HCMNOTIFICATION -HCMTRANSFORM=HCMTRANSFORM HCONV=HCONV HCONVLIST=HCONVLIST HCS_CALLBACK=HCS_CALLBACK diff --git a/sources/Interop/Windows/Windows/other/helper-types/HCMTRANSFORM.cs b/sources/Interop/Windows/Windows/other/helper-types/HCMTRANSFORM.cs new file mode 100644 index 0000000000..6cc5d070a0 --- /dev/null +++ b/sources/Interop/Windows/Windows/other/helper-types/HCMTRANSFORM.cs @@ -0,0 +1,101 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +using System; + +namespace TerraFX.Interop.Windows; + +public readonly unsafe partial struct HCMTRANSFORM : IComparable, IComparable, IEquatable, IFormattable +{ + public readonly void* Value; + + public HCMTRANSFORM(void* value) + { + Value = value; + } + + public static HCMTRANSFORM INVALID_VALUE => new HCMTRANSFORM((void*)(-1)); + + public static HCMTRANSFORM NULL => new HCMTRANSFORM(null); + + public static bool operator ==(HCMTRANSFORM left, HCMTRANSFORM right) => left.Value == right.Value; + + public static bool operator !=(HCMTRANSFORM left, HCMTRANSFORM right) => left.Value != right.Value; + + public static bool operator <(HCMTRANSFORM left, HCMTRANSFORM right) => left.Value < right.Value; + + public static bool operator <=(HCMTRANSFORM left, HCMTRANSFORM right) => left.Value <= right.Value; + + public static bool operator >(HCMTRANSFORM left, HCMTRANSFORM right) => left.Value > right.Value; + + public static bool operator >=(HCMTRANSFORM left, HCMTRANSFORM right) => left.Value >= right.Value; + + public static explicit operator HCMTRANSFORM(void* value) => new HCMTRANSFORM(value); + + public static implicit operator void*(HCMTRANSFORM value) => value.Value; + + public static explicit operator HCMTRANSFORM(HANDLE value) => new HCMTRANSFORM(value); + + public static implicit operator HANDLE(HCMTRANSFORM value) => new HANDLE(value.Value); + + public static explicit operator HCMTRANSFORM(byte value) => new HCMTRANSFORM(unchecked((void*)(value))); + + public static explicit operator byte(HCMTRANSFORM value) => (byte)(value.Value); + + public static explicit operator HCMTRANSFORM(short value) => new HCMTRANSFORM(unchecked((void*)(value))); + + public static explicit operator short(HCMTRANSFORM value) => (short)(value.Value); + + public static explicit operator HCMTRANSFORM(int value) => new HCMTRANSFORM(unchecked((void*)(value))); + + public static explicit operator int(HCMTRANSFORM value) => (int)(value.Value); + + public static explicit operator HCMTRANSFORM(long value) => new HCMTRANSFORM(unchecked((void*)(value))); + + public static explicit operator long(HCMTRANSFORM value) => (long)(value.Value); + + public static explicit operator HCMTRANSFORM(nint value) => new HCMTRANSFORM(unchecked((void*)(value))); + + public static implicit operator nint(HCMTRANSFORM value) => (nint)(value.Value); + + public static explicit operator HCMTRANSFORM(sbyte value) => new HCMTRANSFORM(unchecked((void*)(value))); + + public static explicit operator sbyte(HCMTRANSFORM value) => (sbyte)(value.Value); + + public static explicit operator HCMTRANSFORM(ushort value) => new HCMTRANSFORM(unchecked((void*)(value))); + + public static explicit operator ushort(HCMTRANSFORM value) => (ushort)(value.Value); + + public static explicit operator HCMTRANSFORM(uint value) => new HCMTRANSFORM(unchecked((void*)(value))); + + public static explicit operator uint(HCMTRANSFORM value) => (uint)(value.Value); + + public static explicit operator HCMTRANSFORM(ulong value) => new HCMTRANSFORM(unchecked((void*)(value))); + + public static explicit operator ulong(HCMTRANSFORM value) => (ulong)(value.Value); + + public static explicit operator HCMTRANSFORM(nuint value) => new HCMTRANSFORM(unchecked((void*)(value))); + + public static implicit operator nuint(HCMTRANSFORM value) => (nuint)(value.Value); + + public int CompareTo(object? obj) + { + if (obj is HCMTRANSFORM other) + { + return CompareTo(other); + } + + return (obj is null) ? 1 : throw new ArgumentException("obj is not an instance of HCMTRANSFORM."); + } + + public int CompareTo(HCMTRANSFORM other) => ((nuint)(Value)).CompareTo((nuint)(other.Value)); + + public override bool Equals(object? obj) => (obj is HCMTRANSFORM other) && Equals(other); + + public bool Equals(HCMTRANSFORM other) => ((nuint)(Value)).Equals((nuint)(other.Value)); + + public override int GetHashCode() => ((nuint)(Value)).GetHashCode(); + + public override string ToString() => ((nuint)(Value)).ToString((sizeof(nint) == 4) ? "X8" : "X16"); + + public string ToString(string? format, IFormatProvider? formatProvider) => ((nuint)(Value)).ToString(format, formatProvider); +} diff --git a/sources/Interop/Windows/Windows/um/CommCtrl/CDN.cs b/sources/Interop/Windows/Windows/um/CommCtrl/CDN.cs deleted file mode 100644 index a324941ee3..0000000000 --- a/sources/Interop/Windows/Windows/um/CommCtrl/CDN.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. - -// Ported from um/CommCtrl.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace TerraFX.Interop.Windows; - -public static partial class CDN -{ - [NativeTypeName("#define CDN_FIRST (0U-601U)")] - public const uint CDN_FIRST = unchecked(0U - 601U); - - [NativeTypeName("#define CDN_LAST (0U-699U)")] - public const uint CDN_LAST = unchecked(0U - 699U); -} diff --git a/sources/Interop/Windows/Windows/um/WinUser/COLOR.cs b/sources/Interop/Windows/Windows/um/WinUser/COLOR.cs index 0d10885237..c0c34cb728 100644 --- a/sources/Interop/Windows/Windows/um/WinUser/COLOR.cs +++ b/sources/Interop/Windows/Windows/um/WinUser/COLOR.cs @@ -5,7 +5,7 @@ namespace TerraFX.Interop.Windows; -public static partial class COLOR +public partial struct COLOR { [NativeTypeName("#define COLOR_SCROLLBAR 0")] public const int COLOR_SCROLLBAR = 0; diff --git a/sources/Interop/Windows/Windows/um/icm/COLOR.cs b/sources/Interop/Windows/Windows/um/icm/COLOR.cs index ebafdcd83f..bd3ee68bc6 100644 --- a/sources/Interop/Windows/Windows/um/icm/COLOR.cs +++ b/sources/Interop/Windows/Windows/um/icm/COLOR.cs @@ -9,96 +9,93 @@ namespace TerraFX.Interop.Windows; -public static partial class COLOR +/// +[StructLayout(LayoutKind.Explicit)] +public unsafe partial struct COLOR { - /// - [StructLayout(LayoutKind.Explicit)] - public unsafe partial struct COLOR - { - /// - [FieldOffset(0)] - [NativeTypeName("struct GRAYCOLOR")] - public GRAYCOLOR gray; - - /// - [FieldOffset(0)] - [NativeTypeName("struct RGBCOLOR")] - public RGBCOLOR rgb; - - /// - [FieldOffset(0)] - [NativeTypeName("struct CMYKCOLOR")] - public CMYKCOLOR cmyk; - - /// - [FieldOffset(0)] - [NativeTypeName("struct XYZCOLOR")] - public XYZCOLOR XYZ; - - /// - [FieldOffset(0)] - [NativeTypeName("struct YxyCOLOR")] - public YxyCOLOR Yxy; - - /// - [FieldOffset(0)] - [NativeTypeName("struct LabCOLOR")] - public LabCOLOR Lab; - - /// - [FieldOffset(0)] - [NativeTypeName("struct GENERIC3CHANNEL")] - public GENERIC3CHANNEL gen3ch; - - /// - [FieldOffset(0)] - [NativeTypeName("struct NAMEDCOLOR")] - public NAMEDCOLOR named; - - /// - [FieldOffset(0)] - [NativeTypeName("struct HiFiCOLOR")] - public HiFiCOLOR hifi; - - /// - [FieldOffset(0)] - [NativeTypeName("__AnonymousRecord_icm_L127_C5")] - public _Anonymous_e__Struct Anonymous; + [NativeTypeName("#define COLOR_MATCH_VERSION 0x0200")] + public const int COLOR_MATCH_VERSION = 0x0200; - /// - [UnscopedRef] - public ref uint reserved1 + /// + [FieldOffset(0)] + [NativeTypeName("struct GRAYCOLOR")] + public GRAYCOLOR gray; + + /// + [FieldOffset(0)] + [NativeTypeName("struct RGBCOLOR")] + public RGBCOLOR rgb; + + /// + [FieldOffset(0)] + [NativeTypeName("struct CMYKCOLOR")] + public CMYKCOLOR cmyk; + + /// + [FieldOffset(0)] + [NativeTypeName("struct XYZCOLOR")] + public XYZCOLOR XYZ; + + /// + [FieldOffset(0)] + [NativeTypeName("struct YxyCOLOR")] + public YxyCOLOR Yxy; + + /// + [FieldOffset(0)] + [NativeTypeName("struct LabCOLOR")] + public LabCOLOR Lab; + + /// + [FieldOffset(0)] + [NativeTypeName("struct GENERIC3CHANNEL")] + public GENERIC3CHANNEL gen3ch; + + /// + [FieldOffset(0)] + [NativeTypeName("struct NAMEDCOLOR")] + public NAMEDCOLOR named; + + /// + [FieldOffset(0)] + [NativeTypeName("struct HiFiCOLOR")] + public HiFiCOLOR hifi; + + /// + [FieldOffset(0)] + [NativeTypeName("__AnonymousRecord_icm_L127_C5")] + public _Anonymous_e__Struct Anonymous; + + /// + [UnscopedRef] + public ref uint reserved1 + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return ref Anonymous.reserved1; - } + return ref Anonymous.reserved1; } + } - /// - [UnscopedRef] - public ref void* reserved2 + /// + [UnscopedRef] + public ref void* reserved2 + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - return ref Anonymous.reserved2; - } + return ref Anonymous.reserved2; } + } - /// - public unsafe partial struct _Anonymous_e__Struct - { - /// - [NativeTypeName("DWORD")] - public uint reserved1; + /// + public unsafe partial struct _Anonymous_e__Struct + { + /// + [NativeTypeName("DWORD")] + public uint reserved1; - /// - public void* reserved2; - } + /// + public void* reserved2; } - - [NativeTypeName("#define COLOR_MATCH_VERSION 0x0200")] - public const int COLOR_MATCH_VERSION = 0x0200; } diff --git a/sources/Interop/Windows/Windows/um/icm/Windows.cs b/sources/Interop/Windows/Windows/um/icm/Windows.cs index e6727bd5de..278460c2e8 100644 --- a/sources/Interop/Windows/Windows/um/icm/Windows.cs +++ b/sources/Interop/Windows/Windows/um/icm/Windows.cs @@ -502,10 +502,6 @@ public static unsafe partial class Windows [SupportedOSPlatform("windows10.0.19043.0")] public static extern HRESULT ColorProfileGetDisplayUserScope(LUID targetAdapterID, [NativeTypeName("UINT32")] uint sourceID, WCS_PROFILE_MANAGEMENT_SCOPE* scope); - /// - [DllImport("", ExactSpelling = true)] - public static extern HRESULT ColorProfileGetDeviceCapabilities(WCS_PROFILE_MANAGEMENT_SCOPE scope, LUID targetAdapterID, [NativeTypeName("UINT32")] uint sourceID, WCS_DEVICE_CAPABILITIES_TYPE capsType, [NativeTypeName("PVOID")] void* outputCapabilities); - [NativeTypeName("#define INTENT_PERCEPTUAL 0")] public const int INTENT_PERCEPTUAL = 0; diff --git a/sources/Interop/Windows/Windows/um/wingdi/COLOR.cs b/sources/Interop/Windows/Windows/um/wingdi/COLOR.cs index 59679d6d3d..87ad2aa6e6 100644 --- a/sources/Interop/Windows/Windows/um/wingdi/COLOR.cs +++ b/sources/Interop/Windows/Windows/um/wingdi/COLOR.cs @@ -5,7 +5,7 @@ namespace TerraFX.Interop.Windows; -public static partial class COLOR +public partial struct COLOR { [NativeTypeName("#define COLOR_ADJ_MIN (SHORT)-100")] public const short COLOR_ADJ_MIN = (short)(-100); diff --git a/tests/Interop/Windows/Windows/um/icm/COLORTests.cs b/tests/Interop/Windows/Windows/um/icm/COLORTests.cs index fa7b3770a5..3fb3312a15 100644 --- a/tests/Interop/Windows/Windows/um/icm/COLORTests.cs +++ b/tests/Interop/Windows/Windows/um/icm/COLORTests.cs @@ -9,38 +9,34 @@ namespace TerraFX.Interop.Windows.UnitTests; -/// Provides validation of the class. -public static partial class COLORTests +/// Provides validation of the struct. +public static unsafe partial class COLORTests { - /// Provides validation of the struct. - public static unsafe partial class COLORTests + /// Validates that the struct is blittable. + [Test] + public static void IsBlittableTest() { - /// Validates that the struct is blittable. - [Test] - public static void IsBlittableTest() - { - Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(COLOR))); - } + Assert.That(Marshal.SizeOf(), Is.EqualTo(sizeof(COLOR))); + } + + /// Validates that the struct has the right . + [Test] + public static void IsLayoutExplicitTest() + { + Assert.That(typeof(COLOR).IsExplicitLayout, Is.True); + } - /// Validates that the struct has the right . - [Test] - public static void IsLayoutExplicitTest() + /// Validates that the struct has the correct size. + [Test] + public static void SizeOfTest() + { + if (Environment.Is64BitProcess) { - Assert.That(typeof(COLOR).IsExplicitLayout, Is.True); + Assert.That(sizeof(COLOR), Is.EqualTo(16)); } - - /// Validates that the struct has the correct size. - [Test] - public static void SizeOfTest() + else { - if (Environment.Is64BitProcess) - { - Assert.That(sizeof(COLOR), Is.EqualTo(16)); - } - else - { - Assert.That(sizeof(COLOR), Is.EqualTo(8)); - } + Assert.That(sizeof(COLOR), Is.EqualTo(8)); } } } From 6d4dad9bd8778a8ad54f2f581bb1ffaf71cfa62a Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 23 Jun 2023 07:10:23 -0700 Subject: [PATCH 7/8] Fixing some --with-librarypath where the docs had the wrong information --- generation/Windows/um/icm/generate.rsp | 28 +++++++++---------- .../Interop/Windows/Windows/um/icm/Windows.cs | 28 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/generation/Windows/um/icm/generate.rsp b/generation/Windows/um/icm/generate.rsp index d9abb7b335..6e505c215c 100644 --- a/generation/Windows/um/icm/generate.rsp +++ b/generation/Windows/um/icm/generate.rsp @@ -33,26 +33,26 @@ AssociateColorProfileWithDeviceW=mscms CheckBitmapBits=mscms CheckColors=mscms CloseColorProfile=mscms -CMCheckColors=mscms -CMCheckColorsInGamut=mscms -CMCheckRGBs=mscms -CMConvertColorNameToIndex=mscms -CMConvertIndexToColorName=mscms +CMCheckColors=icm32 +CMCheckColorsInGamut=icm32 +CMCheckRGBs=icm32 +CMConvertColorNameToIndex=icm32 +CMConvertIndexToColorName=icm32 CMCreateDeviceLinkProfile=icm32 CMCreateMultiProfileTransform=icm32 -CMCreateProfile=mscms -CMCreateProfileW=mscms -CMCreateTransform=mscms +CMCreateProfile=icm32 +CMCreateProfileW=icm32 +CMCreateTransform=icm32 CMCreateTransformExt=icm32 CMCreateTransformExtW=icm32 -CMCreateTransformW=mscms +CMCreateTransformW=icm32 CMDeleteTransform=icm32 -CMGetInfo=mscms +CMGetInfo=icm32 CMGetNamedProfileInfo=icm32 -CMGetPS2ColorRenderingDictionary=mscms -CMGetPS2ColorRenderingIntent=mscms -CMGetPS2ColorSpaceArray=mscms -CMIsProfileValid=mscms +CMGetPS2ColorRenderingDictionary=icm32 +CMGetPS2ColorRenderingIntent=icm32 +CMGetPS2ColorSpaceArray=icm32 +CMIsProfileValid=icm32 CMTranslateColors=icm32 CMTranslateRGB=icm32 CMTranslateRGBs=icm32 diff --git a/sources/Interop/Windows/Windows/um/icm/Windows.cs b/sources/Interop/Windows/Windows/um/icm/Windows.cs index 278460c2e8..8e24cff492 100644 --- a/sources/Interop/Windows/Windows/um/icm/Windows.cs +++ b/sources/Interop/Windows/Windows/um/icm/Windows.cs @@ -346,20 +346,20 @@ public static unsafe partial class Windows public static extern BOOL WcsCheckColors(HTRANSFORM hColorTransform, [NativeTypeName("DWORD")] uint nColors, [NativeTypeName("DWORD")] uint nInputChannels, COLORDATATYPE cdtInput, [NativeTypeName("DWORD")] uint cbInput, [NativeTypeName("PVOID")] void* pInputData, [NativeTypeName("PBYTE")] byte* paResult); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] public static extern BOOL CMCheckColors(HCMTRANSFORM hcmTransform, [NativeTypeName("LPCOLOR")] COLOR* lpaInputColors, [NativeTypeName("DWORD")] uint nColors, COLORTYPE ctInput, [NativeTypeName("LPBYTE")] byte* lpaResult); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] [SupportedOSPlatform("windows10.0.19043.0")] public static extern BOOL CMCheckRGBs(HCMTRANSFORM hcmTransform, [NativeTypeName("LPVOID")] void* lpSrcBits, BMFORMAT bmInput, [NativeTypeName("DWORD")] uint dwWidth, [NativeTypeName("DWORD")] uint dwHeight, [NativeTypeName("DWORD")] uint dwStride, [NativeTypeName("LPBYTE")] byte* lpaResult, [NativeTypeName("PBMCALLBACKFN")] delegate* unmanaged pfnCallback, LPARAM ulCallbackData); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] public static extern BOOL CMConvertColorNameToIndex(HPROFILE hProfile, [NativeTypeName("PCOLOR_NAME")] sbyte** paColorName, [NativeTypeName("PDWORD")] uint* paIndex, [NativeTypeName("DWORD")] uint dwCount); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] public static extern BOOL CMConvertIndexToColorName(HPROFILE hProfile, [NativeTypeName("PDWORD")] uint* paIndex, [NativeTypeName("PCOLOR_NAME")] sbyte** paColorName, [NativeTypeName("DWORD")] uint dwCount); /// @@ -371,17 +371,17 @@ public static unsafe partial class Windows public static extern HCMTRANSFORM CMCreateMultiProfileTransform([NativeTypeName("PHPROFILE")] HPROFILE* pahProfiles, [NativeTypeName("DWORD")] uint nProfiles, [NativeTypeName("PDWORD")] uint* padwIntents, [NativeTypeName("DWORD")] uint nIntents, [NativeTypeName("DWORD")] uint dwFlags); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] [SetsLastSystemError] public static extern BOOL CMCreateProfileW([NativeTypeName("LPLOGCOLORSPACEW")] LOGCOLORSPACEW* lpColorSpace, [NativeTypeName("LPDEVCHARACTER *")] void** lpProfileData); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] [SupportedOSPlatform("windows10.0.19043.0")] public static extern HCMTRANSFORM CMCreateTransform([NativeTypeName("LPLOGCOLORSPACEA")] LOGCOLORSPACEA* lpColorSpace, [NativeTypeName("LPDEVCHARACTER")] void* lpDevCharacter, [NativeTypeName("LPDEVCHARACTER")] void* lpTargetDevCharacter); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] [SupportedOSPlatform("windows10.0.19043.0")] public static extern HCMTRANSFORM CMCreateTransformW([NativeTypeName("LPLOGCOLORSPACEW")] LOGCOLORSPACEW* lpColorSpace, [NativeTypeName("LPDEVCHARACTER")] void* lpDevCharacter, [NativeTypeName("LPDEVCHARACTER")] void* lpTargetDevCharacter); @@ -390,12 +390,12 @@ public static unsafe partial class Windows public static extern HCMTRANSFORM CMCreateTransformExt([NativeTypeName("LPLOGCOLORSPACEA")] LOGCOLORSPACEA* lpColorSpace, [NativeTypeName("LPDEVCHARACTER")] void* lpDevCharacter, [NativeTypeName("LPDEVCHARACTER")] void* lpTargetDevCharacter, [NativeTypeName("DWORD")] uint dwFlags); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] [SetsLastSystemError] public static extern BOOL CMCheckColorsInGamut(HCMTRANSFORM hcmTransform, RGBTRIPLE* lpaRGBTriple, [NativeTypeName("LPBYTE")] byte* lpaResult, uint nCount); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] [SetsLastSystemError] public static extern BOOL CMCreateProfile([NativeTypeName("LPLOGCOLORSPACEA")] LOGCOLORSPACEA* lpColorSpace, [NativeTypeName("LPDEVCHARACTER *")] void** lpProfileData); @@ -417,7 +417,7 @@ public static unsafe partial class Windows public static extern BOOL CMDeleteTransform(HCMTRANSFORM hcmTransform); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] [return: NativeTypeName("DWORD")] public static extern uint CMGetInfo([NativeTypeName("DWORD")] uint dwInfo); @@ -426,21 +426,21 @@ public static unsafe partial class Windows public static extern BOOL CMGetNamedProfileInfo(HPROFILE hProfile, [NativeTypeName("PNAMED_PROFILE_INFO")] NAMED_PROFILE_INFO* pNamedProfileInfo); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] [SupportedOSPlatform("windows10.0.19043.0")] public static extern BOOL CMGetPS2ColorRenderingDictionary(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("LPBYTE")] byte* lpBuffer, [NativeTypeName("LPDWORD")] uint* lpcbSize, [NativeTypeName("LPBOOL")] BOOL* lpbBinary); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] public static extern BOOL CMGetPS2ColorRenderingIntent(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("LPBYTE")] byte* lpBuffer, [NativeTypeName("LPDWORD")] uint* lpcbSize); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] [SupportedOSPlatform("windows10.0.19043.0")] public static extern BOOL CMGetPS2ColorSpaceArray(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("DWORD")] uint dwCSAType, [NativeTypeName("LPBYTE")] byte* lpBuffer, [NativeTypeName("LPDWORD")] uint* lpcbSize, [NativeTypeName("LPBOOL")] BOOL* lpbBinary); /// - [DllImport("mscms", ExactSpelling = true)] + [DllImport("icm32", ExactSpelling = true)] public static extern BOOL CMIsProfileValid(HPROFILE hProfile, [NativeTypeName("LPBOOL")] BOOL* lpbValid); /// From eb46d7a526e075b1cb2043cd13ce93603f5661cb Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 23 Jun 2023 07:55:10 -0700 Subject: [PATCH 8/8] Remove three unresolvable methods --- generation/Windows/um/icm/generate.rsp | 9 ++++----- sources/Interop/Windows/Windows/um/icm/Windows.cs | 14 -------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/generation/Windows/um/icm/generate.rsp b/generation/Windows/um/icm/generate.rsp index 6e505c215c..3eca36637e 100644 --- a/generation/Windows/um/icm/generate.rsp +++ b/generation/Windows/um/icm/generate.rsp @@ -1,5 +1,9 @@ @../../../settings.rsp @../../../remap.rsp +--exclude +CMGetPS2ColorRenderingDictionary(HPROFILE, DWORD, LPBYTE, LPDWORD, LPBOOL):BOOL +CMGetPS2ColorRenderingIntent(HPROFILE, DWORD, LPBYTE, LPDWORD):BOOL +CMGetPS2ColorSpaceArray(HPROFILE, DWORD, DWORD, LPBYTE, LPDWORD, LPBOOL):BOOL --file um-icm.h --methodClassName @@ -18,8 +22,6 @@ AssociateColorProfileWithDeviceA=SupportedOSPlatform("windows10.0.19043.0") CMCheckRGBs=SupportedOSPlatform("windows10.0.19043.0") CMCreateTransform=SupportedOSPlatform("windows10.0.19043.0") CMCreateTransformW=SupportedOSPlatform("windows10.0.19043.0") -CMGetPS2ColorRenderingDictionary=SupportedOSPlatform("windows10.0.19043.0") -CMGetPS2ColorSpaceArray=SupportedOSPlatform("windows10.0.19043.0") ColorProfileAddDisplayAssociation=SupportedOSPlatform("windows10.0.19043.0") ColorProfileGetDisplayDefault=SupportedOSPlatform("windows10.0.19043.0") ColorProfileGetDisplayList=SupportedOSPlatform("windows10.0.19043.0") @@ -49,9 +51,6 @@ CMCreateTransformW=icm32 CMDeleteTransform=icm32 CMGetInfo=icm32 CMGetNamedProfileInfo=icm32 -CMGetPS2ColorRenderingDictionary=icm32 -CMGetPS2ColorRenderingIntent=icm32 -CMGetPS2ColorSpaceArray=icm32 CMIsProfileValid=icm32 CMTranslateColors=icm32 CMTranslateRGB=icm32 diff --git a/sources/Interop/Windows/Windows/um/icm/Windows.cs b/sources/Interop/Windows/Windows/um/icm/Windows.cs index 8e24cff492..d20056c45d 100644 --- a/sources/Interop/Windows/Windows/um/icm/Windows.cs +++ b/sources/Interop/Windows/Windows/um/icm/Windows.cs @@ -425,20 +425,6 @@ public static unsafe partial class Windows [DllImport("icm32", ExactSpelling = true)] public static extern BOOL CMGetNamedProfileInfo(HPROFILE hProfile, [NativeTypeName("PNAMED_PROFILE_INFO")] NAMED_PROFILE_INFO* pNamedProfileInfo); - /// - [DllImport("icm32", ExactSpelling = true)] - [SupportedOSPlatform("windows10.0.19043.0")] - public static extern BOOL CMGetPS2ColorRenderingDictionary(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("LPBYTE")] byte* lpBuffer, [NativeTypeName("LPDWORD")] uint* lpcbSize, [NativeTypeName("LPBOOL")] BOOL* lpbBinary); - - /// - [DllImport("icm32", ExactSpelling = true)] - public static extern BOOL CMGetPS2ColorRenderingIntent(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("LPBYTE")] byte* lpBuffer, [NativeTypeName("LPDWORD")] uint* lpcbSize); - - /// - [DllImport("icm32", ExactSpelling = true)] - [SupportedOSPlatform("windows10.0.19043.0")] - public static extern BOOL CMGetPS2ColorSpaceArray(HPROFILE hProfile, [NativeTypeName("DWORD")] uint dwIntent, [NativeTypeName("DWORD")] uint dwCSAType, [NativeTypeName("LPBYTE")] byte* lpBuffer, [NativeTypeName("LPDWORD")] uint* lpcbSize, [NativeTypeName("LPBOOL")] BOOL* lpbBinary); - /// [DllImport("icm32", ExactSpelling = true)] public static extern BOOL CMIsProfileValid(HPROFILE hProfile, [NativeTypeName("LPBOOL")] BOOL* lpbValid);