Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c03125a1
Commit
c03125a1
authored
Jun 27, 2007
by
Aric Stewart
Committed by
Alexandre Julliard
Jun 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Make richedit control IME aware.
parent
33af21fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
1 deletion
+62
-1
Makefile.in
dlls/riched20/Makefile.in
+1
-1
editor.c
dlls/riched20/editor.c
+59
-0
editstr.h
dlls/riched20/editstr.h
+2
-0
No files found.
dlls/riched20/Makefile.in
View file @
c03125a1
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
riched20.dll
IMPORTLIB
=
libriched20.
$(IMPLIBEXT)
IMPORTS
=
ole32 user32 gdi32 kernel32
IMPORTS
=
ole32
imm32
user32 gdi32 kernel32
EXTRALIBS
=
-luuid
C_SRCS
=
\
...
...
dlls/riched20/editor.c
View file @
c03125a1
...
...
@@ -227,6 +227,7 @@
#define NO_SHLWAPI_STREAM
#include "shlwapi.h"
#include "rtf.h"
#include "imm.h"
#define STACK_SIZE_DEFAULT 100
#define STACK_SIZE_MAX 1000
...
...
@@ -2515,6 +2516,64 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
ME_RewrapRepaint
(
editor
);
return
DefWindowProcW
(
hWnd
,
msg
,
wParam
,
lParam
);
}
/* IME messages to make richedit controls IME aware */
case
WM_IME_SETCONTEXT
:
case
WM_IME_CONTROL
:
case
WM_IME_SELECT
:
case
WM_IME_COMPOSITIONFULL
:
return
0
;
case
WM_IME_STARTCOMPOSITION
:
{
editor
->
imeStartIndex
=
ME_GetCursorOfs
(
editor
,
0
);
ME_DeleteSelection
(
editor
);
ME_CommitUndo
(
editor
);
ME_UpdateRepaint
(
editor
);
return
0
;
}
case
WM_IME_COMPOSITION
:
{
HIMC
hIMC
;
ME_Style
*
style
=
ME_GetInsertStyle
(
editor
,
0
);
hIMC
=
ImmGetContext
(
hWnd
);
ME_DeleteSelection
(
editor
);
ME_CommitUndo
(
editor
);
ME_SaveTempStyle
(
editor
);
if
(
lParam
&
GCS_RESULTSTR
)
{
LPWSTR
lpCompStr
=
NULL
;
DWORD
dwBufLen
;
dwBufLen
=
ImmGetCompositionStringW
(
hIMC
,
GCS_RESULTSTR
,
NULL
,
0
);
lpCompStr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwBufLen
+
sizeof
(
WCHAR
));
ImmGetCompositionStringW
(
hIMC
,
GCS_RESULTSTR
,
lpCompStr
,
dwBufLen
);
lpCompStr
[
dwBufLen
/
sizeof
(
WCHAR
)]
=
0
;
ME_InsertTextFromCursor
(
editor
,
0
,
lpCompStr
,
dwBufLen
/
sizeof
(
WCHAR
),
style
);
}
else
if
(
lParam
&
GCS_COMPSTR
)
{
LPWSTR
lpCompStr
=
NULL
;
DWORD
dwBufLen
;
dwBufLen
=
ImmGetCompositionStringW
(
hIMC
,
GCS_COMPSTR
,
NULL
,
0
);
lpCompStr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwBufLen
+
sizeof
(
WCHAR
));
ImmGetCompositionStringW
(
hIMC
,
GCS_COMPSTR
,
lpCompStr
,
dwBufLen
);
lpCompStr
[
dwBufLen
/
sizeof
(
WCHAR
)]
=
0
;
ME_InsertTextFromCursor
(
editor
,
0
,
lpCompStr
,
dwBufLen
/
sizeof
(
WCHAR
),
style
);
ME_SetSelection
(
editor
,
editor
->
imeStartIndex
,
editor
->
imeStartIndex
+
dwBufLen
/
sizeof
(
WCHAR
));
}
ME_ReleaseStyle
(
style
);
ME_UpdateRepaint
(
editor
);
return
0
;
}
case
WM_IME_ENDCOMPOSITION
:
{
ME_DeleteSelection
(
editor
);
editor
->
imeStartIndex
=-
1
;
return
0
;
}
case
EM_GETOLEINTERFACE
:
{
LPVOID
*
ppvObj
=
(
LPVOID
*
)
lParam
;
...
...
dlls/riched20/editstr.h
View file @
c03125a1
...
...
@@ -322,6 +322,8 @@ typedef struct tagME_TextEditor
BOOL
AutoURLDetect_bEnable
;
WCHAR
cPasswordMask
;
BOOL
bHaveFocus
;
/*for IME */
int
imeStartIndex
;
}
ME_TextEditor
;
typedef
struct
tagME_Context
...
...
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