ReactOS 0.4.16-dev-1272-g2c12489
mlng.cpp File Reference
#include <windows.h>
#include <shellapi.h>
#include <imm.h>
#include <imm32_undoc.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <shlwapi_undoc.h>
#include <msctf.h>
#include <msctf_undoc.h>
#include <strsafe.h>
#include <assert.h>
#include <cicreg.h>
#include <cicarray.h>
#include <wine/debug.h>
#include "mlng.h"
Include dependency graph for mlng.cpp:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msctf)
 
DWORD GetSpecialKLID (_In_ HKL hKL)
 @implemented
 
DWORD GetHKLSubstitute (_In_ HKL hKL)
 @implemented
 
static BOOL GetKbdLayoutNameFromReg (_In_ HKL hKL, _Out_ LPWSTR pszDesc, _In_ UINT cchDesc)
 @implemented
 
static BOOL GetHKLName (_In_ HKL hKL, _Out_ LPWSTR pszDesc, _In_ UINT cchDesc)
 @implemented
 
static BOOL GetHKLDesctription (_In_ HKL hKL, _Out_ LPWSTR pszDesc, _In_ UINT cchDesc, _Out_ LPWSTR pszImeFileName, _In_ UINT cchImeFileName)
 @implemented
 
HICON GetIconFromFile (_In_ INT cx, _In_ INT cy, _In_ LPCWSTR pszFileName, _In_ INT iIcon)
 @implemented
 
static BOOL EnsureIconImageList (VOID)
 @implemented
 
static INT GetPhysicalFontHeight (LOGFONTW *plf)
 @implemented
 
INT InatAddIcon (_In_ HICON hIcon)
 @implemented
 
HICON InatCreateIconBySize (_In_ LANGID LangID, _In_ INT nWidth, _In_ INT nHeight, _In_ const LOGFONTW *plf)
 @implemented
 
HICON InatCreateIcon (_In_ LANGID LangID)
 @implemented
 
BOOL InatGetIconSize (_Out_ INT *pcx, _Out_ INT *pcy)
 @implemented
 
INT InatGetImageCount (VOID)
 @implemented
 
VOID InatRemoveAll (VOID)
 @implemented
 
VOID UninitINAT (VOID)
 @implemented
 
static BOOL CheckMlngInfo (VOID)
 @implemented
 
static VOID DestroyMlngInfo (VOID)
 @implemented
 
static VOID CreateMlngInfo (VOID)
 @implemented
 
EXTERN_C VOID WINAPI TF_InitMlngInfo (VOID)
 
EXTERN_C INT WINAPI TF_MlngInfoCount (VOID)
 
EXTERN_C HICON WINAPI TF_InatExtractIcon (_In_ INT iKL)
 
EXTERN_C INT WINAPI TF_GetMlngIconIndex (_In_ INT iKL)
 
EXTERN_C BOOL WINAPI TF_GetMlngHKL (_In_ INT iKL, _Out_opt_ HKL *phKL, _Out_opt_ LPWSTR pszDesc, _In_ INT cchDesc)
 

Variables

CRITICAL_SECTION g_cs
 
CicArray< MLNGINFO > * g_pMlngInfo = NULL
 
CStaticIconList g_IconList
 
static HKL s_hCacheKL = NULL
 
static DWORD s_dwCacheKLID = 0
 

Macro Definition Documentation

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 8 of file mlng.cpp.

Function Documentation

◆ CheckMlngInfo()

static BOOL CheckMlngInfo ( VOID  )
static

@implemented

Definition at line 515 of file mlng.cpp.

