ReactOS 0.4.15-dev-8116-gf69e256
langbarmgr.c
Go to the documentation of this file.
1/*
2 * ITfLangBarMgr implementation
3 *
4 * Copyright 2010 Justin Chevrier
5 *
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.
10 *
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.
15 *
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
19 */
20
21#define COBJMACROS
22
23#include "wine/debug.h"
24#include "winbase.h"
25#include "winreg.h"
26#include "shlwapi.h"
27
28#include "msctf.h"
29#include "msctf_internal.h"
30
32
33typedef struct tagLangBarMgr {
35
37
39
41{
42 return CONTAINING_RECORD(iface, LangBarMgr, ITfLangBarMgr_iface);
43}
44
46{
47 TRACE("destroying %p\n", This);
48
50}
51
53{
55 *ppvOut = NULL;
56
57 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr))
58 {
59 *ppvOut = &This->ITfLangBarMgr_iface;
60 }
61
62 if (*ppvOut)
63 {
64 ITfLangBarMgr_AddRef(iface);
65 return S_OK;
66 }
67
68 WARN("unsupported interface: %s\n", debugstr_guid(iid));
69 return E_NOINTERFACE;
70}
71
73{
75 return InterlockedIncrement(&This->refCount);
76}
77
79{
81 ULONG ret;
82
83 ret = InterlockedDecrement(&This->refCount);
84 if (ret == 0)
86 return ret;
87}
88
89/*****************************************************
90 * ITfLangBarMgr functions
91 *****************************************************/
92
94{
96
97 FIXME("STUB:(%p)\n",This);
98 return E_NOTIMPL;
99}
100
102{
104
105 FIXME("STUB:(%p)\n",This);
106 return E_NOTIMPL;
107}
108
110{
112
113 FIXME("STUB:(%p)\n",This);
114 return E_NOTIMPL;
115}
116
118{
120
121 FIXME("STUB:(%p)\n",This);
122 return E_NOTIMPL;
123}
124
125static HRESULT WINAPI LangBarMgr_GetInputProcessorProfiles( ITfLangBarMgr* iface, DWORD dwThreadId, ITfInputProcessorProfiles **ppaip, DWORD *pdwThreadid)
126{
128
129 FIXME("STUB:(%p)\n",This);
130 return E_NOTIMPL;
131}
132
134{
136
137 FIXME("STUB:(%p)\n",This);
138 return E_NOTIMPL;
139}
140
142{
144
145 FIXME("STUB:(%p)\n",This);
146 return E_NOTIMPL;
147}
148
150{
152
153 FIXME("STUB:(%p)\n",This);
154 return E_NOTIMPL;
155}
156
158{
160
161 FIXME("STUB:(%p)\n",This);
162 return E_NOTIMPL;
163}
164
165static const ITfLangBarMgrVtbl LangBarMgr_LangBarMgrVtbl =
166{
170
180};
181
183{
185 if (pUnkOuter)
187
189 if (This == NULL)
190 return E_OUTOFMEMORY;
191
192 This->ITfLangBarMgr_iface.lpVtbl = &LangBarMgr_LangBarMgrVtbl;
193 This->refCount = 1;
194
195 *ppOut = (IUnknown *)&This->ITfLangBarMgr_iface;
196 TRACE("returning %p\n", *ppOut);
197 return S_OK;
198}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:114
#define WARN(fmt,...)
Definition: debug.h:115
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
DWORD dwThreadId
Definition: fdebug.c:31
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
static HRESULT WINAPI LangBarMgr_GetThreadLangBarItemMgr(ITfLangBarMgr *iface, DWORD dwThreadId, ITfLangBarItemMgr **pplbi, DWORD *pdwThreadid)
Definition: langbarmgr.c:117
static const ITfLangBarMgrVtbl LangBarMgr_LangBarMgrVtbl
Definition: langbarmgr.c:165
static ULONG WINAPI LangBarMgr_Release(ITfLangBarMgr *iface)
Definition: langbarmgr.c:78
static LangBarMgr * impl_from_ITfLangBarMgr(ITfLangBarMgr *iface)
Definition: langbarmgr.c:40
static HRESULT WINAPI LangBarMgr_RestoreLastFocus(ITfLangBarMgr *iface, DWORD *dwThreadId, BOOL fPrev)
Definition: langbarmgr.c:133
static void LangBarMgr_Destructor(LangBarMgr *This)
Definition: langbarmgr.c:45
static HRESULT WINAPI LangBarMgr_SetModalInput(ITfLangBarMgr *iface, ITfLangBarEventSink *pSink, DWORD dwThreadId, DWORD dwFlags)
Definition: langbarmgr.c:141
static HRESULT WINAPI LangBarMgr_GetThreadMarshalInterface(ITfLangBarMgr *iface, DWORD dwThreadId, DWORD dwType, REFIID riid, IUnknown **ppunk)
Definition: langbarmgr.c:109
static HRESULT WINAPI LangBarMgr_GetShowFloatingStatus(ITfLangBarMgr *iface, DWORD *pdwFlags)
Definition: langbarmgr.c:157
static HRESULT WINAPI LangBarMgr_UnAdviseEventSink(ITfLangBarMgr *iface, DWORD dwCookie)
Definition: langbarmgr.c:101
static HRESULT WINAPI LangBarMgr_ShowFloating(ITfLangBarMgr *iface, DWORD dwFlags)
Definition: langbarmgr.c:149
static HRESULT WINAPI LangBarMgr_QueryInterface(ITfLangBarMgr *iface, REFIID iid, LPVOID *ppvOut)
Definition: langbarmgr.c:52
HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
Definition: langbarmgr.c:182
static HRESULT WINAPI LangBarMgr_GetInputProcessorProfiles(ITfLangBarMgr *iface, DWORD dwThreadId, ITfInputProcessorProfiles **ppaip, DWORD *pdwThreadid)
Definition: langbarmgr.c:125
static ULONG WINAPI LangBarMgr_AddRef(ITfLangBarMgr *iface)
Definition: langbarmgr.c:72
static HRESULT WINAPI LangBarMgr_AdviseEventSink(ITfLangBarMgr *iface, ITfLangBarEventSink *pSink, HWND hwnd, DWORD dwflags, DWORD *pdwCookie)
Definition: langbarmgr.c:93
struct tagLangBarMgr LangBarMgr
static _In_ DWORD dwflags
Definition: dispmode.c:64
long LONG
Definition: pedump.c:60
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define TRACE(s)
Definition: solgame.cpp:4
ITfLangBarMgr ITfLangBarMgr_iface
Definition: langbarmgr.c:34
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662