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
4bb8e995
Commit
4bb8e995
authored
May 18, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
May 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Starting implementation of ITfContext::RequestEditSession and…
msctf: Starting implementation of ITfContext::RequestEditSession and ITextStoreACPSink::OnLockGranted.
parent
94945af5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
13 deletions
+87
-13
context.c
dlls/msctf/context.c
+64
-4
inputprocessor.c
dlls/msctf/tests/inputprocessor.c
+21
-9
textstor.idl
include/textstor.idl
+2
-0
No files found.
dlls/msctf/context.c
View file @
4bb8e995
...
...
@@ -74,6 +74,7 @@ typedef struct tagContext {
ITfContextOwnerCompositionSink
*
pITfContextOwnerCompositionSink
;
ITextStoreACPSink
*
pITextStoreACPSink
;
ITfEditSession
*
currentEditSession
;
/* kept as separate lists to reduce unnecessary iterations */
struct
list
pContextKeyEventSink
;
...
...
@@ -206,9 +207,53 @@ static HRESULT WINAPI Context_RequestEditSession (ITfContext *iface,
TfClientId
tid
,
ITfEditSession
*
pes
,
DWORD
dwFlags
,
HRESULT
*
phrSession
)
{
HRESULT
hr
;
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
DWORD
dwLockFlags
=
0x0
;
TS_STATUS
status
;
TRACE
(
"(%p) %i %p %x %p
\n
"
,
This
,
tid
,
pes
,
dwFlags
,
phrSession
);
if
(
!
(
dwFlags
&
TF_ES_READ
)
&&
!
(
dwFlags
&
TF_ES_READWRITE
))
{
*
phrSession
=
E_FAIL
;
return
E_INVALIDARG
;
}
if
(
!
This
->
pITextStoreACP
)
{
FIXME
(
"No ITextStoreACP avaliable
\n
"
);
*
phrSession
=
E_FAIL
;
return
E_FAIL
;
}
if
(
!
(
dwFlags
&
TF_ES_ASYNC
))
dwLockFlags
&=
TS_LF_SYNC
;
if
(
dwFlags
&
TF_ES_READ
)
dwLockFlags
&=
TS_LF_READ
;
else
if
((
dwFlags
&
TF_ES_READWRITE
)
==
TF_ES_READWRITE
)
dwLockFlags
&=
TS_LF_READWRITE
;
/* TODO: cache this */
ITextStoreACP_GetStatus
(
This
->
pITextStoreACP
,
&
status
);
if
(((
dwFlags
&
TF_ES_READWRITE
)
==
TF_ES_READWRITE
)
&&
(
status
.
dwDynamicFlags
&
TS_SD_READONLY
))
{
*
phrSession
=
TS_E_READONLY
;
return
S_OK
;
}
if
(
FAILED
(
ITfEditSession_QueryInterface
(
pes
,
&
IID_ITfEditSession
,
(
LPVOID
*
)
&
This
->
currentEditSession
)))
{
*
phrSession
=
E_FAIL
;
return
E_INVALIDARG
;
}
hr
=
ITextStoreACP_RequestLock
(
This
->
pITextStoreACP
,
dwLockFlags
,
phrSession
);
return
hr
;
}
static
HRESULT
WINAPI
Context_InWriteSession
(
ITfContext
*
iface
,
...
...
@@ -597,8 +642,23 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface,
DWORD
dwLockFlags
)
{
TextStoreACPSink
*
This
=
(
TextStoreACPSink
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
HRESULT
hr
;
TRACE
(
"(%p) %x
\n
"
,
This
,
dwLockFlags
);
if
(
!
This
->
pContext
||
!
This
->
pContext
->
currentEditSession
)
{
ERR
(
"OnLockGranted called on a context without a current edit session
\n
Z"
);
return
E_FAIL
;
}
/* TODO: generate and use an edit cookie */
hr
=
ITfEditSession_DoEditSession
(
This
->
pContext
->
currentEditSession
,
0xdeadcafe
);
ITfEditSession_Release
(
This
->
pContext
->
currentEditSession
);
This
->
pContext
->
currentEditSession
=
NULL
;
return
hr
;
}
static
HRESULT
WINAPI
TextStoreACPSink_OnStartEditTransaction
(
ITextStoreACPSink
*
iface
)
...
...
dlls/msctf/tests/inputprocessor.c
View file @
4bb8e995
...
...
@@ -149,8 +149,15 @@ static HRESULT WINAPI TextStoreACP_RequestLock(ITextStoreACP *iface,
static
HRESULT
WINAPI
TextStoreACP_GetStatus
(
ITextStoreACP
*
iface
,
TS_STATUS
*
pdcs
)
{
ok
(
test_ACP_GetStatus
==
SINK_EXPECTED
,
"Unexpected TextStoreACP_GetStatus
\n
"
);
static
UINT
count
=
0
;
count
++
;
if
(
count
==
1
)
ok
(
test_ACP_GetStatus
==
SINK_EXPECTED
,
"Unexpected TextStoreACP_GetStatus
\n
"
);
else
todo_wine
ok
(
count
==
1
,
"GetStatus called too many times
\n
"
);
test_ACP_GetStatus
=
SINK_FIRED
;
pdcs
->
dwDynamicFlags
=
TS_SD_READONLY
;
return
S_OK
;
}
static
HRESULT
WINAPI
TextStoreACP_QueryInsert
(
ITextStoreACP
*
iface
,
...
...
@@ -1410,19 +1417,24 @@ static void test_TStoApplicationText(void)
hrSession
=
0xfeedface
;
/* Test no premissions flags */
hr
=
ITfContext_RequestEditSession
(
cxt
,
tid
,
es
,
TF_ES_SYNC
,
&
hrSession
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"RequestEditSession should have failed with %x not %x
\n
"
,
E_INVALIDARG
,
hr
);
todo_wine
ok
(
hrSession
==
E_FAIL
,
"hrSession should be %x not %x
\n
"
,
E_FAIL
,
hrSession
);
ok
(
hr
==
E_INVALIDARG
,
"RequestEditSession should have failed with %x not %x
\n
"
,
E_INVALIDARG
,
hr
);
ok
(
hrSession
==
E_FAIL
,
"hrSession should be %x not %x
\n
"
,
E_FAIL
,
hrSession
);
hrSession
=
0xfeedface
;
test_ACP_GetStatus
=
SINK_EXPECTED
;
hr
=
ITfContext_RequestEditSession
(
cxt
,
tid
,
es
,
TF_ES_SYNC
|
TF_ES_READWRITE
,
&
hrSession
);
ok
(
SUCCEEDED
(
hr
),
"ITfContext_RequestEditSession failed
\n
"
);
ok
(
hrSession
==
TS_E_READONLY
,
"Unexpected hrSession (%x)
\n
"
,
hrSession
);
ok
(
test_ACP_GetStatus
==
SINK_FIRED
,
" expected GetStatus not fired
\n
"
);
test_ACP_GetStatus
=
SINK_UNEXPECTED
;
test_ACP_RequestLock
=
SINK_EXPECTED
;
hrSession
=
0xfeedface
;
hr
=
ITfContext_RequestEditSession
(
cxt
,
tid
,
es
,
TF_ES_SYNC
|
TF_ES_READWRITE
,
&
hrSession
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"ITfContext_RequestEditSession failed
\n
"
);
todo_wine
ok
(
test_ACP_GetStatus
==
SINK_FIRED
,
" expected GetStatus not fired
\n
"
);
todo_wine
ok
(
test_ACP_RequestLock
==
SINK_FIRED
,
" expected RequestLock not fired
\n
"
);
todo_wine
ok
(
test_DoEditSession
==
SINK_FIRED
,
" expected DoEditSession not fired
\n
"
);
todo_wine
ok
(
hrSession
==
0xdeadcafe
,
"Unexpected hrSession
\n
"
);
hr
=
ITfContext_RequestEditSession
(
cxt
,
tid
,
es
,
TF_ES_SYNC
|
TF_ES_READ
,
&
hrSession
);
ok
(
SUCCEEDED
(
hr
),
"ITfContext_RequestEditSession failed
\n
"
);
ok
(
test_ACP_RequestLock
==
SINK_FIRED
,
" expected RequestLock not fired
\n
"
);
ok
(
test_DoEditSession
==
SINK_FIRED
,
" expected DoEditSession not fired
\n
"
);
ok
(
hrSession
==
0xdeadcafe
,
"Unexpected hrSession (%x)
\n
"
,
hrSession
);
ITfContext_Release
(
cxt
);
ITfDocumentMgr_Release
(
dm
);
...
...
include/textstor.idl
View file @
4bb8e995
...
...
@@ -20,6 +20,8 @@
import
"oaidl.idl"
;
#
endif
cpp_quote
(
"#define TS_E_READONLY MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0209)"
)
const
ULONG
TS_DEFAULT_SELECTION
=
~
0u
;
const
DWORD
TS_SD_READONLY
=
0
x001
;
...
...
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