516{
517 if (!g_pMlngInfo)
518 return TRUE; // Needs creation
519
521 if (cKLs != TF_MlngInfoCount())
522 return TRUE; // Needs refresh
523
524 if (!cKLs)
525 return FALSE;
526
527 HKL *phKLs = (HKL*)cicMemAlloc(cKLs * sizeof(HKL));
528 if (!phKLs)
529 return FALSE;
530
531 ::GetKeyboardLayoutList(cKLs, phKLs);
532
534
535 BOOL ret = FALSE;
536 for (INT iKL = 0; iKL < cKLs; ++iKL)
537 {
538 if ((*g_pMlngInfo)[iKL].m_hKL != phKLs[iKL])
539 {
540 ret = TRUE; // Needs refresh
541 break;
542 }
543 }
544
545 cicMemFree(phKLs);
546 return ret;
547}
static LPVOID cicMemAlloc(SIZE_T size)
Definition: cicbase.h:10
static void cicMemFree(LPVOID ptr)
Definition: cicbase.h:27
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define assert(x)
Definition: debug.h:53
unsigned int BOOL
Definition: ntddk_ex.h:94
CicArray< MLNGINFO > * g_pMlngInfo
Definition: mlng.cpp:33
EXTERN_C INT WINAPI TF_MlngInfoCount(VOID)
Definition: mlng.cpp:615
UINT_PTR HKL
Definition: msctf.idl:125
int32_t INT
Definition: typedefs.h:58
int ret
UINT WINAPI GetKeyboardLayoutList(_In_ int nBuff, _Out_writes_to_opt_(nBuff, return) HKL FAR *lpList)

Referenced by TF_InitMlngInfo().

◆ CreateMlngInfo()

static VOID CreateMlngInfo ( VOID  )
static

@implemented

Definition at line 560 of file mlng.cpp.

561{
562 if (!g_pMlngInfo)
563 {
565 if (!g_pMlngInfo)
566 return;
567 }
568
569 if (!EnsureIconImageList())
570 return;
571
573 HKL *phKLs = (HKL*)cicMemAllocClear(cKLs * sizeof(HKL));
574 if (!phKLs)
575 return;
576
577 ::GetKeyboardLayoutList(cKLs, phKLs);
578
579 for (INT iKL = 0; iKL < cKLs; ++iKL)
580 {
581 MLNGINFO& info = (*g_pMlngInfo)[iKL];
582 info.m_hKL = phKLs[iKL];
583 info.m_bInitDesc = FALSE;
584 info.m_bInitIcon = FALSE;
585 }
586
587 cicMemFree(phKLs);
588}
#define cicNoThrow
Definition: cicbase.h:34
static LPVOID cicMemAllocClear(SIZE_T size)
Definition: cicbase.h:15
static BOOL EnsureIconImageList(VOID)
@implemented
Definition: mlng.cpp:225
Definition: mlng.h:13

Referenced by TF_InitMlngInfo().

◆ DestroyMlngInfo()

static VOID DestroyMlngInfo ( VOID  )
static

@implemented

Definition at line 550 of file mlng.cpp.

551{
552 if (!g_pMlngInfo)
553 return;
554
555 delete g_pMlngInfo;
557}

Referenced by TF_InitMlngInfo().

◆ EnsureIconImageList()

static BOOL EnsureIconImageList ( VOID  )
static

@implemented

Definition at line 225 of file mlng.cpp.

226{
229
230 return TRUE;
231}
void Init(INT cxIcon, INT cyIcon)
@implemented
Definition: mlng.cpp:443
static INT s_cx
Definition: mlng.h:31
CStaticIconList g_IconList
Definition: mlng.cpp:36
#define SM_CYSMICON
Definition: winuser.h:1024
#define SM_CXSMICON
Definition: winuser.h:1023
int WINAPI GetSystemMetrics(_In_ int)

Referenced by CreateMlngInfo(), and InatAddIcon().

◆ GetHKLDesctription()

static BOOL GetHKLDesctription ( _In_ HKL  hKL,
_Out_ LPWSTR  pszDesc,
_In_ UINT  cchDesc,
_Out_ LPWSTR  pszImeFileName,
_In_ UINT  cchImeFileName 
)
static

@implemented

Definition at line 184 of file mlng.cpp.

