ReactOS 0.4.15-dev-8131-g4988de4
ui.cpp File Reference
#include "msctfime.h"
Include dependency graph for ui.cpp:

Go to the source code of this file.

Classes

struct  CIMEUIWindowHandler
 

Macros

#define UICOMP_GWLP_INDEX   0
 
#define UICOMP_GWLP_SIZE   (UICOMP_GWLP_INDEX + sizeof(INT))
 
#define UI_GWLP_HIMC   0
 
#define UI_GWLP_UI   sizeof(HIMC)
 
#define UI_GWLP_SIZE   (UI_GWLP_UI + sizeof(UI*))
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msctfime)
 
BOOL IsMsImeMessage (_In_ UINT uMsg)
 @implemented
 
BOOL RegisterMSIMEMessage (VOID)
 @implemented
 
 STDMETHODIMP_ (void) CCompButtonFrameWindow
 @implemented
 
 STDMETHODIMP_ (BOOL) CDefCompFrameWindow
 @implemented
 
EXTERN_C LRESULT CALLBACK UIWndProc (_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
 @implemented
 
BOOL RegisterImeClass (VOID)
 @implemented
 
VOID UnregisterImeClass (VOID)
 @implemented
 

Variables

UINT WM_MSIME_SERVICE = 0
 
UINT WM_MSIME_UIREADY = 0
 
UINT WM_MSIME_RECONVERTREQUEST = 0
 
UINT WM_MSIME_RECONVERT = 0
 
UINT WM_MSIME_DOCUMENTFEED = 0
 
UINT WM_MSIME_QUERYPOSITION = 0
 
UINT WM_MSIME_MODEBIAS = 0
 
UINT WM_MSIME_SHOWIMEPAD = 0
 
UINT WM_MSIME_MOUSE = 0
 
UINT WM_MSIME_KEYMAP = 0
 

Macro Definition Documentation

◆ UI_GWLP_HIMC

#define UI_GWLP_HIMC   0

Definition at line 872 of file ui.cpp.

◆ UI_GWLP_SIZE

#define UI_GWLP_SIZE   (UI_GWLP_UI + sizeof(UI*))

Definition at line 874 of file ui.cpp.

◆ UI_GWLP_UI

#define UI_GWLP_UI   sizeof(HIMC)

Definition at line 873 of file ui.cpp.

◆ UICOMP_GWLP_INDEX

#define UICOMP_GWLP_INDEX   0

Definition at line 454 of file ui.cpp.

◆ UICOMP_GWLP_SIZE

#define UICOMP_GWLP_SIZE   (UICOMP_GWLP_INDEX + sizeof(INT))

Definition at line 455 of file ui.cpp.

Function Documentation

◆ IsMsImeMessage()

BOOL IsMsImeMessage ( _In_ UINT  uMsg)

@implemented

Definition at line 26 of file ui.cpp.

27{
28 return (uMsg == WM_MSIME_SERVICE ||
29 uMsg == WM_MSIME_UIREADY ||
31 uMsg == WM_MSIME_RECONVERT ||
32 uMsg == WM_MSIME_DOCUMENTFEED ||
33 uMsg == WM_MSIME_QUERYPOSITION ||
34 uMsg == WM_MSIME_MODEBIAS ||
35 uMsg == WM_MSIME_SHOWIMEPAD ||
36 uMsg == WM_MSIME_MOUSE ||
37 uMsg == WM_MSIME_KEYMAP);
38}
UINT WM_MSIME_RECONVERTREQUEST
Definition: ui.cpp:16
UINT WM_MSIME_DOCUMENTFEED
Definition: ui.cpp:18
UINT WM_MSIME_UIREADY
Definition: ui.cpp:15
UINT WM_MSIME_SHOWIMEPAD
Definition: ui.cpp:21
UINT WM_MSIME_MODEBIAS
Definition: ui.cpp:20
UINT WM_MSIME_KEYMAP
Definition: ui.cpp:23
UINT WM_MSIME_RECONVERT
Definition: ui.cpp:17
UINT WM_MSIME_SERVICE
Definition: ui.cpp:14
UINT WM_MSIME_MOUSE
Definition: ui.cpp:22
UINT WM_MSIME_QUERYPOSITION
Definition: ui.cpp:19

Referenced by CtfImeDispatchDefImeMessage(), and CIMEUIWindowHandler::ImeUIWndProcWorker().

◆ RegisterImeClass()

BOOL RegisterImeClass ( VOID  )

@implemented

Definition at line 1356 of file ui.cpp.

1357{
1358 WNDCLASSEXW wcx;
1359
1360 if (!GetClassInfoExW(g_hInst, L"MSCTFIME UI", &wcx))
1361 {
1362 ZeroMemory(&wcx, sizeof(wcx));
1363 wcx.cbSize = sizeof(WNDCLASSEXW);
1365 wcx.hIcon = LoadIconW(0, (LPCWSTR)IDC_ARROW);
1366 wcx.hInstance = g_hInst;
1369 wcx.style = CS_IME | CS_GLOBALCLASS;
1370 wcx.lpfnWndProc = UIWndProc;
1371 wcx.lpszClassName = L"MSCTFIME UI";
1372 if (!RegisterClassExW(&wcx))
1373 return FALSE;
1374 }
1375
1376 if (!GetClassInfoExW(g_hInst, L"MSCTFIME Composition", &wcx))
1377 {
1378 ZeroMemory(&wcx, sizeof(wcx));
1379 wcx.cbSize = sizeof(WNDCLASSEXW);
1381 wcx.hIcon = NULL;
1382 wcx.hInstance = g_hInst;
1387 wcx.lpszClassName = L"MSCTFIME Composition";
1388 if (!RegisterClassExW(&wcx))
1389 return FALSE;
1390 }
1391
1392 return TRUE;
1393}
static LRESULT CALLBACK CompWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@unimplemented
Definition: ui.cpp:780
HINSTANCE g_hInst
Definition: ctfmon.cpp:23
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define L(x)
Definition: ntvdm.h:50
LPCWSTR lpszClassName
Definition: winuser.h:3226
HBRUSH hbrBackground
Definition: winuser.h:3224
WNDPROC lpfnWndProc
Definition: winuser.h:3218
UINT cbSize
Definition: winuser.h:3216
int cbWndExtra
Definition: winuser.h:3220
HCURSOR hCursor
Definition: winuser.h:3223
HINSTANCE hInstance
Definition: winuser.h:3221
UINT style
Definition: winuser.h:3217
HICON hIcon
Definition: winuser.h:3222
#define UI_GWLP_SIZE
Definition: ui.cpp:874
#define UICOMP_GWLP_SIZE
Definition: ui.cpp:455
EXTERN_C LRESULT CALLBACK UIWndProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
@implemented
Definition: ui.cpp:1344
#define ZeroMemory
Definition: winbase.h:1712
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define NULL_BRUSH
Definition: wingdi.h:901
#define CS_VREDRAW
Definition: winuser.h:658
#define CS_IME
Definition: winuser.h:659
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
BOOL WINAPI GetClassInfoExW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _Out_ LPWNDCLASSEXW)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2136
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define IDC_IBEAM
Definition: winuser.h:688
#define CS_GLOBALCLASS
Definition: winuser.h:652
struct _WNDCLASSEXW WNDCLASSEXW
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2106
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by AttachIME().

