dwrite/tests: Use fabs for floating point numbers (clang).
[wine.git] / dlls / msimtf / activeimmapp.c
blob313cd8c95062d7a922400cc5989cc0cfb742460a
1 /*
2 * ActiveIMMApp Interface
4 * Copyright 2008 CodeWeavers, Aric Stewart
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "config.h"
23 #include <stdarg.h>
25 #define COBJMACROS
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wingdi.h"
30 #include "winreg.h"
31 #include "winuser.h"
32 #include "winerror.h"
33 #include "objbase.h"
34 #include "dimm.h"
35 #include "imm.h"
37 #include "wine/unicode.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(msimtf);
43 typedef struct tagActiveIMMApp {
44 IActiveIMMApp IActiveIMMApp_iface;
45 IActiveIMMMessagePumpOwner IActiveIMMMessagePumpOwner_iface;
46 LONG refCount;
47 } ActiveIMMApp;
49 static inline ActiveIMMApp *impl_from_IActiveIMMApp(IActiveIMMApp *iface)
51 return CONTAINING_RECORD(iface, ActiveIMMApp, IActiveIMMApp_iface);
54 static void ActiveIMMApp_Destructor(ActiveIMMApp* This)
56 TRACE("\n");
57 HeapFree(GetProcessHeap(),0,This);
60 static HRESULT WINAPI ActiveIMMApp_QueryInterface (IActiveIMMApp* iface,
61 REFIID iid, LPVOID *ppvOut)
63 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface);
64 *ppvOut = NULL;
66 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IActiveIMMApp))
68 *ppvOut = &This->IActiveIMMApp_iface;
70 else if (IsEqualIID(iid, &IID_IActiveIMMMessagePumpOwner))
72 *ppvOut = &This->IActiveIMMMessagePumpOwner_iface;
75 if (*ppvOut)
77 IUnknown_AddRef(iface);
78 return S_OK;
81 WARN("unsupported interface: %s\n", debugstr_guid(iid));
82 return E_NOINTERFACE;
85 static ULONG WINAPI ActiveIMMApp_AddRef(IActiveIMMApp* iface)
87 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface);
88 return InterlockedIncrement(&This->refCount);
91 static ULONG WINAPI ActiveIMMApp_Release(IActiveIMMApp* iface)
93 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface);
94 ULONG ret;
96 ret = InterlockedDecrement(&This->refCount);
97 if (ret == 0)
98 ActiveIMMApp_Destructor(This);
99 return ret;
102 static HRESULT WINAPI ActiveIMMApp_AssociateContext(IActiveIMMApp* iface,
103 HWND hWnd, HIMC hIME, HIMC *phPrev)
105 *phPrev = ImmAssociateContext(hWnd,hIME);
106 return S_OK;
109 static HRESULT WINAPI ActiveIMMApp_ConfigureIMEA(IActiveIMMApp* This,
110 HKL hKL, HWND hwnd, DWORD dwMode, REGISTERWORDA *pData)
112 BOOL rc;
114 rc = ImmConfigureIMEA(hKL, hwnd, dwMode, pData);
115 if (rc)
116 return E_FAIL;
117 else
118 return S_OK;
121 static HRESULT WINAPI ActiveIMMApp_ConfigureIMEW(IActiveIMMApp* This,
122 HKL hKL, HWND hWnd, DWORD dwMode, REGISTERWORDW *pData)
124 BOOL rc;
126 rc = ImmConfigureIMEW(hKL, hWnd, dwMode, pData);
127 if (rc)
128 return E_FAIL;
129 else
130 return S_OK;
133 static HRESULT WINAPI ActiveIMMApp_CreateContext(IActiveIMMApp* This,
134 HIMC *phIMC)
136 *phIMC = ImmCreateContext();
137 if (*phIMC)
138 return S_OK;
139 else
140 return E_FAIL;
143 static HRESULT WINAPI ActiveIMMApp_DestroyContext(IActiveIMMApp* This,
144 HIMC hIME)
146 BOOL rc;
148 rc = ImmDestroyContext(hIME);
149 if (rc)
150 return S_OK;
151 else
152 return E_FAIL;
155 static HRESULT WINAPI ActiveIMMApp_EnumRegisterWordA(IActiveIMMApp* This,
156 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szRegister,
157 LPVOID pData, IEnumRegisterWordA **pEnum)
159 FIXME("Stub\n");
160 return E_NOTIMPL;
163 static HRESULT WINAPI ActiveIMMApp_EnumRegisterWordW(IActiveIMMApp* This,
164 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szRegister,
165 LPVOID pData, IEnumRegisterWordW **pEnum)
167 FIXME("Stub\n");
168 return E_NOTIMPL;
171 static HRESULT WINAPI ActiveIMMApp_EscapeA(IActiveIMMApp* This,
172 HKL hKL, HIMC hIMC, UINT uEscape, LPVOID pData, LRESULT *plResult)
174 *plResult = ImmEscapeA(hKL, hIMC, uEscape, pData);
175 return S_OK;
178 static HRESULT WINAPI ActiveIMMApp_EscapeW(IActiveIMMApp* This,
179 HKL hKL, HIMC hIMC, UINT uEscape, LPVOID pData, LRESULT *plResult)
181 *plResult = ImmEscapeW(hKL, hIMC, uEscape, pData);
182 return S_OK;
185 static HRESULT WINAPI ActiveIMMApp_GetCandidateListA(IActiveIMMApp* This,
186 HIMC hIMC, DWORD dwIndex, UINT uBufLen, CANDIDATELIST *pCandList,
187 UINT *puCopied)
189 *puCopied = ImmGetCandidateListA(hIMC, dwIndex, pCandList, uBufLen);
190 return S_OK;
193 static HRESULT WINAPI ActiveIMMApp_GetCandidateListW(IActiveIMMApp* This,
194 HIMC hIMC, DWORD dwIndex, UINT uBufLen, CANDIDATELIST *pCandList,
195 UINT *puCopied)
197 *puCopied = ImmGetCandidateListW(hIMC, dwIndex, pCandList, uBufLen);
198 return S_OK;
201 static HRESULT WINAPI ActiveIMMApp_GetCandidateListCountA(IActiveIMMApp* This,
202 HIMC hIMC, DWORD *pdwListSize, DWORD *pdwBufLen)
204 *pdwBufLen = ImmGetCandidateListCountA(hIMC, pdwListSize);
205 return S_OK;
208 static HRESULT WINAPI ActiveIMMApp_GetCandidateListCountW(IActiveIMMApp* This,
209 HIMC hIMC, DWORD *pdwListSize, DWORD *pdwBufLen)
211 *pdwBufLen = ImmGetCandidateListCountA(hIMC, pdwListSize);
212 return S_OK;
215 static HRESULT WINAPI ActiveIMMApp_GetCandidateWindow(IActiveIMMApp* This,
216 HIMC hIMC, DWORD dwIndex, CANDIDATEFORM *pCandidate)
218 BOOL rc;
219 rc = ImmGetCandidateWindow(hIMC,dwIndex,pCandidate);
220 if (rc)
221 return S_OK;
222 else
223 return E_FAIL;
226 static HRESULT WINAPI ActiveIMMApp_GetCompositionFontA(IActiveIMMApp* This,
227 HIMC hIMC, LOGFONTA *plf)
229 BOOL rc;
230 rc = ImmGetCompositionFontA(hIMC,plf);
231 if (rc)
232 return S_OK;
233 else
234 return E_FAIL;
237 static HRESULT WINAPI ActiveIMMApp_GetCompositionFontW(IActiveIMMApp* This,
238 HIMC hIMC, LOGFONTW *plf)
240 BOOL rc;
241 rc = ImmGetCompositionFontW(hIMC,plf);
242 if (rc)
243 return S_OK;
244 else
245 return E_FAIL;
248 static HRESULT WINAPI ActiveIMMApp_GetCompositionStringA(IActiveIMMApp* This,
249 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LONG *plCopied, LPVOID pBuf)
251 *plCopied = ImmGetCompositionStringA(hIMC, dwIndex, pBuf, dwBufLen);
252 return S_OK;
255 static HRESULT WINAPI ActiveIMMApp_GetCompositionStringW(IActiveIMMApp* This,
256 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LONG *plCopied, LPVOID pBuf)
258 *plCopied = ImmGetCompositionStringW(hIMC, dwIndex, pBuf, dwBufLen);
259 return S_OK;
262 static HRESULT WINAPI ActiveIMMApp_GetCompositionWindow(IActiveIMMApp* This,
263 HIMC hIMC, COMPOSITIONFORM *pCompForm)
265 BOOL rc;
267 rc = ImmGetCompositionWindow(hIMC,pCompForm);
269 if (rc)
270 return S_OK;
271 else
272 return E_FAIL;
275 static HRESULT WINAPI ActiveIMMApp_GetContext(IActiveIMMApp* This,
276 HWND hwnd, HIMC *phIMC)
278 *phIMC = ImmGetContext(hwnd);
279 return S_OK;
282 static HRESULT WINAPI ActiveIMMApp_GetConversionListA(IActiveIMMApp* This,
283 HKL hKL, HIMC hIMC, LPSTR pSrc, UINT uBufLen, UINT uFlag,
284 CANDIDATELIST *pDst, UINT *puCopied)
286 *puCopied = ImmGetConversionListA(hKL, hIMC, pSrc, pDst, uBufLen, uFlag);
287 return S_OK;
290 static HRESULT WINAPI ActiveIMMApp_GetConversionListW(IActiveIMMApp* This,
291 HKL hKL, HIMC hIMC, LPWSTR pSrc, UINT uBufLen, UINT uFlag,
292 CANDIDATELIST *pDst, UINT *puCopied)
294 *puCopied = ImmGetConversionListW(hKL, hIMC, pSrc, pDst, uBufLen, uFlag);
295 return S_OK;
298 static HRESULT WINAPI ActiveIMMApp_GetConversionStatus(IActiveIMMApp* This,
299 HIMC hIMC, DWORD *pfdwConversion, DWORD *pfdwSentence)
301 BOOL rc;
303 rc = ImmGetConversionStatus(hIMC, pfdwConversion, pfdwSentence);
305 if (rc)
306 return S_OK;
307 else
308 return E_FAIL;
311 static HRESULT WINAPI ActiveIMMApp_GetDefaultIMEWnd(IActiveIMMApp* This,
312 HWND hWnd, HWND *phDefWnd)
314 *phDefWnd = ImmGetDefaultIMEWnd(hWnd);
315 return S_OK;
318 static HRESULT WINAPI ActiveIMMApp_GetDescriptionA(IActiveIMMApp* This,
319 HKL hKL, UINT uBufLen, LPSTR szDescription, UINT *puCopied)
321 *puCopied = ImmGetDescriptionA(hKL, szDescription, uBufLen);
322 return S_OK;
325 static HRESULT WINAPI ActiveIMMApp_GetDescriptionW(IActiveIMMApp* This,
326 HKL hKL, UINT uBufLen, LPWSTR szDescription, UINT *puCopied)
328 *puCopied = ImmGetDescriptionW(hKL, szDescription, uBufLen);
329 return S_OK;
332 static HRESULT WINAPI ActiveIMMApp_GetGuideLineA(IActiveIMMApp* This,
333 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LPSTR pBuf,
334 DWORD *pdwResult)
336 *pdwResult = ImmGetGuideLineA(hIMC, dwIndex, pBuf, dwBufLen);
337 return S_OK;
340 static HRESULT WINAPI ActiveIMMApp_GetGuideLineW(IActiveIMMApp* This,
341 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LPWSTR pBuf,
342 DWORD *pdwResult)
344 *pdwResult = ImmGetGuideLineW(hIMC, dwIndex, pBuf, dwBufLen);
345 return S_OK;
348 static HRESULT WINAPI ActiveIMMApp_GetIMEFileNameA(IActiveIMMApp* This,
349 HKL hKL, UINT uBufLen, LPSTR szFileName, UINT *puCopied)
351 *puCopied = ImmGetIMEFileNameA(hKL, szFileName, uBufLen);
352 return S_OK;
355 static HRESULT WINAPI ActiveIMMApp_GetIMEFileNameW(IActiveIMMApp* This,
356 HKL hKL, UINT uBufLen, LPWSTR szFileName, UINT *puCopied)
358 *puCopied = ImmGetIMEFileNameW(hKL, szFileName, uBufLen);
359 return S_OK;
362 static HRESULT WINAPI ActiveIMMApp_GetOpenStatus(IActiveIMMApp* This,
363 HIMC hIMC)
365 return ImmGetOpenStatus(hIMC);
368 static HRESULT WINAPI ActiveIMMApp_GetProperty(IActiveIMMApp* This,
369 HKL hKL, DWORD fdwIndex, DWORD *pdwProperty)
371 *pdwProperty = ImmGetProperty(hKL, fdwIndex);
372 return S_OK;
375 static HRESULT WINAPI ActiveIMMApp_GetRegisterWordStyleA(IActiveIMMApp* This,
376 HKL hKL, UINT nItem, STYLEBUFA *pStyleBuf, UINT *puCopied)
378 *puCopied = ImmGetRegisterWordStyleA(hKL, nItem, pStyleBuf);
379 return S_OK;
382 static HRESULT WINAPI ActiveIMMApp_GetRegisterWordStyleW(IActiveIMMApp* This,
383 HKL hKL, UINT nItem, STYLEBUFW *pStyleBuf, UINT *puCopied)
385 *puCopied = ImmGetRegisterWordStyleW(hKL, nItem, pStyleBuf);
386 return S_OK;
389 static HRESULT WINAPI ActiveIMMApp_GetStatusWindowPos(IActiveIMMApp* This,
390 HIMC hIMC, POINT *pptPos)
392 BOOL rc;
393 rc = ImmGetStatusWindowPos(hIMC, pptPos);
395 if (rc)
396 return S_OK;
397 else
398 return E_FAIL;
401 static HRESULT WINAPI ActiveIMMApp_GetVirtualKey(IActiveIMMApp* This,
402 HWND hWnd, UINT *puVirtualKey)
404 *puVirtualKey = ImmGetVirtualKey(hWnd);
405 return S_OK;
408 static HRESULT WINAPI ActiveIMMApp_InstallIMEA(IActiveIMMApp* This,
409 LPSTR szIMEFileName, LPSTR szLayoutText, HKL *phKL)
411 *phKL = ImmInstallIMEA(szIMEFileName,szLayoutText);
412 return S_OK;
415 static HRESULT WINAPI ActiveIMMApp_InstallIMEW(IActiveIMMApp* This,
416 LPWSTR szIMEFileName, LPWSTR szLayoutText, HKL *phKL)
418 *phKL = ImmInstallIMEW(szIMEFileName,szLayoutText);
419 return S_OK;
422 static HRESULT WINAPI ActiveIMMApp_IsIME(IActiveIMMApp* This,
423 HKL hKL)
425 return ImmIsIME(hKL);
428 static HRESULT WINAPI ActiveIMMApp_IsUIMessageA(IActiveIMMApp* This,
429 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
431 return ImmIsUIMessageA(hWndIME,msg,wParam,lParam);
434 static HRESULT WINAPI ActiveIMMApp_IsUIMessageW(IActiveIMMApp* This,
435 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
437 return ImmIsUIMessageW(hWndIME,msg,wParam,lParam);
440 static HRESULT WINAPI ActiveIMMApp_NotifyIME(IActiveIMMApp* This,
441 HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
443 BOOL rc;
445 rc = ImmNotifyIME(hIMC,dwAction,dwIndex,dwValue);
447 if (rc)
448 return S_OK;
449 else
450 return E_FAIL;
453 static HRESULT WINAPI ActiveIMMApp_RegisterWordA(IActiveIMMApp* This,
454 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szRegister)
456 BOOL rc;
458 rc = ImmRegisterWordA(hKL,szReading,dwStyle,szRegister);
460 if (rc)
461 return S_OK;
462 else
463 return E_FAIL;
466 static HRESULT WINAPI ActiveIMMApp_RegisterWordW(IActiveIMMApp* This,
467 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szRegister)
469 BOOL rc;
471 rc = ImmRegisterWordW(hKL,szReading,dwStyle,szRegister);
473 if (rc)
474 return S_OK;
475 else
476 return E_FAIL;
479 static HRESULT WINAPI ActiveIMMApp_ReleaseContext(IActiveIMMApp* This,
480 HWND hWnd, HIMC hIMC)
482 BOOL rc;
484 rc = ImmReleaseContext(hWnd,hIMC);
486 if (rc)
487 return S_OK;
488 else
489 return E_FAIL;
492 static HRESULT WINAPI ActiveIMMApp_SetCandidateWindow(IActiveIMMApp* This,
493 HIMC hIMC, CANDIDATEFORM *pCandidate)
495 BOOL rc;
497 rc = ImmSetCandidateWindow(hIMC,pCandidate);
499 if (rc)
500 return S_OK;
501 else
502 return E_FAIL;
505 static HRESULT WINAPI ActiveIMMApp_SetCompositionFontA(IActiveIMMApp* This,
506 HIMC hIMC, LOGFONTA *plf)
508 BOOL rc;
510 rc = ImmSetCompositionFontA(hIMC,plf);
512 if (rc)
513 return S_OK;
514 else
515 return E_FAIL;
518 static HRESULT WINAPI ActiveIMMApp_SetCompositionFontW(IActiveIMMApp* This,
519 HIMC hIMC, LOGFONTW *plf)
521 BOOL rc;
523 rc = ImmSetCompositionFontW(hIMC,plf);
525 if (rc)
526 return S_OK;
527 else
528 return E_FAIL;
531 static HRESULT WINAPI ActiveIMMApp_SetCompositionStringA(IActiveIMMApp* This,
532 HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLen,
533 LPVOID pRead, DWORD dwReadLen)
535 BOOL rc;
537 rc = ImmSetCompositionStringA(hIMC,dwIndex,pComp,dwCompLen,pRead,dwReadLen);
539 if (rc)
540 return S_OK;
541 else
542 return E_FAIL;
545 static HRESULT WINAPI ActiveIMMApp_SetCompositionStringW(IActiveIMMApp* This,
546 HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLen,
547 LPVOID pRead, DWORD dwReadLen)
549 BOOL rc;
551 rc = ImmSetCompositionStringW(hIMC,dwIndex,pComp,dwCompLen,pRead,dwReadLen);
553 if (rc)
554 return S_OK;
555 else
556 return E_FAIL;
559 static HRESULT WINAPI ActiveIMMApp_SetCompositionWindow(IActiveIMMApp* This,
560 HIMC hIMC, COMPOSITIONFORM *pCompForm)
562 BOOL rc;
564 rc = ImmSetCompositionWindow(hIMC,pCompForm);
566 if (rc)
567 return S_OK;
568 else
569 return E_FAIL;
572 static HRESULT WINAPI ActiveIMMApp_SetConversionStatus(IActiveIMMApp* This,
573 HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
575 BOOL rc;
577 rc = ImmSetConversionStatus(hIMC,fdwConversion,fdwSentence);
579 if (rc)
580 return S_OK;
581 else
582 return E_FAIL;
585 static HRESULT WINAPI ActiveIMMApp_SetOpenStatus(IActiveIMMApp* This,
586 HIMC hIMC, BOOL fOpen)
588 BOOL rc;
590 rc = ImmSetOpenStatus(hIMC,fOpen);
592 if (rc)
593 return S_OK;
594 else
595 return E_FAIL;
598 static HRESULT WINAPI ActiveIMMApp_SetStatusWindowPos(IActiveIMMApp* This,
599 HIMC hIMC, POINT *pptPos)
601 BOOL rc;
603 rc = ImmSetStatusWindowPos(hIMC,pptPos);
605 if (rc)
606 return S_OK;
607 else
608 return E_FAIL;
611 static HRESULT WINAPI ActiveIMMApp_SimulateHotKey(IActiveIMMApp* This,
612 HWND hwnd, DWORD dwHotKeyID)
614 BOOL rc;
616 rc = ImmSimulateHotKey(hwnd,dwHotKeyID);
618 if (rc)
619 return S_OK;
620 else
621 return E_FAIL;
624 static HRESULT WINAPI ActiveIMMApp_UnregisterWordA(IActiveIMMApp* This,
625 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szUnregister)
627 BOOL rc;
629 rc = ImmUnregisterWordA(hKL,szReading,dwStyle,szUnregister);
631 if (rc)
632 return S_OK;
633 else
634 return E_FAIL;
638 static HRESULT WINAPI ActiveIMMApp_UnregisterWordW(IActiveIMMApp* This,
639 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szUnregister)
641 BOOL rc;
643 rc = ImmUnregisterWordW(hKL,szReading,dwStyle,szUnregister);
645 if (rc)
646 return S_OK;
647 else
648 return E_FAIL;
651 static HRESULT WINAPI ActiveIMMApp_Activate(IActiveIMMApp* This,
652 BOOL fRestoreLayout)
654 FIXME("Stub\n");
655 return S_OK;
658 static HRESULT WINAPI ActiveIMMApp_Deactivate(IActiveIMMApp* This)
660 FIXME("Stub\n");
661 return S_OK;
664 static HRESULT WINAPI ActiveIMMApp_OnDefWindowProc(IActiveIMMApp* This,
665 HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult)
667 FIXME("Stub (%p %x %lx %lx)\n",hWnd,Msg,wParam,lParam);
668 return E_FAIL;
671 static HRESULT WINAPI ActiveIMMApp_FilterClientWindows(IActiveIMMApp* This,
672 ATOM *aaClassList, UINT uSize)
674 FIXME("Stub\n");
675 return S_OK;
678 static HRESULT WINAPI ActiveIMMApp_GetCodePageA(IActiveIMMApp* This,
679 HKL hKL, UINT *uCodePage)
681 FIXME("Stub\n");
682 return E_NOTIMPL;
685 static HRESULT WINAPI ActiveIMMApp_GetLangId(IActiveIMMApp* This,
686 HKL hKL, LANGID *plid)
688 FIXME("Stub\n");
689 return E_NOTIMPL;
692 static HRESULT WINAPI ActiveIMMApp_AssociateContextEx(IActiveIMMApp* This,
693 HWND hWnd, HIMC hIMC, DWORD dwFlags)
695 BOOL rc;
697 rc = ImmAssociateContextEx(hWnd,hIMC,dwFlags);
699 if (rc)
700 return S_OK;
701 else
702 return E_FAIL;
705 static HRESULT WINAPI ActiveIMMApp_DisableIME(IActiveIMMApp* This,
706 DWORD idThread)
708 BOOL rc;
710 rc = ImmDisableIME(idThread);
712 if (rc)
713 return S_OK;
714 else
715 return E_FAIL;
718 static HRESULT WINAPI ActiveIMMApp_GetImeMenuItemsA(IActiveIMMApp* This,
719 HIMC hIMC, DWORD dwFlags, DWORD dwType,
720 IMEMENUITEMINFOA *pImeParentMenu, IMEMENUITEMINFOA *pImeMenu,
721 DWORD dwSize, DWORD *pdwResult)
723 *pdwResult = ImmGetImeMenuItemsA(hIMC,dwFlags,dwType,pImeParentMenu,pImeMenu,dwSize);
724 return S_OK;
727 static HRESULT WINAPI ActiveIMMApp_GetImeMenuItemsW(IActiveIMMApp* This,
728 HIMC hIMC, DWORD dwFlags, DWORD dwType,
729 IMEMENUITEMINFOW *pImeParentMenu, IMEMENUITEMINFOW *pImeMenu,
730 DWORD dwSize, DWORD *pdwResult)
732 *pdwResult = ImmGetImeMenuItemsW(hIMC,dwFlags,dwType,pImeParentMenu,pImeMenu,dwSize);
733 return S_OK;
736 static HRESULT WINAPI ActiveIMMApp_EnumInputContext(IActiveIMMApp* This,
737 DWORD idThread, IEnumInputContext **ppEnum)
739 FIXME("Stub\n");
740 return E_NOTIMPL;
743 static const IActiveIMMAppVtbl ActiveIMMAppVtbl =
745 ActiveIMMApp_QueryInterface,
746 ActiveIMMApp_AddRef,
747 ActiveIMMApp_Release,
749 ActiveIMMApp_AssociateContext,
750 ActiveIMMApp_ConfigureIMEA,
751 ActiveIMMApp_ConfigureIMEW,
752 ActiveIMMApp_CreateContext,
753 ActiveIMMApp_DestroyContext,
754 ActiveIMMApp_EnumRegisterWordA,
755 ActiveIMMApp_EnumRegisterWordW,
756 ActiveIMMApp_EscapeA,
757 ActiveIMMApp_EscapeW,
758 ActiveIMMApp_GetCandidateListA,
759 ActiveIMMApp_GetCandidateListW,
760 ActiveIMMApp_GetCandidateListCountA,
761 ActiveIMMApp_GetCandidateListCountW,
762 ActiveIMMApp_GetCandidateWindow,
763 ActiveIMMApp_GetCompositionFontA,
764 ActiveIMMApp_GetCompositionFontW,
765 ActiveIMMApp_GetCompositionStringA,
766 ActiveIMMApp_GetCompositionStringW,
767 ActiveIMMApp_GetCompositionWindow,
768 ActiveIMMApp_GetContext,
769 ActiveIMMApp_GetConversionListA,
770 ActiveIMMApp_GetConversionListW,
771 ActiveIMMApp_GetConversionStatus,
772 ActiveIMMApp_GetDefaultIMEWnd,
773 ActiveIMMApp_GetDescriptionA,
774 ActiveIMMApp_GetDescriptionW,
775 ActiveIMMApp_GetGuideLineA,
776 ActiveIMMApp_GetGuideLineW,
777 ActiveIMMApp_GetIMEFileNameA,
778 ActiveIMMApp_GetIMEFileNameW,
779 ActiveIMMApp_GetOpenStatus,
780 ActiveIMMApp_GetProperty,
781 ActiveIMMApp_GetRegisterWordStyleA,
782 ActiveIMMApp_GetRegisterWordStyleW,
783 ActiveIMMApp_GetStatusWindowPos,
784 ActiveIMMApp_GetVirtualKey,
785 ActiveIMMApp_InstallIMEA,
786 ActiveIMMApp_InstallIMEW,
787 ActiveIMMApp_IsIME,
788 ActiveIMMApp_IsUIMessageA,
789 ActiveIMMApp_IsUIMessageW,
790 ActiveIMMApp_NotifyIME,
791 ActiveIMMApp_RegisterWordA,
792 ActiveIMMApp_RegisterWordW,
793 ActiveIMMApp_ReleaseContext,
794 ActiveIMMApp_SetCandidateWindow,
795 ActiveIMMApp_SetCompositionFontA,
796 ActiveIMMApp_SetCompositionFontW,
797 ActiveIMMApp_SetCompositionStringA,
798 ActiveIMMApp_SetCompositionStringW,
799 ActiveIMMApp_SetCompositionWindow,
800 ActiveIMMApp_SetConversionStatus,
801 ActiveIMMApp_SetOpenStatus,
802 ActiveIMMApp_SetStatusWindowPos,
803 ActiveIMMApp_SimulateHotKey,
804 ActiveIMMApp_UnregisterWordA,
805 ActiveIMMApp_UnregisterWordW,
807 ActiveIMMApp_Activate,
808 ActiveIMMApp_Deactivate,
809 ActiveIMMApp_OnDefWindowProc,
810 ActiveIMMApp_FilterClientWindows,
811 ActiveIMMApp_GetCodePageA,
812 ActiveIMMApp_GetLangId,
813 ActiveIMMApp_AssociateContextEx,
814 ActiveIMMApp_DisableIME,
815 ActiveIMMApp_GetImeMenuItemsA,
816 ActiveIMMApp_GetImeMenuItemsW,
817 ActiveIMMApp_EnumInputContext
820 static inline ActiveIMMApp *impl_from_IActiveIMMMessagePumpOwner(IActiveIMMMessagePumpOwner *iface)
822 return CONTAINING_RECORD(iface, ActiveIMMApp, IActiveIMMMessagePumpOwner_iface);
825 static HRESULT WINAPI ActiveIMMMessagePumpOwner_QueryInterface(IActiveIMMMessagePumpOwner* iface,
826 REFIID iid, LPVOID *ppvOut)
828 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
829 return IActiveIMMApp_QueryInterface(&This->IActiveIMMApp_iface, iid, ppvOut);
832 static ULONG WINAPI ActiveIMMMessagePumpOwner_AddRef(IActiveIMMMessagePumpOwner* iface)
834 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
835 return IActiveIMMApp_AddRef(&This->IActiveIMMApp_iface);
838 static ULONG WINAPI ActiveIMMMessagePumpOwner_Release(IActiveIMMMessagePumpOwner* iface)
840 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
841 return IActiveIMMApp_Release(&This->IActiveIMMApp_iface);
844 static HRESULT WINAPI ActiveIMMMessagePumpOwner_Start(IActiveIMMMessagePumpOwner* iface)
846 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
847 FIXME("(%p)->(): stub\n", This);
848 return E_NOTIMPL;
851 static HRESULT WINAPI ActiveIMMMessagePumpOwner_End(IActiveIMMMessagePumpOwner* iface)
853 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
854 FIXME("(%p)->(): stub\n", This);
855 return E_NOTIMPL;
858 static HRESULT WINAPI ActiveIMMMessagePumpOwner_OnTranslateMessage(IActiveIMMMessagePumpOwner* iface,
859 const MSG *msg)
861 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
862 FIXME("(%p)->(%p): stub\n", This, msg);
863 return E_NOTIMPL;
866 static HRESULT WINAPI ActiveIMMMessagePumpOwner_Pause(IActiveIMMMessagePumpOwner* iface,
867 DWORD *cookie)
869 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
870 FIXME("(%p)->(%p): stub\n", This, cookie);
871 return E_NOTIMPL;
874 static HRESULT WINAPI ActiveIMMMessagePumpOwner_Resume(IActiveIMMMessagePumpOwner* iface,
875 DWORD cookie)
877 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
878 FIXME("(%p)->(%u): stub\n", This, cookie);
879 return E_NOTIMPL;
882 static const IActiveIMMMessagePumpOwnerVtbl ActiveIMMMessagePumpOwnerVtbl =
884 ActiveIMMMessagePumpOwner_QueryInterface,
885 ActiveIMMMessagePumpOwner_AddRef,
886 ActiveIMMMessagePumpOwner_Release,
887 ActiveIMMMessagePumpOwner_Start,
888 ActiveIMMMessagePumpOwner_End,
889 ActiveIMMMessagePumpOwner_OnTranslateMessage,
890 ActiveIMMMessagePumpOwner_Pause,
891 ActiveIMMMessagePumpOwner_Resume,
894 DECLSPEC_HIDDEN HRESULT ActiveIMMApp_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
896 ActiveIMMApp *This;
897 if (pUnkOuter)
898 return CLASS_E_NOAGGREGATION;
900 This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ActiveIMMApp));
901 if (This == NULL)
902 return E_OUTOFMEMORY;
904 This->IActiveIMMApp_iface.lpVtbl = &ActiveIMMAppVtbl;
905 This->IActiveIMMMessagePumpOwner_iface.lpVtbl = &ActiveIMMMessagePumpOwnerVtbl;
906 This->refCount = 1;
908 TRACE("returning %p\n",This);
909 *ppOut = (IUnknown *)&This->IActiveIMMApp_iface;
910 return S_OK;