190{
191 pszDesc[0] = pszImeFileName[0] = UNICODE_NULL;
192
193 if (!IS_IME_HKL(hKL))
194 return GetHKLName(hKL, pszDesc, cchDesc);
195
196 if (GetKbdLayoutNameFromReg(hKL, pszDesc, cchDesc))
197 return TRUE;
198
199 if (!::ImmGetDescriptionW(hKL, pszDesc, cchDesc))
200 {
201 *pszDesc = UNICODE_NULL;
202 return GetHKLName(hKL, pszDesc, cchDesc);
203 }
204
205 if (!::ImmGetIMEFileNameW(hKL, pszImeFileName, cchImeFileName))
206 *pszImeFileName = UNICODE_NULL;
207
208 return TRUE;
209}
#define IS_IME_HKL(hKL)
Definition: imm32_undoc.h:21
UINT WINAPI ImmGetIMEFileNameW(_In_ HKL hKL, _Out_writes_opt_(uBufLen) LPWSTR lpszFileName, _In_ UINT uBufLen)
Definition: ime.c:732
UINT WINAPI ImmGetDescriptionW(_In_ HKL hKL, _Out_writes_opt_(uBufLen) LPWSTR lpszDescription, _In_ UINT uBufLen)
Definition: ime.c:668
static BOOL GetHKLName(_In_ HKL hKL, _Out_ LPWSTR pszDesc, _In_ UINT cchDesc)
@implemented
Definition: mlng.cpp:169
static BOOL GetKbdLayoutNameFromReg(_In_ HKL hKL, _Out_ LPWSTR pszDesc, _In_ UINT cchDesc)
@implemented
Definition: mlng.cpp:142
#define UNICODE_NULL

Referenced by MLNGINFO::InitDesc(), and MLNGINFO::InitIcon().

◆ GetHKLName()

static BOOL GetHKLName ( _In_ HKL  hKL,
_Out_ LPWSTR  pszDesc,
_In_ UINT  cchDesc 
)
static

@implemented

Definition at line 169 of file mlng.cpp.

170{
171 if (::GetLocaleInfoW(LOWORD(hKL), LOCALE_SLANGUAGE, pszDesc, cchDesc))
172 return TRUE;
173
174 *pszDesc = UNICODE_NULL;
175
176 if (LOWORD(hKL) == HIWORD(hKL))
177 return FALSE;
178
179 return GetKbdLayoutNameFromReg(hKL, pszDesc, cchDesc);
180}
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1666
#define LOWORD(l)
Definition: pedump.c:82
#define HIWORD(l)
Definition: typedefs.h:247
#define LOCALE_SLANGUAGE
Definition: winnls.h:31

Referenced by GetHKLDesctription().

◆ GetHKLSubstitute()

DWORD GetHKLSubstitute ( _In_ HKL  hKL)

@implemented

Definition at line 94 of file mlng.cpp.

