From 7f642e51670bc38a4ef782a363936850bc2b0ba9 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 22 Apr 2021 06:38:23 -0700 Subject: Move dutil into libs/dutil --- src/libs/dutil/WixToolset.DUtil/inc/locutil.h | 120 ++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 src/libs/dutil/WixToolset.DUtil/inc/locutil.h (limited to 'src/libs/dutil/WixToolset.DUtil/inc/locutil.h') diff --git a/src/libs/dutil/WixToolset.DUtil/inc/locutil.h b/src/libs/dutil/WixToolset.DUtil/inc/locutil.h new file mode 100644 index 00000000..38ddda20 --- /dev/null +++ b/src/libs/dutil/WixToolset.DUtil/inc/locutil.h @@ -0,0 +1,120 @@ +#pragma once +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + + +#ifdef __cplusplus +extern "C" { +#endif + +struct LOC_STRING +{ + LPWSTR wzId; + LPWSTR wzText; + BOOL bOverridable; +}; + +const int LOC_CONTROL_NOT_SET = INT_MAX; + +struct LOC_CONTROL +{ + LPWSTR wzControl; + int nX; + int nY; + int nWidth; + int nHeight; + LPWSTR wzText; +}; + +const int WIX_LOCALIZATION_LANGUAGE_NOT_SET = INT_MAX; + +struct WIX_LOCALIZATION +{ + DWORD dwLangId; + + DWORD cLocStrings; + LOC_STRING* rgLocStrings; + + DWORD cLocControls; + LOC_CONTROL* rgLocControls; +}; + +/******************************************************************** + LocProbeForFile - Searches for a localization file on disk. + +*******************************************************************/ +HRESULT DAPI LocProbeForFile( + __in_z LPCWSTR wzBasePath, + __in_z LPCWSTR wzLocFileName, + __in_z_opt LPCWSTR wzLanguage, + __inout LPWSTR* psczPath + ); + +/******************************************************************** + LocLoadFromFile - Loads a localization file + +*******************************************************************/ +HRESULT DAPI LocLoadFromFile( + __in_z LPCWSTR wzWxlFile, + __out WIX_LOCALIZATION** ppWixLoc + ); + +/******************************************************************** + LocLoadFromResource - loads a localization file from a module's data + resource. + + NOTE: The resource data must be UTF-8 encoded. +*******************************************************************/ +HRESULT DAPI LocLoadFromResource( + __in HMODULE hModule, + __in_z LPCSTR szResource, + __out WIX_LOCALIZATION** ppWixLoc + ); + +/******************************************************************** + LocFree - free memory allocated when loading a localization file + +*******************************************************************/ +void DAPI LocFree( + __in_opt WIX_LOCALIZATION* pWixLoc + ); + +/******************************************************************** + LocLocalizeString - replace any #(loc.id) in a string with the + correct sub string +*******************************************************************/ +HRESULT DAPI LocLocalizeString( + __in const WIX_LOCALIZATION* pWixLoc, + __inout LPWSTR* psczInput + ); + +/******************************************************************** + LocGetControl - returns a control's localization information +*******************************************************************/ +HRESULT DAPI LocGetControl( + __in const WIX_LOCALIZATION* pWixLoc, + __in_z LPCWSTR wzId, + __out LOC_CONTROL** ppLocControl + ); + +/******************************************************************** +LocGetString - returns a string's localization information +*******************************************************************/ +extern "C" HRESULT DAPI LocGetString( + __in const WIX_LOCALIZATION* pWixLoc, + __in_z LPCWSTR wzId, + __out LOC_STRING** ppLocString + ); + +/******************************************************************** +LocAddString - adds a localization string +*******************************************************************/ +extern "C" HRESULT DAPI LocAddString( + __in WIX_LOCALIZATION* pWixLoc, + __in_z LPCWSTR wzId, + __in_z LPCWSTR wzLocString, + __in BOOL bOverridable + ); + +#ifdef __cplusplus +} +#endif -- cgit v1.2.3-55-g6feb