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
a9774847
Commit
a9774847
authored
Nov 27, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
Nov 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Add a partial implementation of ITfThreadMgrEx_ActivateEx().
Signed-off-by:
Matteo Bruni
<
mbruni@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd4cb88e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
35 deletions
+50
-35
msctf.c
dlls/msctf/msctf.c
+10
-10
msctf_internal.h
dlls/msctf/msctf_internal.h
+1
-1
inputprocessor.c
dlls/msctf/tests/inputprocessor.c
+14
-2
threadmgr.c
dlls/msctf/threadmgr.c
+25
-22
No files found.
dlls/msctf/msctf.c
View file @
a9774847
...
...
@@ -53,7 +53,7 @@ typedef struct
typedef
struct
{
TF_LANGUAGEPROFILE
LanguageProfile
;
ITfTextInputProcessor
*
pITfTextInputProcessor
;
ITfThreadMgr
*
pITfThreadMgr
;
ITfThreadMgr
Ex
*
pITfThreadMgrEx
;
ITfKeyEventSink
*
pITfKeyEventSink
;
TfClientId
tid
;
}
ActivatedTextService
;
...
...
@@ -287,7 +287,7 @@ DWORD enumerate_Cookie(DWORD magic, DWORD *index)
/*****************************************************************************
* Active Text Service Management
*****************************************************************************/
static
HRESULT
activate_given_ts
(
ActivatedTextService
*
actsvr
,
ITfThreadMgr
*
tm
)
static
HRESULT
activate_given_ts
(
ActivatedTextService
*
actsvr
,
ITfThreadMgr
Ex
*
tm
)
{
HRESULT
hr
;
...
...
@@ -299,7 +299,7 @@ static HRESULT activate_given_ts(ActivatedTextService *actsvr, ITfThreadMgr* tm)
&
IID_ITfTextInputProcessor
,
(
void
**
)
&
actsvr
->
pITfTextInputProcessor
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
ITfTextInputProcessor_Activate
(
actsvr
->
pITfTextInputProcessor
,
tm
,
actsvr
->
tid
);
hr
=
ITfTextInputProcessor_Activate
(
actsvr
->
pITfTextInputProcessor
,
(
ITfThreadMgr
*
)
tm
,
actsvr
->
tid
);
if
(
FAILED
(
hr
))
{
ITfTextInputProcessor_Release
(
actsvr
->
pITfTextInputProcessor
);
...
...
@@ -307,8 +307,8 @@ static HRESULT activate_given_ts(ActivatedTextService *actsvr, ITfThreadMgr* tm)
return
hr
;
}
actsvr
->
pITfThreadMgr
=
tm
;
ITfThreadMgr_AddRef
(
tm
);
actsvr
->
pITfThreadMgr
Ex
=
tm
;
ITfThreadMgr
Ex
_AddRef
(
tm
);
return
hr
;
}
...
...
@@ -320,9 +320,9 @@ static HRESULT deactivate_given_ts(ActivatedTextService *actsvr)
{
hr
=
ITfTextInputProcessor_Deactivate
(
actsvr
->
pITfTextInputProcessor
);
ITfTextInputProcessor_Release
(
actsvr
->
pITfTextInputProcessor
);
ITfThreadMgr
_Release
(
actsvr
->
pITfThreadMgr
);
ITfThreadMgr
Ex_Release
(
actsvr
->
pITfThreadMgrEx
);
actsvr
->
pITfTextInputProcessor
=
NULL
;
actsvr
->
pITfThreadMgr
=
NULL
;
actsvr
->
pITfThreadMgr
Ex
=
NULL
;
}
return
hr
;
...
...
@@ -351,7 +351,7 @@ HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp)
ActivatedTextService
*
actsvr
;
ITfCategoryMgr
*
catmgr
;
AtsEntry
*
entry
;
ITfThreadMgr
*
tm
=
TlsGetValue
(
tlsIndex
);
ITfThreadMgr
Ex
*
tm
=
TlsGetValue
(
tlsIndex
);
ITfClientId
*
clientid
;
if
(
!
tm
)
return
E_UNEXPECTED
;
...
...
@@ -359,7 +359,7 @@ HRESULT add_active_textservice(TF_LANGUAGEPROFILE *lp)
actsvr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ActivatedTextService
));
if
(
!
actsvr
)
return
E_OUTOFMEMORY
;
ITfThreadMgr
_QueryInterface
(
tm
,
&
IID_ITfClientId
,(
LPVOID
)
&
clientid
);
ITfThreadMgr
Ex_QueryInterface
(
tm
,
&
IID_ITfClientId
,
(
void
**
)
&
clientid
);
ITfClientId_GetClientId
(
clientid
,
&
lp
->
clsid
,
&
actsvr
->
tid
);
ITfClientId_Release
(
clientid
);
...
...
@@ -426,7 +426,7 @@ BOOL get_active_textservice(REFCLSID rclsid, TF_LANGUAGEPROFILE *profile)
return
FALSE
;
}
HRESULT
activate_textservices
(
ITfThreadMgr
*
tm
)
HRESULT
activate_textservices
(
ITfThreadMgr
Ex
*
tm
)
{
HRESULT
hr
=
S_OK
;
AtsEntry
*
ats
;
...
...
dlls/msctf/msctf_internal.h
View file @
a9774847
...
...
@@ -58,7 +58,7 @@ extern DWORD enumerate_Cookie(DWORD magic, DWORD *index) DECLSPEC_HIDDEN;
/* activated text services functions */
extern
HRESULT
add_active_textservice
(
TF_LANGUAGEPROFILE
*
lp
)
DECLSPEC_HIDDEN
;
extern
BOOL
get_active_textservice
(
REFCLSID
rclsid
,
TF_LANGUAGEPROFILE
*
lp
)
DECLSPEC_HIDDEN
;
extern
HRESULT
activate_textservices
(
ITfThreadMgr
*
tm
)
DECLSPEC_HIDDEN
;
extern
HRESULT
activate_textservices
(
ITfThreadMgr
Ex
*
tm
)
DECLSPEC_HIDDEN
;
extern
HRESULT
deactivate_textservices
(
void
)
DECLSPEC_HIDDEN
;
extern
CLSID
get_textservice_clsid
(
TfClientId
tid
)
DECLSPEC_HIDDEN
;
...
...
dlls/msctf/tests/inputprocessor.c
View file @
a9774847
...
...
@@ -1409,6 +1409,7 @@ static void test_startSession(void)
ITfContext
*
cxt
,
*
cxt2
,
*
cxt3
,
*
cxtTest
;
ITextStoreACP
*
ts
;
TfClientId
cid2
=
0
;
ITfThreadMgrEx
*
tmex
;
hr
=
ITfThreadMgr_Deactivate
(
g_tm
);
ok
(
hr
==
E_UNEXPECTED
,
"Deactivate should have failed with E_UNEXPECTED
\n
"
);
...
...
@@ -1421,10 +1422,21 @@ static void test_startSession(void)
test_ShouldActivate
=
FALSE
;
hr
=
ITfThreadMgr_Activate
(
g_tm
,
&
cid2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to Activate
\n
"
);
ok
(
cid
==
cid2
,
"Second activate client ID does not match
\n
"
);
ok
(
cid
==
cid2
,
"Second activate client ID does not match
\n
"
);
hr
=
ITfThreadMgr_QueryInterface
(
g_tm
,
&
IID_ITfThreadMgrEx
,
(
void
**
)
&
tmex
);
ok
(
SUCCEEDED
(
hr
),
"Unable to acquire ITfThreadMgrEx interface
\n
"
);
hr
=
ITfThreadMgrEx_ActivateEx
(
tmex
,
&
cid2
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to Activate
\n
"
);
ok
(
cid
==
cid2
,
"ActivateEx client ID does not match
\n
"
);
ITfThreadMgrEx_Release
(
tmex
);
hr
=
ITfThreadMgr_Deactivate
(
g_tm
);
ok
(
SUCCEEDED
(
hr
),
"Failed to Deactivate
\n
"
);
ok
(
SUCCEEDED
(
hr
),
"Failed to Deactivate
\n
"
);
hr
=
ITfThreadMgr_Deactivate
(
g_tm
);
ok
(
SUCCEEDED
(
hr
),
"Failed to Deactivate
\n
"
);
test_EnumDocumentMgr
(
g_tm
,
NULL
,
NULL
);
...
...
dlls/msctf/threadmgr.c
View file @
a9774847
...
...
@@ -327,29 +327,15 @@ static ULONG WINAPI ThreadMgr_Release(ITfThreadMgrEx *iface)
* ITfThreadMgr functions
*****************************************************/
static
HRESULT
WINAPI
ThreadMgr_
fnActivate
(
ITfThreadMgrEx
*
iface
,
TfClientId
*
pt
id
)
static
HRESULT
WINAPI
ThreadMgr_
Activate
(
ITfThreadMgrEx
*
iface
,
TfClientId
*
id
)
{
ThreadMgr
*
This
=
impl_from_ITfThreadMgrEx
(
iface
);
TRACE
(
"(%p) %p
\n
"
,
This
,
ptid
);
if
(
!
ptid
)
return
E_INVALIDARG
;
if
(
!
processId
)
{
GUID
guid
;
CoCreateGuid
(
&
guid
);
ITfClientId_GetClientId
(
&
This
->
ITfClientId_iface
,
&
guid
,
&
processId
);
}
activate_textservices
((
ITfThreadMgr
*
)
iface
);
This
->
activationCount
++
;
*
ptid
=
processId
;
return
S_OK
;
TRACE
(
"(%p) %p
\n
"
,
This
,
id
);
return
ITfThreadMgrEx_ActivateEx
(
iface
,
id
,
0
);
}
static
HRESULT
WINAPI
ThreadMgr_
fn
Deactivate
(
ITfThreadMgrEx
*
iface
)
static
HRESULT
WINAPI
ThreadMgr_Deactivate
(
ITfThreadMgrEx
*
iface
)
{
ThreadMgr
*
This
=
impl_from_ITfThreadMgrEx
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -597,8 +583,25 @@ static HRESULT WINAPI ThreadMgr_ActivateEx(ITfThreadMgrEx *iface, TfClientId *id
{
ThreadMgr
*
This
=
impl_from_ITfThreadMgrEx
(
iface
);
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"(%p) %p, %#x
\n
"
,
This
,
id
,
flags
);
if
(
!
id
)
return
E_INVALIDARG
;
if
(
flags
)
FIXME
(
"Unimplemented flags %#x
\n
"
,
flags
);
if
(
!
processId
)
{
GUID
guid
;
CoCreateGuid
(
&
guid
);
ITfClientId_GetClientId
(
&
This
->
ITfClientId_iface
,
&
guid
,
&
processId
);
}
activate_textservices
(
iface
);
This
->
activationCount
++
;
*
id
=
processId
;
return
S_OK
;
}
static
HRESULT
WINAPI
ThreadMgr_GetActiveFlags
(
ITfThreadMgrEx
*
iface
,
DWORD
*
flags
)
...
...
@@ -614,8 +617,8 @@ static const ITfThreadMgrExVtbl ThreadMgrExVtbl =
ThreadMgr_QueryInterface
,
ThreadMgr_AddRef
,
ThreadMgr_Release
,
ThreadMgr_
fn
Activate
,
ThreadMgr_
fn
Deactivate
,
ThreadMgr_Activate
,
ThreadMgr_Deactivate
,
ThreadMgr_CreateDocumentMgr
,
ThreadMgr_EnumDocumentMgrs
,
ThreadMgr_GetFocus
,
...
...
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