95{
96 if (IS_IME_HKL(hKL))
97 return HandleToUlong(hKL);
98
99 DWORD dwKLID;
100 if (HIWORD(hKL) == LOWORD(hKL))
101 dwKLID = LOWORD(hKL);
102 else if (IS_SPECIAL_HKL(hKL))
103 dwKLID = GetSpecialKLID(hKL);
104 else
105 dwKLID = HandleToUlong(hKL);
106
107 if (dwKLID == 0)
108 return HandleToUlong(hKL);
109
110 CicRegKey regKey;
111 LSTATUS error = regKey.Open(HKEY_CURRENT_USER, L"Keyboard Layout\\Substitutes");
112 if (error == ERROR_SUCCESS)
113 {
114 WCHAR szName[MAX_PATH], szValue[MAX_PATH];
115 DWORD dwIndex, dwValue;
116 for (dwIndex = 0; ; ++dwIndex)
117 {
118 error = regKey.EnumValue(dwIndex, szName, _countof(szName));
119 szName[_countof(szName) - 1] = UNICODE_NULL; // Avoid buffer overrun
120 if (error != ERROR_SUCCESS)
121 break;
122
123 error = regKey.QuerySz(szName, szValue, _countof(szValue));
124 szValue[_countof(szValue) - 1] = UNICODE_NULL; // Avoid buffer overrun
125 if (error != ERROR_SUCCESS)
126 break;
127
128 dwValue = wcstoul(szValue, NULL, 16);
129 if ((dwKLID & ~SPECIAL_MASK) == dwValue)
130 {
131 dwKLID = wcstoul(szName, NULL, 16);
132 break;
133 }
134 }
135 }
136
137 return dwKLID;
138}
#define SPECIAL_MASK
Definition: debug.h:13
#define HandleToUlong(h)
Definition: basetsd.h:79
LSTATUS QuerySz(LPCTSTR pszValueName, LPTSTR pszValue, DWORD cchValueMax)
Definition: cicreg.h:84
LSTATUS Open(HKEY hKey, LPCTSTR lpSubKey, REGSAM samDesired=KEY_READ)
Definition: cicreg.h:51
LSTATUS EnumValue(DWORD dwIndex, LPTSTR lpValueName, DWORD cchValueName)
Definition: cicreg.h:108
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IS_SPECIAL_HKL(hKL)
Definition: imm32_undoc.h:22
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define error(str)
Definition: mkdosfs.c:1605
DWORD GetSpecialKLID(_In_ HKL hKL)
@implemented
Definition: mlng.cpp:47
#define L(x)
Definition: ntvdm.h:50
static const WCHAR szName[]
Definition: powrprof.c:45
#define _countof(array)
Definition: sndvol32.h:70
#define HKEY_CURRENT_USER
Definition: winreg.h:11
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by GetKbdLayoutNameFromReg().

◆ GetIconFromFile()

HICON GetIconFromFile ( _In_ INT  cx,
_In_ INT  cy,
_In_ LPCWSTR  pszFileName,
_In_ INT  iIcon 
)

@implemented

Definition at line 212 of file mlng.cpp.

213{
214 HICON hIcon;
215
218 else
219 ::ExtractIconExW(pszFileName, iIcon, &hIcon, NULL, 1);
220
221 return hIcon;
222}
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:855
static HICON
Definition: imagelist.c:80
HICON hIcon
Definition: msconfig.c:44
_Out_opt_ int * cx
Definition: commctrl.h:585
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44

Referenced by MLNGINFO::InitIcon().

◆ GetKbdLayoutNameFromReg()

static BOOL GetKbdLayoutNameFromReg ( _In_ HKL  hKL,
_Out_ LPWSTR  pszDesc,
_In_ UINT  cchDesc 
)
static

@implemented

Definition at line 142 of file mlng.cpp.

143{
144 const DWORD dwKLID = GetHKLSubstitute(hKL);
145
146 WCHAR szSubKey[MAX_PATH];
147 StringCchPrintfW(szSubKey, _countof(szSubKey),
148 L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\%08lX",
149 dwKLID);
150
151 CicRegKey regKey;
152 LSTATUS error = regKey.Open(HKEY_LOCAL_MACHINE, szSubKey);
153 if (error != ERROR_SUCCESS)
154 return FALSE;
155
156 if (SHLoadRegUIStringW(regKey, L"Layout Display Name", pszDesc, cchDesc) == S_OK)
157 {
158 pszDesc[cchDesc - 1] = UNICODE_NULL; // Avoid buffer overrun
159 return TRUE;
160 }
161
162 error = regKey.QuerySz(L"Layout Text", pszDesc, cchDesc);
163 pszDesc[cchDesc - 1] = UNICODE_NULL; // Avoid buffer overrun
164 return (error == ERROR_SUCCESS);
165}
HRESULT WINAPI SHLoadRegUIStringW(HKEY hkey, LPCWSTR value, LPWSTR buf, DWORD size)
Definition: ordinal.c:4277
#define S_OK
Definition: intsafe.h:52
DWORD GetHKLSubstitute(_In_ HKL hKL)
@implemented
Definition: mlng.cpp:94
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by GetHKLDesctription(), and GetHKLName().

◆ GetPhysicalFontHeight()

