ReactOS 0.4.15-dev-8219-ge8b88cf
CicIMCLock Class Reference

#include <cicimc.h>

Inheritance diagram for CicIMCLock:
Collaboration diagram for CicIMCLock:

Public Member Functions

 CicIMCLock (HIMC hIMC)
 
 ~CicIMCLock ()
 
void unlock ()
 
void InitContext ()
 
BOOL ValidCompositionString ()
 
BOOL ClearCand ()
 
BOOL UseVerticalCompWindow () const
 
 operator INPUTCONTEXTDX * () const
 
INPUTCONTEXTDXget () const
 
- Public Member Functions inherited from CIC_IMC_LOCK
 CIC_IMC_LOCK (HIMC hIMC)
 
BOOL Invalid () const
 

Protected Member Functions

HRESULT _LockIMC (HIMC hIMC, LPINPUTCONTEXTDX *ppIC)
 
HRESULT _UnlockIMC (HIMC hIMC)
 

Additional Inherited Members

- Public Attributes inherited from CIC_IMC_LOCK
HIMC m_hIMC
 
HRESULT m_hr
 
DWORD m_dw3
 
- Protected Attributes inherited from CIC_IMC_LOCK
LPINPUTCONTEXTDX m_pIC
 

Detailed Description

Definition at line 113 of file cicimc.h.

Constructor & Destructor Documentation

◆ CicIMCLock()

CicIMCLock::CicIMCLock ( HIMC  hIMC)
inline

Definition at line 116 of file cicimc.h.

116 : CIC_IMC_LOCK(hIMC)
117 {
118 m_hr = _LockIMC(hIMC, &m_pIC);
119 }
HRESULT m_hr
Definition: cicimc.h:96
LPINPUTCONTEXTDX m_pIC
Definition: cicimc.h:92
HRESULT _LockIMC(HIMC hIMC, LPINPUTCONTEXTDX *ppIC)
Definition: cicimc.h:171

◆ ~CicIMCLock()

CicIMCLock::~CicIMCLock ( )
inline

Definition at line 120 of file cicimc.h.

121 {
122 unlock();
123 }
void unlock()
Definition: cicimc.h:125

Member Function Documentation

◆ _LockIMC()

HRESULT CicIMCLock::_LockIMC ( HIMC  hIMC,
LPINPUTCONTEXTDX ppIC 
)
inlineprotected

Definition at line 171 of file cicimc.h.

172 {
173 if (!hIMC)
174 return E_INVALIDARG;
175
177 *ppIC = pIC;
178 return (pIC ? S_OK : E_FAIL);
179 }
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1057
struct INPUTCONTEXTDX * LPINPUTCONTEXTDX
#define S_OK
Definition: intsafe.h:52

Referenced by CicIMCLock().

◆ _UnlockIMC()

HRESULT CicIMCLock::_UnlockIMC ( HIMC  hIMC)
inlineprotected

Definition at line 180 of file cicimc.h.

181 {
182 return ::ImmUnlockIMC(hIMC) ? S_OK : E_FAIL;
183 }

Referenced by unlock().

◆ ClearCand()

BOOL CicIMCLock::ClearCand ( )

Definition at line 16 of file cicimc.cpp.

17{
18 HIMCC hNewCandInfo, hCandInfo = m_pIC->hCandInfo;
19 if (hCandInfo)
20 {
21 hNewCandInfo = ImmReSizeIMCC(hCandInfo, CUSTOM_CAND_INFO_SIZE);
22 if (!hNewCandInfo)
23 {
24 ImmDestroyIMCC(m_pIC->hCandInfo);
26 return FALSE;
27 }
28 }
29 else
30 {
32 }
33
34 m_pIC->hCandInfo = hNewCandInfo;
35 if (!m_pIC->hCandInfo)
36 return FALSE;
37
38 CicIMCCLock<CANDIDATEINFO> candInfo(m_pIC->hCandInfo);
39 if (!candInfo)
40 {
41 ImmDestroyIMCC(m_pIC->hCandInfo);
43 return FALSE;
44 }
45
46 candInfo.get().dwSize = CUSTOM_CAND_INFO_SIZE;
47 candInfo.get().dwCount = 0;
48 candInfo.get().dwOffset[0] = sizeof(CANDIDATEINFO);
49
50 // FIXME: Something is trailing after CANDIDATEINFO...
51
52 return TRUE;
53}
#define CUSTOM_CAND_INFO_SIZE
Definition: cicimc.cpp:14
DWORD HIMCC
Definition: dimm.idl:76
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: utils.c:1178
HIMCC WINAPI ImmReSizeIMCC(HIMCC imcc, DWORD size)
Definition: utils.c:1226
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: utils.c:1188
struct tagCANDIDATEINFO CANDIDATEINFO

Referenced by InternalSelectEx().

◆ get()

◆ InitContext()

void CicIMCLock::InitContext ( )
inline

Definition at line 134 of file cicimc.h.

135 {
136 if (!(m_pIC->fdwInit & INIT_COMPFORM))
137 m_pIC->cfCompForm.dwStyle = 0;
138 for (UINT i = 0; i < 4; ++i)
139 m_pIC->cfCandForm[i].dwStyle = 0;
140 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define INIT_COMPFORM
Definition: immdev.h:177
unsigned int UINT
Definition: ndis.h:50

Referenced by InternalSelectEx().

◆ operator INPUTCONTEXTDX *()

CicIMCLock::operator INPUTCONTEXTDX * ( ) const
inline

Definition at line 161 of file cicimc.h.

162 {
163 return m_pIC;
164 }

◆ unlock()

void CicIMCLock::unlock ( )
inline

Definition at line 125 of file cicimc.h.

126 {
127 if (m_pIC)
128 {
130 m_pIC = NULL;
131 }
132 }
HIMC m_hIMC
Definition: cicimc.h:95
HRESULT _UnlockIMC(HIMC hIMC)
Definition: cicimc.h:180
#define NULL
Definition: types.h:112

Referenced by CicBridge::CreateInputContext(), and ~CicIMCLock().

◆ UseVerticalCompWindow()

BOOL CicIMCLock::UseVerticalCompWindow ( ) const
inline

Definition at line 156 of file cicimc.h.

157 {
158 return m_pIC->cfCompForm.dwStyle && ((m_pIC->lfFont.A.lfEscapement / 900) % 4 == 3);
159 }

◆ ValidCompositionString()

BOOL CicIMCLock::ValidCompositionString ( )
inline

Definition at line 142 of file cicimc.h.

143 {
144 if (ImmGetIMCCSize(m_pIC->hCompStr) < sizeof(COMPOSITIONSTRING))
145 return FALSE;
146
147 CicIMCCLock<COMPOSITIONSTRING> imccLock(m_pIC->hCompStr);
148 if (!imccLock)
149 return FALSE;
150
151 return imccLock.get().dwCompStrLen > 0;
152 }
DWORD WINAPI ImmGetIMCCSize(HIMCC imcc)
Definition: utils.c:1236

Referenced by CicBridge::OnSetOpenStatus().


The documentation for this class was generated from the following files: