https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fc3eeb61f3222524ea072…
commit fc3eeb61f3222524ea072ad3563dcf239c668d6a
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Feb 17 09:53:50 2024 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Feb 17 09:53:50 2024 +0900
[SDK:LIB] Introduce Cicero static library (#6492)
Refactoring and reduce binary size.
JIRA issue: CORE-19268
- Add cicero static library in sdk/lib/cicero folder.
- Delete sdk/include/reactos/cicero folder.
- Adapt the dependencies to these changes.
- Make ctfmon, msutb, and msctf modules UNICODE.
---
base/applications/ctfmon/CMakeLists.txt | 4 +-
base/applications/ctfmon/precomp.h | 4 +-
dll/ime/msctfime/CMakeLists.txt | 2 +-
dll/ime/msctfime/msctfime.h | 13 +-
dll/win32/msctf/CMakeLists.txt | 4 +-
dll/win32/msctf/utils.cpp | 8 +-
dll/win32/msutb/CMakeLists.txt | 4 +-
dll/win32/msutb/msutb.cpp | 21 +-
dll/win32/msutb/precomp.h | 8 +-
sdk/include/reactos/cicero/cicreg.h | 177 --
sdk/lib/CMakeLists.txt | 1 +
sdk/lib/cicero/CMakeLists.txt | 15 +
sdk/lib/cicero/cicarray.cpp | 78 +
sdk/{include/reactos => lib}/cicero/cicarray.h | 73 +-
.../cicero/cicbase.h => lib/cicero/cicbase.cpp} | 240 +--
sdk/lib/cicero/cicbase.h | 133 ++
.../cicero/ciccaret.h => lib/cicero/ciccaret.cpp} | 47 +-
sdk/lib/cicero/ciccaret.h | 32 +
sdk/{include/reactos => lib}/cicero/cicevent.h | 0
.../cicero/cicfmap.h => lib/cicero/cicfmap.cpp} | 64 +-
sdk/lib/cicero/cicfmap.h | 48 +
sdk/lib/cicero/cicimc.cpp | 53 +
sdk/{include/reactos => lib}/cicero/cicimc.h | 41 -
sdk/{include/reactos => lib}/cicero/cicmutex.h | 0
sdk/lib/cicero/cicreg.cpp | 83 +
sdk/lib/cicero/cicreg.h | 116 ++
sdk/{include/reactos => lib}/cicero/cictf.h | 0
.../cicero/cicuif.h => lib/cicero/cicuif.cpp} | 1994 +++++---------------
sdk/lib/cicero/cicuif.h | 1088 +++++++++++
sdk/{include/reactos => lib}/cicero/cicutb.h | 23 +-
sdk/lib/cicero/precomp.h | 6 +
31 files changed, 2269 insertions(+), 2111 deletions(-)
diff --git a/base/applications/ctfmon/CMakeLists.txt
b/base/applications/ctfmon/CMakeLists.txt
index 8ca1d7b5311..8ee72826571 100644
--- a/base/applications/ctfmon/CMakeLists.txt
+++ b/base/applications/ctfmon/CMakeLists.txt
@@ -6,9 +6,9 @@ list(APPEND SOURCE
add_rc_deps(ctfmon.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/ctfmon.ico)
add_executable(ctfmon ${SOURCE} ctfmon.rc)
-set_module_type(ctfmon win32gui)
+set_module_type(ctfmon win32gui UNICODE)
add_dependencies(ctfmon msctf msutb)
-target_link_libraries(ctfmon uuid)
+target_link_libraries(ctfmon uuid cicero)
add_importlibs(ctfmon msctf msutb advapi32 shell32 user32 msvcrt kernel32)
add_pch(ctfmon precomp.h SOURCE)
add_cd_file(TARGET ctfmon DESTINATION reactos/system32 FOR all)
diff --git a/base/applications/ctfmon/precomp.h b/base/applications/ctfmon/precomp.h
index b6ca0bdcb4d..44344559440 100644
--- a/base/applications/ctfmon/precomp.h
+++ b/base/applications/ctfmon/precomp.h
@@ -17,8 +17,8 @@
#include <msctf.h>
#include <ctfutb.h>
#include <ctffunc.h>
-#include <cicero/cicbase.h>
-#include <cicero/cicutb.h>
+#include <cicbase.h>
+#include <cicutb.h>
#include "resource.h"
diff --git a/dll/ime/msctfime/CMakeLists.txt b/dll/ime/msctfime/CMakeLists.txt
index a3955cea141..5a034398964 100644
--- a/dll/ime/msctfime/CMakeLists.txt
+++ b/dll/ime/msctfime/CMakeLists.txt
@@ -16,7 +16,7 @@ add_library(msctfime MODULE
${CMAKE_CURRENT_BINARY_DIR}/msctfime.def)
set_module_type(msctfime win32dll UNICODE)
set_target_properties(msctfime PROPERTIES SUFFIX ".ime")
-target_link_libraries(msctfime wine uuid)
+target_link_libraries(msctfime wine uuid cicero)
add_importlibs(msctfime user32 gdi32 advapi32 msvcrt kernel32 ntdll)
add_delay_importlibs(msctfime comctl32 msctf oleaut32 imm32)
add_cd_file(TARGET msctfime DESTINATION reactos/system32 FOR all)
diff --git a/dll/ime/msctfime/msctfime.h b/dll/ime/msctfime/msctfime.h
index 697aa8da684..040ecc11c96 100644
--- a/dll/ime/msctfime/msctfime.h
+++ b/dll/ime/msctfime/msctfime.h
@@ -24,12 +24,13 @@
#include <shlwapi.h>
#include <strsafe.h>
-#include <cicero/cicbase.h>
-#include <cicero/cicarray.h>
-#include <cicero/cicimc.h>
-#include <cicero/cictf.h>
-#include <cicero/ciccaret.h>
-#include <cicero/cicuif.h>
+#include <cicbase.h>
+#include <cicarray.h>
+#include <cicimc.h>
+#include <cictf.h>
+#include <ciccaret.h>
+#include <cicuif.h>
+#include <cicutb.h>
#include <wine/debug.h>
diff --git a/dll/win32/msctf/CMakeLists.txt b/dll/win32/msctf/CMakeLists.txt
index d8caf9a8e04..a167162dc58 100644
--- a/dll/win32/msctf/CMakeLists.txt
+++ b/dll/win32/msctf/CMakeLists.txt
@@ -29,8 +29,8 @@ add_library(msctf MODULE
version.rc
${CMAKE_CURRENT_BINARY_DIR}/msctf.def)
-set_module_type(msctf win32dll)
-target_link_libraries(msctf uuid wine)
+set_module_type(msctf win32dll UNICODE)
+target_link_libraries(msctf uuid wine cicero)
add_importlibs(msctf user32 advapi32 advapi32_vista msvcrt kernel32 ntdll)
add_delay_importlibs(msctf ole32 oleaut32)
add_pch(msctf precomp.h SOURCE)
diff --git a/dll/win32/msctf/utils.cpp b/dll/win32/msctf/utils.cpp
index 1b26fa92684..4fc57a5ac0d 100644
--- a/dll/win32/msctf/utils.cpp
+++ b/dll/win32/msctf/utils.cpp
@@ -23,9 +23,9 @@
#include <shlwapi.h>
#include <strsafe.h>
-#include <cicero/cicreg.h>
-#include <cicero/cicmutex.h>
-#include <cicero/cicfmap.h>
+#include <cicreg.h>
+#include <cicmutex.h>
+#include <cicfmap.h>
#include <wine/debug.h>
@@ -366,7 +366,7 @@ BOOL InitLangChangeHotKey(VOID)
szLanguage[0] = szLayout[0] = TEXT('3');
szLanguage[1] = szLayout[1] = TEXT('\0');
- error = regKey.Open(HKEY_CURRENT_USER, "Keyboard Layout\\Toggle");
+ error = regKey.Open(HKEY_CURRENT_USER, TEXT("Keyboard Layout\\Toggle"));
if (error == ERROR_SUCCESS)
{
error = regKey.QuerySz(TEXT("Language Hotkey"), szLanguage,
_countof(szLanguage));
diff --git a/dll/win32/msutb/CMakeLists.txt b/dll/win32/msutb/CMakeLists.txt
index ee8204be2ff..c63dbb11cb2 100644
--- a/dll/win32/msutb/CMakeLists.txt
+++ b/dll/win32/msutb/CMakeLists.txt
@@ -11,9 +11,9 @@ add_library(msutb MODULE
${SOURCE}
msutb.rc
${CMAKE_CURRENT_BINARY_DIR}/msutb.def)
-set_module_type(msutb win32dll)
+set_module_type(msutb win32dll UNICODE)
add_dependencies(msutb msctf psdk)
-target_link_libraries(msutb wine uuid atl_classes)
+target_link_libraries(msutb wine uuid atl_classes cicero)
add_importlibs(msutb user32 gdi32 advapi32 msvcrt kernel32 ntdll)
add_delay_importlibs(msutb uxtheme imm32 comctl32 msctf ole32 oleacc oleaut32 shell32)
add_cd_file(TARGET msutb DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/msutb/msutb.cpp b/dll/win32/msutb/msutb.cpp
index c5e3c337614..74c537ede80 100644
--- a/dll/win32/msutb/msutb.cpp
+++ b/dll/win32/msutb/msutb.cpp
@@ -20,7 +20,7 @@ LONG g_DllRefCount = 0;
BOOL g_bWinLogon = FALSE;
BOOL g_fInClosePopupTipbar = FALSE;
HWND g_hwndParent = NULL;
-LIBTHREAD g_libTLS = { NULL, NULL };
+CIC_LIBTHREAD g_libTLS = { NULL, NULL };
#ifdef ENABLE_DESKBAND
BOOL g_bEnableDeskBand = TRUE;
#else
@@ -77,23 +77,6 @@ class CMsUtbModule : public CComModule
CMsUtbModule gModule;
-void TFUninitLib_Thread(LIBTHREAD *libThread)
-{
- if (!libThread)
- return;
-
- if (libThread->m_pUnknown1)
- {
- libThread->m_pUnknown1->Release();
- libThread->m_pUnknown1 = NULL;
- }
- if (libThread->m_pDisplayAttrMgr)
- {
- libThread->m_pDisplayAttrMgr->Release();
- libThread->m_pDisplayAttrMgr = NULL;
- }
-}
-
class CCicLibMenuItem;
class CTipbarAccItem;
class CUTBMenuItem;
@@ -6075,7 +6058,7 @@ BOOL GetTipbarInternal(HWND hWnd, DWORD dwFlags, CDeskBand
*pDeskBand)
*
* @implemented
*/
-EXTERN_C PLIBTHREAD WINAPI
+EXTERN_C PCIC_LIBTHREAD WINAPI
GetLibTls(VOID)
{
TRACE("()\n");
diff --git a/dll/win32/msutb/precomp.h b/dll/win32/msutb/precomp.h
index 53e68d549b5..c2e3415a56d 100644
--- a/dll/win32/msutb/precomp.h
+++ b/dll/win32/msutb/precomp.h
@@ -9,7 +9,6 @@
#include <stdlib.h>
-#define WIN32_NO_STATUS
#define COBJMACROS
#define INITGUID
@@ -25,11 +24,10 @@
#include <atlbase.h>
#include <atlcom.h>
#include <strsafe.h>
-#undef STATUS_NO_MEMORY
#include "resource.h"
-#include <cicero/cicreg.h>
-#include <cicero/cicutb.h>
-#include <cicero/cicuif.h>
+#include <cicreg.h>
+#include <cicutb.h>
+#include <cicuif.h>
#include <wine/debug.h>
diff --git a/sdk/include/reactos/cicero/cicreg.h b/sdk/include/reactos/cicero/cicreg.h
deleted file mode 100644
index b5a99658a15..00000000000
--- a/sdk/include/reactos/cicero/cicreg.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * PROJECT: ReactOS Cicero
- * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
- * PURPOSE: Cicero registry handling
- * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
- */
-
-#pragma once
-
-#include "cicbase.h"
-
-class CicRegKey
-{
-public:
- HKEY m_hKey;
-
- CicRegKey() : m_hKey(NULL) { }
- virtual ~CicRegKey() { Close(); }
-
- operator HKEY() { return m_hKey; }
-
- void Close();
-
- LSTATUS Open(
- HKEY hKey,
- LPCTSTR lpSubKey,
- REGSAM samDesired = KEY_READ);
-
- LSTATUS Create(
- HKEY hKey,
- LPCTSTR lpSubKey,
- LPTSTR lpClass = NULL,
- DWORD dwOptions = REG_OPTION_NON_VOLATILE,
- REGSAM samDesired = KEY_ALL_ACCESS,
- LPSECURITY_ATTRIBUTES lpSecurityAttributes = NULL,
- LPDWORD pdwDisposition = NULL);
-
- LSTATUS QueryDword(LPCTSTR pszValueName, LPDWORD pdwValue)
- {
- DWORD cbData = sizeof(DWORD);
- return ::RegQueryValueEx(m_hKey, pszValueName, 0, NULL, (LPBYTE)pdwValue,
&cbData);
- }
-
- LSTATUS SetDword(LPCTSTR pszValueName, DWORD dwValue)
- {
- return ::RegSetValueEx(m_hKey, pszValueName, 0, REG_DWORD, (LPBYTE)&dwValue,
sizeof(dwValue));
- }
-
- LSTATUS QuerySz(LPCTSTR pszValueName, LPTSTR pszValue, DWORD cchValueMax);
-
- LSTATUS SetSz(LPCTSTR pszValueName, LPCTSTR pszValue)
- {
- DWORD cbValue = (lstrlen(pszValue) + 1) * sizeof(TCHAR);
- return ::RegSetValueEx(m_hKey, pszValueName, 0, REG_SZ, (LPBYTE)pszValue,
cbValue);
- }
- LSTATUS SetSzW(LPCWSTR pszValueName, LPCWSTR pszValue)
- {
- DWORD cbValue = (lstrlenW(pszValue) + 1) * sizeof(WCHAR);
- return ::RegSetValueExW(m_hKey, pszValueName, 0, REG_SZ, (LPBYTE)pszValue,
cbValue);
- }
-
- LSTATUS DeleteSubKey(LPCTSTR lpSubKey)
- {
- return ::RegDeleteKey(m_hKey, lpSubKey);
- }
-
- LSTATUS RecurseDeleteKey(LPCTSTR lpSubKey);
-
- LSTATUS EnumValue(DWORD dwIndex, LPTSTR lpValueName, DWORD cchValueName);
-};
-
-/******************************************************************************/
-
-inline void
-CicRegKey::Close()
-{
- if (!m_hKey)
- return;
-
- ::RegCloseKey(m_hKey);
- m_hKey = NULL;
-}
-
-inline LSTATUS
-CicRegKey::Open(
- HKEY hKey,
- LPCTSTR lpSubKey,
- REGSAM samDesired)
-{
- HKEY hNewKey = NULL;
- LSTATUS error = ::RegOpenKeyEx(hKey, lpSubKey, 0, samDesired, &hNewKey);
- if (error != ERROR_SUCCESS)
- return error;
-
- Close();
- m_hKey = hNewKey;
- return error;
-}
-
-inline LSTATUS
-CicRegKey::Create(
- HKEY hKey,
- LPCTSTR lpSubKey,
- LPTSTR lpClass,
- DWORD dwOptions,
- REGSAM samDesired,
- LPSECURITY_ATTRIBUTES lpSecurityAttributes,
- LPDWORD pdwDisposition)
-{
- HKEY hNewKey = NULL;
- LSTATUS error = ::RegCreateKeyEx(hKey,
- lpSubKey,
- 0,
- lpClass,
- dwOptions,
- samDesired,
- lpSecurityAttributes,
- &hNewKey,
- pdwDisposition);
- if (error != ERROR_SUCCESS)
- return error;
-
- Close();
- m_hKey = hNewKey;
- return error;
-}
-
-inline LSTATUS
-CicRegKey::QuerySz(LPCTSTR pszValueName, LPTSTR pszValue, DWORD cchValueMax)
-{
- DWORD cchSaveMax = cchValueMax;
-
- cchValueMax *= sizeof(TCHAR);
- LSTATUS error = ::RegQueryValueEx(m_hKey, pszValueName, 0, NULL,
- (LPBYTE)pszValue, &cchValueMax);
- if (cchSaveMax > 0)
- pszValue[(error == ERROR_SUCCESS) ? (cchSaveMax - 1) : 0] = UNICODE_NULL;
-
- return error;
-}
-
-inline LSTATUS
-CicRegKey::RecurseDeleteKey(LPCTSTR lpSubKey)
-{
- CicRegKey regKey;
- LSTATUS error = regKey.Open(m_hKey, lpSubKey, KEY_READ | KEY_WRITE);
- if (error != ERROR_SUCCESS)
- return error;
-
- TCHAR szName[MAX_PATH];
- DWORD cchName;
- do
- {
- cchName = _countof(szName);
- error = ::RegEnumKeyEx(regKey, 0, szName, &cchName, NULL, NULL, NULL, NULL);
- if (error != ERROR_SUCCESS)
- break;
-
- szName[_countof(szName) - 1] = UNICODE_NULL;
- error = regKey.RecurseDeleteKey(szName);
- } while (error == ERROR_SUCCESS);
-
- regKey.Close();
-
- return DeleteSubKey(lpSubKey);
-}
-
-inline LSTATUS
-CicRegKey::EnumValue(DWORD dwIndex, LPTSTR lpValueName, DWORD cchValueName)
-{
- DWORD dwSaveLen = cchValueName;
- LSTATUS error = ::RegEnumValue(m_hKey, dwIndex, lpValueName, &cchValueName,
- NULL, NULL, NULL, NULL);
- if (dwSaveLen)
- lpValueName[error == ERROR_SUCCESS ? dwSaveLen - 1 : 0] = 0;
- return error;
-}
diff --git a/sdk/lib/CMakeLists.txt b/sdk/lib/CMakeLists.txt
index 61b051f6193..78958dd3de0 100644
--- a/sdk/lib/CMakeLists.txt
+++ b/sdk/lib/CMakeLists.txt
@@ -6,6 +6,7 @@ add_subdirectory(inflib)
if(CMAKE_CROSSCOMPILING)
add_subdirectory(3rdparty)
+add_subdirectory(cicero)
add_subdirectory(comsupp)
add_subdirectory(conutils)
add_subdirectory(cportlib)
diff --git a/sdk/lib/cicero/CMakeLists.txt b/sdk/lib/cicero/CMakeLists.txt
new file mode 100644
index 00000000000..b2cddda0f9a
--- /dev/null
+++ b/sdk/lib/cicero/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+list(APPEND SOURCE
+ cicarray.cpp
+ cicbase.cpp
+ ciccaret.cpp
+ cicfmap.cpp
+ cicimc.cpp
+ cicreg.cpp
+ cicuif.cpp)
+
+add_library(cicero STATIC ${SOURCE})
+target_compile_definitions(cicero PRIVATE UNICODE _UNICODE)
+add_dependencies(cicero psdk)
+target_include_directories(cicero INTERFACE
+ $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}>)
diff --git a/sdk/lib/cicero/cicarray.cpp b/sdk/lib/cicero/cicarray.cpp
new file mode 100644
index 00000000000..293f2392c47
--- /dev/null
+++ b/sdk/lib/cicero/cicarray.cpp
@@ -0,0 +1,78 @@
+/*
+ * PROJECT: ReactOS Cicero
+ * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
+ * PURPOSE: Cicero dynamic array
+ * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
+ */
+
+#include "precomp.h"
+#include "cicarray.h"
+
+CicArrayBase::CicArrayBase(size_t cbItem)
+{
+ m_cbItem = cbItem;
+ m_pb = NULL;
+ m_cItems = m_cCapacity = 0;
+}
+
+CicArrayBase::~CicArrayBase()
+{
+ cicMemFree(m_pb);
+}
+
+LPVOID CicArrayBase::Append(size_t cGrow)
+{
+ if (!Insert(m_cItems, cGrow))
+ return NULL;
+ return &m_pb[(m_cItems - cGrow) * m_cbItem];
+}
+
+BOOL CicArrayBase::Insert(size_t iItem, size_t cGrow)
+{
+ size_t cNewCapacity = m_cItems + cGrow;
+ if (m_cCapacity < cNewCapacity)
+ {
+ if (cNewCapacity <= m_cItems + m_cItems / 2)
+ cNewCapacity = m_cItems + m_cItems / 2;
+
+ LPBYTE pbNew = (LPBYTE)cicMemReAlloc(m_pb, cNewCapacity * m_cbItem);
+ if (!pbNew)
+ return FALSE;
+
+ m_pb = pbNew;
+ m_cCapacity = cNewCapacity;
+ }
+
+ if (iItem < m_cItems)
+ {
+ MoveMemory(&m_pb[(cGrow + iItem) * m_cbItem],
+ &m_pb[iItem * m_cbItem],
+ (m_cItems - iItem) * m_cbItem);
+ }
+
+ m_cItems += cGrow;
+ return TRUE;
+}
+
+void CicArrayBase::Remove(size_t iItem, size_t cRemove)
+{
+ if (iItem + cRemove < m_cItems)
+ {
+ MoveMemory(&m_pb[iItem * m_cbItem],
+ &m_pb[(iItem + cRemove) * m_cbItem],
+ (m_cItems - iItem - cRemove) * m_cbItem);
+ }
+
+ m_cItems -= cRemove;
+
+ size_t cHalfCapacity = m_cCapacity / 2;
+ if (cHalfCapacity <= m_cItems)
+ return;
+
+ LPBYTE pb = (LPBYTE)cicMemReAlloc(m_pb, cHalfCapacity * m_cbItem);
+ if (pb)
+ {
+ m_pb = pb;
+ m_cCapacity = cHalfCapacity;
+ }
+}
diff --git a/sdk/include/reactos/cicero/cicarray.h b/sdk/lib/cicero/cicarray.h
similarity index 50%
rename from sdk/include/reactos/cicero/cicarray.h
rename to sdk/lib/cicero/cicarray.h
index 2df46e51c26..3a36f8f9b1c 100644
--- a/sdk/include/reactos/cicero/cicarray.h
+++ b/sdk/lib/cicero/cicarray.h
@@ -66,7 +66,7 @@ public:
return TRUE;
}
- ssize_t Find(const T_ITEM& item) const
+ ptrdiff_t Find(const T_ITEM& item) const
{
for (size_t iItem = 0; iItem < m_cItems; ++iItem)
{
@@ -76,74 +76,3 @@ public:
return -1;
}
};
-
-/******************************************************************************/
-
-inline CicArrayBase::CicArrayBase(size_t cbItem)
-{
- m_cbItem = cbItem;
- m_pb = NULL;
- m_cItems = m_cCapacity = 0;
-}
-
-inline CicArrayBase::~CicArrayBase()
-{
- cicMemFree(m_pb);
-}
-
-inline LPVOID CicArrayBase::Append(size_t cGrow)
-{
- if (!Insert(m_cItems, cGrow))
- return NULL;
- return &m_pb[(m_cItems - cGrow) * m_cbItem];
-}
-
-inline BOOL CicArrayBase::Insert(size_t iItem, size_t cGrow)
-{
- size_t cNewCapacity = m_cItems + cGrow;
- if (m_cCapacity < cNewCapacity)
- {
- if (cNewCapacity <= m_cItems + m_cItems / 2)
- cNewCapacity = m_cItems + m_cItems / 2;
-
- LPBYTE pbNew = (LPBYTE)cicMemReAlloc(m_pb, cNewCapacity * m_cbItem);
- if (!pbNew)
- return FALSE;
-
- m_pb = pbNew;
- m_cCapacity = cNewCapacity;
- }
-
- if (iItem < m_cItems)
- {
- MoveMemory(&m_pb[(cGrow + iItem) * m_cbItem],
- &m_pb[iItem * m_cbItem],
- (m_cItems - iItem) * m_cbItem);
- }
-
- m_cItems += cGrow;
- return TRUE;
-}
-
-inline void CicArrayBase::Remove(size_t iItem, size_t cRemove)
-{
- if (iItem + cRemove < m_cItems)
- {
- MoveMemory(&m_pb[iItem * m_cbItem],
- &m_pb[(iItem + cRemove) * m_cbItem],
- (m_cItems - iItem - cRemove) * m_cbItem);
- }
-
- m_cItems -= cRemove;
-
- size_t cHalfCapacity = m_cCapacity / 2;
- if (cHalfCapacity <= m_cItems)
- return;
-
- LPBYTE pb = (LPBYTE)cicMemReAlloc(m_pb, cHalfCapacity * m_cbItem);
- if (pb)
- {
- m_pb = pb;
- m_cCapacity = cHalfCapacity;
- }
-}
diff --git a/sdk/include/reactos/cicero/cicbase.h b/sdk/lib/cicero/cicbase.cpp
similarity index 58%
rename from sdk/include/reactos/cicero/cicbase.h
rename to sdk/lib/cicero/cicbase.cpp
index 25c3710ec77..cf76100e1cd 100644
--- a/sdk/include/reactos/cicero/cicbase.h
+++ b/sdk/lib/cicero/cicbase.cpp
@@ -2,84 +2,84 @@
* PROJECT: ReactOS Cicero
* LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
* PURPOSE: Cicero base
- * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
+ * COPYRIGHT: Copyright 2023-2024 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
*/
-#pragma once
+#include "precomp.h"
+#include "cicbase.h"
+#include <shlwapi.h>
+#include <stdlib.h>
+#include <string.h>
+#include <tchar.h>
+#include <strsafe.h>
-#ifndef __cplusplus
- #error Cicero needs C++.
-#endif
-
-static inline LPVOID cicMemAlloc(SIZE_T size)
-{
- return LocalAlloc(0, size);
-}
-
-static inline LPVOID cicMemAllocClear(SIZE_T size)
-{
- return LocalAlloc(LMEM_ZEROINIT, size);
-}
-
-static inline LPVOID cicMemReAlloc(LPVOID ptr, SIZE_T newSize)
-{
- if (!ptr)
- return LocalAlloc(LMEM_ZEROINIT, newSize);
- return LocalReAlloc(ptr, newSize, LMEM_ZEROINIT);
-}
-
-static inline void cicMemFree(LPVOID ptr)
-{
- if (ptr)
- LocalFree(ptr);
-}
-
-struct CicNoThrow { };
-#define cicNoThrow CicNoThrow{}
-
-inline void* operator new(size_t size, const CicNoThrow&) noexcept
+void* operator new(size_t size, const CicNoThrow&) noexcept
{
return cicMemAllocClear(size);
}
-inline void* operator new[](size_t size, const CicNoThrow&) noexcept
+void* operator new[](size_t size, const CicNoThrow&) noexcept
{
return cicMemAllocClear(size);
}
-inline void operator delete(void* ptr) noexcept
+void operator delete(void* ptr) noexcept
{
cicMemFree(ptr);
}
-inline void operator delete[](void* ptr) noexcept
+void operator delete[](void* ptr) noexcept
{
cicMemFree(ptr);
}
-inline void operator delete(void* ptr, size_t size) noexcept
+void operator delete(void* ptr, size_t size) noexcept
{
cicMemFree(ptr);
}
-inline void operator delete[](void* ptr, size_t size) noexcept
+void operator delete[](void* ptr, size_t size) noexcept
{
cicMemFree(ptr);
}
-typedef struct CIC_LIBTHREAD
+// FIXME
+typedef enum _PROCESSINFOCLASS
+{
+ ProcessBasicInformation = 0,
+ ProcessDebugPort = 7,
+ ProcessWow64Information = 26,
+ ProcessImageFileName = 27,
+ ProcessBreakOnTermination = 29
+} PROCESSINFOCLASS;
+
+// FIXME
+typedef LONG NTSTATUS;
+
+/* ntdll!NtQueryInformationProcess */
+typedef NTSTATUS (WINAPI *FN_NtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID,
ULONG, PULONG);
+
+EXTERN_C
+BOOL cicIsWow64(VOID)
{
- IUnknown *m_pUnknown1;
- ITfDisplayAttributeMgr *m_pDisplayAttrMgr;
-} CIC_LIBTHREAD, *PCIC_LIBTHREAD;
+ static FN_NtQueryInformationProcess s_fnNtQueryInformationProcess = NULL;
+ ULONG_PTR Value;
-/* The flags of cicGetOSInfo() */
-#define CIC_OSINFO_NT 0x01
-#define CIC_OSINFO_2KPLUS 0x02
-#define CIC_OSINFO_95 0x04
-#define CIC_OSINFO_98PLUS 0x08
-#define CIC_OSINFO_CJK 0x10
-#define CIC_OSINFO_IMM 0x20
-#define CIC_OSINFO_DBCS 0x40
-#define CIC_OSINFO_XPPLUS 0x80
+ if (!s_fnNtQueryInformationProcess)
+ {
+ HMODULE hNTDLL = cicGetSystemModuleHandle(TEXT("ntdll.dll"), FALSE);
+ if (!hNTDLL)
+ return FALSE;
-static inline void
-cicGetOSInfo(LPUINT puACP, LPDWORD pdwOSInfo)
+ s_fnNtQueryInformationProcess =
+ (FN_NtQueryInformationProcess)GetProcAddress(hNTDLL,
"NtQueryInformationProcess");
+ if (!s_fnNtQueryInformationProcess)
+ return FALSE;
+ }
+
+ Value = 0;
+ s_fnNtQueryInformationProcess(GetCurrentProcess(), ProcessWow64Information,
+ &Value, sizeof(Value), NULL);
+ return !!Value;
+}
+
+EXTERN_C
+void cicGetOSInfo(LPUINT puACP, LPDWORD pdwOSInfo)
{
*pdwOSInfo = 0;
@@ -124,22 +124,9 @@ cicGetOSInfo(LPUINT puACP, LPDWORD pdwOSInfo)
*pdwOSInfo |= CIC_OSINFO_DBCS;
}
-struct CicSystemModulePath
-{
- TCHAR m_szPath[MAX_PATH + 2];
- SIZE_T m_cchPath;
-
- CicSystemModulePath()
- {
- m_szPath[0] = UNICODE_NULL;
- m_cchPath = 0;
- }
-
- BOOL Init(_In_ LPCTSTR pszFileName, _In_ BOOL bSysWinDir);
-};
-
// Get an instance handle that is already loaded
-static inline HINSTANCE
+EXTERN_C
+HINSTANCE
cicGetSystemModuleHandle(
_In_ LPCTSTR pszFileName,
_In_ BOOL bSysWinDir)
@@ -151,7 +138,8 @@ cicGetSystemModuleHandle(
}
// Load a system library
-static inline HINSTANCE
+EXTERN_C
+HINSTANCE
cicLoadSystemLibrary(
_In_ LPCTSTR pszFileName,
_In_ BOOL bSysWinDir)
@@ -162,54 +150,7 @@ cicLoadSystemLibrary(
return ::LoadLibrary(ModPath.m_szPath);
}
-template <typename T_FN>
-static inline BOOL
-cicGetFN(HINSTANCE& hinstDLL, T_FN& fn, LPCTSTR pszDllName, LPCSTR pszFuncName)
-{
- if (fn)
- return TRUE;
- if (!hinstDLL)
- hinstDLL = cicLoadSystemLibrary(pszDllName, FALSE);
- if (!hinstDLL)
- return FALSE;
- fn = reinterpret_cast<T_FN>(GetProcAddress(hinstDLL, pszFuncName));
- return !!fn;
-}
-
-#include <ndk/pstypes.h> /* for PROCESSINFOCLASS */
-
-/* ntdll!NtQueryInformationProcess */
-typedef NTSTATUS (WINAPI *FN_NtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID,
ULONG, PULONG);
-
-/* Is the current process on WoW64? */
-static inline BOOL cicIsWow64(VOID)
-{
- static FN_NtQueryInformationProcess s_fnNtQueryInformationProcess = NULL;
- ULONG_PTR Value;
- NTSTATUS Status;
-
- if (!s_fnNtQueryInformationProcess)
- {
- HMODULE hNTDLL = cicGetSystemModuleHandle(TEXT("ntdll.dll"), FALSE);
- if (!hNTDLL)
- return FALSE;
-
- s_fnNtQueryInformationProcess =
- (FN_NtQueryInformationProcess)GetProcAddress(hNTDLL,
"NtQueryInformationProcess");
- if (!s_fnNtQueryInformationProcess)
- return FALSE;
- }
-
- Value = 0;
- Status = s_fnNtQueryInformationProcess(GetCurrentProcess(), ProcessWow64Information,
- &Value, sizeof(Value), NULL);
- if (!NT_SUCCESS(Status))
- return FALSE;
-
- return !!Value;
-}
-
-inline BOOL
+BOOL
CicSystemModulePath::Init(
_In_ LPCTSTR pszFileName,
_In_ BOOL bSysWinDir)
@@ -251,15 +192,7 @@ Failure:
return FALSE;
}
-// ole32!CoCreateInstance
-typedef HRESULT (WINAPI *FN_CoCreateInstance)(
- REFCLSID rclsid,
- LPUNKNOWN pUnkOuter,
- DWORD dwClsContext,
- REFIID iid,
- LPVOID *ppv);
-
-static inline FN_CoCreateInstance
+static FN_CoCreateInstance
_cicGetSetUserCoCreateInstance(FN_CoCreateInstance fnUserCoCreateInstance)
{
static FN_CoCreateInstance s_fn = NULL;
@@ -268,13 +201,14 @@ _cicGetSetUserCoCreateInstance(FN_CoCreateInstance
fnUserCoCreateInstance)
return s_fn;
}
-static inline HRESULT
+EXTERN_C
+HRESULT
cicRealCoCreateInstance(
- REFCLSID rclsid,
- LPUNKNOWN pUnkOuter,
- DWORD dwClsContext,
- REFIID iid,
- LPVOID *ppv)
+ _In_ REFCLSID rclsid,
+ _In_ LPUNKNOWN pUnkOuter,
+ _In_ DWORD dwClsContext,
+ _In_ REFIID iid,
+ _Out_ LPVOID *ppv)
{
static HINSTANCE s_hOle32 = NULL;
static FN_CoCreateInstance s_fnCoCreateInstance = NULL;
@@ -293,13 +227,13 @@ cicRealCoCreateInstance(
/**
* @implemented
*/
-static inline HRESULT
+HRESULT
cicCoCreateInstance(
- REFCLSID rclsid,
- LPUNKNOWN pUnkOuter,
- DWORD dwClsContext,
- REFIID iid,
- LPVOID *ppv)
+ _In_ REFCLSID rclsid,
+ _In_ LPUNKNOWN pUnkOuter,
+ _In_ DWORD dwClsContext,
+ _In_ REFIID iid,
+ _Out_ LPVOID *ppv)
{
// NOTE: It looks like Cicero wants to hook CoCreateInstance
FN_CoCreateInstance fnUserCoCreateInstance = _cicGetSetUserCoCreateInstance(NULL);
@@ -312,8 +246,9 @@ cicCoCreateInstance(
/**
* @implemented
*/
-static inline BOOL
-TFInitLib(FN_CoCreateInstance fnCoCreateInstance = NULL)
+EXTERN_C
+BOOL
+TFInitLib(FN_CoCreateInstance fnCoCreateInstance)
{
if (fnCoCreateInstance)
_cicGetSetUserCoCreateInstance(fnCoCreateInstance);
@@ -323,30 +258,9 @@ TFInitLib(FN_CoCreateInstance fnCoCreateInstance = NULL)
/**
* @unimplemented
*/
-static inline VOID
+EXTERN_C
+VOID
TFUninitLib(VOID)
{
//FIXME
}
-
-/**
- * @implemented
- */
-static inline VOID
-TFUninitLib_Thread(PCIC_LIBTHREAD pLibThread)
-{
- if (!pLibThread)
- return;
-
- if (pLibThread->m_pUnknown1)
- {
- pLibThread->m_pUnknown1->Release();
- pLibThread->m_pUnknown1 = NULL;
- }
-
- if (pLibThread->m_pDisplayAttrMgr)
- {
- pLibThread->m_pDisplayAttrMgr->Release();
- pLibThread->m_pDisplayAttrMgr = NULL;
- }
-}
diff --git a/sdk/lib/cicero/cicbase.h b/sdk/lib/cicero/cicbase.h
new file mode 100644
index 00000000000..36a143fc9b9
--- /dev/null
+++ b/sdk/lib/cicero/cicbase.h
@@ -0,0 +1,133 @@
+/*
+ * PROJECT: ReactOS Cicero
+ * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
+ * PURPOSE: Cicero base
+ * COPYRIGHT: Copyright 2023-2024 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
+ */
+
+#pragma once
+
+static inline LPVOID cicMemAlloc(SIZE_T size)
+{
+ return LocalAlloc(0, size);
+}
+
+static inline LPVOID cicMemAllocClear(SIZE_T size)
+{
+ return LocalAlloc(LMEM_ZEROINIT, size);
+}
+
+static inline LPVOID cicMemReAlloc(LPVOID ptr, SIZE_T newSize)
+{
+ if (!ptr)
+ return LocalAlloc(LMEM_ZEROINIT, newSize);
+ return LocalReAlloc(ptr, newSize, LMEM_ZEROINIT);
+}
+
+static inline void cicMemFree(LPVOID ptr)
+{
+ if (ptr)
+ LocalFree(ptr);
+}
+
+struct CicNoThrow { };
+#define cicNoThrow CicNoThrow{}
+
+void* operator new(size_t size, const CicNoThrow&) noexcept;
+void* operator new[](size_t size, const CicNoThrow&) noexcept;
+void operator delete(void* ptr) noexcept;
+void operator delete[](void* ptr) noexcept;
+void operator delete(void* ptr, size_t size) noexcept;
+void operator delete[](void* ptr, size_t size) noexcept;
+
+/* The flags of cicGetOSInfo() */
+#define CIC_OSINFO_NT 0x01
+#define CIC_OSINFO_2KPLUS 0x02
+#define CIC_OSINFO_95 0x04
+#define CIC_OSINFO_98PLUS 0x08
+#define CIC_OSINFO_CJK 0x10
+#define CIC_OSINFO_IMM 0x20
+#define CIC_OSINFO_DBCS 0x40
+#define CIC_OSINFO_XPPLUS 0x80
+
+EXTERN_C
+void cicGetOSInfo(LPUINT puACP, LPDWORD pdwOSInfo);
+
+#ifdef __cplusplus
+struct CicSystemModulePath
+{
+ TCHAR m_szPath[MAX_PATH + 2];
+ SIZE_T m_cchPath;
+
+ CicSystemModulePath()
+ {
+ m_szPath[0] = UNICODE_NULL;
+ m_cchPath = 0;
+ }
+
+ BOOL Init(_In_ LPCTSTR pszFileName, _In_ BOOL bSysWinDir);
+};
+#endif
+
+// Get an instance handle that is already loaded
+EXTERN_C
+HINSTANCE
+cicGetSystemModuleHandle(
+ _In_ LPCTSTR pszFileName,
+ _In_ BOOL bSysWinDir);
+
+// Load a system library
+EXTERN_C
+HINSTANCE
+cicLoadSystemLibrary(
+ _In_ LPCTSTR pszFileName,
+ _In_ BOOL bSysWinDir);
+
+#ifdef __cplusplus
+template <typename T_FN>
+static inline BOOL
+cicGetFN(HINSTANCE& hinstDLL, T_FN& fn, LPCTSTR pszDllName, LPCSTR pszFuncName)
+{
+ if (fn)
+ return TRUE;
+ if (!hinstDLL)
+ hinstDLL = cicLoadSystemLibrary(pszDllName, FALSE);
+ if (!hinstDLL)
+ return FALSE;
+ fn = reinterpret_cast<T_FN>(GetProcAddress(hinstDLL, pszFuncName));
+ return !!fn;
+}
+#endif
+
+/* Is the current process on WoW64? */
+EXTERN_C
+BOOL cicIsWow64(VOID);
+
+EXTERN_C
+HRESULT
+cicRealCoCreateInstance(
+ _In_ REFCLSID rclsid,
+ _In_ LPUNKNOWN pUnkOuter,
+ _In_ DWORD dwClsContext,
+ _In_ REFIID iid,
+ _Out_ LPVOID *ppv);
+
+EXTERN_C
+HRESULT
+cicCoCreateInstance(
+ _In_ REFCLSID rclsid,
+ _In_ LPUNKNOWN pUnkOuter,
+ _In_ DWORD dwClsContext,
+ _In_ REFIID iid,
+ _Out_ LPVOID *ppv);
+
+// ole32!CoCreateInstance
+typedef HRESULT (WINAPI *FN_CoCreateInstance)(
+ REFCLSID rclsid,
+ LPUNKNOWN pUnkOuter,
+ DWORD dwClsContext,
+ REFIID iid,
+ LPVOID *ppv);
+
+EXTERN_C BOOL TFInitLib(FN_CoCreateInstance fnCoCreateInstance = NULL);
+EXTERN_C VOID TFUninitLib(VOID);
diff --git a/sdk/include/reactos/cicero/ciccaret.h b/sdk/lib/cicero/ciccaret.cpp
similarity index 63%
rename from sdk/include/reactos/cicero/ciccaret.h
rename to sdk/lib/cicero/ciccaret.cpp
index b6d7722d58f..ff7e7ea16f3 100644
--- a/sdk/include/reactos/cicero/ciccaret.h
+++ b/sdk/lib/cicero/ciccaret.cpp
@@ -5,38 +5,13 @@
* COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
*/
-#pragma once
-
-class CicCaret
-{
-protected:
- HWND m_hWnd;
- UINT m_uCaretBlinkTimerID;
- POINT m_pt;
- SIZE m_size;
- BOOL m_bCaretBlinking;
- BOOL m_bCaretVisible;
-
-public:
- enum { TIMER_ID = 0x4F83AF91 };
- CicCaret();
- virtual ~CicCaret();
-
- void CreateCaret(HWND hWnd, SIZE size);
- void DestroyCaret();
- void HideCaret();
- void InvertCaret();
- void OnTimer();
- void SetCaretPos(POINT pt);
- void SetBlinking(BOOL bBlinking);
-};
-
-/***********************************************************************/
+#include "precomp.h"
+#include "ciccaret.h"
/**
* @implemented
*/
-inline CicCaret::CicCaret()
+CicCaret::CicCaret()
{
m_bCaretBlinking = FALSE;
m_bCaretVisible = FALSE;
@@ -48,7 +23,7 @@ inline CicCaret::CicCaret()
/**
* @implemented
*/
-inline CicCaret::~CicCaret()
+CicCaret::~CicCaret()
{
HideCaret();
::KillTimer(m_hWnd, m_uCaretBlinkTimerID);
@@ -58,7 +33,7 @@ inline CicCaret::~CicCaret()
/**
* @implemented
*/
-inline void CicCaret::CreateCaret(HWND hWnd, SIZE size)
+void CicCaret::CreateCaret(HWND hWnd, SIZE size)
{
m_hWnd = hWnd;
m_size = size;
@@ -69,7 +44,7 @@ inline void CicCaret::CreateCaret(HWND hWnd, SIZE size)
/**
* @implemented
*/
-inline void CicCaret::DestroyCaret()
+void CicCaret::DestroyCaret()
{
HideCaret();
::KillTimer(m_hWnd, m_uCaretBlinkTimerID);
@@ -79,7 +54,7 @@ inline void CicCaret::DestroyCaret()
/**
* @implemented
*/
-inline void CicCaret::HideCaret()
+void CicCaret::HideCaret()
{
if (m_bCaretVisible)
{
@@ -92,7 +67,7 @@ inline void CicCaret::HideCaret()
/**
* @implemented
*/
-inline void CicCaret::InvertCaret()
+void CicCaret::InvertCaret()
{
HDC hDC = ::GetDC(m_hWnd);
::PatBlt(hDC, m_pt.x, m_pt.y, m_size.cx, m_size.cy, DSTINVERT);
@@ -102,7 +77,7 @@ inline void CicCaret::InvertCaret()
/**
* @implemented
*/
-inline void CicCaret::OnTimer()
+void CicCaret::OnTimer()
{
if (m_bCaretBlinking)
{
@@ -114,7 +89,7 @@ inline void CicCaret::OnTimer()
/**
* @implemented
*/
-inline void CicCaret::SetCaretPos(POINT pt)
+void CicCaret::SetCaretPos(POINT pt)
{
BOOL bCaretVisible = m_bCaretVisible;
if (bCaretVisible)
@@ -129,7 +104,7 @@ inline void CicCaret::SetCaretPos(POINT pt)
/**
* @implemented
*/
-inline void CicCaret::SetBlinking(BOOL bBlinking)
+void CicCaret::SetBlinking(BOOL bBlinking)
{
m_bCaretBlinking = bBlinking;
}
diff --git a/sdk/lib/cicero/ciccaret.h b/sdk/lib/cicero/ciccaret.h
new file mode 100644
index 00000000000..09044ee4884
--- /dev/null
+++ b/sdk/lib/cicero/ciccaret.h
@@ -0,0 +1,32 @@
+/*
+ * PROJECT: ReactOS Cicero
+ * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
+ * PURPOSE: Displaying Cicero caret
+ * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
+ */
+
+#pragma once
+
+class CicCaret
+{
+protected:
+ HWND m_hWnd;
+ UINT m_uCaretBlinkTimerID;
+ POINT m_pt;
+ SIZE m_size;
+ BOOL m_bCaretBlinking;
+ BOOL m_bCaretVisible;
+
+public:
+ enum { TIMER_ID = 0x4F83AF91 };
+ CicCaret();
+ virtual ~CicCaret();
+
+ void CreateCaret(HWND hWnd, SIZE size);
+ void DestroyCaret();
+ void HideCaret();
+ void InvertCaret();
+ void OnTimer();
+ void SetCaretPos(POINT pt);
+ void SetBlinking(BOOL bBlinking);
+};
diff --git a/sdk/include/reactos/cicero/cicevent.h b/sdk/lib/cicero/cicevent.h
similarity index 100%
rename from sdk/include/reactos/cicero/cicevent.h
rename to sdk/lib/cicero/cicevent.h
diff --git a/sdk/include/reactos/cicero/cicfmap.h b/sdk/lib/cicero/cicfmap.cpp
similarity index 61%
rename from sdk/include/reactos/cicero/cicfmap.h
rename to sdk/lib/cicero/cicfmap.cpp
index 3c711fc1e75..703d157aa81 100644
--- a/sdk/include/reactos/cicero/cicfmap.h
+++ b/sdk/lib/cicero/cicfmap.cpp
@@ -5,51 +5,9 @@
* COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
*/
-#pragma once
+#include "precomp.h"
+#include "cicfmap.h"
-#include "cicmutex.h"
-
-// class CicFileMappingStatic;
-// class CicFileMapping;
-
-class CicFileMappingStatic
-{
-protected:
- LPCTSTR m_pszName;
- LPVOID m_pView;
- HANDLE m_hMapping;
- BOOL m_bCreated;
- BOOL m_bHasMutex;
- CicMutex *m_pMutex;
-
- LPVOID _Map();
-
-public:
- CicFileMappingStatic() { }
- ~CicFileMappingStatic() { }
-
- void Init(LPCTSTR pszName, CicMutex *pMutex);
-
- LPVOID Create(LPSECURITY_ATTRIBUTES pSA, DWORD dwMaximumSizeLow, LPBOOL
pbAlreadyExists);
- LPVOID Open();
- void Close();
-
- BOOL Enter();
- void Leave();
- BOOL Flush(SIZE_T dwNumberOfBytesToFlush);
- void Finalize();
-};
-
-class CicFileMapping : public CicFileMappingStatic
-{
-public:
- CicFileMapping(LPCTSTR pszName, CicMutex *pMutex);
- virtual ~CicFileMapping() { Finalize(); }
-};
-
-/******************************************************************************/
-
-inline
CicFileMapping::CicFileMapping(LPCTSTR pszName, CicMutex *pMutex)
{
m_pszName = NULL;
@@ -61,7 +19,7 @@ CicFileMapping::CicFileMapping(LPCTSTR pszName, CicMutex *pMutex)
Init(pszName, pMutex);
}
-inline void CicFileMappingStatic::Close()
+void CicFileMappingStatic::Close()
{
if (m_pView)
{
@@ -78,7 +36,7 @@ inline void CicFileMappingStatic::Close()
m_bCreated = FALSE;
}
-inline void CicFileMappingStatic::Init(LPCTSTR pszName, CicMutex *pMutex)
+void CicFileMappingStatic::Init(LPCTSTR pszName, CicMutex *pMutex)
{
if (pMutex)
m_pMutex = pMutex;
@@ -88,7 +46,7 @@ inline void CicFileMappingStatic::Init(LPCTSTR pszName, CicMutex
*pMutex)
m_bHasMutex = (pMutex != NULL);
}
-inline LPVOID
+LPVOID
CicFileMappingStatic::Create(
LPSECURITY_ATTRIBUTES pSA,
DWORD dwMaximumSizeLow,
@@ -112,7 +70,7 @@ CicFileMappingStatic::Create(
return _Map();
}
-inline LPVOID CicFileMappingStatic::Open()
+LPVOID CicFileMappingStatic::Open()
{
if (!m_pszName)
return NULL;
@@ -123,7 +81,7 @@ inline LPVOID CicFileMappingStatic::Open()
return _Map();
}
-inline LPVOID CicFileMappingStatic::_Map()
+LPVOID CicFileMappingStatic::_Map()
{
m_pView = ::MapViewOfFile(m_hMapping, FILE_MAP_WRITE, 0, 0, 0);
if (!m_pView)
@@ -134,28 +92,28 @@ inline LPVOID CicFileMappingStatic::_Map()
return m_pView;
}
-inline BOOL CicFileMappingStatic::Enter()
+BOOL CicFileMappingStatic::Enter()
{
if (!m_bHasMutex)
return TRUE;
return m_pMutex->Enter();
}
-inline void CicFileMappingStatic::Leave()
+void CicFileMappingStatic::Leave()
{
if (!m_bHasMutex)
return;
m_pMutex->Leave();
}
-inline BOOL CicFileMappingStatic::Flush(SIZE_T dwNumberOfBytesToFlush)
+BOOL CicFileMappingStatic::Flush(SIZE_T dwNumberOfBytesToFlush)
{
if (!m_pView)
return FALSE;
return ::FlushViewOfFile(m_pView, dwNumberOfBytesToFlush);
}
-inline void CicFileMappingStatic::Finalize()
+void CicFileMappingStatic::Finalize()
{
if (!m_bHasMutex)
return;
diff --git a/sdk/lib/cicero/cicfmap.h b/sdk/lib/cicero/cicfmap.h
new file mode 100644
index 00000000000..4469f838910
--- /dev/null
+++ b/sdk/lib/cicero/cicfmap.h
@@ -0,0 +1,48 @@
+/*
+ * PROJECT: ReactOS Cicero
+ * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
+ * PURPOSE: Cicero file mapping
+ * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
+ */
+
+#pragma once
+
+#include "cicmutex.h"
+
+// class CicFileMappingStatic;
+// class CicFileMapping;
+
+class CicFileMappingStatic
+{
+protected:
+ LPCTSTR m_pszName;
+ LPVOID m_pView;
+ HANDLE m_hMapping;
+ BOOL m_bCreated;
+ BOOL m_bHasMutex;
+ CicMutex *m_pMutex;
+
+ LPVOID _Map();
+
+public:
+ CicFileMappingStatic() { }
+ ~CicFileMappingStatic() { }
+
+ void Init(LPCTSTR pszName, CicMutex *pMutex);
+
+ LPVOID Create(LPSECURITY_ATTRIBUTES pSA, DWORD dwMaximumSizeLow, LPBOOL
pbAlreadyExists);
+ LPVOID Open();
+ void Close();
+
+ BOOL Enter();
+ void Leave();
+ BOOL Flush(SIZE_T dwNumberOfBytesToFlush);
+ void Finalize();
+};
+
+class CicFileMapping : public CicFileMappingStatic
+{
+public:
+ CicFileMapping(LPCTSTR pszName, CicMutex *pMutex);
+ virtual ~CicFileMapping() { Finalize(); }
+};
diff --git a/sdk/lib/cicero/cicimc.cpp b/sdk/lib/cicero/cicimc.cpp
new file mode 100644
index 00000000000..41af20cdb81
--- /dev/null
+++ b/sdk/lib/cicero/cicimc.cpp
@@ -0,0 +1,53 @@
+/*
+ * PROJECT: ReactOS Cicero
+ * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
+ * PURPOSE: Locking and Unlocking IMC and IMCC handles
+ * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
+ */
+
+#include "precomp.h"
+#include <imm.h>
+#include <immdev.h>
+#include <imm32_undoc.h>
+#include "cicimc.h"
+
+#define CUSTOM_CAND_INFO_SIZE 1964
+
+BOOL CicIMCLock::ClearCand()
+{
+ HIMCC hNewCandInfo, hCandInfo = m_pIC->hCandInfo;
+ if (hCandInfo)
+ {
+ hNewCandInfo = ImmReSizeIMCC(hCandInfo, CUSTOM_CAND_INFO_SIZE);
+ if (!hNewCandInfo)
+ {
+ ImmDestroyIMCC(m_pIC->hCandInfo);
+ m_pIC->hCandInfo = ImmCreateIMCC(CUSTOM_CAND_INFO_SIZE);
+ return FALSE;
+ }
+ }
+ else
+ {
+ hNewCandInfo = ImmCreateIMCC(CUSTOM_CAND_INFO_SIZE);
+ }
+
+ m_pIC->hCandInfo = hNewCandInfo;
+ if (!m_pIC->hCandInfo)
+ return FALSE;
+
+ CicIMCCLock<CANDIDATEINFO> candInfo(m_pIC->hCandInfo);
+ if (!candInfo)
+ {
+ ImmDestroyIMCC(m_pIC->hCandInfo);
+ m_pIC->hCandInfo = ImmCreateIMCC(CUSTOM_CAND_INFO_SIZE);
+ return FALSE;
+ }
+
+ candInfo.get().dwSize = CUSTOM_CAND_INFO_SIZE;
+ candInfo.get().dwCount = 0;
+ candInfo.get().dwOffset[0] = sizeof(CANDIDATEINFO);
+
+ // FIXME: Something is trailing after CANDIDATEINFO...
+
+ return TRUE;
+}
diff --git a/sdk/include/reactos/cicero/cicimc.h b/sdk/lib/cicero/cicimc.h
similarity index 77%
rename from sdk/include/reactos/cicero/cicimc.h
rename to sdk/lib/cicero/cicimc.h
index 4f0e6c73e0a..779884abfdd 100644
--- a/sdk/include/reactos/cicero/cicimc.h
+++ b/sdk/lib/cicero/cicimc.h
@@ -183,44 +183,3 @@ protected:
return ::ImmUnlockIMC(hIMC) ? S_OK : E_FAIL;
}
};
-
-#define CUSTOM_CAND_INFO_SIZE 1964
-
-inline BOOL CicIMCLock::ClearCand()
-{
- HIMCC hNewCandInfo, hCandInfo = m_pIC->hCandInfo;
- if (hCandInfo)
- {
- hNewCandInfo = ImmReSizeIMCC(hCandInfo, CUSTOM_CAND_INFO_SIZE);
- if (!hNewCandInfo)
- {
- ImmDestroyIMCC(m_pIC->hCandInfo);
- m_pIC->hCandInfo = ImmCreateIMCC(CUSTOM_CAND_INFO_SIZE);
- return FALSE;
- }
- }
- else
- {
- hNewCandInfo = ImmCreateIMCC(CUSTOM_CAND_INFO_SIZE);
- }
-
- m_pIC->hCandInfo = hNewCandInfo;
- if (!m_pIC->hCandInfo)
- return FALSE;
-
- CicIMCCLock<CANDIDATEINFO> candInfo(m_pIC->hCandInfo);
- if (!candInfo)
- {
- ImmDestroyIMCC(m_pIC->hCandInfo);
- m_pIC->hCandInfo = ImmCreateIMCC(CUSTOM_CAND_INFO_SIZE);
- return FALSE;
- }
-
- candInfo.get().dwSize = CUSTOM_CAND_INFO_SIZE;
- candInfo.get().dwCount = 0;
- candInfo.get().dwOffset[0] = sizeof(CANDIDATEINFO);
-
- // FIXME: Something is trailing after CANDIDATEINFO...
-
- return TRUE;
-}
diff --git a/sdk/include/reactos/cicero/cicmutex.h b/sdk/lib/cicero/cicmutex.h
similarity index 100%
rename from sdk/include/reactos/cicero/cicmutex.h
rename to sdk/lib/cicero/cicmutex.h
diff --git a/sdk/lib/cicero/cicreg.cpp b/sdk/lib/cicero/cicreg.cpp
new file mode 100644
index 00000000000..fff4a64a6a8
--- /dev/null
+++ b/sdk/lib/cicero/cicreg.cpp
@@ -0,0 +1,83 @@
+/*
+ * PROJECT: ReactOS Cicero
+ * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
+ * PURPOSE: Cicero registry handling
+ * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
+ */
+
+#include "precomp.h"
+#include <cicreg.h>
+
+EXTERN_C LSTATUS
+_cicRegKey_Open(CicRegKey& self, HKEY hKey, LPCTSTR lpSubKey, REGSAM samDesired)
+{
+ HKEY hNewKey;
+ LSTATUS error = ::RegOpenKeyEx(hKey, lpSubKey, 0, samDesired, &hNewKey);
+ if (error != ERROR_SUCCESS)
+ return error;
+
+ self.Close();
+ self.m_hKey = hNewKey;
+ return error;
+}
+
+EXTERN_C LSTATUS
+_cicRegKey_Create(CicRegKey& self, HKEY hKey, LPCTSTR lpSubKey)
+{
+ HKEY hNewKey;
+ LSTATUS error = ::RegCreateKeyEx(hKey, lpSubKey, 0, NULL, REG_OPTION_NON_VOLATILE,
+ KEY_ALL_ACCESS, NULL, &hNewKey, NULL);
+ if (error != ERROR_SUCCESS)
+ return error;
+
+ self.Close();
+ self.m_hKey = hNewKey;
+ return error;
+}
+
+EXTERN_C LSTATUS
+_cicRegKey_EnumValue(CicRegKey& self, DWORD dwIndex, LPTSTR lpValueName, DWORD
cchValueName)
+{
+ DWORD dwSaveLen = cchValueName;
+ LSTATUS error = ::RegEnumValue(self.m_hKey, dwIndex, lpValueName, &cchValueName,
+ NULL, NULL, NULL, NULL);
+ if (dwSaveLen)
+ lpValueName[error == ERROR_SUCCESS ? dwSaveLen - 1 : 0] = 0;
+ return error;
+}
+
+EXTERN_C LSTATUS
+_cicRegKey_QuerySz(CicRegKey& self, LPCTSTR pszValueName, LPTSTR pszValue, DWORD
cchValueMax)
+{
+ DWORD cbValueMax = cchValueMax * sizeof(TCHAR);
+ LSTATUS error = ::RegQueryValueEx(self.m_hKey, pszValueName, 0, NULL,
(LPBYTE)pszValue, &cbValueMax);
+ if (cchValueMax > 0)
+ pszValue[(error == ERROR_SUCCESS) ? (cchValueMax - 1) : 0] = UNICODE_NULL;
+ return error;
+}
+
+EXTERN_C LSTATUS
+_cicRegKey_RecurseDeleteKey(CicRegKey& self, LPCTSTR lpSubKey)
+{
+ CicRegKey regKey;
+ LSTATUS error = regKey.Open(self.m_hKey, lpSubKey, KEY_READ | KEY_WRITE);
+ if (error != ERROR_SUCCESS)
+ return error;
+
+ TCHAR szName[MAX_PATH];
+ DWORD cchName;
+ do
+ {
+ cchName = _countof(szName);
+ error = ::RegEnumKeyEx(regKey, 0, szName, &cchName, NULL, NULL, NULL, NULL);
+ if (error != ERROR_SUCCESS)
+ break;
+
+ szName[_countof(szName) - 1] = UNICODE_NULL;
+ error = regKey.RecurseDeleteKey(szName);
+ } while (error == ERROR_SUCCESS);
+
+ regKey.Close();
+
+ return self.DeleteSubKey(lpSubKey);
+}
diff --git a/sdk/lib/cicero/cicreg.h b/sdk/lib/cicero/cicreg.h
new file mode 100644
index 00000000000..aaf6619fb88
--- /dev/null
+++ b/sdk/lib/cicero/cicreg.h
@@ -0,0 +1,116 @@
+/*
+ * PROJECT: ReactOS Cicero
+ * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
+ * PURPOSE: Cicero registry handling
+ * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
+ */
+
+#pragma once
+
+class CicRegKey
+{
+public:
+ HKEY m_hKey;
+
+ CicRegKey() : m_hKey(NULL) { }
+ ~CicRegKey() { Close(); }
+
+ operator HKEY() { return m_hKey; }
+
+ LSTATUS Open(HKEY hKey, LPCTSTR lpSubKey, REGSAM samDesired = KEY_READ);
+ LSTATUS Create(HKEY hKey, LPCTSTR lpSubKey);
+ void Close();
+
+ LSTATUS QueryDword(LPCTSTR pszValueName, LPDWORD pdwValue);
+ LSTATUS SetDword(LPCTSTR pszValueName, DWORD dwValue);
+
+ LSTATUS QuerySz(LPCTSTR pszValueName, LPTSTR pszValue, DWORD cchValueMax);
+ LSTATUS SetSz(LPCTSTR pszValueName, LPCTSTR pszValue);
+ LSTATUS SetSzW(LPCWSTR pszValueName, LPCWSTR pszValue);
+
+ LSTATUS DeleteValue(LPCTSTR pszValueName);
+ LSTATUS DeleteSubKey(LPCTSTR lpSubKey);
+ LSTATUS RecurseDeleteKey(LPCTSTR lpSubKey);
+
+ LSTATUS EnumValue(DWORD dwIndex, LPTSTR lpValueName, DWORD cchValueName);
+};
+
+/***********************************************************************/
+
+// FIXME: Here, directly using C++ methods causes compile errors... Why?
+EXTERN_C LSTATUS _cicRegKey_Open(CicRegKey& self, HKEY hKey, LPCTSTR lpSubKey, REGSAM
samDesired);
+EXTERN_C LSTATUS _cicRegKey_Create(CicRegKey& self, HKEY hKey, LPCTSTR lpSubKey);
+EXTERN_C LSTATUS _cicRegKey_RecurseDeleteKey(CicRegKey& self, LPCTSTR lpSubKey);
+
+EXTERN_C LSTATUS
+_cicRegKey_EnumValue(CicRegKey& self, DWORD dwIndex, LPTSTR lpValueName, DWORD
cchValueName);
+
+EXTERN_C LSTATUS
+_cicRegKey_QuerySz(CicRegKey& self, LPCTSTR pszValueName, LPTSTR pszValue, DWORD
cchValueMax);
+
+inline LSTATUS CicRegKey::Open(HKEY hKey, LPCTSTR lpSubKey, REGSAM samDesired)
+{
+ return _cicRegKey_Open(*this, hKey, lpSubKey, samDesired);
+}
+
+inline LSTATUS CicRegKey::Create(HKEY hKey, LPCTSTR lpSubKey)
+{
+ return _cicRegKey_Create(*this, hKey, lpSubKey);
+}
+
+inline LSTATUS CicRegKey::QueryDword(LPCTSTR pszValueName, LPDWORD pdwValue)
+{
+ DWORD cbData = sizeof(DWORD);
+ return ::RegQueryValueEx(m_hKey, pszValueName, 0, NULL, (LPBYTE)pdwValue,
&cbData);
+}
+
+inline LSTATUS CicRegKey::SetDword(LPCTSTR pszValueName, DWORD dwValue)
+{
+ return ::RegSetValueEx(m_hKey, pszValueName, 0, REG_DWORD, (LPBYTE)&dwValue,
sizeof(dwValue));
+}
+
+inline LSTATUS CicRegKey::SetSz(LPCTSTR pszValueName, LPCTSTR pszValue)
+{
+ DWORD cbValue = (lstrlen(pszValue) + 1) * sizeof(TCHAR);
+ return ::RegSetValueEx(m_hKey, pszValueName, 0, REG_SZ, (LPBYTE)pszValue, cbValue);
+}
+
+inline LSTATUS CicRegKey::SetSzW(LPCWSTR pszValueName, LPCWSTR pszValue)
+{
+ DWORD cbValue = (lstrlenW(pszValue) + 1) * sizeof(WCHAR);
+ return ::RegSetValueExW(m_hKey, pszValueName, 0, REG_SZ, (LPBYTE)pszValue, cbValue);
+}
+
+inline LSTATUS CicRegKey::QuerySz(LPCTSTR pszValueName, LPTSTR pszValue, DWORD
cchValueMax)
+{
+ return _cicRegKey_QuerySz(*this, pszValueName, pszValue, cchValueMax);
+}
+
+inline void CicRegKey::Close()
+{
+ if (!m_hKey)
+ return;
+
+ ::RegCloseKey(m_hKey);
+ m_hKey = NULL;
+}
+
+inline LSTATUS CicRegKey::DeleteValue(LPCTSTR pszValueName)
+{
+ return ::RegDeleteValue(m_hKey, pszValueName);
+}
+
+inline LSTATUS CicRegKey::DeleteSubKey(LPCTSTR lpSubKey)
+{
+ return ::RegDeleteKey(m_hKey, lpSubKey);
+}
+
+inline LSTATUS CicRegKey::EnumValue(DWORD dwIndex, LPTSTR lpValueName, DWORD
cchValueName)
+{
+ return _cicRegKey_EnumValue(*this, dwIndex, lpValueName, cchValueName);
+}
+
+inline LSTATUS CicRegKey::RecurseDeleteKey(LPCTSTR lpSubKey)
+{
+ return _cicRegKey_RecurseDeleteKey(*this, lpSubKey);
+}
diff --git a/sdk/include/reactos/cicero/cictf.h b/sdk/lib/cicero/cictf.h
similarity index 100%
rename from sdk/include/reactos/cicero/cictf.h
rename to sdk/lib/cicero/cictf.h
diff --git a/sdk/include/reactos/cicero/cicuif.h b/sdk/lib/cicero/cicuif.cpp
similarity index 72%
rename from sdk/include/reactos/cicero/cicuif.h
rename to sdk/lib/cicero/cicuif.cpp
index 126e22e9e74..322058e1ad3 100644
--- a/sdk/include/reactos/cicero/cicuif.h
+++ b/sdk/lib/cicero/cicuif.cpp
@@ -5,1155 +5,38 @@
* COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
*/
-#pragma once
-
-#include "cicarray.h"
-
-// This is Cicero UIF Library to support the IME UI interface.
-// Cicero UIF Library implements some GUI parts for IMEs and Language Bar.
-// The GUI parts of UIF Library requires special handling because:
-//
-// 1. To avoid interfering with IME input, the GUI part should not receive focus.
-// 2. The IME popup window has WS_DISABLED style, so it cannot receive mouse messages
-// directly.
-
-class CUIFSystemInfo;
-class CUIFTheme;
- class CUIFObject;
- class CUIFWindow;
- class CUIFToolTip;
- class CUIFShadow;
- class CUIFBalloonWindow;
- class CUIFMenu;
- class CUIFButton;
- class CUIFButton2;
- class CUIFToolbarMenuButton;
- class CUIFToolbarButtonElement;
- class CUIFBalloonButton;
- class CUIFToolbarButton;
- class CUIFWndFrame;
- class CUIFGripper;
- class CUIFMenuItem;
- class CUIFMenuItemSeparator;
-class CUIFObjectArray;
-class CUIFColorTable;
- class CUIFColorTableSys;
- class CUIFColorTableOff10;
-class CUIFBitmapDC;
-class CUIFIcon;
-class CUIFSolidBrush;
-class CUIFScheme;
+#include "precomp.h"
+#include "cicuif.h"
/////////////////////////////////////////////////////////////////////////////
-
-class CUIFSystemInfo : OSVERSIONINFO
-{
-public:
- static CUIFSystemInfo *s_pSystemInfo;
- DWORD m_cBitsPixels;
- BOOL m_bHighContrast1;
- BOOL m_bHighContrast2;
-
- CUIFSystemInfo() { }
- void GetSystemMetrics();
- void Initialize();
-};
-
-DECLSPEC_SELECTANY CUIFSystemInfo *CUIFSystemInfo::s_pSystemInfo = NULL;
-
-void cicInitUIFSys(void);
-void cicDoneUIFSys(void);
-void cicUpdateUIFSys(void);
-
-inline void cicGetWorkAreaRect(POINT pt, LPRECT prc)
-{
- ::SystemParametersInfo(SPI_GETWORKAREA, 0, prc, 0);
-
- HMONITOR hMon = ::MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
- if (hMon)
- {
- MONITORINFO mi = { sizeof(mi) };
- if (::GetMonitorInfo(hMon, &mi))
- *prc = mi.rcWork;
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-#include <uxtheme.h>
-#include <vsstyle.h>
-
-// uxtheme.dll
-using FN_OpenThemeData = decltype(&OpenThemeData);
-using FN_CloseThemeData = decltype(&CloseThemeData);
-using FN_DrawThemeBackground = decltype(&DrawThemeBackground);
-using FN_DrawThemeParentBackground = decltype(&DrawThemeParentBackground);
-using FN_DrawThemeText = decltype(&DrawThemeText);
-using FN_DrawThemeIcon = decltype(&DrawThemeIcon);
-using FN_GetThemeBackgroundExtent = decltype(&GetThemeBackgroundExtent);
-using FN_GetThemeBackgroundContentRect = decltype(&GetThemeBackgroundContentRect);
-using FN_GetThemeTextExtent = decltype(&GetThemeTextExtent);
-using FN_GetThemePartSize = decltype(&GetThemePartSize);
-using FN_DrawThemeEdge = decltype(&DrawThemeEdge);
-using FN_GetThemeColor = decltype(&GetThemeColor);
-using FN_GetThemeMargins = decltype(&GetThemeMargins);
-using FN_GetThemeFont = decltype(&GetThemeFont);
-using FN_GetThemeSysColor = decltype(&GetThemeSysColor);
-using FN_GetThemeSysSize = decltype(&GetThemeSysSize);
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFTheme
-{
-public:
- LPCWSTR m_pszClassList;
- INT m_iPartId;
- INT m_iStateId;
- HTHEME m_hTheme;
- static HINSTANCE s_hUXTHEME;
- static FN_OpenThemeData s_fnOpenThemeData;
- static FN_CloseThemeData s_fnCloseThemeData;
- static FN_DrawThemeBackground s_fnDrawThemeBackground;
- static FN_DrawThemeParentBackground s_fnDrawThemeParentBackground;
- static FN_DrawThemeText s_fnDrawThemeText;
- static FN_DrawThemeIcon s_fnDrawThemeIcon;
- static FN_GetThemeBackgroundExtent s_fnGetThemeBackgroundExtent;
- static FN_GetThemeBackgroundContentRect s_fnGetThemeBackgroundContentRect;
- static FN_GetThemeTextExtent s_fnGetThemeTextExtent;
- static FN_GetThemePartSize s_fnGetThemePartSize;
- static FN_DrawThemeEdge s_fnDrawThemeEdge;
- static FN_GetThemeColor s_fnGetThemeColor;
- static FN_GetThemeMargins s_fnGetThemeMargins;
- static FN_GetThemeFont s_fnGetThemeFont;
- static FN_GetThemeSysColor s_fnGetThemeSysColor;
- static FN_GetThemeSysSize s_fnGetThemeSysSize;
-
- HRESULT InternalOpenThemeData(HWND hWnd);
- HRESULT EnsureThemeData(HWND hWnd);
- HRESULT CloseThemeData();
-
- STDMETHOD(DrawThemeBackground)(HDC hDC, int iStateId, LPCRECT pRect, LPCRECT
pClipRect);
- STDMETHOD(DrawThemeParentBackground)(HWND hwnd, HDC hDC, LPRECT prc);
- STDMETHOD(DrawThemeText)(HDC hDC, int iStateId, LPCWSTR pszText, int cchText, DWORD
dwTextFlags, DWORD dwTextFlags2, LPCRECT pRect);
- STDMETHOD(DrawThemeIcon)(HDC hDC, int iStateId, LPCRECT pRect, HIMAGELIST himl, int
iImageIndex);
- STDMETHOD(GetThemeBackgroundExtent)(HDC hDC, int iStateId, LPCRECT pContentRect,
LPRECT pExtentRect);
- STDMETHOD(GetThemeBackgroundContentRect)(HDC hDC, int iStateId, LPCRECT
pBoundingRect, LPRECT pContentRect);
- STDMETHOD(GetThemeTextExtent)(HDC hDC, int iStateId, LPCWSTR pszText, int
cchCharCount, DWORD dwTextFlags, LPCRECT pBoundingRect, LPRECT pExtentRect);
- STDMETHOD(GetThemePartSize)(HDC hDC, int iStateId, LPRECT prc, THEMESIZE eSize, SIZE
*psz);
- STDMETHOD(DrawThemeEdge)(HDC hDC, int iStateId, LPCRECT pDestRect, UINT uEdge, UINT
uFlags, LPRECT pContentRect);
- STDMETHOD(GetThemeColor)(int iStateId, int iPropId, COLORREF *pColor);
- STDMETHOD(GetThemeMargins)(HDC hDC, int iStateId, int iPropId, LPRECT prc, MARGINS
*pMargins);
- STDMETHOD(GetThemeFont)(HDC hDC, int iStateId, int iPropId, LOGFONTW *pFont);
- STDMETHOD_(COLORREF, GetThemeSysColor)(INT iColorId);
- STDMETHOD_(int, GetThemeSysSize)(int iSizeId);
- STDMETHOD_(void, SetActiveTheme)(LPCWSTR pszClassList, INT iPartId, INT iStateId);
-};
-
// static members
-DECLSPEC_SELECTANY HINSTANCE CUIFTheme::s_hUXTHEME = NULL;
-DECLSPEC_SELECTANY FN_OpenThemeData CUIFTheme::s_fnOpenThemeData = NULL;
-DECLSPEC_SELECTANY FN_CloseThemeData CUIFTheme::s_fnCloseThemeData = NULL;
-DECLSPEC_SELECTANY FN_DrawThemeBackground CUIFTheme::s_fnDrawThemeBackground = NULL;
-DECLSPEC_SELECTANY FN_DrawThemeParentBackground CUIFTheme::s_fnDrawThemeParentBackground
= NULL;
-DECLSPEC_SELECTANY FN_DrawThemeText CUIFTheme::s_fnDrawThemeText = NULL;
-DECLSPEC_SELECTANY FN_DrawThemeIcon CUIFTheme::s_fnDrawThemeIcon = NULL;
-DECLSPEC_SELECTANY FN_GetThemeBackgroundExtent CUIFTheme::s_fnGetThemeBackgroundExtent =
NULL;
-DECLSPEC_SELECTANY FN_GetThemeBackgroundContentRect
CUIFTheme::s_fnGetThemeBackgroundContentRect = NULL;
-DECLSPEC_SELECTANY FN_GetThemeTextExtent CUIFTheme::s_fnGetThemeTextExtent = NULL;
-DECLSPEC_SELECTANY FN_GetThemePartSize CUIFTheme::s_fnGetThemePartSize = NULL;
-DECLSPEC_SELECTANY FN_DrawThemeEdge CUIFTheme::s_fnDrawThemeEdge = NULL;
-DECLSPEC_SELECTANY FN_GetThemeColor CUIFTheme::s_fnGetThemeColor = NULL;
-DECLSPEC_SELECTANY FN_GetThemeMargins CUIFTheme::s_fnGetThemeMargins = NULL;
-DECLSPEC_SELECTANY FN_GetThemeFont CUIFTheme::s_fnGetThemeFont = NULL;
-DECLSPEC_SELECTANY FN_GetThemeSysColor CUIFTheme::s_fnGetThemeSysColor = NULL;
-DECLSPEC_SELECTANY FN_GetThemeSysSize CUIFTheme::s_fnGetThemeSysSize = NULL;
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFObjectArray : public CicArray<CUIFObject*>
-{
-public:
- CUIFObjectArray() { }
-
- BOOL Add(CUIFObject *pObject)
- {
- if (!pObject || Find(pObject) >= 0)
- return FALSE;
-
- CUIFObject **ppNew = Append(1);
- if (!ppNew)
- return FALSE;
-
- *ppNew = pObject;
- return TRUE;
- }
-
- BOOL Remove(CUIFObject *pObject)
- {
- if (!pObject)
- return FALSE;
-
- ssize_t iItem = Find(pObject);
- if (iItem < 0)
- return FALSE;
-
- if (size_t(iItem) + 1 < size())
- MoveMemory(&data()[iItem], &data()[iItem + 1],
- (size() - (iItem + 1)) * sizeof(CUIFObject*));
-
- --m_cItems;
- return TRUE;
- }
-
- CUIFObject *GetLast() const
- {
- if (empty())
- return NULL;
- return (*this)[size() - 1];
- }
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFObject : public CUIFTheme
-{
-protected:
- CUIFObject *m_pParent;
- CUIFWindow *m_pWindow;
- CUIFScheme *m_pScheme;
- CUIFObjectArray m_ObjectArray;
- DWORD m_nObjectID;
- DWORD m_style;
- RECT m_rc;
- BOOL m_bEnable;
- BOOL m_bVisible;
- HFONT m_hFont;
- BOOL m_bHasCustomFont;
- LPWSTR m_pszToolTip;
- DWORD m_dwUnknown4[2]; //FIXME: name and type
- friend class CUIFWindow;
- friend class CUIFToolTip;
- friend class CUIFBalloonWindow;
-
-public:
- CUIFObject(CUIFObject *pParent, DWORD nObjectID, LPCRECT prc, DWORD style);
- virtual ~CUIFObject();
-
- void StartCapture();
- void EndCapture();
- BOOL IsCapture();
- BOOL IsRTL();
- LRESULT NotifyCommand(WPARAM wParam, LPARAM lParam);
- CUIFObject* ObjectFromPoint(POINT pt);
- void SetScheme(CUIFScheme *scheme);
- void StartTimer(WPARAM wParam);
- void EndTimer();
-
- STDMETHOD_(BOOL, Initialize)() { return TRUE; }
- STDMETHOD_(void, OnPaint)(HDC hDC);
- STDMETHOD_(void, OnTimer)() { }
- STDMETHOD_(void, OnLButtonDown)(LONG x, LONG y) { }
- STDMETHOD_(void, OnMButtonDown)(LONG x, LONG y) { }
- STDMETHOD_(void, OnRButtonDown)(LONG x, LONG y) { }
- STDMETHOD_(void, OnLButtonUp)(LONG x, LONG y) { }
- STDMETHOD_(void, OnMButtonUp)(LONG x, LONG y) { }
- STDMETHOD_(void, OnRButtonUp)(LONG x, LONG y) { }
- STDMETHOD_(void, OnMouseMove)(LONG x, LONG y) { }
- STDMETHOD_(void, OnMouseIn)(LONG x, LONG y) { }
- STDMETHOD_(void, OnMouseOut)(LONG x, LONG y) { }
- STDMETHOD_(BOOL, OnSetCursor)(UINT uMsg, LONG x, LONG y);
- STDMETHOD_(void, GetRect)(LPRECT prc);
- STDMETHOD_(void, SetRect)(LPCRECT prc);
- STDMETHOD_(BOOL, PtInObject)(POINT pt);
- STDMETHOD_(void, PaintObject)(HDC hDC, LPCRECT prc);
- STDMETHOD_(void, CallOnPaint)();
- STDMETHOD_(void, Enable)(BOOL bEnable);
- STDMETHOD_(void, Show)(BOOL bVisible);
- STDMETHOD_(void, SetFontToThis)(HFONT hFont);
- STDMETHOD_(void, SetFont)(HFONT hFont);
- STDMETHOD_(void, SetStyle)(DWORD style);
- STDMETHOD_(void, AddUIObj)(CUIFObject *pObject);
- STDMETHOD_(void, RemoveUIObj)(CUIFObject *pObject);
- STDMETHOD_(LRESULT, OnObjectNotify)(CUIFObject *pObject, WPARAM wParam, LPARAM
lParam);
- STDMETHOD_(void, SetToolTip)(LPCWSTR pszToolTip);
- STDMETHOD_(LPCWSTR, GetToolTip)() { return m_pszToolTip; }
- STDMETHOD_(LRESULT, OnShowToolTip)() { return 0; }
- STDMETHOD_(void, OnHideToolTip)() { }
- STDMETHOD_(void, DetachWndObj)();
- STDMETHOD_(void, ClearWndObj)();
- STDMETHOD_(BOOL, OnPaintTheme)(HDC hDC) { return FALSE; }
- STDMETHOD_(void, OnPaintNoTheme)(HDC hDC) { }
- STDMETHOD_(void, ClearTheme)();
-};
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFColorTable
-{
-public:
- CUIFColorTable() { }
- virtual ~CUIFColorTable() { }
-
- STDMETHOD_(void, InitColor)() = 0;
- STDMETHOD_(void, DoneColor)() { }
- STDMETHOD_(void, InitBrush)() = 0;
- STDMETHOD_(void, DoneBrush)() = 0;
-
- void Update()
- {
- DoneColor();
- DoneBrush();
- InitColor();
- InitBrush();
- }
-};
-
-class CUIFColorTableSys : public CUIFColorTable
-{
-protected:
- COLORREF m_rgbColors[16];
- HBRUSH m_hBrushes[16];
-
-public:
- CUIFColorTableSys() { }
-
- COLORREF GetColor(INT iColor) const { return m_rgbColors[iColor]; }
- HBRUSH GetBrush(INT iColor);
-
- STDMETHOD_(void, InitColor)() override;
- STDMETHOD_(void, InitBrush)() override;
- STDMETHOD_(void, DoneBrush)() override;
-};
-
-class CUIFColorTableOff10 : public CUIFColorTable
-{
-protected:
- COLORREF m_rgbColors[32];
- HBRUSH m_hBrushes[32];
-
-public:
- CUIFColorTableOff10() { }
-
- COLORREF GetColor(INT iColor) const { return m_rgbColors[iColor]; }
- HBRUSH GetBrush(INT iColor);
-
- STDMETHOD_(void, InitColor)() override;
- STDMETHOD_(void, InitBrush)() override;
- STDMETHOD_(void, DoneBrush)() override;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFSolidBrush
-{
-public:
- HBRUSH m_hBrush;
-
- operator HBRUSH() const { return m_hBrush; }
-
- CUIFSolidBrush(COLORREF rgbColor)
- {
- m_hBrush = ::CreateSolidBrush(rgbColor);
- }
- ~CUIFSolidBrush()
- {
- if (m_hBrush)
- {
- ::DeleteObject(m_hBrush);
- m_hBrush = NULL;
- }
- }
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFIcon
-{
-public:
- HICON m_hIcon;
- HIMAGELIST m_hImageList;
-
- CUIFIcon& operator=(HICON hIcon)
- {
- m_hIcon = hIcon;
- if (m_hImageList)
- {
- ImageList_Destroy(m_hImageList);
- m_hImageList = NULL;
- }
- return *this;
- }
-
- HIMAGELIST GetImageList(BOOL bMirror);
-};
-
-BOOL cicGetIconSize(HICON hIcon, LPSIZE pSize);
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFBitmapDC
-{
-protected:
- HBITMAP m_hBitmap;
- HGDIOBJ m_hOldBitmap;
- HGDIOBJ m_hOldObject;
- HDC m_hDC;
-
-public:
- static BOOL s_fInitBitmapDCs;
- static CUIFBitmapDC *s_phdcSrc;
- static CUIFBitmapDC *s_phdcMask;
- static CUIFBitmapDC *s_phdcDst;
-
- CUIFBitmapDC(BOOL bMemory);
- ~CUIFBitmapDC();
- operator HDC() const { return m_hDC; }
-
- void Uninit(BOOL bKeep = FALSE);
-
- BOOL SetBitmap(HBITMAP hBitmap);
- BOOL SetBitmap(LONG cx, LONG cy, WORD cPlanes, WORD cBitCount);
- BOOL SetDIB(LONG cx, LONG cy, WORD cPlanes, WORD cBitCount);
-
- HBITMAP DetachBitmap()
- {
- HBITMAP hOldBitmap = m_hBitmap;
- m_hBitmap = NULL;
- return hOldBitmap;
- }
-};
-
-DECLSPEC_SELECTANY BOOL CUIFBitmapDC::s_fInitBitmapDCs = FALSE;
-DECLSPEC_SELECTANY CUIFBitmapDC *CUIFBitmapDC::s_phdcSrc = NULL;
-DECLSPEC_SELECTANY CUIFBitmapDC *CUIFBitmapDC::s_phdcMask = NULL;
-DECLSPEC_SELECTANY CUIFBitmapDC *CUIFBitmapDC::s_phdcDst = NULL;
-
-void cicInitUIFUtil(void);
-void cicDoneUIFUtil(void);
-
-HBITMAP cicMirrorBitmap(HBITMAP hBitmap, HBRUSH hbrBack);
-HBRUSH cicCreateDitherBrush(VOID);
-HBITMAP cicCreateDisabledBitmap(LPCRECT prc, HBITMAP hbmMask, HBRUSH hbr1, HBRUSH hbr2,
- BOOL bPressed);
-HBITMAP cicCreateShadowMaskBmp(LPRECT prc, HBITMAP hbm1, HBITMAP hbm2, HBRUSH hbr1,
HBRUSH hbr2);
-HBITMAP cicChangeBitmapColor(LPCRECT prc, HBITMAP hbm, COLORREF rgbBack, COLORREF
rgbFore);
-HBITMAP cicConvertBlackBKGBitmap(LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2, HBRUSH
hBrush);
-HBITMAP cicCreateMaskBmp(LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2, HBRUSH hbr,
- COLORREF rgbColor, COLORREF rgbBack);
-BOOL cicGetIconBitmaps(HICON hIcon, HBITMAP *hbm1, HBITMAP *hbm2, const SIZE *pSize);
-void cicDrawMaskBmpOnDC(HDC hDC, LPCRECT prc, HBITMAP hbmp, HBITMAP hbmpMask);
-
-/////////////////////////////////////////////////////////////////////////////
-
-// Flags for dwDrawFlags
-enum
-{
- UIF_DRAW_PRESSED = 0x10,
- UIF_DRAW_DISABLED = 0x20,
-};
-
-class CUIFScheme
-{
-public:
- static CUIFColorTableSys *s_pColorTableSys;
- static CUIFColorTableOff10 *s_pColorTableOff10;
- BOOL m_bMirroring;
-
- CUIFScheme() : m_bMirroring(FALSE) { }
- virtual ~CUIFScheme() { }
-
- STDMETHOD_(DWORD, GetType)() = 0;
- STDMETHOD_(COLORREF, GetColor)(INT iColor) = 0;
- STDMETHOD_(HBRUSH, GetBrush)(INT iColor) = 0;
- STDMETHOD_(INT, CyMenuItem)(INT cyText) = 0;
- STDMETHOD_(INT, CxSizeFrame)() = 0;
- STDMETHOD_(INT, CySizeFrame)() = 0;
- STDMETHOD_(INT, CxWndBorder)() = 0;
- STDMETHOD_(INT, CyWndBorder)() = 0;
- STDMETHOD_(void, FillRect)(HDC hDC, LPCRECT prc, INT iColor);
- STDMETHOD_(void, FrameRect)(HDC hDC, LPCRECT prc, INT iColor);
- STDMETHOD_(void, DrawSelectionRect)(HDC hDC, LPCRECT prc, int) = 0;
- STDMETHOD_(void, GetCtrlFaceOffset)(DWORD, DWORD dwDrawFlags, LPSIZE pSize) = 0;
- STDMETHOD_(void, DrawCtrlBkgd)(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags) = 0;
- STDMETHOD_(void, DrawCtrlEdge)(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags) = 0;
- STDMETHOD_(void, DrawCtrlText)(HDC hDC, LPCRECT prc, LPCWSTR pszText, INT cchText,
DWORD dwDrawFlags, BOOL bRight) = 0;
- STDMETHOD_(void, DrawCtrlIcon)(HDC hDC, LPCRECT prc, HICON hIcon, DWORD dwDrawFlags,
LPSIZE pSize) = 0;
- STDMETHOD_(void, DrawCtrlBitmap)(HDC hDC, LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2,
DWORD dwDrawFlags) = 0;
- STDMETHOD_(void, DrawMenuBitmap)(HDC hDC, LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2,
DWORD dwDrawFlags) = 0;
- STDMETHOD_(void, DrawMenuSeparator)(HDC hDC, LPCRECT prc) = 0;
- STDMETHOD_(void, DrawFrameCtrlBkgd)(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags) = 0;
- STDMETHOD_(void, DrawFrameCtrlEdge)(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags) = 0;
- STDMETHOD_(void, DrawFrameCtrlIcon)(HDC hDC, LPCRECT prc, HICON hIcon, DWORD
dwDrawFlags, LPSIZE pSize) = 0;
- STDMETHOD_(void, DrawFrameCtrlBitmap)(HDC hDC, LPCRECT prc, HBITMAP hbm1, HBITMAP
hbm2, DWORD dwDrawFlags) = 0;
- STDMETHOD_(void, DrawWndFrame)(HDC hDC, LPCRECT prc, DWORD type, DWORD unused1, DWORD
unused2) = 0;
- STDMETHOD_(void, DrawDragHandle)(HDC hDC, LPCRECT prc, BOOL bVertical) = 0;
- STDMETHOD_(void, DrawSeparator)(HDC hDC, LPCRECT prc, BOOL bVertical) = 0;
-};
-
-class CUIFSchemeDef : public CUIFScheme
-{
-protected:
- DWORD m_dwType;
-
-public:
- CUIFSchemeDef(DWORD dwType) : m_dwType(dwType) { }
-
- STDMETHOD_(DWORD, GetType)() override;
- STDMETHOD_(COLORREF, GetColor)(INT iColor) override;
- STDMETHOD_(HBRUSH, GetBrush)(INT iColor) override;
- STDMETHOD_(INT, CyMenuItem)(INT cyText) override;
- STDMETHOD_(INT, CxSizeFrame)() override;
- STDMETHOD_(INT, CySizeFrame)() override;
- STDMETHOD_(INT, CxWndBorder)() override { return 1; }
- STDMETHOD_(INT, CyWndBorder)() override { return 1; }
- STDMETHOD_(void, DrawSelectionRect)(HDC hDC, LPCRECT prc, int) override;
- STDMETHOD_(void, GetCtrlFaceOffset)(DWORD dwUnknownFlags, DWORD dwDrawFlags, LPSIZE
pSize) override;
- STDMETHOD_(void, DrawCtrlBkgd)(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags) override;
- STDMETHOD_(void, DrawCtrlEdge)(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags) override;
- STDMETHOD_(void, DrawCtrlText)(HDC hDC, LPCRECT prc, LPCWSTR pszText, INT cchText,
DWORD dwDrawFlags, BOOL bRight) override;
- STDMETHOD_(void, DrawCtrlIcon)(HDC hDC, LPCRECT prc, HICON hIcon, DWORD dwDrawFlags,
LPSIZE pSize) override;
- STDMETHOD_(void, DrawCtrlBitmap)(HDC hDC, LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2,
DWORD dwDrawFlags) override;
- STDMETHOD_(void, DrawMenuBitmap)(HDC hDC, LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2,
DWORD dwDrawFlags) override;
- STDMETHOD_(void, DrawMenuSeparator)(HDC hDC, LPCRECT prc) override;
- STDMETHOD_(void, DrawFrameCtrlBkgd)(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags) override;
- STDMETHOD_(void, DrawFrameCtrlEdge)(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags) override;
- STDMETHOD_(void, DrawFrameCtrlIcon)(HDC hDC, LPCRECT prc, HICON hIcon, DWORD
dwDrawFlags, LPSIZE pSize) override;
- STDMETHOD_(void, DrawFrameCtrlBitmap)(HDC hDC, LPCRECT prc, HBITMAP hbm1, HBITMAP
hbm2, DWORD dwDrawFlags) override;
- STDMETHOD_(void, DrawWndFrame)(HDC hDC, LPCRECT prc, DWORD type, DWORD unused1, DWORD
unused2) override;
- STDMETHOD_(void, DrawDragHandle)(HDC hDC, LPCRECT prc, BOOL bVertical) override;
- STDMETHOD_(void, DrawSeparator)(HDC hDC, LPCRECT prc, BOOL bVertical) override;
-};
-
-DECLSPEC_SELECTANY CUIFColorTableSys *CUIFScheme::s_pColorTableSys = NULL;
-DECLSPEC_SELECTANY CUIFColorTableOff10 *CUIFScheme::s_pColorTableOff10 = NULL;
-
-void cicInitUIFScheme(void);
-void cicUpdateUIFScheme(void);
-void cicDoneUIFScheme(void);
-CUIFScheme *cicCreateUIFScheme(DWORD type);
-
-/////////////////////////////////////////////////////////////////////////////
-
-// m_style flags for CUIFWindow
-enum
-{
- UIF_WINDOW_CHILD = 0x1,
- UIF_WINDOW_TOPMOST = 0x2,
- UIF_WINDOW_TOOLWINDOW = 0x4,
- UIF_WINDOW_DLGFRAME = 0x8,
- UIF_WINDOW_TOOLTIP = 0x20,
- UIF_WINDOW_SHADOW = 0x40,
- UIF_WINDOW_WORKAREA = 0x80,
- UIF_WINDOW_MONITOR = 0x100,
- UIF_WINDOW_LAYOUTRTL = 0x200,
- UIF_WINDOW_NOMOUSEMSG = 0x400,
- UIF_WINDOW_USESCHEME1 = 0x10000000,
- UIF_WINDOW_USESCHEME2 = 0x20000000,
- UIF_WINDOW_USESCHEME3 = 0x40000000,
- UIF_WINDOW_ENABLETHEMED = 0x80000000,
-};
-
-class CUIFWindow : public CUIFObject
-{
-protected:
- INT m_nLeft;
- INT m_nTop;
- INT m_nHeight;
- INT m_nWidth;
- HINSTANCE m_hInst;
- HWND m_hWnd;
- CUIFObject *m_pTimerObject;
- CUIFObject *m_pCaptured;
- CUIFObject *m_pPointed;
- BOOL m_bPointing;
- CUIFWindow *m_pBehindModal;
- CUIFToolTip *m_pToolTip;
- CUIFShadow *m_pShadow;
- BOOL m_bShowShadow;
- friend class CUIFObject;
- friend class CUIFShadow;
- friend class CUIFToolTip;
- friend class CUIFButton;
- friend class CUIFMenu;
-
-public:
- enum { POINTING_TIMER_ID = 0x7982, USER_TIMER_ID = 0x5461 };
- operator HWND() const { return m_hWnd; }
- CUIFWindow(HINSTANCE hInst, DWORD style);
- ~CUIFWindow() override;
-
- static CUIFWindow* GetThis(HWND hWnd);
- static void SetThis(HWND hWnd, LONG_PTR dwNewLong);
-
- STDMETHOD_(BOOL, Initialize)() override;
- STDMETHOD_(void, Show)(BOOL bVisible) override;
- STDMETHOD_(void, SetRect)(LPCRECT prc) override;
- STDMETHOD_(void, PaintObject)(HDC hDC, LPCRECT prc) override;
- STDMETHOD_(void, RemoveUIObj)(CUIFObject *pRemove) override;
-
- void SetCaptureObject(CUIFObject *pCaptured);
- void SetObjectPointed(CUIFObject *pPointed, POINT pt);
- void CreateScheme();
- BOOL GetWorkArea(LPCRECT prcWnd, LPRECT prcWorkArea);
- void AdjustWindowPosition();
- void SetBehindModal(CUIFWindow *pBehindModal);
- void SetTimerObject(CUIFObject *pTimerObject, UINT uElapse);
-
- static LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam);
-
- STDMETHOD_(LPCTSTR, GetClassName)() { return TEXT("CiceroUIWndFrame"); }
- STDMETHOD_(LPCTSTR, GetWndTitle)() { return TEXT("CiceroUIWndFrame"); }
- STDMETHOD_(DWORD, GetWndStyle)();
- STDMETHOD_(DWORD, GetWndStyleEx)();
- STDMETHOD_(HWND, CreateWnd)(HWND hwndParent);
- STDMETHOD_(void, Move)(INT x, INT y, INT nWidth, INT nHeight);
- STDMETHOD_(BOOL, AnimateWnd)(DWORD dwTime, DWORD dwFlags);
- STDMETHOD_(void, OnObjectMoved)(CUIFObject *pObject);
- STDMETHOD_(void, OnMouseOutFromWindow)(LONG x, LONG y) { }
- STDMETHOD_(void, OnCreate)(HWND hWnd) { }
- STDMETHOD_(void, OnDestroy)(HWND hWnd) { }
- STDMETHOD_(void, OnNCDestroy)(HWND hWnd) { }
- STDMETHOD_(void, OnSetFocus)(HWND hWnd) { }
- STDMETHOD_(void, OnKillFocus)(HWND hWnd) { }
- STDMETHOD_(void, OnNotify)(HWND hWnd, WPARAM wParam, LPARAM lParam) { }
- STDMETHOD_(void, OnTimer)(WPARAM wParam) { }
- STDMETHOD_(void, OnSysColorChange)() { }
- STDMETHOD_(void, OnEndSession)(HWND hWnd, WPARAM wParam, LPARAM lParam) { }
- STDMETHOD_(void, OnKeyDown)(HWND hWnd, WPARAM wParam, LPARAM lParam) { }
- STDMETHOD_(void, OnKeyUp)(HWND, WPARAM wParam, LPARAM lParam) { }
- STDMETHOD_(void, OnUser)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { }
- STDMETHOD_(LRESULT, OnActivate)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
- { return 0; }
- STDMETHOD_(LRESULT, OnWindowPosChanged)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
- { return 0; }
- STDMETHOD_(LRESULT, OnWindowPosChanging)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
- { return 0; }
- STDMETHOD_(LRESULT, OnNotifyFormat)(HWND hWnd, WPARAM wParam, LPARAM lParam) { return
0; }
- STDMETHOD_(LRESULT, OnShowWindow)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
- { return 0; }
- STDMETHOD_(LRESULT, OnSettingChange)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam);
- STDMETHOD_(LRESULT, OnDisplayChange)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
- { return 0; }
- STDMETHOD_(HRESULT, OnGetObject)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
- { return S_OK; }
- STDMETHOD_(LRESULT, WindowProc)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
- STDMETHOD_(BOOL, OnEraseBkGnd)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
- { return FALSE; }
- STDMETHOD_(void, OnThemeChanged)(HWND hWnd, WPARAM wParam, LPARAM lParam);
- STDMETHOD_(void, UpdateUI)(LPCRECT prc);
- STDMETHOD_(void, SetCapture)(int);
- STDMETHOD_(void, ModalMouseNotify)(UINT uMsg, LONG x, LONG y) { }
- STDMETHOD_(void, OnAnimationStart)() { }
- STDMETHOD_(void, OnAnimationEnd)();
- STDMETHOD_(void, HandleMouseMsg)(UINT uMsg, LONG x, LONG y);
- STDMETHOD_(void, ClientRectToWindowRect)(LPRECT pRect);
- STDMETHOD_(void, GetWindowFrameSize)(LPSIZE pSize);
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFToolTip : public CUIFWindow
-{
-protected:
- CUIFWindow *m_pToolTipOwner;
- CUIFObject *m_pToolTipTarget;
- LPWSTR m_pszToolTipText;
- BOOL m_bShowToolTip;
- DWORD m_dwUnknown10; //FIXME: name and type
- LONG m_nDelayTimeType2;
- LONG m_nDelayTimeType3;
- LONG m_nDelayTimeType1;
- RECT m_rcToolTipMargin;
- LONG m_cxToolTipWidth;
- BOOL m_bToolTipHasBkColor;
- BOOL m_bToolTipHasTextColor;
- COLORREF m_rgbToolTipBkColor;
- COLORREF m_rgbToolTipTextColor;
- friend class CUIFObject;
- friend class CTipbarWnd;
-
-public:
- enum { TOOLTIP_TIMER_ID = 0x3216 };
- CUIFToolTip(HINSTANCE hInst, DWORD style, CUIFWindow *pToolTipOwner);
- ~CUIFToolTip() override;
-
- LONG GetDelayTime(UINT uType);
- void GetMargin(LPRECT prc);
- COLORREF GetTipBkColor();
- COLORREF GetTipTextColor();
- CUIFObject* FindObject(HWND hWnd, POINT pt);
-
- void ShowTip();
- void HideTip();
-
- void GetTipWindowSize(LPSIZE pSize);
- void GetTipWindowRect(LPRECT pRect, SIZE toolTipSize, LPCRECT prc);
-
- void RelayEvent(LPMSG pMsg);
-
- STDMETHOD_(void, OnPaint)(HDC hDC) override;
- STDMETHOD_(void, Enable)(BOOL bEnable) override;
- STDMETHOD_(void, OnTimer)(WPARAM wParam) override;
-};
-
-class CUIFShadow : public CUIFWindow
-{
-protected:
- CUIFWindow *m_pShadowOwner;
- COLORREF m_rgbShadowColor;
- DWORD m_dwUnknown11[2];
- INT m_xShadowDelta;
- INT m_yShadowDelta;
- BOOL m_bLayerAvailable;
-
-public:
- CUIFShadow(HINSTANCE hInst, DWORD style, CUIFWindow *pShadowOwner);
- ~CUIFShadow() override;
-
- void InitSettings();
- void InitShadow();
- void AdjustWindowPos();
- void OnOwnerWndMoved(BOOL bDoSize);
-
- STDMETHOD_(BOOL, Initialize)() override;
- STDMETHOD_(DWORD, GetWndStyleEx)() override;
- STDMETHOD_(void, OnPaint)(HDC hDC) override;
- STDMETHOD_(LRESULT, OnWindowPosChanging)(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
lParam) override;
- STDMETHOD_(LRESULT, OnSettingChange)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam) override;
- STDMETHOD_(void, Show)(BOOL bVisible) override;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-// m_style flags for CUIFMenu
-enum
-{
- UIF_MENU_USE_OFF10 = 0x10000000,
-};
-
-class CUIFMenu : public CUIFWindow
-{
-public:
- CUIFMenu *m_pVisibleSubMenu;
- CUIFMenu *m_pParentMenu;
- CUIFMenuItem *m_pSelectedItem;
- UINT m_nSelectedID;
- CicArray<CUIFMenuItem*> m_MenuItems;
- HFONT m_hMenuFont;
- BOOL m_bModal;
- BOOL m_bHasMargin;
- DWORD m_dwUnknown14;
- LONG m_cxyMargin;
- LONG m_cxMenuExtent;
- friend class CUIFMenuItem;
-
-public:
- CUIFMenu(HINSTANCE hInst, DWORD style, DWORD dwUnknown14);
- ~CUIFMenu() override;
-
- void CancelMenu();
- void ClearMenuFont();
- CUIFMenuItem* GetNextItem(CUIFMenuItem *pItem);
- CUIFMenuItem* GetPrevItem(CUIFMenuItem *pItem);
- CUIFMenu* GetTopSubMenu();
- BOOL InsertItem(CUIFMenuItem *pItem);
- BOOL InsertSeparator();
- void PostKey(BOOL bUp, WPARAM wParam, LPARAM lParam);
- void SetMenuFont();
- void SetSelectedId(UINT nSelectID);
- void SetSelectedItem(CUIFMenuItem *pItem);
- UINT ShowModalPopup(CUIFWindow *pWindow, LPCRECT prc, BOOL bFlag);
- void ShowSubPopup(CUIFMenu *pSubMenu, LPCRECT prc, BOOL bFlag);
-
- STDMETHOD_(void, OnKeyDown)(HWND hWnd, WPARAM wParam, LPARAM lParam) override;
- STDMETHOD_(void, HandleMouseMsg)(UINT uMsg, LONG x, LONG y) override;
- STDMETHOD_(void, ModalMouseNotify)(UINT uMsg, LONG x, LONG y) override;
-
- STDMETHOD_(void, ModalMessageLoop)();
- STDMETHOD_(BOOL, InitShow)(CUIFWindow *pWindow, LPCRECT prc, BOOL bFlag, BOOL
bDoAnimation);
- STDMETHOD_(BOOL, UninitShow)();
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFMenuItem : public CUIFObject
-{
-protected:
- UINT m_nMenuItemID;
- LPWSTR m_pszMenuItemLeft;
- UINT m_cchMenuItemLeft;
- LPWSTR m_pszMenuItemRight;
- UINT m_cchMenuItemRight;
- UINT m_nMenuItemVKey;
- UINT m_ichMenuItemPrefix;
- HBITMAP m_hbmColor;
- HBITMAP m_hbmMask;
- BOOL m_bMenuItemChecked;
- BOOL m_bMenuItemForceChecked;
- BOOL m_bMenuItemGrayed;
- BOOL m_bMenuItemDisabled;
- CUIFMenu *m_pMenu;
- CUIFMenu *m_pSubMenu;
- SIZE m_MenuLeftExtent;
- SIZE m_MenuRightExtent;
- friend class CUIFMenu;
-
- void DrawArrow(HDC hDC, INT x, INT y);
- void DrawBitmapProc(HDC hDC, INT xLeft, INT yTop);
- void DrawCheck(HDC hDC, INT xLeft, INT yTop);
- void DrawUnderline(HDC hDC, INT xText, INT yText, HBRUSH hbr);
-
-public:
- CUIFMenuItem(CUIFMenu *pMenu, BOOL bDisabled = FALSE);
- ~CUIFMenuItem() override;
-
- BOOL Init(UINT nMenuItemID, LPCWSTR pszText);
-
- BOOL IsCheck();
- void Check(BOOL bChecked) { m_bMenuItemChecked = bChecked; }
- void Gray(BOOL bGrayed) { m_bMenuItemGrayed = bGrayed; }
-
- void SetBitmap(HBITMAP hbmColor) { m_hbmColor = hbmColor; }
- void SetBitmapMask(HBITMAP hbmMask);
- void SetSub(CUIFMenu *pSubMenu) { m_pSubMenu = pSubMenu; }
-
- void ShowSubPopup();
-
- STDMETHOD_(void, OnLButtonUp)(LONG x, LONG y) override;
- STDMETHOD_(void, OnMouseIn)(LONG x, LONG y) override;
- STDMETHOD_(void, OnPaint)(HDC hDC) override;
- STDMETHOD_(void, OnTimer)() override;
-
- STDMETHOD_(void, InitMenuExtent)();
- STDMETHOD_(void, OnPaintDef)(HDC hDC);
- STDMETHOD_(void, OnPaintO10)(HDC hDC);
- STDMETHOD_(void, OnUnknownMethod)() { } // FIXME: method name
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFMenuItemSeparator : public CUIFMenuItem
-{
-public:
- CUIFMenuItemSeparator(CUIFMenu *pMenu);
-
- STDMETHOD_(void, InitMenuExtent)() override;
- STDMETHOD_(void, OnPaintDef)(HDC hDC) override;
- STDMETHOD_(void, OnPaintO10)(HDC hDC) override;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-// m_style flags for CUIFButton
-enum
-{
- UIF_BUTTON_H_ALIGN_LEFT = 0,
- UIF_BUTTON_H_ALIGN_CENTER = 0x1,
- UIF_BUTTON_H_ALIGN_RIGHT = 0x2,
- UIF_BUTTON_H_ALIGN_MASK = UIF_BUTTON_H_ALIGN_CENTER | UIF_BUTTON_H_ALIGN_RIGHT,
- UIF_BUTTON_V_ALIGN_TOP = 0,
- UIF_BUTTON_V_ALIGN_MIDDLE = 0x4,
- UIF_BUTTON_V_ALIGN_BOTTOM = 0x8,
- UIF_BUTTON_V_ALIGN_MASK = UIF_BUTTON_V_ALIGN_MIDDLE | UIF_BUTTON_V_ALIGN_BOTTOM,
- UIF_BUTTON_LARGE_ICON = 0x100,
- UIF_BUTTON_VERTICAL = 0x400,
-};
-
-class CUIFButton : public CUIFObject
-{
-protected:
- UINT m_uButtonStatus;
- LPWSTR m_pszButtonText;
- CUIFIcon m_ButtonIcon;
- DWORD m_dwUnknown9;
- HBITMAP m_hbmButton1;
- HBITMAP m_hbmButton2;
- BOOL m_bPressed;
- SIZE m_IconSize;
- SIZE m_TextSize;
- friend class CUIFToolbarButton;
-
- void DrawBitmapProc(HDC hDC, LPCRECT prc, BOOL bPressed);
- void DrawEdgeProc(HDC hDC, LPCRECT prc, BOOL bPressed);
- void DrawIconProc(HDC hDC, LPRECT prc, BOOL bPressed);
- void DrawTextProc(HDC hDC, LPCRECT prc, BOOL bPressed);
-
-public:
- CUIFButton(CUIFObject *pParent, DWORD nObjectID, LPCRECT prc, DWORD style);
- ~CUIFButton() override;
-
- void SetIcon(HICON hIcon);
- void SetText(LPCWSTR pszText);
-
- void GetIconSize(HICON hIcon, LPSIZE pSize);
- void GetTextSize(LPCWSTR pszText, LPSIZE pSize);
-
- STDMETHOD_(void, Enable)(BOOL bEnable) override;
- STDMETHOD_(void, OnMouseIn)(LONG x, LONG y) override;
- STDMETHOD_(void, OnMouseOut)(LONG x, LONG y) override;
- STDMETHOD_(void, OnLButtonDown)(LONG x, LONG y) override;
- STDMETHOD_(void, OnLButtonUp)(LONG x, LONG y) override;
- STDMETHOD_(void, OnPaintNoTheme)(HDC hDC) override;
- STDMETHOD_(void, SetStatus)(UINT uStatus);
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFButton2 : public CUIFButton
-{
-protected:
- SIZE m_BitmapSize;
-
-public:
- CUIFButton2(CUIFObject *pParent, DWORD nObjectID, LPCRECT prc, DWORD style);
- ~CUIFButton2() override;
-
- DWORD MakeDrawFlag();
- STDMETHOD_(BOOL, OnPaintTheme)(HDC hDC) override;
- STDMETHOD_(void, OnPaintNoTheme)(HDC hDC) override;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFToolbarMenuButton : public CUIFButton2
-{
-public:
- CUIFToolbarButton *m_pToolbarButton;
-
- CUIFToolbarMenuButton(CUIFToolbarButton *pParent, DWORD nObjectID, LPCRECT prc, DWORD
style);
- ~CUIFToolbarMenuButton() override;
-
- STDMETHOD_(void, OnLButtonUp)(LONG x, LONG y) override;
- STDMETHOD_(BOOL, OnSetCursor)(UINT uMsg, LONG x, LONG y) override;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFToolbarButtonElement : public CUIFButton2
-{
-public:
- CUIFToolbarButton *m_pToolbarButton;
-
- CUIFToolbarButtonElement(CUIFToolbarButton *pParent, DWORD nObjectID, LPCRECT prc,
DWORD style);
-
- STDMETHOD_(LPCWSTR, GetToolTip)() override;
- STDMETHOD_(void, OnLButtonUp)(LONG x, LONG y) override;
- STDMETHOD_(void, OnRButtonUp)(LONG x, LONG y) override;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFToolbarButton : public CUIFObject
-{
-public:
- CUIFToolbarButtonElement *m_pToolbarButtonElement;
- CUIFToolbarMenuButton *m_pToolbarMenuButton;
- DWORD m_dwToolbarButtonFlags;
- LPCWSTR m_pszUnknownText;
-
- CUIFToolbarButton(
- CUIFObject *pParent,
- DWORD nObjectID,
- LPCRECT prc,
- DWORD style,
- DWORD dwToolbarButtonFlags,
- LPCWSTR pszUnknownText);
- ~CUIFToolbarButton() override { }
-
- BOOL Init();
- HICON GetIcon();
- void SetIcon(HICON hIcon);
-
- STDMETHOD_(void, ClearWndObj)() override;
- STDMETHOD_(void, DetachWndObj)() override;
- STDMETHOD_(void, Enable)(BOOL bEnable) override;
- STDMETHOD_(LPCWSTR, GetToolTip)() override;
- STDMETHOD_(void, SetActiveTheme)(LPCWSTR pszClassList, INT iPartId, INT iStateId)
override;
- STDMETHOD_(void, SetFont)(HFONT hFont) override;
- STDMETHOD_(void, SetRect)(LPCRECT prc) override;
- STDMETHOD_(void, SetToolTip)(LPCWSTR pszToolTip) override;
-
- STDMETHOD_(void, OnUnknownMouse0)() { }
- STDMETHOD_(void, OnUnknownMouse1)(LONG x, LONG y) { }
- STDMETHOD_(void, OnUnknownMouse2)(LONG x, LONG y) { }
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-// m_style flags for CUIFGripper
-enum
-{
- UIF_GRIPPER_VERTICAL = 0x1,
-};
-
-class CUIFGripper : public CUIFObject
-{
-protected:
- POINT m_ptGripper;
-
-public:
- CUIFGripper(CUIFObject *pParent, LPCRECT prc, DWORD style);
- ~CUIFGripper() override;
-
- STDMETHOD_(void, OnMouseMove)(LONG x, LONG y) override;
- STDMETHOD_(void, OnLButtonDown)(LONG x, LONG y) override;
- STDMETHOD_(void, OnLButtonUp)(LONG x, LONG y) override;
- STDMETHOD_(BOOL, OnPaintTheme)(HDC hDC) override;
- STDMETHOD_(void, OnPaintNoTheme)(HDC hDC) override;
- STDMETHOD_(BOOL, OnSetCursor)(UINT uMsg, LONG x, LONG y) override;
- STDMETHOD_(void, SetStyle)(DWORD style) override;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFWndFrame : public CUIFObject
-{
-protected:
- DWORD m_dwHitTest;
- POINT m_ptHit;
- RECT m_rcWnd;
- INT m_cxFrame;
- INT m_cyFrame;
- INT m_cxMin;
- INT m_cyMin;
-
-public:
- CUIFWndFrame(CUIFObject *pParent, LPCRECT prc, DWORD style);
-
- void GetFrameSize(LPSIZE pSize);
- DWORD HitTest(LONG x, LONG y);
-
- STDMETHOD_(void, OnMouseMove)(LONG x, LONG y) override;
- STDMETHOD_(void, OnLButtonDown)(LONG x, LONG y) override;
- STDMETHOD_(void, OnLButtonUp)(LONG x, LONG y) override;
- STDMETHOD_(BOOL, OnPaintTheme)(HDC hDC) override;
- STDMETHOD_(void, OnPaintNoTheme)(HDC hDC) override;
- STDMETHOD_(BOOL, OnSetCursor)(UINT uMsg, LONG x, LONG y) override;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-class CUIFBalloonButton : public CUIFButton
-{
-protected:
- UINT m_nCommandID;
- friend class CUIFBalloonWindow;
-
-public:
- CUIFBalloonButton(CUIFObject *pParent, DWORD nObjectID, LPCRECT prc, DWORD style);
-
- STDMETHOD_(void, OnPaint)(HDC hDC) override;
- void DrawTextProc(HDC hDC, LPCRECT prc, BOOL bPressed);
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-// m_style flags for CUIFBalloonWindow
-enum
-{
- UIF_BALLOON_WINDOW_OK = 0x10000,
- UIF_BALLOON_WINDOW_YESNO = 0x20000,
- UIF_BALLOON_WINDOW_TYPE_MASK = 0xF0000,
-};
-
-class CUIFBalloonWindow : public CUIFWindow
-{
-protected:
- LPWSTR m_pszBalloonText;
- HRGN m_hRgn;
- RECT m_rcMargin;
- DWORD m_dwUnknown6;
- BOOL m_bHasBkColor;
- BOOL m_bHasTextColor;
- COLORREF m_rgbBkColor;
- COLORREF m_rgbTextColor;
- POINT m_ptTarget;
- RECT m_rcExclude;
- POINT m_ptBalloon;
- DWORD m_dwUnknown7;
- UINT m_nBalloonType;
- DWORD m_dwUnknown8[2];
- UINT m_cButtons;
- WPARAM m_nActionID;
- HWND m_hwndNotif;
- UINT m_uNotifMsg;
-
-public:
- CUIFBalloonWindow(HINSTANCE hInst, DWORD style);
- ~CUIFBalloonWindow() override;
-
- STDMETHOD_(BOOL, Initialize)() override;
- STDMETHOD_(LPCTSTR, GetClassName)() override { return
TEXT("MSIME_PopupMessage"); }
- STDMETHOD_(LPCTSTR, GetWndTitle)() override { return
TEXT("MSIME_PopupMessage"); }
- STDMETHOD_(void, OnCreate)(HWND hWnd) override;
- STDMETHOD_(void, OnDestroy)(HWND hWnd) override;
- STDMETHOD_(void, OnKeyDown)(HWND hWnd, WPARAM wParam, LPARAM lParam) override;
- STDMETHOD_(LRESULT, OnObjectNotify)(CUIFObject *pObject, WPARAM wParam, LPARAM
lParam) override;
- STDMETHOD_(void, OnPaint)(HDC hDC) override;
-
- void AddButton(UINT nCommandId);
- void AdjustPos();
- HRGN CreateRegion(LPCRECT prc);
- void DoneWindowRegion();
- CUIFBalloonButton *FindButton(UINT nCommandID);
- CUIFObject *FindUIObject(UINT nObjectID);
-
- COLORREF GetBalloonBkColor();
- COLORREF GetBalloonTextColor();
- void GetButtonSize(LPSIZE pSize);
- void GetMargin(LPRECT prcMargin);
- void SetExcludeRect(LPCRECT prcExclude);
- void SetTargetPos(POINT ptTarget);
- void SetText(LPCWSTR pszText);
-
- void InitWindowRegion();
- void LayoutObject();
- void PaintFrameProc(HDC hDC, LPCRECT prc);
- void PaintMessageProc(HDC hDC, LPRECT prc, LPCWSTR pszText);
- void SendNotification(WPARAM wParam);
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-inline void cicInitUIFLib(void)
-{
- cicInitUIFSys();
- cicInitUIFScheme();
- cicInitUIFUtil();
-}
-
-inline void cicDoneUIFLib(void)
-{
- cicDoneUIFScheme();
- cicDoneUIFSys();
- cicDoneUIFUtil();
-}
-
-inline void cicGetScreenRect(POINT pt, LPRECT prc)
-{
- *prc = { 0, 0, ::GetSystemMetrics(SM_CXSCREEN), ::GetSystemMetrics(SM_CYSCREEN) };
- HMONITOR hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
- if (hMon)
- {
- MONITORINFO mi = { sizeof(mi) };
- GetMonitorInfo(hMon, &mi);
- *prc = mi.rcMonitor;
- }
-}
-
-inline BOOL cicIsFullScreenSize(HWND hWnd)
-{
- RECT rc;
-
- ::GetWindowRect(hWnd, &rc);
- return (rc.left <= 0) && (rc.top <= 0) &&
- (rc.right >= GetSystemMetrics(SM_CXFULLSCREEN)) &&
- (rc.bottom >= GetSystemMetrics(SM_CYFULLSCREEN));
-}
+HINSTANCE CUIFTheme::s_hUXTHEME = NULL;
+FN_OpenThemeData CUIFTheme::s_fnOpenThemeData = NULL;
+FN_CloseThemeData CUIFTheme::s_fnCloseThemeData = NULL;
+FN_DrawThemeBackground CUIFTheme::s_fnDrawThemeBackground = NULL;
+FN_DrawThemeParentBackground CUIFTheme::s_fnDrawThemeParentBackground = NULL;
+FN_DrawThemeText CUIFTheme::s_fnDrawThemeText = NULL;
+FN_DrawThemeIcon CUIFTheme::s_fnDrawThemeIcon = NULL;
+FN_GetThemeBackgroundExtent CUIFTheme::s_fnGetThemeBackgroundExtent = NULL;
+FN_GetThemeBackgroundContentRect CUIFTheme::s_fnGetThemeBackgroundContentRect = NULL;
+FN_GetThemeTextExtent CUIFTheme::s_fnGetThemeTextExtent = NULL;
+FN_GetThemePartSize CUIFTheme::s_fnGetThemePartSize = NULL;
+FN_DrawThemeEdge CUIFTheme::s_fnDrawThemeEdge = NULL;
+FN_GetThemeColor CUIFTheme::s_fnGetThemeColor = NULL;
+FN_GetThemeMargins CUIFTheme::s_fnGetThemeMargins = NULL;
+FN_GetThemeFont CUIFTheme::s_fnGetThemeFont = NULL;
+FN_GetThemeSysColor CUIFTheme::s_fnGetThemeSysColor = NULL;
+FN_GetThemeSysSize CUIFTheme::s_fnGetThemeSysSize = NULL;
+
+CUIFSystemInfo *CUIFSystemInfo::s_pSystemInfo = NULL;
+
+CUIFColorTableSys *CUIFScheme::s_pColorTableSys = NULL;
+CUIFColorTableOff10 *CUIFScheme::s_pColorTableOff10 = NULL;
/////////////////////////////////////////////////////////////////////////////
-inline void CUIFSystemInfo::GetSystemMetrics()
+void CUIFSystemInfo::GetSystemMetrics()
{
HDC hDC = ::GetDC(NULL);
m_cBitsPixels = ::GetDeviceCaps(hDC, BITSPIXEL);
@@ -1170,38 +53,17 @@ inline void CUIFSystemInfo::GetSystemMetrics()
(rgbBtnText == white && rgbBtnFace == black));
}
-inline void CUIFSystemInfo::Initialize()
+void CUIFSystemInfo::Initialize()
{
dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
::GetVersionEx(this);
GetSystemMetrics();
}
-inline void cicInitUIFSys(void)
-{
- CUIFSystemInfo::s_pSystemInfo = new(cicNoThrow) CUIFSystemInfo();
- if (CUIFSystemInfo::s_pSystemInfo)
- CUIFSystemInfo::s_pSystemInfo->Initialize();
-}
-
-inline void cicDoneUIFSys(void)
-{
- if (CUIFSystemInfo::s_pSystemInfo)
- {
- delete CUIFSystemInfo::s_pSystemInfo;
- CUIFSystemInfo::s_pSystemInfo = NULL;
- }
-}
-
-inline void cicUpdateUIFSys(void)
-{
- if (CUIFSystemInfo::s_pSystemInfo)
- CUIFSystemInfo::s_pSystemInfo->GetSystemMetrics();
-}
-
/////////////////////////////////////////////////////////////////////////////
+// CUIFTheme
-inline HRESULT CUIFTheme::InternalOpenThemeData(HWND hWnd)
+HRESULT CUIFTheme::InternalOpenThemeData(HWND hWnd)
{
if (!hWnd || !m_pszClassList)
return E_FAIL;
@@ -1212,14 +74,14 @@ inline HRESULT CUIFTheme::InternalOpenThemeData(HWND hWnd)
return (m_hTheme ? S_OK : E_FAIL);
}
-inline HRESULT CUIFTheme::EnsureThemeData(HWND hWnd)
+HRESULT CUIFTheme::EnsureThemeData(HWND hWnd)
{
if (m_hTheme)
return S_OK;
return InternalOpenThemeData(hWnd);
}
-inline HRESULT CUIFTheme::CloseThemeData()
+HRESULT CUIFTheme::CloseThemeData()
{
if (!m_hTheme)
return S_OK;
@@ -1232,7 +94,7 @@ inline HRESULT CUIFTheme::CloseThemeData()
return hr;
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::DrawThemeBackground(HDC hDC, int iStateId, LPCRECT pRect, LPCRECT pClipRect)
{
if (!cicGetFN(s_hUXTHEME, s_fnDrawThemeBackground, TEXT("uxtheme.dll"),
"DrawThemeBackground"))
@@ -1240,7 +102,7 @@ CUIFTheme::DrawThemeBackground(HDC hDC, int iStateId, LPCRECT pRect,
LPCRECT pCl
return s_fnDrawThemeBackground(m_hTheme, hDC, m_iPartId, iStateId, pRect,
pClipRect);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::DrawThemeParentBackground(HWND hwnd, HDC hDC, LPRECT prc)
{
if (!cicGetFN(s_hUXTHEME, s_fnDrawThemeParentBackground,
TEXT("uxtheme.dll"), "DrawThemeParentBackground"))
@@ -1248,7 +110,7 @@ CUIFTheme::DrawThemeParentBackground(HWND hwnd, HDC hDC, LPRECT prc)
return s_fnDrawThemeParentBackground(hwnd, hDC, prc);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::DrawThemeText(HDC hDC, int iStateId, LPCWSTR pszText, int cchText, DWORD
dwTextFlags, DWORD dwTextFlags2, LPCRECT pRect)
{
if (!cicGetFN(s_hUXTHEME, s_fnDrawThemeText, TEXT("uxtheme.dll"),
"DrawThemeText"))
@@ -1256,7 +118,7 @@ CUIFTheme::DrawThemeText(HDC hDC, int iStateId, LPCWSTR pszText, int
cchText, DW
return s_fnDrawThemeText(m_hTheme, hDC, m_iPartId, iStateId, pszText, cchText,
dwTextFlags, dwTextFlags2, pRect);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::DrawThemeIcon(HDC hDC, int iStateId, LPCRECT pRect, HIMAGELIST himl, int
iImageIndex)
{
if (!cicGetFN(s_hUXTHEME, s_fnDrawThemeIcon, TEXT("uxtheme.dll"),
"DrawThemeIcon"))
@@ -1264,7 +126,7 @@ CUIFTheme::DrawThemeIcon(HDC hDC, int iStateId, LPCRECT pRect,
HIMAGELIST himl,
return s_fnDrawThemeIcon(m_hTheme, hDC, m_iPartId, iStateId, pRect, himl,
iImageIndex);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::GetThemeBackgroundExtent(HDC hDC, int iStateId, LPCRECT pContentRect, LPRECT
pExtentRect)
{
if (!cicGetFN(s_hUXTHEME, s_fnGetThemeBackgroundExtent,
TEXT("uxtheme.dll"), "GetThemeBackgroundExtent"))
@@ -1272,7 +134,7 @@ CUIFTheme::GetThemeBackgroundExtent(HDC hDC, int iStateId, LPCRECT
pContentRect,
return s_fnGetThemeBackgroundExtent(m_hTheme, hDC, m_iPartId, iStateId, pContentRect,
pExtentRect);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::GetThemeBackgroundContentRect(HDC hDC, int iStateId, LPCRECT pBoundingRect,
LPRECT pContentRect)
{
if (!cicGetFN(s_hUXTHEME, s_fnGetThemeBackgroundContentRect,
TEXT("uxtheme.dll"), "GetThemeBackgroundContentRect"))
@@ -1280,7 +142,7 @@ CUIFTheme::GetThemeBackgroundContentRect(HDC hDC, int iStateId,
LPCRECT pBoundin
return s_fnGetThemeBackgroundContentRect(m_hTheme, hDC, m_iPartId, iStateId,
pBoundingRect, pContentRect);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::GetThemeTextExtent(HDC hDC, int iStateId, LPCWSTR pszText, int cchCharCount,
DWORD dwTextFlags, LPCRECT pBoundingRect, LPRECT pExtentRect)
{
if (!cicGetFN(s_hUXTHEME, s_fnGetThemeTextExtent, TEXT("uxtheme.dll"),
"GetThemeTextExtent"))
@@ -1288,7 +150,7 @@ CUIFTheme::GetThemeTextExtent(HDC hDC, int iStateId, LPCWSTR pszText,
int cchCha
return s_fnGetThemeTextExtent(m_hTheme, hDC, m_iPartId, iStateId, pszText,
cchCharCount, dwTextFlags, pBoundingRect, pExtentRect);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::GetThemePartSize(HDC hDC, int iStateId, LPRECT prc, THEMESIZE eSize, SIZE
*psz)
{
if (!cicGetFN(s_hUXTHEME, s_fnGetThemePartSize, TEXT("uxtheme.dll"),
"GetThemePartSize"))
@@ -1296,7 +158,7 @@ CUIFTheme::GetThemePartSize(HDC hDC, int iStateId, LPRECT prc,
THEMESIZE eSize,
return s_fnGetThemePartSize(m_hTheme, hDC, m_iPartId, iStateId, prc, eSize, psz);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::DrawThemeEdge(HDC hDC, int iStateId, LPCRECT pDestRect, UINT uEdge, UINT
uFlags, LPRECT pContentRect)
{
if (!cicGetFN(s_hUXTHEME, s_fnDrawThemeEdge, TEXT("uxtheme.dll"),
"DrawThemeEdge"))
@@ -1304,7 +166,7 @@ CUIFTheme::DrawThemeEdge(HDC hDC, int iStateId, LPCRECT pDestRect,
UINT uEdge, U
return s_fnDrawThemeEdge(m_hTheme, hDC, m_iPartId, iStateId, pDestRect, uEdge,
uFlags, pContentRect);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::GetThemeColor(int iStateId, int iPropId, COLORREF *pColor)
{
if (!cicGetFN(s_hUXTHEME, s_fnGetThemeColor, TEXT("uxtheme.dll"),
"GetThemeColor"))
@@ -1312,7 +174,7 @@ CUIFTheme::GetThemeColor(int iStateId, int iPropId, COLORREF
*pColor)
return s_fnGetThemeColor(m_hTheme, m_iPartId, iStateId, iPropId, pColor);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::GetThemeMargins(HDC hDC, int iStateId, int iPropId, LPRECT prc, MARGINS
*pMargins)
{
if (!cicGetFN(s_hUXTHEME, s_fnGetThemeMargins, TEXT("uxtheme.dll"),
"GetThemeMargins"))
@@ -1320,7 +182,7 @@ CUIFTheme::GetThemeMargins(HDC hDC, int iStateId, int iPropId, LPRECT
prc, MARGI
return s_fnGetThemeMargins(m_hTheme, hDC, m_iPartId, iStateId, iPropId, prc,
pMargins);
}
-inline STDMETHODIMP
+STDMETHODIMP
CUIFTheme::GetThemeFont(HDC hDC, int iStateId, int iPropId, LOGFONTW *pFont)
{
if (!cicGetFN(s_hUXTHEME, s_fnGetThemeFont, TEXT("uxtheme.dll"),
"GetThemeFont"))
@@ -1328,7 +190,7 @@ CUIFTheme::GetThemeFont(HDC hDC, int iStateId, int iPropId, LOGFONTW
*pFont)
return s_fnGetThemeFont(m_hTheme, hDC, m_iPartId, iStateId, iPropId, pFont);
}
-inline STDMETHODIMP_(COLORREF)
+STDMETHODIMP_(COLORREF)
CUIFTheme::GetThemeSysColor(INT iColorId)
{
if (!cicGetFN(s_hUXTHEME, s_fnGetThemeSysColor, TEXT("uxtheme.dll"),
"GetThemeSysColor"))
@@ -1336,7 +198,7 @@ CUIFTheme::GetThemeSysColor(INT iColorId)
return s_fnGetThemeSysColor(m_hTheme, iColorId);
}
-inline STDMETHODIMP_(int)
+STDMETHODIMP_(int)
CUIFTheme::GetThemeSysSize(int iSizeId)
{
if (!cicGetFN(s_hUXTHEME, s_fnGetThemeSysSize, TEXT("uxtheme.dll"),
"GetThemeSysSize"))
@@ -1344,7 +206,7 @@ CUIFTheme::GetThemeSysSize(int iSizeId)
return s_fnGetThemeSysSize(m_hTheme, iSizeId);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFTheme::SetActiveTheme(LPCWSTR pszClassList, INT iPartId, INT iStateId)
{
m_iPartId = iPartId;
@@ -1353,9 +215,9 @@ CUIFTheme::SetActiveTheme(LPCWSTR pszClassList, INT iPartId, INT
iStateId)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFObject
/// @unimplemented
-inline
CUIFObject::CUIFObject(CUIFObject *pParent, DWORD nObjectID, LPCRECT prc, DWORD style)
{
m_pszClassList = NULL;
@@ -1391,7 +253,6 @@ CUIFObject::CUIFObject(CUIFObject *pParent, DWORD nObjectID, LPCRECT
prc, DWORD
m_dwUnknown4[1] = -1; //FIXME: name
}
-inline
CUIFObject::~CUIFObject()
{
if (m_pWindow)
@@ -1420,28 +281,28 @@ CUIFObject::~CUIFObject()
CloseThemeData();
}
-inline STDMETHODIMP_(void) CUIFObject::OnPaint(HDC hDC)
+STDMETHODIMP_(void) CUIFObject::OnPaint(HDC hDC)
{
if (!(m_pWindow->m_style & UIF_WINDOW_ENABLETHEMED) || !OnPaintTheme(hDC))
OnPaintNoTheme(hDC);
}
-inline STDMETHODIMP_(BOOL) CUIFObject::OnSetCursor(UINT uMsg, LONG x, LONG y)
+STDMETHODIMP_(BOOL) CUIFObject::OnSetCursor(UINT uMsg, LONG x, LONG y)
{
return FALSE;
}
-inline STDMETHODIMP_(void) CUIFObject::GetRect(LPRECT prc)
+STDMETHODIMP_(void) CUIFObject::GetRect(LPRECT prc)
{
*prc = m_rc;
}
-inline STDMETHODIMP_(BOOL) CUIFObject::PtInObject(POINT pt)
+STDMETHODIMP_(BOOL) CUIFObject::PtInObject(POINT pt)
{
return m_bVisible && ::PtInRect(&m_rc, pt);
}
-inline STDMETHODIMP_(void) CUIFObject::PaintObject(HDC hDC, LPCRECT prc)
+STDMETHODIMP_(void) CUIFObject::PaintObject(HDC hDC, LPCRECT prc)
{
if (!m_bVisible)
return;
@@ -1460,13 +321,13 @@ inline STDMETHODIMP_(void) CUIFObject::PaintObject(HDC hDC, LPCRECT
prc)
}
}
-inline STDMETHODIMP_(void) CUIFObject::CallOnPaint()
+STDMETHODIMP_(void) CUIFObject::CallOnPaint()
{
if (m_pWindow)
m_pWindow->UpdateUI(&m_rc);
}
-inline STDMETHODIMP_(void) CUIFObject::Enable(BOOL bEnable)
+STDMETHODIMP_(void) CUIFObject::Enable(BOOL bEnable)
{
if (m_bEnable == bEnable)
return;
@@ -1478,7 +339,7 @@ inline STDMETHODIMP_(void) CUIFObject::Enable(BOOL bEnable)
CallOnPaint();
}
-inline STDMETHODIMP_(void) CUIFObject::Show(BOOL bVisible)
+STDMETHODIMP_(void) CUIFObject::Show(BOOL bVisible)
{
if (m_bVisible == bVisible)
return;
@@ -1491,7 +352,7 @@ inline STDMETHODIMP_(void) CUIFObject::Show(BOOL bVisible)
m_pParent->CallOnPaint();
}
-inline STDMETHODIMP_(void) CUIFObject::SetFontToThis(HFONT hFont)
+STDMETHODIMP_(void) CUIFObject::SetFontToThis(HFONT hFont)
{
m_bHasCustomFont = !!hFont;
if (!hFont)
@@ -1499,7 +360,7 @@ inline STDMETHODIMP_(void) CUIFObject::SetFontToThis(HFONT hFont)
m_hFont = hFont;
}
-inline STDMETHODIMP_(void) CUIFObject::SetFont(HFONT hFont)
+STDMETHODIMP_(void) CUIFObject::SetFont(HFONT hFont)
{
SetFontToThis(hFont);
@@ -1509,31 +370,31 @@ inline STDMETHODIMP_(void) CUIFObject::SetFont(HFONT hFont)
CallOnPaint();
}
-inline STDMETHODIMP_(void) CUIFObject::SetStyle(DWORD style)
+STDMETHODIMP_(void) CUIFObject::SetStyle(DWORD style)
{
m_style = style;
}
-inline STDMETHODIMP_(void) CUIFObject::AddUIObj(CUIFObject *pObject)
+STDMETHODIMP_(void) CUIFObject::AddUIObj(CUIFObject *pObject)
{
m_ObjectArray.Add(pObject);
CallOnPaint();
}
-inline STDMETHODIMP_(void) CUIFObject::RemoveUIObj(CUIFObject *pObject)
+STDMETHODIMP_(void) CUIFObject::RemoveUIObj(CUIFObject *pObject)
{
if (m_ObjectArray.Remove(pObject))
CallOnPaint();
}
-inline STDMETHODIMP_(LRESULT) CUIFObject::OnObjectNotify(CUIFObject *pObject, WPARAM
wParam, LPARAM lParam)
+STDMETHODIMP_(LRESULT) CUIFObject::OnObjectNotify(CUIFObject *pObject, WPARAM wParam,
LPARAM lParam)
{
if (m_pParent)
return m_pParent->OnObjectNotify(pObject, wParam, lParam);
return 0;
}
-inline STDMETHODIMP_(void) CUIFObject::SetToolTip(LPCWSTR pszToolTip)
+STDMETHODIMP_(void) CUIFObject::SetToolTip(LPCWSTR pszToolTip)
{
if (m_pszToolTip)
{
@@ -1550,38 +411,38 @@ inline STDMETHODIMP_(void) CUIFObject::SetToolTip(LPCWSTR
pszToolTip)
}
}
-inline STDMETHODIMP_(void) CUIFObject::ClearWndObj()
+STDMETHODIMP_(void) CUIFObject::ClearWndObj()
{
m_pWindow = NULL;
for (size_t iItem = 0; iItem < m_ObjectArray.size(); ++iItem)
m_ObjectArray[iItem]->ClearWndObj();
}
-inline STDMETHODIMP_(void) CUIFObject::ClearTheme()
+STDMETHODIMP_(void) CUIFObject::ClearTheme()
{
CloseThemeData();
for (size_t iItem = 0; iItem < m_ObjectArray.size(); ++iItem)
m_ObjectArray[iItem]->ClearTheme();
}
-inline void CUIFObject::StartCapture()
+void CUIFObject::StartCapture()
{
if (m_pWindow)
m_pWindow->SetCaptureObject(this);
}
-inline void CUIFObject::EndCapture()
+void CUIFObject::EndCapture()
{
if (m_pWindow)
m_pWindow->SetCaptureObject(NULL);
}
-inline BOOL CUIFObject::IsCapture()
+BOOL CUIFObject::IsCapture()
{
return m_pWindow && (m_pWindow->m_pCaptured == this);
}
-inline void CUIFObject::SetRect(LPCRECT prc)
+void CUIFObject::SetRect(LPCRECT prc)
{
m_rc = *prc;
if (m_pWindow)
@@ -1589,14 +450,14 @@ inline void CUIFObject::SetRect(LPCRECT prc)
CallOnPaint();
}
-inline LRESULT CUIFObject::NotifyCommand(WPARAM wParam, LPARAM lParam)
+LRESULT CUIFObject::NotifyCommand(WPARAM wParam, LPARAM lParam)
{
if (m_pParent)
return m_pParent->OnObjectNotify(this, wParam, lParam);
return 0;
}
-inline void CUIFObject::DetachWndObj()
+void CUIFObject::DetachWndObj()
{
if (m_pWindow)
{
@@ -1609,14 +470,14 @@ inline void CUIFObject::DetachWndObj()
}
}
-inline BOOL CUIFObject::IsRTL()
+BOOL CUIFObject::IsRTL()
{
if (!m_pWindow)
return FALSE;
return !!(m_pWindow->m_style & UIF_WINDOW_LAYOUTRTL);
}
-inline CUIFObject* CUIFObject::ObjectFromPoint(POINT pt)
+CUIFObject* CUIFObject::ObjectFromPoint(POINT pt)
{
if (!PtInObject(pt))
return NULL;
@@ -1631,7 +492,7 @@ inline CUIFObject* CUIFObject::ObjectFromPoint(POINT pt)
return pFound;
}
-inline void CUIFObject::SetScheme(CUIFScheme *scheme)
+void CUIFObject::SetScheme(CUIFScheme *scheme)
{
m_pScheme = scheme;
for (size_t i = 0; i < m_ObjectArray.size(); ++i)
@@ -1640,21 +501,22 @@ inline void CUIFObject::SetScheme(CUIFScheme *scheme)
}
}
-inline void CUIFObject::StartTimer(WPARAM wParam)
+void CUIFObject::StartTimer(WPARAM wParam)
{
if (m_pWindow)
m_pWindow->SetTimerObject(this, wParam);
}
-inline void CUIFObject::EndTimer()
+void CUIFObject::EndTimer()
{
if (m_pWindow)
m_pWindow->SetTimerObject(NULL, 0);
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFColorTable...
-inline STDMETHODIMP_(void) CUIFColorTableSys::InitColor()
+STDMETHODIMP_(void) CUIFColorTableSys::InitColor()
{
m_rgbColors[0] = ::GetSysColor(COLOR_BTNFACE);
m_rgbColors[1] = ::GetSysColor(COLOR_BTNSHADOW);
@@ -1674,12 +536,12 @@ inline STDMETHODIMP_(void) CUIFColorTableSys::InitColor()
m_rgbColors[15] = ::GetSysColor(COLOR_WINDOWTEXT);
}
-inline STDMETHODIMP_(void) CUIFColorTableSys::InitBrush()
+STDMETHODIMP_(void) CUIFColorTableSys::InitBrush()
{
ZeroMemory(m_hBrushes, sizeof(m_hBrushes));
}
-inline STDMETHODIMP_(void) CUIFColorTableSys::DoneBrush()
+STDMETHODIMP_(void) CUIFColorTableSys::DoneBrush()
{
for (size_t i = 0; i < _countof(m_hBrushes); ++i)
{
@@ -1691,14 +553,14 @@ inline STDMETHODIMP_(void) CUIFColorTableSys::DoneBrush()
}
}
-inline HBRUSH CUIFColorTableSys::GetBrush(INT iColor)
+HBRUSH CUIFColorTableSys::GetBrush(INT iColor)
{
if (!m_hBrushes[iColor])
m_hBrushes[iColor] = ::CreateSolidBrush(m_rgbColors[iColor]);
return m_hBrushes[iColor];
}
-inline HBRUSH CUIFColorTableOff10::GetBrush(INT iColor)
+HBRUSH CUIFColorTableOff10::GetBrush(INT iColor)
{
if (!m_hBrushes[iColor])
m_hBrushes[iColor] = ::CreateSolidBrush(m_rgbColors[iColor]);
@@ -1706,7 +568,7 @@ inline HBRUSH CUIFColorTableOff10::GetBrush(INT iColor)
}
/// @unimplemented
-inline STDMETHODIMP_(void) CUIFColorTableOff10::InitColor()
+STDMETHODIMP_(void) CUIFColorTableOff10::InitColor()
{
m_rgbColors[0] = ::GetSysColor(COLOR_BTNFACE);
m_rgbColors[1] = ::GetSysColor(COLOR_WINDOW);
@@ -1742,12 +604,12 @@ inline STDMETHODIMP_(void) CUIFColorTableOff10::InitColor()
m_rgbColors[31] = ::GetSysColor(COLOR_WINDOWTEXT);
}
-inline STDMETHODIMP_(void) CUIFColorTableOff10::InitBrush()
+STDMETHODIMP_(void) CUIFColorTableOff10::InitBrush()
{
ZeroMemory(m_hBrushes, sizeof(m_hBrushes));
}
-inline STDMETHODIMP_(void) CUIFColorTableOff10::DoneBrush()
+STDMETHODIMP_(void) CUIFColorTableOff10::DoneBrush()
{
for (size_t i = 0; i < _countof(m_hBrushes); ++i)
{
@@ -1760,106 +622,70 @@ inline STDMETHODIMP_(void) CUIFColorTableOff10::DoneBrush()
}
/////////////////////////////////////////////////////////////////////////////
-
-inline void cicInitUIFScheme(void)
-{
- CUIFColorTable *pColorTable;
-
- pColorTable = CUIFScheme::s_pColorTableSys = new(cicNoThrow) CUIFColorTableSys();
- if (pColorTable)
- {
- pColorTable->InitColor();
- pColorTable->InitBrush();
- }
-
- pColorTable = CUIFScheme::s_pColorTableOff10 = new(cicNoThrow)
CUIFColorTableOff10();
- if (pColorTable)
- {
- pColorTable->InitColor();
- pColorTable->InitBrush();
- }
-}
-
-inline void cicUpdateUIFScheme(void)
-{
- if (CUIFScheme::s_pColorTableSys)
- CUIFScheme::s_pColorTableSys->Update();
- if (CUIFScheme::s_pColorTableOff10)
- CUIFScheme::s_pColorTableOff10->Update();
-}
-
-inline void cicDoneUIFScheme(void)
-{
- if (CUIFScheme::s_pColorTableSys)
- {
- delete CUIFScheme::s_pColorTableSys;
- CUIFScheme::s_pColorTableSys = NULL;
- }
- if (CUIFScheme::s_pColorTableOff10)
- {
- delete CUIFScheme::s_pColorTableOff10;
- CUIFScheme::s_pColorTableOff10 = NULL;
- }
-}
+// CUIFScheme
/// @unimplemented
-inline CUIFScheme *cicCreateUIFScheme(DWORD type)
+CUIFScheme *cicCreateUIFScheme(DWORD type)
{
+#if 1
+ return new(cicNoThrow) CUIFSchemeDef(type);
+#else
switch (type)
{
- //case 1: return new(cicNoThrow) CUIFSchemeOff10(1);
- //case 2: return new(cicNoThrow) CUIFSchemeOff10(2);
- //case 3: return new(cicNoThrow) CUIFSchemeOff10(3);
+ case 1: return new(cicNoThrow) CUIFSchemeOff10(1);
+ case 2: return new(cicNoThrow) CUIFSchemeOff10(2);
+ case 3: return new(cicNoThrow) CUIFSchemeOff10(3);
default: return new(cicNoThrow) CUIFSchemeDef(type);
}
+#endif
}
-inline STDMETHODIMP_(DWORD) CUIFSchemeDef::GetType()
+STDMETHODIMP_(DWORD) CUIFSchemeDef::GetType()
{
return m_dwType;
}
-inline STDMETHODIMP_(COLORREF) CUIFSchemeDef::GetColor(INT iColor)
+STDMETHODIMP_(COLORREF) CUIFSchemeDef::GetColor(INT iColor)
{
return s_pColorTableSys->GetColor(iColor);
}
-inline STDMETHODIMP_(HBRUSH) CUIFSchemeDef::GetBrush(INT iColor)
+STDMETHODIMP_(HBRUSH) CUIFSchemeDef::GetBrush(INT iColor)
{
return s_pColorTableSys->GetBrush(iColor);
}
-inline STDMETHODIMP_(INT) CUIFSchemeDef::CyMenuItem(INT cyText)
+STDMETHODIMP_(INT) CUIFSchemeDef::CyMenuItem(INT cyText)
{
return cyText + 2;
}
-inline STDMETHODIMP_(INT) CUIFSchemeDef::CxSizeFrame()
+STDMETHODIMP_(INT) CUIFSchemeDef::CxSizeFrame()
{
return ::GetSystemMetrics(SM_CXSIZEFRAME);
}
-inline STDMETHODIMP_(INT) CUIFSchemeDef::CySizeFrame()
+STDMETHODIMP_(INT) CUIFSchemeDef::CySizeFrame()
{
return ::GetSystemMetrics(SM_CYSIZEFRAME);
}
-inline STDMETHODIMP_(void) CUIFScheme::FillRect(HDC hDC, LPCRECT prc, INT iColor)
+STDMETHODIMP_(void) CUIFScheme::FillRect(HDC hDC, LPCRECT prc, INT iColor)
{
::FillRect(hDC, prc, GetBrush(iColor));
}
-inline STDMETHODIMP_(void) CUIFScheme::FrameRect(HDC hDC, LPCRECT prc, INT iColor)
+STDMETHODIMP_(void) CUIFScheme::FrameRect(HDC hDC, LPCRECT prc, INT iColor)
{
::FrameRect(hDC, prc, GetBrush(iColor));
}
-inline STDMETHODIMP_(void) CUIFSchemeDef::DrawSelectionRect(HDC hDC, LPCRECT prc, int)
+STDMETHODIMP_(void) CUIFSchemeDef::DrawSelectionRect(HDC hDC, LPCRECT prc, int)
{
::FillRect(hDC, prc, GetBrush(6));
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::GetCtrlFaceOffset(DWORD dwUnknownFlags, DWORD dwDrawFlags, LPSIZE pSize)
{
if (!(dwDrawFlags & UIF_DRAW_PRESSED))
@@ -1899,7 +725,7 @@ CUIFSchemeDef::GetCtrlFaceOffset(DWORD dwUnknownFlags, DWORD
dwDrawFlags, LPSIZE
pSize->cx = pSize->cy = -1;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawCtrlBkgd(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags)
{
::FillRect(hDC, prc, GetBrush(9));
@@ -1922,7 +748,7 @@ CUIFSchemeDef::DrawCtrlBkgd(HDC hDC, LPCRECT prc, DWORD
dwUnknownFlags, DWORD dw
::DeleteObject(hbrDither);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawCtrlEdge(
HDC hDC,
LPCRECT prc,
@@ -1970,7 +796,7 @@ CUIFSchemeDef::DrawCtrlEdge(
::DrawEdge(hDC, &rc, uEdge, BF_RECT);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawCtrlText(
HDC hDC,
LPCRECT prc,
@@ -2003,7 +829,7 @@ CUIFSchemeDef::DrawCtrlText(
::SetBkMode(hDC, OldBkMode);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawCtrlIcon(HDC hDC, LPCRECT prc, HICON hIcon, DWORD dwDrawFlags, LPSIZE
pSize)
{
if (m_bMirroring)
@@ -2025,7 +851,7 @@ CUIFSchemeDef::DrawCtrlIcon(HDC hDC, LPCRECT prc, HICON hIcon, DWORD
dwDrawFlags
}
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawCtrlBitmap(HDC hDC, LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2, DWORD
dwDrawFlags)
{
if (m_bMirroring)
@@ -2087,13 +913,13 @@ CUIFSchemeDef::DrawCtrlBitmap(HDC hDC, LPCRECT prc, HBITMAP hbm1,
HBITMAP hbm2,
}
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawMenuBitmap(HDC hDC, LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2, DWORD
dwDrawFlags)
{
DrawCtrlBitmap(hDC, prc, hbm1, hbm2, dwDrawFlags);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawMenuSeparator(HDC hDC, LPCRECT prc)
{
RECT rc = *prc;
@@ -2105,31 +931,31 @@ CUIFSchemeDef::DrawMenuSeparator(HDC hDC, LPCRECT prc)
::FillRect(hDC, &rc, (HBRUSH)UlongToHandle(COLOR_BTNHIGHLIGHT + 1));
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawFrameCtrlBkgd(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags)
{
DrawCtrlBkgd(hDC, prc, dwUnknownFlags, dwDrawFlags);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawFrameCtrlEdge(HDC hDC, LPCRECT prc, DWORD dwUnknownFlags, DWORD
dwDrawFlags)
{
DrawCtrlEdge(hDC, prc, dwUnknownFlags, dwDrawFlags);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawFrameCtrlIcon(HDC hDC, LPCRECT prc, HICON hIcon, DWORD dwDrawFlags,
LPSIZE pSize)
{
DrawCtrlIcon(hDC, prc, hIcon, dwDrawFlags, pSize);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawFrameCtrlBitmap(HDC hDC, LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2,
DWORD dwDrawFlags)
{
DrawCtrlBitmap(hDC, prc, hbm1, hbm2, dwDrawFlags);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawWndFrame(HDC hDC, LPCRECT prc, DWORD type, DWORD unused1, DWORD
unused2)
{
RECT rc = *prc;
@@ -2139,7 +965,7 @@ CUIFSchemeDef::DrawWndFrame(HDC hDC, LPCRECT prc, DWORD type, DWORD
unused1, DWO
FrameRect(hDC, &rc, 14);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawDragHandle(HDC hDC, LPCRECT prc, BOOL bVertical)
{
RECT rc;
@@ -2150,7 +976,7 @@ CUIFSchemeDef::DrawDragHandle(HDC hDC, LPCRECT prc, BOOL bVertical)
::DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFSchemeDef::DrawSeparator(HDC hDC, LPCRECT prc, BOOL bVertical)
{
HPEN hLightPen = ::CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_BTNHIGHLIGHT));
@@ -2188,23 +1014,9 @@ CUIFSchemeDef::DrawSeparator(HDC hDC, LPCRECT prc, BOOL bVertical)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFIcon
-inline BOOL cicGetIconSize(HICON hIcon, LPSIZE pSize)
-{
- ICONINFO IconInfo;
- if (!GetIconInfo(hIcon, &IconInfo))
- return FALSE;
-
- BITMAP bm;
- ::GetObject(IconInfo.hbmColor, sizeof(bm), &bm);
- ::DeleteObject(IconInfo.hbmColor);
- ::DeleteObject(IconInfo.hbmMask);
- pSize->cx = bm.bmWidth;
- pSize->cy = bm.bmHeight;
- return TRUE;
-}
-
-inline HIMAGELIST CUIFIcon::GetImageList(BOOL bMirror)
+HIMAGELIST CUIFIcon::GetImageList(BOOL bMirror)
{
if (!m_hImageList)
return NULL;
@@ -2229,8 +1041,9 @@ inline HIMAGELIST CUIFIcon::GetImageList(BOOL bMirror)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFBitmapDC
-inline CUIFBitmapDC::CUIFBitmapDC(BOOL bMemory)
+CUIFBitmapDC::CUIFBitmapDC(BOOL bMemory)
{
m_hBitmap = NULL;
m_hOldBitmap = NULL;
@@ -2241,13 +1054,13 @@ inline CUIFBitmapDC::CUIFBitmapDC(BOOL bMemory)
m_hDC = ::CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
}
-inline CUIFBitmapDC::~CUIFBitmapDC()
+CUIFBitmapDC::~CUIFBitmapDC()
{
Uninit();
::DeleteDC(m_hDC);
}
-inline void CUIFBitmapDC::Uninit(BOOL bKeep)
+void CUIFBitmapDC::Uninit(BOOL bKeep)
{
if (m_hOldBitmap)
{
@@ -2271,21 +1084,21 @@ inline void CUIFBitmapDC::Uninit(BOOL bKeep)
}
}
-inline BOOL CUIFBitmapDC::SetBitmap(HBITMAP hBitmap)
+BOOL CUIFBitmapDC::SetBitmap(HBITMAP hBitmap)
{
if (m_hDC)
m_hOldBitmap = ::SelectObject(m_hDC, hBitmap);
return TRUE;
}
-inline BOOL CUIFBitmapDC::SetBitmap(LONG cx, LONG cy, WORD cPlanes, WORD cBitCount)
+BOOL CUIFBitmapDC::SetBitmap(LONG cx, LONG cy, WORD cPlanes, WORD cBitCount)
{
m_hBitmap = ::CreateBitmap(cx, cy, cPlanes, cBitCount, 0);
m_hOldBitmap = ::SelectObject(m_hDC, m_hBitmap);
return TRUE;
}
-inline BOOL CUIFBitmapDC::SetDIB(LONG cx, LONG cy, WORD cPlanes, WORD cBitCount)
+BOOL CUIFBitmapDC::SetDIB(LONG cx, LONG cy, WORD cPlanes, WORD cBitCount)
{
BITMAPINFO bmi;
ZeroMemory(&bmi, sizeof(bmi));
@@ -2300,7 +1113,7 @@ inline BOOL CUIFBitmapDC::SetDIB(LONG cx, LONG cy, WORD cPlanes,
WORD cBitCount)
return TRUE;
}
-inline void cicInitUIFUtil(void)
+void cicInitUIFUtil(void)
{
if (!CUIFBitmapDC::s_phdcSrc)
CUIFBitmapDC::s_phdcSrc = new(cicNoThrow) CUIFBitmapDC(TRUE);
@@ -2315,7 +1128,7 @@ inline void cicInitUIFUtil(void)
CUIFBitmapDC::s_fInitBitmapDCs = TRUE;
}
-inline void cicDoneUIFUtil(void)
+void cicDoneUIFUtil(void)
{
if (CUIFBitmapDC::s_phdcSrc)
{
@@ -2338,7 +1151,7 @@ inline void cicDoneUIFUtil(void)
CUIFBitmapDC::s_fInitBitmapDCs = FALSE;
}
-inline HBITMAP cicMirrorBitmap(HBITMAP hBitmap, HBRUSH hbrBack)
+HBITMAP cicMirrorBitmap(HBITMAP hBitmap, HBRUSH hbrBack)
{
BITMAP bm;
if (!CUIFBitmapDC::s_fInitBitmapDCs || !::GetObject(hBitmap, sizeof(bm), &bm))
@@ -2355,7 +1168,7 @@ inline HBITMAP cicMirrorBitmap(HBITMAP hBitmap, HBRUSH hbrBack)
::BitBlt(*CUIFBitmapDC::s_phdcMask, 0, 0, bm.bmWidth, bm.bmHeight,
*CUIFBitmapDC::s_phdcSrc, 0, 0, SRCCOPY);
- ::SetLayout(*CUIFBitmapDC::s_phdcMask, LAYOUT_LTR);
+ ::SetLayout(*CUIFBitmapDC::s_phdcMask, 0);
::BitBlt(*CUIFBitmapDC::s_phdcDst, 0, 0, bm.bmWidth, bm.bmHeight,
*CUIFBitmapDC::s_phdcMask, 1, 0, SRCCOPY);
@@ -2365,7 +1178,7 @@ inline HBITMAP cicMirrorBitmap(HBITMAP hBitmap, HBRUSH hbrBack)
return CUIFBitmapDC::s_phdcDst->DetachBitmap();
}
-inline HBRUSH cicCreateDitherBrush(VOID)
+HBRUSH cicCreateDitherBrush(VOID)
{
BYTE bytes[16];
ZeroMemory(&bytes, sizeof(bytes));
@@ -2383,7 +1196,7 @@ inline HBRUSH cicCreateDitherBrush(VOID)
return hbr;
}
-inline HBITMAP
+HBITMAP
cicCreateDisabledBitmap(LPCRECT prc, HBITMAP hbmMask, HBRUSH hbr1, HBRUSH hbr2, BOOL
bPressed)
{
if (!CUIFBitmapDC::s_fInitBitmapDCs)
@@ -2420,7 +1233,7 @@ cicCreateDisabledBitmap(LPCRECT prc, HBITMAP hbmMask, HBRUSH hbr1,
HBRUSH hbr2,
return CUIFBitmapDC::s_phdcDst->DetachBitmap();
}
-inline HBITMAP
+HBITMAP
cicCreateShadowMaskBmp(LPRECT prc, HBITMAP hbm1, HBITMAP hbm2, HBRUSH hbr1, HBRUSH hbr2)
{
if (!CUIFBitmapDC::s_fInitBitmapDCs)
@@ -2455,7 +1268,7 @@ cicCreateShadowMaskBmp(LPRECT prc, HBITMAP hbm1, HBITMAP hbm2,
HBRUSH hbr1, HBRU
return CUIFBitmapDC::s_phdcDst->DetachBitmap();
}
-inline HBITMAP
+HBITMAP
cicChangeBitmapColor(LPCRECT prc, HBITMAP hbm, COLORREF rgbBack, COLORREF rgbFore)
{
if (!CUIFBitmapDC::s_fInitBitmapDCs)
@@ -2485,7 +1298,7 @@ cicChangeBitmapColor(LPCRECT prc, HBITMAP hbm, COLORREF rgbBack,
COLORREF rgbFor
return CUIFBitmapDC::s_phdcDst->DetachBitmap();
}
-inline HBITMAP
+HBITMAP
cicConvertBlackBKGBitmap(LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2, HBRUSH hBrush)
{
if (!CUIFBitmapDC::s_fInitBitmapDCs)
@@ -2525,7 +1338,7 @@ cicConvertBlackBKGBitmap(LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2,
HBRUSH hBrush)
return CUIFBitmapDC::s_phdcDst->DetachBitmap();
}
-inline HBITMAP
+HBITMAP
cicCreateMaskBmp(LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2,
HBRUSH hbr, COLORREF rgbColor, COLORREF rgbBack)
{
@@ -2559,10 +1372,10 @@ cicCreateMaskBmp(LPCRECT prc, HBITMAP hbm1, HBITMAP hbm2,
return CUIFBitmapDC::s_phdcDst->DetachBitmap();
}
-inline BOOL cicGetIconBitmaps(HICON hIcon, HBITMAP *hbm1, HBITMAP *hbm2, const SIZE
*pSize)
+BOOL cicGetIconBitmaps(HICON hIcon, HBITMAP *hbm1, HBITMAP *hbm2, const SIZE *pSize)
{
if (!CUIFBitmapDC::s_fInitBitmapDCs)
- return NULL;
+ return FALSE;
SIZE size;
if (pSize)
@@ -2591,7 +1404,7 @@ inline BOOL cicGetIconBitmaps(HICON hIcon, HBITMAP *hbm1, HBITMAP
*hbm2, const S
return TRUE;
}
-inline void cicDrawMaskBmpOnDC(HDC hDC, LPCRECT prc, HBITMAP hbmp, HBITMAP hbmpMask)
+void cicDrawMaskBmpOnDC(HDC hDC, LPCRECT prc, HBITMAP hbmp, HBITMAP hbmpMask)
{
if (!CUIFBitmapDC::s_fInitBitmapDCs)
return;
@@ -2610,8 +1423,9 @@ inline void cicDrawMaskBmpOnDC(HDC hDC, LPCRECT prc, HBITMAP hbmp,
HBITMAP hbmpM
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFWindow
-inline CUIFWindow::CUIFWindow(HINSTANCE hInst, DWORD style)
+CUIFWindow::CUIFWindow(HINSTANCE hInst, DWORD style)
: CUIFObject(NULL, 0, NULL, style)
{
m_hInst = hInst;
@@ -2632,7 +1446,7 @@ inline CUIFWindow::CUIFWindow(HINSTANCE hInst, DWORD style)
CUIFWindow::CreateScheme();
}
-inline CUIFWindow::~CUIFWindow()
+CUIFWindow::~CUIFWindow()
{
if (m_pToolTip)
{
@@ -2659,7 +1473,7 @@ inline CUIFWindow::~CUIFWindow()
}
}
-inline STDMETHODIMP_(BOOL)
+STDMETHODIMP_(BOOL)
CUIFWindow::Initialize()
{
LPCTSTR pszClass = GetClassName();
@@ -2706,31 +1520,31 @@ CUIFWindow::Initialize()
return CUIFObject::Initialize();
}
-inline STDMETHODIMP_(LRESULT)
+STDMETHODIMP_(LRESULT)
CUIFWindow::OnSettingChange(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}
-inline void CUIFWindow::UpdateUI(LPCRECT prc)
+void CUIFWindow::UpdateUI(LPCRECT prc)
{
if (::IsWindow(m_hWnd))
::InvalidateRect(m_hWnd, prc, FALSE);
}
-inline CUIFWindow*
+CUIFWindow*
CUIFWindow::GetThis(HWND hWnd)
{
return (CUIFWindow*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
}
-inline void
+void
CUIFWindow::SetThis(HWND hWnd, LONG_PTR dwNewLong)
{
::SetWindowLongPtr(hWnd, GWLP_USERDATA, dwNewLong);
}
-inline void CUIFWindow::CreateScheme()
+void CUIFWindow::CreateScheme()
{
if (m_pScheme)
{
@@ -2750,7 +1564,7 @@ inline void CUIFWindow::CreateScheme()
SetScheme(m_pScheme);
}
-inline STDMETHODIMP_(DWORD)
+STDMETHODIMP_(DWORD)
CUIFWindow::GetWndStyle()
{
DWORD ret;
@@ -2770,7 +1584,7 @@ CUIFWindow::GetWndStyle()
return ret;
}
-inline STDMETHODIMP_(DWORD)
+STDMETHODIMP_(DWORD)
CUIFWindow::GetWndStyleEx()
{
DWORD ret = 0;
@@ -2783,7 +1597,7 @@ CUIFWindow::GetWndStyleEx()
return ret;
}
-inline STDMETHODIMP_(HWND)
+STDMETHODIMP_(HWND)
CUIFWindow::CreateWnd(HWND hwndParent)
{
HWND hWnd = CreateWindowEx(GetWndStyleEx(), GetClassName(), GetWndTitle(),
GetWndStyle(),
@@ -2796,7 +1610,7 @@ CUIFWindow::CreateWnd(HWND hwndParent)
return hWnd;
}
-inline void CUIFWindow::Show(BOOL bVisible)
+void CUIFWindow::Show(BOOL bVisible)
{
if (!IsWindow(m_hWnd))
return;
@@ -2808,7 +1622,7 @@ inline void CUIFWindow::Show(BOOL bVisible)
::ShowWindow(m_hWnd, (bVisible ? SW_SHOWNOACTIVATE : 0));
}
-inline STDMETHODIMP_(BOOL)
+STDMETHODIMP_(BOOL)
CUIFWindow::AnimateWnd(DWORD dwTime, DWORD dwFlags)
{
if (!::IsWindow(m_hWnd))
@@ -2823,7 +1637,7 @@ CUIFWindow::AnimateWnd(DWORD dwTime, DWORD dwFlags)
return ret;
}
-inline void CUIFWindow::SetCaptureObject(CUIFObject *pCaptured)
+void CUIFWindow::SetCaptureObject(CUIFObject *pCaptured)
{
if (pCaptured)
{
@@ -2837,7 +1651,7 @@ inline void CUIFWindow::SetCaptureObject(CUIFObject *pCaptured)
}
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::SetCapture(BOOL bSet)
{
if (bSet)
@@ -2846,7 +1660,7 @@ CUIFWindow::SetCapture(BOOL bSet)
::ReleaseCapture();
}
-inline void CUIFWindow::SetObjectPointed(CUIFObject *pPointed, POINT pt)
+void CUIFWindow::SetObjectPointed(CUIFObject *pPointed, POINT pt)
{
if (pPointed == m_pPointed)
return;
@@ -2874,7 +1688,7 @@ inline void CUIFWindow::SetObjectPointed(CUIFObject *pPointed, POINT
pt)
}
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::OnObjectMoved(CUIFObject *pObject)
{
if (!::IsWindow(m_hWnd))
@@ -2888,7 +1702,7 @@ CUIFWindow::OnObjectMoved(CUIFObject *pObject)
SetObjectPointed(pFound, pt2);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::SetRect(LPCRECT prc)
{
RECT Rect = { 0, 0, 0, 0 };
@@ -2899,7 +1713,7 @@ CUIFWindow::SetRect(LPCRECT prc)
CUIFObject::SetRect(&Rect);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::ClientRectToWindowRect(LPRECT lpRect)
{
DWORD style, exstyle;
@@ -2916,7 +1730,7 @@ CUIFWindow::ClientRectToWindowRect(LPRECT lpRect)
::AdjustWindowRectEx(lpRect, style, FALSE, exstyle);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::GetWindowFrameSize(LPSIZE pSize)
{
RECT rc = { 0, 0, 0, 0 };
@@ -2926,20 +1740,20 @@ CUIFWindow::GetWindowFrameSize(LPSIZE pSize)
pSize->cy = (rc.bottom - rc.top) / 2;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::OnAnimationEnd()
{
if (m_pShadow && m_bShowShadow)
m_pShadow->Show(m_bVisible);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::OnThemeChanged(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
ClearTheme();
}
-inline LRESULT
+LRESULT
CUIFWindow::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
@@ -3159,7 +1973,7 @@ CUIFWindow::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
return 0;
}
-inline LRESULT CALLBACK
+LRESULT CALLBACK
CUIFWindow::WindowProcedure(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
CUIFWindow *This;
@@ -3195,7 +2009,7 @@ CUIFWindow::WindowProcedure(HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam)
return This->WindowProc(hWnd, uMsg, wParam, lParam);
}
-inline BOOL
+BOOL
CUIFWindow::GetWorkArea(LPCRECT prcWnd, LPRECT prcWorkArea)
{
if (!(m_style & (UIF_WINDOW_WORKAREA | UIF_WINDOW_MONITOR)))
@@ -3225,7 +2039,7 @@ CUIFWindow::GetWorkArea(LPCRECT prcWnd, LPRECT prcWorkArea)
return TRUE;
}
-inline void
+void
CUIFWindow::AdjustWindowPosition()
{
RECT rc;
@@ -3248,12 +2062,12 @@ CUIFWindow::AdjustWindowPosition()
m_nTop = rcWorkArea.bottom - m_nHeight;
}
-inline void CUIFWindow::SetBehindModal(CUIFWindow *pBehindModal)
+void CUIFWindow::SetBehindModal(CUIFWindow *pBehindModal)
{
m_pBehindModal = pBehindModal;
}
-inline void CUIFWindow::SetTimerObject(CUIFObject *pTimerObject, UINT uElapse)
+void CUIFWindow::SetTimerObject(CUIFObject *pTimerObject, UINT uElapse)
{
if (pTimerObject)
{
@@ -3267,7 +2081,7 @@ inline void CUIFWindow::SetTimerObject(CUIFObject *pTimerObject,
UINT uElapse)
}
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::PaintObject(HDC hDC, LPCRECT prc)
{
BOOL bGotDC = FALSE;
@@ -3305,7 +2119,7 @@ CUIFWindow::PaintObject(HDC hDC, LPCRECT prc)
::ReleaseDC(m_hWnd, hDC);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::Move(INT x, INT y, INT nWidth, INT nHeight)
{
m_nLeft = x;
@@ -3321,7 +2135,7 @@ CUIFWindow::Move(INT x, INT y, INT nWidth, INT nHeight)
}
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::RemoveUIObj(CUIFObject *pRemove)
{
if (pRemove == m_pCaptured)
@@ -3339,7 +2153,7 @@ CUIFWindow::RemoveUIObj(CUIFObject *pRemove)
CUIFObject::RemoveUIObj(pRemove);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWindow::HandleMouseMsg(UINT uMsg, LONG x, LONG y)
{
POINT pt = { x, y };
@@ -3387,9 +2201,10 @@ CUIFWindow::HandleMouseMsg(UINT uMsg, LONG x, LONG y)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFShadow
/// @unimplemented
-inline CUIFShadow::CUIFShadow(HINSTANCE hInst, DWORD style, CUIFWindow *pShadowOwner)
+CUIFShadow::CUIFShadow(HINSTANCE hInst, DWORD style, CUIFWindow *pShadowOwner)
: CUIFWindow(hInst, (style | UIF_WINDOW_TOOLWINDOW))
{
m_pShadowOwner = pShadowOwner;
@@ -3400,14 +2215,14 @@ inline CUIFShadow::CUIFShadow(HINSTANCE hInst, DWORD style,
CUIFWindow *pShadowO
m_bLayerAvailable = FALSE;
}
-inline CUIFShadow::~CUIFShadow()
+CUIFShadow::~CUIFShadow()
{
if (m_pShadowOwner)
m_pShadowOwner->m_pShadow = NULL;
}
/// @unimplemented
-inline void CUIFShadow::InitSettings()
+void CUIFShadow::InitSettings()
{
m_bLayerAvailable = FALSE;
m_rgbShadowColor = RGB(128, 128, 128);
@@ -3415,7 +2230,7 @@ inline void CUIFShadow::InitSettings()
}
/// @unimplemented
-inline void CUIFShadow::InitShadow()
+void CUIFShadow::InitShadow()
{
if (m_bLayerAvailable)
{
@@ -3423,7 +2238,7 @@ inline void CUIFShadow::InitShadow()
}
}
-inline void CUIFShadow::AdjustWindowPos()
+void CUIFShadow::AdjustWindowPos()
{
HWND hwndOwner = *m_pShadowOwner;
if (!::IsWindow(m_hWnd))
@@ -3439,7 +2254,7 @@ inline void CUIFShadow::AdjustWindowPos()
SWP_NOOWNERZORDER | SWP_NOACTIVATE);
}
-inline void CUIFShadow::OnOwnerWndMoved(BOOL bDoSize)
+void CUIFShadow::OnOwnerWndMoved(BOOL bDoSize)
{
if (::IsWindow(m_hWnd) && ::IsWindowVisible(m_hWnd))
{
@@ -3449,14 +2264,14 @@ inline void CUIFShadow::OnOwnerWndMoved(BOOL bDoSize)
}
}
-inline STDMETHODIMP_(BOOL)
+STDMETHODIMP_(BOOL)
CUIFShadow::Initialize()
{
InitSettings();
return CUIFWindow::Initialize();
}
-inline STDMETHODIMP_(DWORD)
+STDMETHODIMP_(DWORD)
CUIFShadow::GetWndStyleEx()
{
DWORD exstyle = CUIFWindow::GetWndStyleEx();
@@ -3465,7 +2280,7 @@ CUIFShadow::GetWndStyleEx()
return exstyle;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFShadow::OnPaint(HDC hDC)
{
RECT rc = m_rc;
@@ -3474,7 +2289,7 @@ CUIFShadow::OnPaint(HDC hDC)
::DeleteObject(hBrush);
}
-inline STDMETHODIMP_(LRESULT)
+STDMETHODIMP_(LRESULT)
CUIFShadow::OnWindowPosChanging(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
WINDOWPOS *wp = (WINDOWPOS *)lParam;
@@ -3482,7 +2297,7 @@ CUIFShadow::OnWindowPosChanging(HWND hWnd, UINT Msg, WPARAM wParam,
LPARAM lPara
return ::DefWindowProc(hWnd, Msg, wParam, lParam);
}
-inline STDMETHODIMP_(LRESULT)
+STDMETHODIMP_(LRESULT)
CUIFShadow::OnSettingChange(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
InitSettings();
@@ -3501,7 +2316,7 @@ CUIFShadow::OnSettingChange(HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam)
return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFShadow::Show(BOOL bVisible)
{
if (bVisible && ::IsWindow(m_hWnd) && !::IsWindowVisible(m_hWnd))
@@ -3518,8 +2333,8 @@ CUIFShadow::Show(BOOL bVisible)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFToolTip
-inline
CUIFToolTip::CUIFToolTip(HINSTANCE hInst, DWORD style, CUIFWindow *pToolTipOwner)
: CUIFWindow(hInst, style)
{
@@ -3541,7 +2356,6 @@ CUIFToolTip::CUIFToolTip(HINSTANCE hInst, DWORD style, CUIFWindow
*pToolTipOwner
m_rgbToolTipTextColor = 0;
}
-inline
CUIFToolTip::~CUIFToolTip()
{
if (m_pToolTipOwner)
@@ -3550,7 +2364,7 @@ CUIFToolTip::~CUIFToolTip()
delete[] m_pszToolTipText;
}
-inline LONG
+LONG
CUIFToolTip::GetDelayTime(UINT uType)
{
LONG nDelayTime;
@@ -3584,13 +2398,13 @@ CUIFToolTip::GetDelayTime(UINT uType)
}
}
-inline void CUIFToolTip::GetMargin(LPRECT prc)
+void CUIFToolTip::GetMargin(LPRECT prc)
{
if (prc)
*prc = m_rcToolTipMargin;
}
-inline COLORREF
+COLORREF
CUIFToolTip::GetTipBkColor()
{
if (m_bToolTipHasBkColor)
@@ -3598,7 +2412,7 @@ CUIFToolTip::GetTipBkColor()
return ::GetSysColor(COLOR_INFOBK);
}
-inline COLORREF
+COLORREF
CUIFToolTip::GetTipTextColor()
{
if (m_bToolTipHasTextColor)
@@ -3606,7 +2420,7 @@ CUIFToolTip::GetTipTextColor()
return ::GetSysColor(COLOR_INFOTEXT);
}
-inline CUIFObject*
+CUIFObject*
CUIFToolTip::FindObject(HWND hWnd, POINT pt)
{
if (hWnd == *m_pToolTipOwner)
@@ -3614,7 +2428,7 @@ CUIFToolTip::FindObject(HWND hWnd, POINT pt)
return NULL;
}
-inline void
+void
CUIFToolTip::ShowTip()
{
::KillTimer(m_hWnd, TOOLTIP_TIMER_ID);
@@ -3658,7 +2472,7 @@ CUIFToolTip::ShowTip()
Show(TRUE);
}
-inline void
+void
CUIFToolTip::HideTip()
{
::KillTimer(m_hWnd, TOOLTIP_TIMER_ID);
@@ -3678,7 +2492,7 @@ CUIFToolTip::HideTip()
}
}
-inline void
+void
CUIFToolTip::GetTipWindowSize(LPSIZE pSize)
{
if (!m_pszToolTipText)
@@ -3716,7 +2530,7 @@ CUIFToolTip::GetTipWindowSize(LPSIZE pSize)
::ReleaseDC(m_hWnd, hDC);
}
-inline void
+void
CUIFToolTip::GetTipWindowRect(LPRECT pRect, SIZE toolTipSize, LPCRECT prc)
{
POINT Point;
@@ -3785,7 +2599,7 @@ CUIFToolTip::GetTipWindowRect(LPRECT pRect, SIZE toolTipSize,
LPCRECT prc)
}
}
-inline void
+void
CUIFToolTip::RelayEvent(LPMSG pMsg)
{
if (!pMsg)
@@ -3834,7 +2648,7 @@ CUIFToolTip::RelayEvent(LPMSG pMsg)
}
}
-inline STDMETHODIMP_(void) CUIFToolTip::OnPaint(HDC hDC)
+STDMETHODIMP_(void) CUIFToolTip::OnPaint(HDC hDC)
{
HGDIOBJ hFontOld = ::SelectObject(hDC, m_hFont);
INT iBkModeOld = ::SetBkMode(hDC, TRANSPARENT);
@@ -3869,22 +2683,22 @@ inline STDMETHODIMP_(void) CUIFToolTip::OnPaint(HDC hDC)
::SelectObject(hDC, hFontOld);
}
-inline STDMETHODIMP_(void) CUIFToolTip::Enable(BOOL bEnable)
+STDMETHODIMP_(void) CUIFToolTip::Enable(BOOL bEnable)
{
if (!bEnable)
HideTip();
CUIFObject::Enable(bEnable);
}
-inline STDMETHODIMP_(void) CUIFToolTip::OnTimer(WPARAM wParam)
+STDMETHODIMP_(void) CUIFToolTip::OnTimer(WPARAM wParam)
{
if (wParam == TOOLTIP_TIMER_ID)
ShowTip();
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFButton
-inline
CUIFButton::CUIFButton(
CUIFObject *pParent,
DWORD nObjectID,
@@ -3901,7 +2715,7 @@ CUIFButton::CUIFButton(
m_pszButtonText = NULL;
}
-inline CUIFButton::~CUIFButton()
+CUIFButton::~CUIFButton()
{
if (m_pszButtonText)
{
@@ -3913,7 +2727,7 @@ inline CUIFButton::~CUIFButton()
ImageList_Destroy(m_ButtonIcon.m_hImageList);
}
-inline void
+void
CUIFButton::DrawBitmapProc(HDC hDC, LPCRECT prc, BOOL bPressed)
{
INT width = m_rc.right - m_rc.left;
@@ -3937,7 +2751,7 @@ CUIFButton::DrawBitmapProc(HDC hDC, LPCRECT prc, BOOL bPressed)
}
}
-inline void
+void
CUIFButton::DrawEdgeProc(HDC hDC, LPCRECT prc, BOOL bPressed)
{
RECT rc = *prc;
@@ -3947,7 +2761,7 @@ CUIFButton::DrawEdgeProc(HDC hDC, LPCRECT prc, BOOL bPressed)
::DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT);
}
-inline void CUIFButton::DrawIconProc(HDC hDC, LPRECT prc, BOOL bPressed)
+void CUIFButton::DrawIconProc(HDC hDC, LPRECT prc, BOOL bPressed)
{
INT width = prc->right - prc->left;
INT height = prc->bottom - prc->top;
@@ -4001,7 +2815,7 @@ inline void CUIFButton::DrawIconProc(HDC hDC, LPRECT prc, BOOL
bPressed)
::DeleteDC(hMemDC);
}
-inline void
+void
CUIFButton::DrawTextProc(HDC hDC, LPCRECT prc, BOOL bPressed)
{
if (!m_pszButtonText)
@@ -4055,7 +2869,7 @@ CUIFButton::DrawTextProc(HDC hDC, LPCRECT prc, BOOL bPressed)
::SelectObject(hDC, hFontOld);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFButton::Enable(BOOL bEnable)
{
CUIFObject::Enable(bEnable);
@@ -4067,7 +2881,7 @@ CUIFButton::Enable(BOOL bEnable)
}
}
-inline void
+void
CUIFButton::GetIconSize(HICON hIcon, LPSIZE pSize)
{
ICONINFO IconInfo;
@@ -4087,7 +2901,7 @@ CUIFButton::GetIconSize(HICON hIcon, LPSIZE pSize)
}
}
-inline void
+void
CUIFButton::GetTextSize(LPCWSTR pszText, LPSIZE pSize)
{
HDC hDC = ::GetDC(NULL);
@@ -4117,7 +2931,7 @@ CUIFButton::GetTextSize(LPCWSTR pszText, LPSIZE pSize)
::ReleaseDC(NULL, hDC);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFButton::OnLButtonDown(LONG x, LONG y)
{
SetStatus(1);
@@ -4127,7 +2941,7 @@ CUIFButton::OnLButtonDown(LONG x, LONG y)
}
/// @unimplemented
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFButton::OnLButtonUp(LONG x, LONG y)
{
POINT pt = { x, y };
@@ -4170,7 +2984,7 @@ CUIFButton::OnLButtonUp(LONG x, LONG y)
}
}
-inline void CUIFButton::OnMouseIn(LONG x, LONG y)
+void CUIFButton::OnMouseIn(LONG x, LONG y)
{
if ((m_style & 0x30) == 0x20)
{
@@ -4188,7 +3002,7 @@ inline void CUIFButton::OnMouseIn(LONG x, LONG y)
}
}
-inline void CUIFButton::OnMouseOut(LONG x, LONG y)
+void CUIFButton::OnMouseOut(LONG x, LONG y)
{
if ((m_style & 0x30) == 0x20)
SetStatus(0);
@@ -4198,7 +3012,7 @@ inline void CUIFButton::OnMouseOut(LONG x, LONG y)
SetStatus(0);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFButton::OnPaintNoTheme(HDC hDC)
{
::FillRect(hDC, &m_rc, (HBRUSH)UlongToHandle(COLOR_BTNFACE + 1));
@@ -4233,7 +3047,7 @@ CUIFButton::OnPaintNoTheme(HDC hDC)
DrawEdgeProc(hDC, &m_rc, FALSE);
}
-inline void CUIFButton::SetIcon(HICON hIcon)
+void CUIFButton::SetIcon(HICON hIcon)
{
m_ButtonIcon = hIcon;
@@ -4245,7 +3059,7 @@ inline void CUIFButton::SetIcon(HICON hIcon)
CallOnPaint();
}
-inline void CUIFButton::SetStatus(UINT uStatus)
+void CUIFButton::SetStatus(UINT uStatus)
{
if (uStatus != m_uButtonStatus)
{
@@ -4254,7 +3068,7 @@ inline void CUIFButton::SetStatus(UINT uStatus)
}
}
-inline void CUIFButton::SetText(LPCWSTR pszText)
+void CUIFButton::SetText(LPCWSTR pszText)
{
if (m_pszButtonText)
{
@@ -4279,8 +3093,9 @@ inline void CUIFButton::SetText(LPCWSTR pszText)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFButton2
-inline CUIFButton2::CUIFButton2(
+CUIFButton2::CUIFButton2(
CUIFObject *pParent,
DWORD nObjectID,
LPCRECT prc,
@@ -4291,12 +3106,12 @@ inline CUIFButton2::CUIFButton2(
m_pszClassList = L"TOOLBAR";
}
-inline CUIFButton2::~CUIFButton2()
+CUIFButton2::~CUIFButton2()
{
CloseThemeData();
}
-inline DWORD CUIFButton2::MakeDrawFlag()
+DWORD CUIFButton2::MakeDrawFlag()
{
DWORD dwDrawFlags = 0;
if (m_bPressed)
@@ -4311,14 +3126,14 @@ inline DWORD CUIFButton2::MakeDrawFlag()
}
/// @unimplemented
-inline STDMETHODIMP_(BOOL)
+STDMETHODIMP_(BOOL)
CUIFButton2::OnPaintTheme(HDC hDC)
{
//FIXME
return FALSE;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFButton2::OnPaintNoTheme(HDC hDC)
{
if (!m_pScheme)
@@ -4341,17 +3156,13 @@ CUIFButton2::OnPaintNoTheme(HDC hDC)
HGDIOBJ hFontOld = ::SelectObject(hdcMem, m_hFont);
RECT rcBack = { 0, 0, width, height };
- INT cxText, cyText, cxContent, cyContent, cxyBorders, cxButton, cyButton;
+ INT cxText = 0, cyText = 0, cxContent = 0, cyContent = 0;
+ INT cxyBorders, cxButton, cyButton;
if (m_pszButtonText)
{
cxText = m_TextSize.cx;
cyText = m_TextSize.cy;
}
- else
- {
- cxText = 0;
- cyText = cyText;
- }
if (m_ButtonIcon.m_hIcon)
{
@@ -4377,8 +3188,8 @@ CUIFButton2::OnPaintNoTheme(HDC hDC)
{
cxyBorders = ((cxText && cxContent) ? 2 : 0);
- cyButton = cyContent;
cxButton = cxText + cxContent + cxyBorders;
+ cyButton = cyContent;
if (cyText > cyButton)
cyButton = cyText;
}
@@ -4464,8 +3275,8 @@ CUIFButton2::OnPaintNoTheme(HDC hDC)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFGripper
-inline
CUIFGripper::CUIFGripper(CUIFObject *pParent, LPCRECT prc, DWORD style)
: CUIFObject(pParent, 0, prc, style)
{
@@ -4477,11 +3288,11 @@ CUIFGripper::CUIFGripper(CUIFObject *pParent, LPCRECT prc, DWORD
style)
m_iPartId = RP_GRIPPER;
}
-inline CUIFGripper::~CUIFGripper()
+CUIFGripper::~CUIFGripper()
{
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFGripper::OnMouseMove(LONG x, LONG y)
{
if (IsCapture())
@@ -4492,7 +3303,7 @@ CUIFGripper::OnMouseMove(LONG x, LONG y)
}
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFGripper::OnLButtonDown(LONG x, LONG y)
{
StartCapture();
@@ -4505,14 +3316,14 @@ CUIFGripper::OnLButtonDown(LONG x, LONG y)
m_ptGripper.y -= rc.top;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFGripper::OnLButtonUp(LONG x, LONG y)
{
if (IsCapture())
EndCapture();
}
-inline STDMETHODIMP_(BOOL)
+STDMETHODIMP_(BOOL)
CUIFGripper::OnPaintTheme(HDC hDC)
{
if (FAILED(EnsureThemeData(*m_pWindow)))
@@ -4535,7 +3346,7 @@ CUIFGripper::OnPaintTheme(HDC hDC)
return TRUE;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFGripper::OnPaintNoTheme(HDC hDC)
{
if (m_pScheme)
@@ -4553,7 +3364,7 @@ CUIFGripper::OnPaintNoTheme(HDC hDC)
::DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT);
}
-inline STDMETHODIMP_(BOOL)
+STDMETHODIMP_(BOOL)
CUIFGripper::OnSetCursor(UINT uMsg, LONG x, LONG y)
{
HCURSOR hCursor = ::LoadCursor(NULL, IDC_SIZEALL);
@@ -4561,7 +3372,7 @@ CUIFGripper::OnSetCursor(UINT uMsg, LONG x, LONG y)
return TRUE;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFGripper::SetStyle(DWORD style)
{
m_style = style;
@@ -4572,8 +3383,8 @@ CUIFGripper::SetStyle(DWORD style)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFToolbarMenuButton
-inline
CUIFToolbarMenuButton::CUIFToolbarMenuButton(
CUIFToolbarButton *pParent,
DWORD nObjectID,
@@ -4588,21 +3399,20 @@ CUIFToolbarMenuButton::CUIFToolbarMenuButton(
SetText(L"u"); // downward triangle
}
-inline
CUIFToolbarMenuButton::~CUIFToolbarMenuButton()
{
::DeleteObject(m_hFont);
SetFont(NULL);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFToolbarMenuButton::OnLButtonUp(LONG x, LONG y)
{
CUIFButton::OnLButtonUp(x, y);
m_pToolbarButton->OnUnknownMouse2(x, y);
}
-inline STDMETHODIMP_(BOOL)
+STDMETHODIMP_(BOOL)
CUIFToolbarMenuButton::OnSetCursor(UINT uMsg, LONG x, LONG y)
{
m_pToolbarButton->OnSetCursor(uMsg, x, y);
@@ -4610,8 +3420,8 @@ CUIFToolbarMenuButton::OnSetCursor(UINT uMsg, LONG x, LONG y)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFToolbarButtonElement
-inline
CUIFToolbarButtonElement::CUIFToolbarButtonElement(
CUIFToolbarButton *pParent,
DWORD nObjectID,
@@ -4621,7 +3431,7 @@ CUIFToolbarButtonElement::CUIFToolbarButtonElement(
m_pToolbarButton = pParent;
}
-inline STDMETHODIMP_(LPCWSTR)
+STDMETHODIMP_(LPCWSTR)
CUIFToolbarButtonElement::GetToolTip()
{
if (m_pToolbarButton)
@@ -4629,7 +3439,7 @@ CUIFToolbarButtonElement::GetToolTip()
return NULL;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFToolbarButtonElement::OnLButtonUp(LONG x, LONG y)
{
CUIFButton::OnLButtonUp(x, y);
@@ -4639,7 +3449,7 @@ CUIFToolbarButtonElement::OnLButtonUp(LONG x, LONG y)
m_pToolbarButton->OnUnknownMouse1(x, y);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFToolbarButtonElement::OnRButtonUp(LONG x, LONG y)
{
if ((m_pToolbarButton->m_dwToolbarButtonFlags & 0x30000) != 0x20000)
@@ -4647,8 +3457,9 @@ CUIFToolbarButtonElement::OnRButtonUp(LONG x, LONG y)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFToolbarButton
-inline CUIFToolbarButton::CUIFToolbarButton(
+CUIFToolbarButton::CUIFToolbarButton(
CUIFObject *pParent,
DWORD nObjectID,
LPCRECT prc,
@@ -4660,7 +3471,7 @@ inline CUIFToolbarButton::CUIFToolbarButton(
m_pszUnknownText = pszUnknownText;
}
-inline BOOL CUIFToolbarButton::Init()
+BOOL CUIFToolbarButton::Init()
{
RECT rc1, rc2;
rc1 = rc2 = m_rc;
@@ -4706,17 +3517,17 @@ inline BOOL CUIFToolbarButton::Init()
return TRUE;
}
-inline HICON CUIFToolbarButton::GetIcon()
+HICON CUIFToolbarButton::GetIcon()
{
return m_pToolbarButtonElement->m_ButtonIcon.m_hIcon;
}
-inline void CUIFToolbarButton::SetIcon(HICON hIcon)
+void CUIFToolbarButton::SetIcon(HICON hIcon)
{
m_pToolbarButtonElement->SetIcon(hIcon);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFToolbarButton::ClearWndObj()
{
if (m_pToolbarButtonElement)
@@ -4727,7 +3538,7 @@ CUIFToolbarButton::ClearWndObj()
CUIFObject::ClearWndObj();
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFToolbarButton::DetachWndObj()
{
if (m_pToolbarButtonElement)
@@ -4738,7 +3549,7 @@ CUIFToolbarButton::DetachWndObj()
CUIFObject::DetachWndObj();
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFToolbarButton::Enable(BOOL bEnable)
{
CUIFObject::Enable(bEnable);
@@ -4748,13 +3559,13 @@ CUIFToolbarButton::Enable(BOOL bEnable)
m_pToolbarMenuButton->Enable(bEnable);
}
-inline STDMETHODIMP_(LPCWSTR)
+STDMETHODIMP_(LPCWSTR)
CUIFToolbarButton::GetToolTip()
{
return CUIFObject::GetToolTip();
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFToolbarButton::SetActiveTheme(LPCWSTR pszClassList, INT iPartId, INT iStateId)
{
if (m_pToolbarButtonElement)
@@ -4767,13 +3578,13 @@ CUIFToolbarButton::SetActiveTheme(LPCWSTR pszClassList, INT
iPartId, INT iStateI
m_iStateId = iStateId;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFToolbarButton::SetFont(HFONT hFont)
{
m_pToolbarButtonElement->SetFont(hFont);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFToolbarButton::SetRect(LPCRECT prc)
{
CUIFObject::SetRect(prc);
@@ -4793,7 +3604,7 @@ CUIFToolbarButton::SetRect(LPCRECT prc)
m_pToolbarMenuButton->SetRect(&rc2);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFToolbarButton::SetToolTip(LPCWSTR pszToolTip)
{
CUIFObject::SetToolTip(pszToolTip);
@@ -4804,8 +3615,8 @@ CUIFToolbarButton::SetToolTip(LPCWSTR pszToolTip)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFWndFrame
-inline
CUIFWndFrame::CUIFWndFrame(
CUIFObject *pParent,
LPCRECT prc,
@@ -4835,13 +3646,13 @@ CUIFWndFrame::CUIFWndFrame(
m_cyMin = GetSystemMetrics(SM_CYMIN);
}
-inline void CUIFWndFrame::GetFrameSize(LPSIZE pSize)
+void CUIFWndFrame::GetFrameSize(LPSIZE pSize)
{
pSize->cx = m_cxFrame;
pSize->cy = m_cyFrame;
}
-inline DWORD CUIFWndFrame::HitTest(LONG x, LONG y)
+DWORD CUIFWndFrame::HitTest(LONG x, LONG y)
{
DWORD dwFlags = 0;
if ( m_rc.left <= x && x < m_rc.left + m_cxFrame)
@@ -4855,7 +3666,7 @@ inline DWORD CUIFWndFrame::HitTest(LONG x, LONG y)
return dwFlags;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWndFrame::OnMouseMove(LONG x, LONG y)
{
if (!IsCapture())
@@ -4889,7 +3700,7 @@ CUIFWndFrame::OnMouseMove(LONG x, LONG y)
m_pWindow->Move(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWndFrame::OnLButtonDown(LONG x, LONG y)
{
POINT Point = { x, y };
@@ -4905,14 +3716,14 @@ CUIFWndFrame::OnLButtonDown(LONG x, LONG y)
StartCapture();
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWndFrame::OnLButtonUp(LONG x, LONG y)
{
if (IsCapture())
EndCapture();
}
-inline STDMETHODIMP_(BOOL)
+STDMETHODIMP_(BOOL)
CUIFWndFrame::OnPaintTheme(HDC hDC)
{
if (FAILED(EnsureThemeData(*m_pWindow)))
@@ -4941,7 +3752,7 @@ CUIFWndFrame::OnPaintTheme(HDC hDC)
return TRUE;
}
-inline STDMETHODIMP_(void)
+STDMETHODIMP_(void)
CUIFWndFrame::OnPaintNoTheme(HDC hDC)
{
if (!m_pScheme)
@@ -4956,7 +3767,7 @@ CUIFWndFrame::OnPaintNoTheme(HDC hDC)
m_pScheme->DrawWndFrame(hDC, &m_rc, type, m_cxFrame, m_cyFrame);
}
-inline STDMETHODIMP_(BOOL)
+STDMETHODIMP_(BOOL)
CUIFWndFrame::OnSetCursor(UINT uMsg, LONG x, LONG y)
{
DWORD dwHitTest = m_dwHitTest;
@@ -4992,8 +3803,8 @@ CUIFWndFrame::OnSetCursor(UINT uMsg, LONG x, LONG y)
}
/////////////////////////////////////////////////////////////////////////////
+// CUIFBalloonButton
-inline
CUIFBalloonButton::CUIFBalloonButton(
CUIFObject *pParent,
DWORD nObjectID,
@@ -5003,7 +3814,7 @@ CUIFBalloonButton::CUIFBalloonButton(
m_nCommandID = 0;
... 1908 lines suppressed ...