static INT GetPhysicalFontHeight ( LOGFONTW plf)
static

@implemented

Definition at line 234 of file mlng.cpp.

235{
236 HDC hDC = ::GetDC(NULL);
238 HGDIOBJ hFontOld = ::SelectObject(hDC, hFont);
241 INT ret = tm.tmExternalLeading + tm.tmHeight;
242 ::SelectObject(hDC, hFontOld);
245 return ret;
246}
static HDC hDC
Definition: 3dtext.c:33
HFONT hFont
Definition: main.c:53
pKey DeleteObject()
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
Definition: time.h:68
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by InatCreateIcon().

◆ GetSpecialKLID()

DWORD GetSpecialKLID ( _In_ HKL  hKL)

@implemented

Definition at line 47 of file mlng.cpp.

48{
50
51 if (s_hCacheKL == hKL && s_dwCacheKLID != 0)
52 return s_dwCacheKLID;
53
54 s_dwCacheKLID = 0;
55
56 CicRegKey regKey1;
58 L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts");
59 if (error != ERROR_SUCCESS)
60 return 0;
61
62 WCHAR szName[16], szLayoutId[16];
63 const DWORD dwSpecialId = SPECIALIDFROMHKL(hKL);
64 for (DWORD dwIndex = 0; ; ++dwIndex)
65 {
66 error = ::RegEnumKeyW(regKey1, dwIndex, szName, _countof(szName));
67 szName[_countof(szName) - 1] = UNICODE_NULL; // Avoid buffer overrun
68 if (error != ERROR_SUCCESS)
69 break;
70
71 CicRegKey regKey2;
72 error = regKey2.Open(regKey1, szName);
73 if (error != ERROR_SUCCESS)
74 break;
75
76 error = regKey2.QuerySz(L"Layout Id", szLayoutId, _countof(szLayoutId));
77 szLayoutId[_countof(szLayoutId) - 1] = UNICODE_NULL; // Avoid buffer overrun
78 if (error == ERROR_SUCCESS)
79 continue;
80
81 DWORD dwLayoutId = wcstoul(szLayoutId, NULL, 16);
82 if (dwLayoutId == dwSpecialId)
83 {
84 s_hCacheKL = hKL;
86 break;
87 }
88 }
89
90 return s_dwCacheKLID;
91}
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2393
#define SPECIALIDFROMHKL(hKL)
Definition: imm32_undoc.h:23
static HKL s_hCacheKL
Definition: mlng.cpp:39
static DWORD s_dwCacheKLID
Definition: mlng.cpp:40

Referenced by GetHKLSubstitute().

◆ InatAddIcon()

INT InatAddIcon ( _In_ HICON  hIcon)

@implemented

Definition at line 253 of file mlng.cpp.

254{
255 if (!EnsureIconImageList())
256 return -1;
257 return g_IconList.AddIcon(hIcon);
258}
INT AddIcon(HICON hIcon)
@implemented
Definition: mlng.cpp:452

Referenced by MLNGINFO::InitIcon().

◆ InatCreateIcon()

HICON InatCreateIcon ( _In_ LANGID  LangID)

@implemented

Definition at line 317 of file mlng.cpp.

318{
320
321 LOGFONTW lf;
323 return NULL;
324
325 if (cySmIcon < GetPhysicalFontHeight(&lf))
326 {
327 lf.lfWidth = 0;
328 lf.lfHeight = - (7 * cySmIcon) / 10;
329 }
330
331 return InatCreateIconBySize(LangID, cxSmIcon, cySmIcon, &lf);
332}
HICON InatCreateIconBySize(_In_ LANGID LangID, _In_ INT nWidth, _In_ INT nHeight, _In_ const LOGFONTW *plf)
@implemented
Definition: mlng.cpp:262
static INT GetPhysicalFontHeight(LOGFONTW *plf)
@implemented
Definition: mlng.cpp:234
LONG lfHeight
Definition: dimm.idl:59
LONG lfWidth
Definition: dimm.idl:60
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1083
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1391
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)

