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
70ff8231
Commit
70ff8231
authored
May 09, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
May 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Remove now unnecessary selected HIMC tracking code.
parent
6a7c131d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
85 deletions
+7
-85
ime.c
dlls/winemac.drv/ime.c
+7
-85
No files found.
dlls/winemac.drv/ime.c
View file @
70ff8231
...
...
@@ -41,51 +41,12 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
imm
);
#define FROM_MACDRV ((HIMC)0xcafe1337)
static
HIMC
*
hSelectedFrom
=
NULL
;
static
INT
hSelectedCount
=
0
;
static
HIMC
RealIMC
(
HIMC
hIMC
)
{
if
(
hIMC
==
FROM_MACDRV
)
{
INT
i
;
HWND
wnd
=
GetFocus
();
HIMC
winHimc
=
ImmGetContext
(
wnd
);
for
(
i
=
0
;
i
<
hSelectedCount
;
i
++
)
if
(
winHimc
==
hSelectedFrom
[
i
])
return
winHimc
;
return
NULL
;
}
else
return
hIMC
;
}
static
LPINPUTCONTEXT
LockRealIMC
(
HIMC
hIMC
)
{
HIMC
real_imc
=
RealIMC
(
hIMC
);
if
(
real_imc
)
return
ImmLockIMC
(
real_imc
);
else
return
NULL
;
}
static
BOOL
UnlockRealIMC
(
HIMC
hIMC
)
{
HIMC
real_imc
=
RealIMC
(
hIMC
);
if
(
real_imc
)
return
ImmUnlockIMC
(
real_imc
);
else
return
FALSE
;
}
static
void
GenerateIMEMessage
(
HIMC
hIMC
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
LPINPUTCONTEXT
lpIMC
;
LPTRANSMSG
lpTransMsg
;
lpIMC
=
LockReal
IMC
(
hIMC
);
lpIMC
=
ImmLock
IMC
(
hIMC
);
if
(
lpIMC
==
NULL
)
return
;
...
...
@@ -105,34 +66,8 @@ static void GenerateIMEMessage(HIMC hIMC, UINT msg, WPARAM wParam, LPARAM lParam
ImmUnlockIMCC
(
lpIMC
->
hMsgBuf
);
lpIMC
->
dwNumMsgBuf
++
;
ImmGenerateMessage
(
RealIMC
(
hIMC
));
UnlockRealIMC
(
hIMC
);
}
static
BOOL
IME_RemoveFromSelected
(
HIMC
hIMC
)
{
int
i
;
for
(
i
=
0
;
i
<
hSelectedCount
;
i
++
)
{
if
(
hSelectedFrom
[
i
]
==
hIMC
)
{
if
(
i
<
hSelectedCount
-
1
)
memmove
(
&
hSelectedFrom
[
i
],
&
hSelectedFrom
[
i
+
1
],
(
hSelectedCount
-
i
-
1
)
*
sizeof
(
HIMC
));
hSelectedCount
--
;
return
TRUE
;
}
}
return
FALSE
;
}
static
void
IME_AddToSelected
(
HIMC
hIMC
)
{
hSelectedCount
++
;
if
(
hSelectedFrom
)
hSelectedFrom
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
hSelectedFrom
,
hSelectedCount
*
sizeof
(
HIMC
));
else
hSelectedFrom
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
HIMC
));
hSelectedFrom
[
hSelectedCount
-
1
]
=
hIMC
;
ImmGenerateMessage
(
hIMC
);
ImmUnlockIMC
(
hIMC
);
}
BOOL
WINAPI
ImeSelect
(
HIMC
hIMC
,
BOOL
fSelect
)
...
...
@@ -140,23 +75,10 @@ BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect)
LPINPUTCONTEXT
lpIMC
;
TRACE
(
"%p %s
\n
"
,
hIMC
,
fSelect
?
"TRUE"
:
"FALSE"
);
if
(
hIMC
==
FROM_MACDRV
)
{
ERR
(
"ImeSelect should never be called from Cocoa
\n
"
);
return
FALSE
;
}
if
(
!
hIMC
)
return
TRUE
;
/* not selected */
if
(
!
fSelect
)
return
IME_RemoveFromSelected
(
hIMC
);
IME_AddToSelected
(
hIMC
);
if
(
!
hIMC
||
!
fSelect
)
return
TRUE
;
/* Initialize our structures */
lpIMC
=
LockReal
IMC
(
hIMC
);
lpIMC
=
ImmLock
IMC
(
hIMC
);
if
(
lpIMC
!=
NULL
)
{
LPIMEPRIVATE
myPrivate
;
...
...
@@ -164,13 +86,13 @@ BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect)
if
(
myPrivate
->
bInComposition
)
GenerateIMEMessage
(
hIMC
,
WM_IME_ENDCOMPOSITION
,
0
,
0
);
if
(
myPrivate
->
bInternalState
)
ImmSetOpenStatus
(
RealIMC
(
FROM_MACDRV
),
FALSE
);
ImmSetOpenStatus
(
hIMC
,
FALSE
);
myPrivate
->
bInComposition
=
FALSE
;
myPrivate
->
bInternalState
=
FALSE
;
myPrivate
->
textfont
=
NULL
;
myPrivate
->
hwndDefault
=
NULL
;
ImmUnlockIMCC
(
lpIMC
->
hPrivate
);
UnlockReal
IMC
(
hIMC
);
ImmUnlock
IMC
(
hIMC
);
}
return
TRUE
;
...
...
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