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
c6d30753
Commit
c6d30753
authored
May 29, 2013
by
Aric Stewart
Committed by
Alexandre Julliard
May 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macdrv: Rework the way we handle cursor position and composition text.
parent
49dbf246
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
75 deletions
+27
-75
cocoa_window.m
dlls/winemac.drv/cocoa_window.m
+1
-8
event.c
dlls/winemac.drv/event.c
+0
-5
ime.c
dlls/winemac.drv/ime.c
+25
-56
macdrv.h
dlls/winemac.drv/macdrv.h
+0
-1
macdrv_cocoa.h
dlls/winemac.drv/macdrv_cocoa.h
+1
-5
No files found.
dlls/winemac.drv/cocoa_window.m
View file @
c6d30753
...
...
@@ -356,14 +356,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
event
->
im_set_text
.
data
=
[
window
imeData
];
event
->
im_set_text
.
text
=
(
CFStringRef
)[[
markedText
string
]
copy
];
event
->
im_set_text
.
complete
=
FALSE
;
[[
window
queue
]
postEvent
:
event
];
macdrv_release_event
(
event
);
event
=
macdrv_create_event
(
IM_SET_CURSOR_POS
,
window
);
event
->
im_set_cursor_pos
.
data
=
[
window
imeData
];
event
->
im_set_cursor_pos
.
pos
=
markedTextSelection
.
location
;
event
->
im_set_text
.
cursor_pos
=
markedTextSelection
.
location
;
[[
window
queue
]
postEvent
:
event
];
...
...
dlls/winemac.drv/event.c
View file @
c6d30753
...
...
@@ -35,7 +35,6 @@ static const char *dbgstr_event(int type)
"APP_DEACTIVATED"
,
"APP_QUIT_REQUESTED"
,
"DISPLAYS_CHANGED"
,
"IM_SET_CURSOR_POS"
,
"IM_SET_TEXT"
,
"KEY_PRESS"
,
"KEY_RELEASE"
,
...
...
@@ -92,7 +91,6 @@ static macdrv_event_mask get_event_mask(DWORD mask)
event_mask
|=
event_mask_for_type
(
APP_DEACTIVATED
);
event_mask
|=
event_mask_for_type
(
APP_QUIT_REQUESTED
);
event_mask
|=
event_mask_for_type
(
DISPLAYS_CHANGED
);
event_mask
|=
event_mask_for_type
(
IM_SET_CURSOR_POS
);
event_mask
|=
event_mask_for_type
(
IM_SET_TEXT
);
event_mask
|=
event_mask_for_type
(
STATUS_ITEM_CLICKED
);
event_mask
|=
event_mask_for_type
(
WINDOW_CLOSE_REQUESTED
);
...
...
@@ -181,9 +179,6 @@ void macdrv_handle_event(const macdrv_event *event)
case
DISPLAYS_CHANGED
:
macdrv_displays_changed
(
event
);
break
;
case
IM_SET_CURSOR_POS
:
macdrv_im_set_cursor_pos
(
event
);
break
;
case
IM_SET_TEXT
:
macdrv_im_set_text
(
event
);
break
;
...
...
dlls/winemac.drv/ime.c
View file @
c6d30753
...
...
@@ -940,15 +940,14 @@ UINT WINAPI ImeEnumRegisterWord(REGISTERWORDENUMPROCW lpfnEnumProc, LPCWSTR lpsz
return
0
;
}
BOOL
WINAPI
ImeSetCompositionString
(
HIMC
hIMC
,
DWORD
dwIndex
,
LPCVOID
lpComp
,
DWORD
dwCompLen
,
LPCVOID
lpRead
,
DWORD
dwReadLen
)
static
BOOL
IME_SetCompositionString
(
void
*
hIMC
,
DWORD
dwIndex
,
LPCVOID
lpComp
,
DWORD
dwCompLen
,
DWORD
cursor_pos
,
BOOL
cursor_valid
)
{
LPINPUTCONTEXT
lpIMC
;
DWORD
flags
=
0
;
WCHAR
wParam
=
0
;
LPIMEPRIVATE
myPrivate
;
TRACE
(
"(%p, %d, %p, %d
, %p, %d):
\n
"
,
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwRead
Len
);
TRACE
(
"(%p, %d, %p, %d
):
\n
"
,
hIMC
,
dwIndex
,
lpComp
,
dwComp
Len
);
/*
* Explanation:
...
...
@@ -957,9 +956,6 @@ BOOL WINAPI ImeSetCompositionString(HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DW
* TODO: set the Cocoa window's marked text string and tell text input context
*/
if
(
lpRead
&&
dwReadLen
)
FIXME
(
"Reading string unimplemented
\n
"
);
lpIMC
=
LockRealIMC
(
hIMC
);
if
(
lpIMC
==
NULL
)
...
...
@@ -994,6 +990,16 @@ BOOL WINAPI ImeSetCompositionString(HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DW
ImmDestroyIMCC
(
lpIMC
->
hCompStr
);
lpIMC
->
hCompStr
=
newCompStr
;
}
if
(
cursor_valid
)
{
LPCOMPOSITIONSTRING
compstr
;
compstr
=
ImmLockIMCC
(
lpIMC
->
hCompStr
);
compstr
->
dwCursorPos
=
cursor_pos
;
ImmUnlockIMCC
(
lpIMC
->
hCompStr
);
flags
|=
GCS_CURSORPOS
;
}
}
GenerateIMEMessage
(
hIMC
,
WM_IME_COMPOSITION
,
wParam
,
flags
);
...
...
@@ -1003,44 +1009,23 @@ BOOL WINAPI ImeSetCompositionString(HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DW
return
TRUE
;
}
DWORD
WINAPI
ImeGetImeMenuItems
(
HIMC
hIMC
,
DWORD
dwFlags
,
DWORD
dwType
,
LPIMEMENUITEMINFOW
lpImeParentMenu
,
LPIMEMENUITEMINFOW
lpImeMenu
,
DWORD
dwSize
)
{
FIXME
(
"(%p, %x %x %p %p %x): stub
\n
"
,
hIMC
,
dwFlags
,
dwType
,
lpImeParentMenu
,
lpImeMenu
,
dwSize
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
0
;
}
static
void
IME_SetCursorPos
(
void
*
hIMC
,
DWORD
pos
)
BOOL
WINAPI
ImeSetCompositionString
(
HIMC
hIMC
,
DWORD
dwIndex
,
LPCVOID
lpComp
,
DWORD
dwCompLen
,
LPCVOID
lpRead
,
DWORD
dwReadLen
)
{
LPINPUTCONTEXT
lpIMC
;
LPCOMPOSITIONSTRING
compstr
;
if
(
!
hSelectedFrom
)
return
;
lpIMC
=
LockRealIMC
(
hIMC
);
if
(
!
lpIMC
)
return
;
TRACE
(
"(%p, %d, %p, %d, %p, %d):
\n
"
,
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
lpRead
,
dwReadLen
);
compstr
=
ImmLockIMCC
(
lpIMC
->
hCompStr
);
if
(
!
compstr
)
{
UnlockRealIMC
(
hIMC
);
return
;
}
if
(
lpRead
&&
dwReadLen
)
FIXME
(
"Reading string unimplemented
\n
"
);
compstr
->
dwCursorPos
=
pos
;
ImmUnlockIMCC
(
lpIMC
->
hCompStr
);
UnlockRealIMC
(
hIMC
);
GenerateIMEMessage
(
FROM_MACDRV
,
WM_IME_COMPOSITION
,
pos
,
GCS_CURSORPOS
);
return
;
return
IME_SetCompositionString
(
hIMC
,
dwIndex
,
lpComp
,
dwCompLen
,
0
,
FALSE
);
}
static
void
IME_SetCompositionString
(
void
*
hIMC
,
LPCVOID
lpComp
,
DWORD
dwCompLen
)
DWORD
WINAPI
ImeGetImeMenuItems
(
HIMC
hIMC
,
DWORD
dwFlags
,
DWORD
dwType
,
LPIMEMENUITEMINFOW
lpImeParentMenu
,
LPIMEMENUITEMINFOW
lpImeMenu
,
DWORD
dwSize
)
{
ImeSetCompositionString
(
hIMC
,
SCS_SETSTR
,
lpComp
,
dwCompLen
,
NULL
,
0
);
FIXME
(
"(%p, %x %x %p %p %x): stub
\n
"
,
hIMC
,
dwFlags
,
dwType
,
lpImeParentMenu
,
lpImeMenu
,
dwSize
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
0
;
}
static
void
IME_NotifyComplete
(
void
*
hIMC
)
...
...
@@ -1437,23 +1422,6 @@ void IME_RegisterClasses(HINSTANCE hImeInst)
WM_MSIME_DOCUMENTFEED
=
RegisterWindowMessageA
(
"MSIMEDocumentFeed"
);
}
/***********************************************************************
* macdrv_im_set_cursor_pos
*/
void
macdrv_im_set_cursor_pos
(
const
macdrv_event
*
event
)
{
HWND
hwnd
=
macdrv_get_window_hwnd
(
event
->
window
);
void
*
himc
=
event
->
im_set_cursor_pos
.
data
;
TRACE
(
"win %p/%p himc %p pos %u
\n
"
,
hwnd
,
event
->
window
,
himc
,
event
->
im_set_cursor_pos
.
pos
);
if
(
!
himc
)
himc
=
RealIMC
(
FROM_MACDRV
);
IME_SetCursorPos
(
himc
,
event
->
im_set_cursor_pos
.
pos
);
}
/***********************************************************************
* macdrv_im_set_text
*/
...
...
@@ -1481,7 +1449,8 @@ void macdrv_im_set_text(const macdrv_event *event)
}
if
(
himc
)
IME_SetCompositionString
(
himc
,
chars
,
length
*
sizeof
(
*
chars
));
IME_SetCompositionString
(
himc
,
SCS_SETSTR
,
chars
,
length
*
sizeof
(
*
chars
),
event
->
im_set_text
.
cursor_pos
,
!
event
->
im_set_text
.
complete
);
else
{
INPUT
input
;
...
...
dlls/winemac.drv/macdrv.h
View file @
c6d30753
...
...
@@ -202,7 +202,6 @@ extern void IME_RegisterClasses(HINSTANCE hImeInst) DECLSPEC_HIDDEN;
extern
BOOL
macdrv_process_text_input
(
UINT
vkey
,
UINT
scan
,
UINT
repeat
,
const
BYTE
*
key_state
,
void
*
himc
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_im_set_cursor_pos
(
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_im_set_text
(
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_ime_char_rect
(
macdrv_query
*
query
)
DECLSPEC_HIDDEN
;
...
...
dlls/winemac.drv/macdrv_cocoa.h
View file @
c6d30753
...
...
@@ -165,7 +165,6 @@ enum {
APP_DEACTIVATED
,
APP_QUIT_REQUESTED
,
DISPLAYS_CHANGED
,
IM_SET_CURSOR_POS
,
IM_SET_TEXT
,
KEY_PRESS
,
KEY_RELEASE
,
...
...
@@ -208,11 +207,8 @@ typedef struct macdrv_event {
}
displays_changed
;
struct
{
void
*
data
;
unsigned
int
pos
;
}
im_set_cursor_pos
;
struct
{
void
*
data
;
CFStringRef
text
;
/* new text or NULL if just completing existing text */
unsigned
int
cursor_pos
;
unsigned
int
complete
;
/* is completing text? */
}
im_set_text
;
struct
{
...
...
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