Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2c74f4ed
Commit
2c74f4ed
authored
May 05, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
May 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use the default IME implementation for ImeSetCompositionString.
parent
c6ab26bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
78 deletions
+63
-78
ime.c
dlls/imm32/ime.c
+62
-8
ime.c
dlls/winex11.drv/ime.c
+1
-69
winex11.drv.spec
dlls/winex11.drv/winex11.drv.spec
+0
-1
No files found.
dlls/imm32/ime.c
View file @
2c74f4ed
...
...
@@ -83,16 +83,51 @@ static WCHAR *input_context_get_comp_str( INPUTCONTEXT *ctx, BOOL result, UINT *
return
text
;
}
static
void
input_context_
reset_comp_str
(
INPUTCONTEXT
*
ctx
)
static
void
input_context_
set_comp_str
(
INPUTCONTEXT
*
ctx
,
const
WCHAR
*
str
,
UINT
len
)
{
COMPOSITIONSTRING
*
compstr
;
HIMCC
himcc
;
UINT
size
;
BYTE
*
dst
;
size
=
sizeof
(
*
compstr
);
size
+=
len
*
sizeof
(
WCHAR
);
/* GCS_COMPSTR */
size
+=
len
;
/* GCS_COMPSTRATTR */
size
+=
2
*
sizeof
(
DWORD
);
/* GCS_COMPSTRCLAUSE */
if
(
!
(
compstr
=
ImmLockIMCC
(
ctx
->
hCompStr
)))
if
(
!
(
himcc
=
ImmReSizeIMCC
(
ctx
->
hCompStr
,
size
)))
WARN
(
"Failed to resize input context composition string
\n
"
);
else
if
(
!
(
compstr
=
ImmLockIMCC
(
(
ctx
->
hCompStr
=
himcc
)
)))
WARN
(
"Failed to lock input context composition string
\n
"
);
else
{
memset
(
compstr
,
0
,
sizeof
(
*
compstr
)
);
compstr
->
dwSize
=
sizeof
(
*
compstr
);
if
(
len
)
{
compstr
->
dwCursorPos
=
len
;
compstr
->
dwCompStrLen
=
len
;
compstr
->
dwCompStrOffset
=
compstr
->
dwSize
;
dst
=
(
BYTE
*
)
compstr
+
compstr
->
dwCompStrOffset
;
memcpy
(
dst
,
str
,
compstr
->
dwCompStrLen
*
sizeof
(
WCHAR
)
);
compstr
->
dwSize
+=
compstr
->
dwCompStrLen
*
sizeof
(
WCHAR
);
compstr
->
dwCompClauseLen
=
2
*
sizeof
(
DWORD
);
compstr
->
dwCompClauseOffset
=
compstr
->
dwSize
;
dst
=
(
BYTE
*
)
compstr
+
compstr
->
dwCompClauseOffset
;
*
((
DWORD
*
)
dst
+
0
)
=
0
;
*
((
DWORD
*
)
dst
+
1
)
=
compstr
->
dwCompStrLen
;
compstr
->
dwSize
+=
compstr
->
dwCompClauseLen
;
compstr
->
dwCompAttrLen
=
compstr
->
dwCompStrLen
;
compstr
->
dwCompAttrOffset
=
compstr
->
dwSize
;
dst
=
(
BYTE
*
)
compstr
+
compstr
->
dwCompAttrOffset
;
memset
(
dst
,
ATTR_INPUT
,
compstr
->
dwCompAttrLen
);
compstr
->
dwSize
+=
compstr
->
dwCompAttrLen
;
}
ImmUnlockIMCC
(
ctx
->
hCompStr
);
}
}
...
...
@@ -437,10 +472,29 @@ DWORD WINAPI ImeConversionList( HIMC himc, const WCHAR *source, CANDIDATELIST *d
BOOL
WINAPI
ImeSetCompositionString
(
HIMC
himc
,
DWORD
index
,
const
void
*
comp
,
DWORD
comp_len
,
const
void
*
read
,
DWORD
read_len
)
{
FIXME
(
"himc %p, index %lu, comp %p, comp_len %lu, read %p, read_len %lu stub!
\n
"
,
himc
,
index
,
comp
,
comp_len
,
read
,
read_len
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
INPUTCONTEXT
*
ctx
;
FIXME
(
"himc %p, index %lu, comp %p, comp_len %lu, read %p, read_len %lu semi-stub!
\n
"
,
himc
,
index
,
comp
,
comp_len
,
read
,
read_len
);
if
(
read
&&
read_len
)
FIXME
(
"Read string unimplemented
\n
"
);
if
(
index
!=
SCS_SETSTR
&&
index
!=
SCS_CHANGECLAUSE
&&
index
!=
SCS_CHANGEATTR
)
return
FALSE
;
if
(
!
(
ctx
=
ImmLockIMC
(
himc
)))
return
FALSE
;
if
(
index
!=
SCS_SETSTR
)
FIXME
(
"index %#lx not implemented
\n
"
,
index
);
else
{
UINT
flags
=
GCS_COMPSTR
|
GCS_COMPCLAUSE
|
GCS_COMPATTR
|
GCS_DELTASTART
|
GCS_CURSORPOS
;
WCHAR
wparam
=
comp
&&
comp_len
>=
sizeof
(
WCHAR
)
?
*
(
WCHAR
*
)
comp
:
0
;
input_context_set_comp_str
(
ctx
,
comp
,
comp_len
/
sizeof
(
WCHAR
)
);
ime_set_composition_status
(
himc
,
TRUE
);
ime_send_message
(
himc
,
WM_IME_COMPOSITION
,
wparam
,
flags
);
}
ImmUnlockIMC
(
himc
);
return
TRUE
;
}
BOOL
WINAPI
NotifyIME
(
HIMC
himc
,
DWORD
action
,
DWORD
index
,
DWORD
value
)
...
...
@@ -468,7 +522,7 @@ BOOL WINAPI NotifyIME( HIMC himc, DWORD action, DWORD index, DWORD value )
case
IMC_SETOPENSTATUS
:
if
(
!
ctx
->
fOpen
)
{
input_context_
reset_comp_str
(
ctx
);
input_context_
set_comp_str
(
ctx
,
NULL
,
0
);
ime_set_composition_status
(
himc
,
FALSE
);
}
NtUserNotifyIMEStatus
(
ctx
->
hWnd
,
ctx
->
fOpen
);
...
...
@@ -511,7 +565,7 @@ BOOL WINAPI NotifyIME( HIMC himc, DWORD action, DWORD index, DWORD value )
break
;
}
case
CPS_CANCEL
:
input_context_
reset_comp_str
(
ctx
);
input_context_
set_comp_str
(
ctx
,
NULL
,
0
);
ImmSetOpenStatus
(
himc
,
FALSE
);
break
;
default:
...
...
dlls/winex11.drv/ime.c
View file @
2c74f4ed
...
...
@@ -529,74 +529,6 @@ UINT WINAPI ImeToAsciiEx (UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState,
return
0
;
}
BOOL
WINAPI
ImeSetCompositionString
(
HIMC
hIMC
,
DWORD
dwIndex
,
LPCVOID
lpComp
,
DWORD
dwCompLen
,
LPCVOID
lpRead
,
DWORD
dwReadLen
)
{
LPINPUTCONTEXT
lpIMC
;
DWORD
flags
=
0
;
WCHAR
wParam
=
0
;
TRACE
(
"(%p, %ld, %p, %ld, %p, %ld):
\n
"
,
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
if
(
hIMC
!=
FROM_X11
)
FIXME
(
"PROBLEM: This only sets the wine level string
\n
"
);
/*
* Explanation:
* this sets the composition string in the imm32.dll level
* of the composition buffer. we cannot manipulate the xim level
* buffer, which means that once the xim level buffer changes again
* any call to this function from the application will be lost
*/
if
(
lpRead
&&
dwReadLen
)
FIXME
(
"Reading string unimplemented
\n
"
);
lpIMC
=
LockRealIMC
(
hIMC
);
if
(
lpIMC
==
NULL
)
return
FALSE
;
if
(
dwIndex
==
SCS_SETSTR
)
{
HIMCC
newCompStr
;
ime_set_composition_status
(
hIMC
,
TRUE
);
/* clear existing result */
newCompStr
=
updateResultStr
(
lpIMC
->
hCompStr
,
NULL
,
0
);
ImmDestroyIMCC
(
lpIMC
->
hCompStr
);
lpIMC
->
hCompStr
=
newCompStr
;
flags
=
GCS_COMPSTR
;
if
(
dwCompLen
&&
lpComp
)
{
newCompStr
=
updateCompStr
(
lpIMC
->
hCompStr
,
(
LPCWSTR
)
lpComp
,
dwCompLen
/
sizeof
(
WCHAR
));
ImmDestroyIMCC
(
lpIMC
->
hCompStr
);
lpIMC
->
hCompStr
=
newCompStr
;
wParam
=
((
const
WCHAR
*
)
lpComp
)[
0
];
flags
|=
GCS_COMPCLAUSE
|
GCS_COMPATTR
|
GCS_DELTASTART
;
}
else
{
newCompStr
=
updateCompStr
(
lpIMC
->
hCompStr
,
NULL
,
0
);
ImmDestroyIMCC
(
lpIMC
->
hCompStr
);
lpIMC
->
hCompStr
=
newCompStr
;
}
}
GenerateIMEMessage
(
hIMC
,
WM_IME_COMPOSITION
,
wParam
,
flags
);
ImmUnlockIMCC
(
lpIMC
->
hPrivate
);
UnlockRealIMC
(
hIMC
);
return
TRUE
;
}
/* Interfaces to XIM and other parts of winex11drv */
NTSTATUS
x11drv_ime_set_open_status
(
UINT
open
)
...
...
@@ -693,7 +625,7 @@ NTSTATUS x11drv_ime_update_association( UINT arg )
NTSTATUS
WINAPI
x11drv_ime_set_composition_string
(
void
*
param
,
ULONG
size
)
{
return
Im
eSetCompositionString
(
FROM_X11
,
SCS_SETSTR
,
param
,
size
,
NULL
,
0
);
return
Im
mSetCompositionStringW
(
RealIMC
(
FROM_X11
),
SCS_SETSTR
,
param
,
size
,
NULL
,
0
);
}
NTSTATUS
WINAPI
x11drv_ime_set_result
(
void
*
params
,
ULONG
len
)
...
...
dlls/winex11.drv/winex11.drv.spec
View file @
2c74f4ed
...
...
@@ -13,5 +13,4 @@
#IME Interface
@ stdcall ImeSelect(long long)
@ stdcall ImeToAsciiEx(long long ptr ptr long long)
@ stdcall ImeSetCompositionString(long long ptr long ptr long)
@ stdcall ImeProcessKey(long long long ptr)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment