diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-10-27 13:55:16 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-11-01 16:34:09 -0500 |
| commit | 8fa040da9d0d3826f5ffda6bcbec4f53abd97452 (patch) | |
| tree | a8a1094f3ac17bd6feed8a6f971c0d6008694345 /src/api/burn | |
| parent | 4917383e6f52f0e44f63c60a645f1dd7e8f8d5f9 (diff) | |
| download | wix-8fa040da9d0d3826f5ffda6bcbec4f53abd97452.tar.gz wix-8fa040da9d0d3826f5ffda6bcbec4f53abd97452.tar.bz2 wix-8fa040da9d0d3826f5ffda6bcbec4f53abd97452.zip | |
Allow more customization of control ids in thmutil.
Allow BAFunctions to set control ids.
Make sure control ids don't collide.
Diffstat (limited to 'src/api/burn')
| -rw-r--r-- | src/api/burn/balutil/inc/BAFunctions.h | 18 | ||||
| -rw-r--r-- | src/api/burn/balutil/inc/BalBaseBAFunctions.h | 9 | ||||
| -rw-r--r-- | src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h | 12 | ||||
| -rw-r--r-- | src/api/burn/balutil/inc/IBAFunctions.h | 8 |
4 files changed, 47 insertions, 0 deletions
diff --git a/src/api/burn/balutil/inc/BAFunctions.h b/src/api/burn/balutil/inc/BAFunctions.h index 43786701..2a34aaad 100644 --- a/src/api/burn/balutil/inc/BAFunctions.h +++ b/src/api/burn/balutil/inc/BAFunctions.h | |||
| @@ -85,6 +85,7 @@ enum BA_FUNCTIONS_MESSAGE | |||
| 85 | 85 | ||
| 86 | BA_FUNCTIONS_MESSAGE_ONTHEMELOADED = 1024, | 86 | BA_FUNCTIONS_MESSAGE_ONTHEMELOADED = 1024, |
| 87 | BA_FUNCTIONS_MESSAGE_WNDPROC, | 87 | BA_FUNCTIONS_MESSAGE_WNDPROC, |
| 88 | BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADING, | ||
| 88 | }; | 89 | }; |
| 89 | 90 | ||
| 90 | typedef HRESULT(WINAPI *PFN_BA_FUNCTIONS_PROC)( | 91 | typedef HRESULT(WINAPI *PFN_BA_FUNCTIONS_PROC)( |
| @@ -94,6 +95,10 @@ typedef HRESULT(WINAPI *PFN_BA_FUNCTIONS_PROC)( | |||
| 94 | __in_opt LPVOID pvContext | 95 | __in_opt LPVOID pvContext |
| 95 | ); | 96 | ); |
| 96 | 97 | ||
| 98 | // Should be the same as THEME_FIRST_ASSIGN_CONTROL_ID. | ||
| 99 | // BAFunctions must only assign ids in the range [BAFUNCTIONS_FIRST_ASSIGN_CONTROL_ID, 0x8000) to avoid collisions. | ||
| 100 | const WORD BAFUNCTIONS_FIRST_ASSIGN_CONTROL_ID = 0x4000; | ||
| 101 | |||
| 97 | struct BA_FUNCTIONS_CREATE_ARGS | 102 | struct BA_FUNCTIONS_CREATE_ARGS |
| 98 | { | 103 | { |
| 99 | DWORD cbSize; | 104 | DWORD cbSize; |
| @@ -108,6 +113,19 @@ struct BA_FUNCTIONS_CREATE_RESULTS | |||
| 108 | LPVOID pvBAFunctionsProcContext; | 113 | LPVOID pvBAFunctionsProcContext; |
| 109 | }; | 114 | }; |
| 110 | 115 | ||
| 116 | struct BA_FUNCTIONS_ONTHEMECONTROLLOADING_ARGS | ||
| 117 | { | ||
| 118 | DWORD cbSize; | ||
| 119 | LPCWSTR wzName; | ||
| 120 | }; | ||
| 121 | |||
| 122 | struct BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS | ||
| 123 | { | ||
| 124 | DWORD cbSize; | ||
| 125 | BOOL fProcessed; | ||
| 126 | WORD wId; | ||
| 127 | }; | ||
| 128 | |||
| 111 | struct BA_FUNCTIONS_ONTHEMELOADED_ARGS | 129 | struct BA_FUNCTIONS_ONTHEMELOADED_ARGS |
| 112 | { | 130 | { |
| 113 | DWORD cbSize; | 131 | DWORD cbSize; |
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctions.h b/src/api/burn/balutil/inc/BalBaseBAFunctions.h index a3054709..c2c8a6dc 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctions.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctions.h | |||
| @@ -841,6 +841,15 @@ public: // IBAFunctions | |||
| 841 | return E_NOTIMPL; | 841 | return E_NOTIMPL; |
| 842 | } | 842 | } |
| 843 | 843 | ||
| 844 | virtual STDMETHODIMP OnThemeControlLoading( | ||
| 845 | __in LPCWSTR /*wzName*/, | ||
| 846 | __inout BOOL* /*pfProcessed*/, | ||
| 847 | __inout WORD* /*pwId*/ | ||
| 848 | ) | ||
| 849 | { | ||
| 850 | return S_OK; | ||
| 851 | } | ||
| 852 | |||
| 844 | protected: | 853 | protected: |
| 845 | CBalBaseBAFunctions( | 854 | CBalBaseBAFunctions( |
| 846 | __in HMODULE hModule, | 855 | __in HMODULE hModule, |
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h index 8d1227fc..efe22ddd 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h | |||
| @@ -24,6 +24,15 @@ static HRESULT BalBaseBAFunctionsProcWndProc( | |||
| 24 | return pBAFunctions->WndProc(pArgs->pTheme, pArgs->hWnd, pArgs->uMsg, pArgs->wParam, pArgs->lParam, &pResults->lres); | 24 | return pBAFunctions->WndProc(pArgs->pTheme, pArgs->hWnd, pArgs->uMsg, pArgs->wParam, pArgs->lParam, &pResults->lres); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | static HRESULT BalBaseBAFunctionsProcOnThemeControlLoading( | ||
| 28 | __in IBAFunctions* pBAFunctions, | ||
| 29 | __in BA_FUNCTIONS_ONTHEMECONTROLLOADING_ARGS* pArgs, | ||
| 30 | __inout BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS* pResults | ||
| 31 | ) | ||
| 32 | { | ||
| 33 | return pBAFunctions->OnThemeControlLoading(pArgs->wzName, &pResults->fProcessed, &pResults->wId); | ||
| 34 | } | ||
| 35 | |||
| 27 | /******************************************************************* | 36 | /******************************************************************* |
| 28 | BalBaseBAFunctionsProc - requires pvContext to be of type IBAFunctions. | 37 | BalBaseBAFunctionsProc - requires pvContext to be of type IBAFunctions. |
| 29 | Provides a default mapping between the message based BAFunctions interface and | 38 | Provides a default mapping between the message based BAFunctions interface and |
| @@ -125,6 +134,9 @@ static HRESULT WINAPI BalBaseBAFunctionsProc( | |||
| 125 | case BA_FUNCTIONS_MESSAGE_WNDPROC: | 134 | case BA_FUNCTIONS_MESSAGE_WNDPROC: |
| 126 | hr = BalBaseBAFunctionsProcWndProc(pBAFunctions, reinterpret_cast<BA_FUNCTIONS_WNDPROC_ARGS*>(pvArgs), reinterpret_cast<BA_FUNCTIONS_WNDPROC_RESULTS*>(pvResults)); | 135 | hr = BalBaseBAFunctionsProcWndProc(pBAFunctions, reinterpret_cast<BA_FUNCTIONS_WNDPROC_ARGS*>(pvArgs), reinterpret_cast<BA_FUNCTIONS_WNDPROC_RESULTS*>(pvResults)); |
| 127 | break; | 136 | break; |
| 137 | case BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADING: | ||
| 138 | hr = BalBaseBAFunctionsProcOnThemeControlLoading(pBAFunctions, reinterpret_cast<BA_FUNCTIONS_ONTHEMECONTROLLOADING_ARGS*>(pvArgs), reinterpret_cast<BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS*>(pvResults)); | ||
| 139 | break; | ||
| 128 | } | 140 | } |
| 129 | } | 141 | } |
| 130 | 142 | ||
diff --git a/src/api/burn/balutil/inc/IBAFunctions.h b/src/api/burn/balutil/inc/IBAFunctions.h index 7d8a07fa..d41b7c9b 100644 --- a/src/api/burn/balutil/inc/IBAFunctions.h +++ b/src/api/burn/balutil/inc/IBAFunctions.h | |||
| @@ -31,4 +31,12 @@ DECLARE_INTERFACE_IID_(IBAFunctions, IBootstrapperApplication, "0FB445ED-17BD-49 | |||
| 31 | __inout LPVOID pvResults, | 31 | __inout LPVOID pvResults, |
| 32 | __in_opt LPVOID pvContext | 32 | __in_opt LPVOID pvContext |
| 33 | ) = 0; | 33 | ) = 0; |
| 34 | |||
| 35 | // OnThemeControlLoading - Called while creating a control for the theme. | ||
| 36 | // | ||
| 37 | STDMETHOD(OnThemeControlLoading)( | ||
| 38 | __in LPCWSTR wzName, | ||
| 39 | __inout BOOL* pfProcessed, | ||
| 40 | __inout WORD* pwId | ||
| 41 | ) = 0; | ||
| 34 | }; | 42 | }; |