Referenced by MLNGINFO::InitIcon().

◆ InatCreateIconBySize()

HICON InatCreateIconBySize ( _In_ LANGID  LangID,
_In_ INT  nWidth,
_In_ INT  nHeight,
_In_ const LOGFONTW plf 
)

@implemented

Definition at line 262 of file mlng.cpp.

267{
268 WCHAR szText[64];
270 szText, _countof(szText));
271 if (!ret)
272 szText[0] = szText[1] = L'?';
273
274 szText[2] = UNICODE_NULL;
275 CharUpperW(szText);
276
278 if (!hFont)
279 return NULL;
280
281 HDC hDC = ::GetDC(NULL);
282 HDC hMemDC = ::CreateCompatibleDC(hDC);
283 HBITMAP hbmColor = ::CreateCompatibleBitmap(hDC, nWidth, nHeight);
284 HBITMAP hbmMask = ::CreateBitmap(nWidth, nHeight, 1, 1, NULL);
286
287 HICON hIcon = NULL;
288 HGDIOBJ hbmOld = ::SelectObject(hMemDC, hbmColor);
289 HGDIOBJ hFontOld = ::SelectObject(hMemDC, hFont);
290 if (hMemDC && hbmColor && hbmMask)
291 {
294
295 RECT rc = { 0, 0, nWidth, nHeight };
296 ::ExtTextOutW(hMemDC, 0, 0, ETO_OPAQUE, &rc, L"", 0, NULL);
297
298 ::DrawTextW(hMemDC, szText, 2, &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
299 ::SelectObject(hMemDC, hbmMask);
300
301 ::PatBlt(hMemDC, 0, 0, nWidth, nHeight, BLACKNESS);
302
303 ICONINFO IconInfo = { TRUE, 0, 0, hbmMask, hbmColor };
305 }
306 ::SelectObject(hMemDC, hFontOld);
307 ::SelectObject(hMemDC, hbmOld);
308
309 ::DeleteObject(hbmMask);
310 ::DeleteObject(hbmColor);
311 ::DeleteDC(hMemDC);
313 return hIcon;
314}
LPWSTR WINAPI CharUpperW(WCHAR *str)
Definition: string.c:1205
_Out_opt_ PICONINFO IconInfo
Definition: ntuser.h:2306
static HBITMAP
Definition: button.c:44
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define BLACKNESS
Definition: wingdi.h:323
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
#define ETO_OPAQUE
Definition: wingdi.h:647
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:917
BOOL WINAPI DeleteDC(_In_ HDC)
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
#define LOCALE_SABBREVLANGNAME
Definition: winnls.h:34
DWORD WINAPI GetSysColor(_In_ int)
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition: cursoricon.c:2943
#define DT_CENTER
Definition: winuser.h:527
#define COLOR_HIGHLIGHT
Definition: winuser.h:937
#define DT_SINGLELINE
Definition: winuser.h:540
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:938
#define DT_VCENTER
Definition: winuser.h:543

Referenced by InatCreateIcon().

◆ InatGetIconSize()

BOOL InatGetIconSize ( _Out_ INT pcx,
_Out_ INT pcy 
)

@implemented

Definition at line 335 of file mlng.cpp.

336{
337 g_IconList.GetIconSize(pcx, pcy);
338 return TRUE;
339}
void GetIconSize(INT *pcx, INT *pcy)
@implemented
Definition: mlng.cpp:480

Referenced by MLNGINFO::InitIcon().

◆ InatGetImageCount()

INT InatGetImageCount ( VOID  )

@implemented

Definition at line 342 of file mlng.cpp.

343{
344 return g_IconList.GetImageCount();
345}
INT GetImageCount()
@implemented
Definition: mlng.cpp:489

◆ InatRemoveAll()

VOID InatRemoveAll ( VOID  )

@implemented

Definition at line 348 of file mlng.cpp.

349{
352}
void RemoveAll(BOOL bNoLock)
@implemented
Definition: mlng.cpp:498