◆ RegisterMSIMEMessage()

BOOL RegisterMSIMEMessage ( VOID  )

@implemented

Definition at line 41 of file ui.cpp.

42{
43 // Using ANSI (A) version here can reduce binary size.
46 WM_MSIME_RECONVERTREQUEST = RegisterWindowMessageA("MSIMEReconvertRequest");
48 WM_MSIME_DOCUMENTFEED = RegisterWindowMessageA("MSIMEDocumentFeed");
49 WM_MSIME_QUERYPOSITION = RegisterWindowMessageA("MSIMEQueryPosition");
52 WM_MSIME_MOUSE = RegisterWindowMessageA("MSIMEMouseOperation");
54 return (WM_MSIME_SERVICE &&
64}
UINT WINAPI RegisterWindowMessageA(_In_ LPCSTR)

Referenced by AttachIME().

◆ STDMETHODIMP_() [1/2]

STDMETHODIMP_ ( BOOL  )

@implemented

Definition at line 343 of file ui.cpp.

344{
345 if (!::IsWindow(m_hwndCompStr))
346 return FALSE;
347
348 RECT rc;
349 ::GetWindowRect(m_hwndCompStr, &rc);
350 MyScreenToClient(NULL, &rc);
351 POINT pt = { x, y };
352 return ::PtInRect(&rc, pt);
353}
#define pt(x, y)
Definition: drawing.c:79
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

◆ STDMETHODIMP_() [2/2]

STDMETHODIMP_ ( void  )

@implemented

@unimplemented

Definition at line 167 of file ui.cpp.

168{
169 ::SetWindowTheme(hWnd, L"TOOLBAR", NULL);
170
171 ZeroMemory(&m_Margins, sizeof(m_Margins));
172
173 CUIFTheme theme;
174 theme.m_hTheme = NULL;
175 theme.m_iPartId = 1;
176 theme.m_iStateId = 0;
177 theme.m_pszClassList = L"TOOLBAR";
179 theme.GetThemeMargins(NULL, 1, 3602, NULL, &m_Margins);
180}
HWND hWnd
Definition: settings.c:17
LPCWSTR m_pszClassList
Definition: cicuif.h:90
STDMETHOD() GetThemeMargins(HDC hDC, int iStateId, int iPropId, LPRECT prc, MARGINS *pMargins)
Definition: cicuif.cpp:178
HRESULT InternalOpenThemeData(HWND hWnd)
Definition: cicuif.cpp:66
INT m_iStateId
Definition: cicuif.h:92
INT m_iPartId
Definition: cicuif.h:91
HTHEME m_hTheme
Definition: cicuif.h:93
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69

◆ UIWndProc()

EXTERN_C LRESULT CALLBACK UIWndProc ( _In_ HWND  hWnd,
_In_ UINT  uMsg,
_In_ WPARAM  wParam,
_In_ LPARAM  lParam 
)

@implemented

Definition at line 1344 of file ui.cpp.

1349{
1351}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static LRESULT CALLBACK ImeUIWndProcWorker(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@implemented
Definition: ui.cpp:1233

Referenced by RegisterImeClass().

◆ UnregisterImeClass()

VOID UnregisterImeClass ( VOID  )

@implemented

Definition at line 1396 of file ui.cpp.

1397{
1398 WNDCLASSEXW wcx;
1399
1400 GetClassInfoExW(g_hInst, L"MSCTFIME UI", &wcx);
1401 UnregisterClassW(L"MSCTFIME UI", g_hInst);
1402 DestroyIcon(wcx.hIcon);
1403 DestroyIcon(wcx.hIconSm);
1404
1405 GetClassInfoExW(g_hInst, L"MSCTFIME Composition", &wcx);
1406 UnregisterClassW(L"MSCTFIME Composition", g_hInst);
1407 DestroyIcon(wcx.hIcon);
1408 DestroyIcon(wcx.hIconSm);
1409}
HICON hIconSm
Definition: winuser.h:3227
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2084

Referenced by DetachIME().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msctfime  )

Variable Documentation

◆ WM_MSIME_DOCUMENTFEED

UINT WM_MSIME_DOCUMENTFEED = 0

Definition at line 18 of file ui.cpp.

Referenced by IsMsImeMessage(), RegisterMSIMEMessage(), and test_ImmIsUIMessage().

◆ WM_MSIME_KEYMAP

UINT WM_MSIME_KEYMAP = 0

Definition at line 23 of file ui.cpp.

Referenced by IsMsImeMessage(), and RegisterMSIMEMessage().

◆ WM_MSIME_MODEBIAS

UINT WM_MSIME_MODEBIAS = 0

◆ WM_MSIME_MOUSE

UINT WM_MSIME_MOUSE = 0

◆ WM_MSIME_QUERYPOSITION

UINT WM_MSIME_QUERYPOSITION = 0

Definition at line 19 of file ui.cpp.

Referenced by IsMsImeMessage(), RegisterMSIMEMessage(), and test_ImmIsUIMessage().

◆ WM_MSIME_RECONVERT

UINT WM_MSIME_RECONVERT = 0

◆ WM_MSIME_RECONVERTREQUEST

UINT WM_MSIME_RECONVERTREQUEST = 0

◆ WM_MSIME_SERVICE

UINT WM_MSIME_SERVICE = 0

◆ WM_MSIME_SHOWIMEPAD

UINT WM_MSIME_SHOWIMEPAD = 0

Definition at line 21 of file ui.cpp.

Referenced by IsMsImeMessage(), and RegisterMSIMEMessage().

◆ WM_MSIME_UIREADY

UINT WM_MSIME_UIREADY = 0

Definition at line 15 of file ui.cpp.

Referenced by IsMsImeMessage(), and RegisterMSIMEMessage().