◆ TF_GetMlngHKL()

EXTERN_C BOOL WINAPI TF_GetMlngHKL ( _In_ INT  iKL,
_Out_opt_ HKL phKL,
_Out_opt_ LPWSTR  pszDesc,
_In_ INT  cchDesc 
)

Definition at line 665 of file mlng.cpp.

670{
671 TRACE("(%d, %p, %p, %d)\n", iKL, phKL, pszDesc, cchDesc);
672
673 BOOL ret = FALSE;
674
676
678
679 if (iKL < (INT)g_pMlngInfo->size())
680 {
681 MLNGINFO& info = (*g_pMlngInfo)[iKL];
682
683 if (phKL)
684 *phKL = info.m_hKL;
685
686 if (pszDesc)
687 StringCchCopyW(pszDesc, cchDesc, info.GetDesc());
688
689 ret = TRUE;
690 }
691
693
694 return ret;
695}
CRITICAL_SECTION g_cs
Definition: utils.cpp:40
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by GethKLDesc(), GetIconIndexFromhKL(), CLBarInatItem::InitMenu(), and CLBarInatItem::OnMenuSelect().

◆ TF_GetMlngIconIndex()

EXTERN_C INT WINAPI TF_GetMlngIconIndex ( _In_ INT  iKL)

Definition at line 641 of file mlng.cpp.

642{
643 TRACE("(%d)\n", iKL);
644
645 INT iIcon = -1;
646
648
650
651 if (iKL < (INT)g_pMlngInfo->size())
652 iIcon = (*g_pMlngInfo)[iKL].GetIconIndex();
653
655
656 return iIcon;
657}

Referenced by GetIconIndexFromhKL().

◆ TF_InatExtractIcon()

EXTERN_C HICON WINAPI TF_InatExtractIcon ( _In_ INT  iKL)

Definition at line 630 of file mlng.cpp.

631{
632 TRACE("(%d)\n", iKL);
633 return g_IconList.ExtractIcon(iKL);
634}
HICON ExtractIcon(INT iIcon)
@implemented
Definition: mlng.cpp:469

Referenced by CLBarInatItem::GetIcon(), and CLBarInatItem::InitMenu().

◆ TF_InitMlngInfo()

EXTERN_C VOID WINAPI TF_InitMlngInfo ( VOID  )

Definition at line 595 of file mlng.cpp.

596{
597 TRACE("()\n");
598
600
601 if (CheckMlngInfo())
602 {
605 }
606
608}
static VOID CreateMlngInfo(VOID)
@implemented
Definition: mlng.cpp:560
static VOID DestroyMlngInfo(VOID)
@implemented
Definition: mlng.cpp:550
static BOOL CheckMlngInfo(VOID)
@implemented
Definition: mlng.cpp:515

◆ TF_MlngInfoCount()

EXTERN_C INT WINAPI TF_MlngInfoCount ( VOID  )

Definition at line 615 of file mlng.cpp.

616{
617 TRACE("()\n");
618
619 if (!g_pMlngInfo)
620 return 0;
621
622 return (INT)g_pMlngInfo->size();
623}

Referenced by CheckMlngInfo(), CLBarInatItem::CLBarInatItem(), GethKLDesc(), GetIconIndexFromhKL(), and CLBarInatItem::InitMenu().

◆ UninitINAT()

VOID UninitINAT ( VOID  )

@implemented

Definition at line 355 of file mlng.cpp.

356{
358
359 if (g_pMlngInfo)
360 {
361 delete g_pMlngInfo;
363 }
364}

Referenced by ProcessDetach().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msctf  )

Variable Documentation

◆ g_cs

◆ g_IconList

◆ g_pMlngInfo

◆ s_dwCacheKLID

DWORD s_dwCacheKLID = 0
static

Definition at line 40 of file mlng.cpp.

Referenced by GetSpecialKLID().

◆ s_hCacheKL

HKL s_hCacheKL = NULL
static

Definition at line 39 of file mlng.cpp.

Referenced by GetSpecialKLID().