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
b712f39b
Commit
b712f39b
authored
Feb 02, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
Feb 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Implement stub ITfContext.
parent
d1cfbab4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
379 additions
and
3 deletions
+379
-3
Makefile.in
dlls/msctf/Makefile.in
+1
-0
context.c
dlls/msctf/context.c
+262
-0
documentmgr.c
dlls/msctf/documentmgr.c
+2
-2
msctf_internal.h
dlls/msctf/msctf_internal.h
+1
-0
msctf.idl
include/msctf.idl
+113
-1
No files found.
dlls/msctf/Makefile.in
View file @
b712f39b
...
@@ -6,6 +6,7 @@ MODULE = msctf.dll
...
@@ -6,6 +6,7 @@ MODULE = msctf.dll
IMPORTS
=
uuid ole32 user32 advapi32 kernel32 ntdll
IMPORTS
=
uuid ole32 user32 advapi32 kernel32 ntdll
C_SRCS
=
\
C_SRCS
=
\
context.c
\
documentmgr.c
\
documentmgr.c
\
msctf.c
\
msctf.c
\
regsvr.c
\
regsvr.c
\
...
...
dlls/msctf/context.c
0 → 100644
View file @
b712f39b
/*
* ITfContext implementation
*
* Copyright 2009 Aric Stewart, CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#define COBJMACROS
#include "wine/debug.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "shlwapi.h"
#include "winerror.h"
#include "objbase.h"
#include "wine/unicode.h"
#include "msctf.h"
#include "msctf_internal.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msctf
);
typedef
struct
tagContext
{
const
ITfContextVtbl
*
ContextVtbl
;
LONG
refCount
;
TfClientId
tidOwner
;
IUnknown
*
punk
;
/* possible ITextStoreACP or ITfContextOwnerCompositionSink */
}
Context
;
static
void
Context_Destructor
(
Context
*
This
)
{
TRACE
(
"destroying %p
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
HRESULT
WINAPI
Context_QueryInterface
(
ITfContext
*
iface
,
REFIID
iid
,
LPVOID
*
ppvOut
)
{
Context
*
This
=
(
Context
*
)
iface
;
*
ppvOut
=
NULL
;
if
(
IsEqualIID
(
iid
,
&
IID_IUnknown
)
||
IsEqualIID
(
iid
,
&
IID_ITfContext
))
{
*
ppvOut
=
This
;
}
if
(
*
ppvOut
)
{
IUnknown_AddRef
(
iface
);
return
S_OK
;
}
WARN
(
"unsupported interface: %s
\n
"
,
debugstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
Context_AddRef
(
ITfContext
*
iface
)
{
Context
*
This
=
(
Context
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
refCount
);
}
static
ULONG
WINAPI
Context_Release
(
ITfContext
*
iface
)
{
Context
*
This
=
(
Context
*
)
iface
;
ULONG
ret
;
ret
=
InterlockedDecrement
(
&
This
->
refCount
);
if
(
ret
==
0
)
Context_Destructor
(
This
);
return
ret
;
}
/*****************************************************
* ITfContext functions
*****************************************************/
static
HRESULT
WINAPI
Context_RequestEditSession
(
ITfContext
*
iface
,
TfClientId
tid
,
ITfEditSession
*
pes
,
DWORD
dwFlags
,
HRESULT
*
phrSession
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_InWriteSession
(
ITfContext
*
iface
,
TfClientId
tid
,
BOOL
*
pfWriteSession
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_GetSelection
(
ITfContext
*
iface
,
TfEditCookie
ec
,
ULONG
ulIndex
,
ULONG
ulCount
,
TF_SELECTION
*
pSelection
,
ULONG
*
pcFetched
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_SetSelection
(
ITfContext
*
iface
,
TfEditCookie
ec
,
ULONG
ulCount
,
const
TF_SELECTION
*
pSelection
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_GetStart
(
ITfContext
*
iface
,
TfEditCookie
ec
,
ITfRange
**
ppStart
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_GetEnd
(
ITfContext
*
iface
,
TfEditCookie
ec
,
ITfRange
**
ppEnd
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_GetActiveView
(
ITfContext
*
iface
,
ITfContextView
**
ppView
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_EnumViews
(
ITfContext
*
iface
,
IEnumTfContextViews
**
ppEnum
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_GetStatus
(
ITfContext
*
iface
,
TF_STATUS
*
pdcs
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_GetProperty
(
ITfContext
*
iface
,
REFGUID
guidProp
,
ITfProperty
**
ppProp
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_GetAppProperty
(
ITfContext
*
iface
,
REFGUID
guidProp
,
ITfReadOnlyProperty
**
ppProp
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_TrackProperties
(
ITfContext
*
iface
,
const
GUID
**
prgProp
,
ULONG
cProp
,
const
GUID
**
prgAppProp
,
ULONG
cAppProp
,
ITfReadOnlyProperty
**
ppProperty
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_EnumProperties
(
ITfContext
*
iface
,
IEnumTfProperties
**
ppEnum
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_GetDocumentMgr
(
ITfContext
*
iface
,
ITfDocumentMgr
**
ppDm
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
Context_CreateRangeBackup
(
ITfContext
*
iface
,
TfEditCookie
ec
,
ITfRange
*
pRange
,
ITfRangeBackup
**
ppBackup
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
const
ITfContextVtbl
Context_ContextVtbl
=
{
Context_QueryInterface
,
Context_AddRef
,
Context_Release
,
Context_RequestEditSession
,
Context_InWriteSession
,
Context_GetSelection
,
Context_SetSelection
,
Context_GetStart
,
Context_GetEnd
,
Context_GetActiveView
,
Context_EnumViews
,
Context_GetStatus
,
Context_GetProperty
,
Context_GetAppProperty
,
Context_TrackProperties
,
Context_EnumProperties
,
Context_GetDocumentMgr
,
Context_CreateRangeBackup
};
HRESULT
Context_Constructor
(
TfClientId
tidOwner
,
IUnknown
*
punk
,
ITfContext
**
ppOut
,
TfEditCookie
*
pecTextStore
)
{
Context
*
This
;
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
Context
));
if
(
This
==
NULL
)
return
E_OUTOFMEMORY
;
This
->
ContextVtbl
=
&
Context_ContextVtbl
;
This
->
refCount
=
1
;
This
->
tidOwner
=
tidOwner
;
This
->
punk
=
punk
;
TRACE
(
"returning %p
\n
"
,
This
);
*
ppOut
=
(
ITfContext
*
)
This
;
/* FIXME */
*
pecTextStore
=
0xdeaddead
;
return
S_OK
;
}
dlls/msctf/documentmgr.c
View file @
b712f39b
...
@@ -97,8 +97,8 @@ static HRESULT WINAPI DocumentMgr_CreateContext(ITfDocumentMgr *iface,
...
@@ -97,8 +97,8 @@ static HRESULT WINAPI DocumentMgr_CreateContext(ITfDocumentMgr *iface,
TfEditCookie
*
pecTextStore
)
TfEditCookie
*
pecTextStore
)
{
{
DocumentMgr
*
This
=
(
DocumentMgr
*
)
iface
;
DocumentMgr
*
This
=
(
DocumentMgr
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
TRACE
(
"(%p) 0x%x 0x%x %p %p %p
\n
"
,
This
,
tidOwner
,
dwFlags
,
punk
,
ppic
,
pecTextStore
);
return
E_NOTIMPL
;
return
Context_Constructor
(
tidOwner
,
punk
,
ppic
,
pecTextStore
)
;
}
}
static
HRESULT
WINAPI
DocumentMgr_Push
(
ITfDocumentMgr
*
iface
,
ITfContext
*
pic
)
static
HRESULT
WINAPI
DocumentMgr_Push
(
ITfDocumentMgr
*
iface
,
ITfContext
*
pic
)
...
...
dlls/msctf/msctf_internal.h
View file @
b712f39b
...
@@ -24,5 +24,6 @@ extern DWORD tlsIndex;
...
@@ -24,5 +24,6 @@ extern DWORD tlsIndex;
extern
HRESULT
ThreadMgr_Constructor
(
IUnknown
*
pUnkOuter
,
IUnknown
**
ppOut
);
extern
HRESULT
ThreadMgr_Constructor
(
IUnknown
*
pUnkOuter
,
IUnknown
**
ppOut
);
extern
HRESULT
DocumentMgr_Constructor
(
ITfDocumentMgr
**
ppOut
);
extern
HRESULT
DocumentMgr_Constructor
(
ITfDocumentMgr
**
ppOut
);
extern
HRESULT
Context_Constructor
(
TfClientId
tidOwner
,
IUnknown
*
punk
,
ITfContext
**
ppOut
,
TfEditCookie
*
pecTextStore
);
#endif
/* __WINE_MSCTF_I_H */
#endif
/* __WINE_MSCTF_I_H */
include/msctf.idl
View file @
b712f39b
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#
ifndef
DO_NO_IMPORTS
#
ifndef
DO_NO_IMPORTS
import
"oaidl.idl"
;
import
"oaidl.idl"
;
import
"comcat.idl"
;
import
"comcat.idl"
;
/*
import
"textstor.idl"
; */
import
"textstor.idl"
;
/*
import
"ctfutb.idl"
; */
/*
import
"ctfutb.idl"
; */
#
endif
#
endif
...
@@ -35,6 +35,14 @@ interface IEnumTfContexts;
...
@@ -35,6 +35,14 @@ interface IEnumTfContexts;
interface
ITfFunctionProvider
;
interface
ITfFunctionProvider
;
interface
IEnumTfFunctionProviders
;
interface
IEnumTfFunctionProviders
;
interface
ITfCompartmentMgr
;
interface
ITfCompartmentMgr
;
interface
ITfEditSession
;
interface
ITfRange
;
interface
ITfContextView
;
interface
IEnumTfContextViews
;
interface
ITfProperty
;
interface
ITfReadOnlyProperty
;
interface
IEnumTfProperties
;
interface
ITfRangeBackup
;
[
[
object
,
object
,
...
@@ -111,3 +119,107 @@ interface ITfDocumentMgr: IUnknown
...
@@ -111,3 +119,107 @@ interface ITfDocumentMgr: IUnknown
HRESULT
EnumContexts
(
HRESULT
EnumContexts
(
[
out
]
IEnumTfContexts
**
ppEnum
)
;
[
out
]
IEnumTfContexts
**
ppEnum
)
;
}
;
}
;
[
object
,
uuid
(
aa80e7fd
-
2021
-
11
d2
-
93
e0
-
0060b067b86
e
),
pointer_default
(
unique
)
]
interface
ITfContext
:
IUnknown
{
const
DWORD
TF_ES_ASYNCDONTCARE
=
0
x0
;
const
DWORD
TF_ES_SYNC
=
0
x1
;
const
DWORD
TF_ES_READ
=
0
x2
;
const
DWORD
TF_ES_READWRITE
=
0
x6
;
const
DWORD
TF_ES_ASYNC
=
0
x8
;
HRESULT
RequestEditSession
(
[
in
]
TfClientId
tid
,
[
in
]
ITfEditSession
*
pes
,
[
in
]
DWORD
dwFlags
,
[
out
]
HRESULT
*
phrSession
)
;
HRESULT
InWriteSession
(
[
in
]
TfClientId
tid
,
[
out
]
BOOL
*
pfWriteSession
)
;
typedef
[
uuid
(
1690b
e9b
-
d3e9
-
49
f6
-
8
d8b
-
51b905
af4c43
)
]
enum
{
TF_AE_NONE
,
TF_AE_START
,
TF_AE_END
}
TfActiveSelEnd
;
typedef
[
uuid
(
36
ae42a4
-
6989
-
4b
dc
-
b48a
-
6137b7b
f2e42
)
]
struct
TF_SELECTIONSTYLE
{
TfActiveSelEnd
ase
;
BOOL
fInterimChar
;
}
TF_SELECTIONSTYLE
;
typedef
[
uuid
(
75
eb22f2
-
b0bf
-
46
a8
-
8006
-
975
a3b6efcf1
)
]
struct
TF_SELECTION
{
ITfRange
*
range
;
TF_SELECTIONSTYLE
style
;
}
TF_SELECTION
;
const
ULONG
TF_DEFAULT_SELECTION
=
TS_DEFAULT_SELECTION
;
HRESULT
GetSelection
(
[
in
]
TfEditCookie
ec
,
[
in
]
ULONG
ulIndex
,
[
in
]
ULONG
ulCount
,
[
out
,
size_is
(
ulCount
),
length_is
(
*
pcFetched
)
]
TF_SELECTION
*
pSelection
,
[
out
]
ULONG
*
pcFetched
)
;
HRESULT
SetSelection
(
[
in
]
TfEditCookie
ec
,
[
in
]
ULONG
ulCount
,
[
in
,
size_is
(
ulCount
)
]
const
TF_SELECTION
*
pSelection
)
;
HRESULT
GetStart
(
[
in
]
TfEditCookie
ec
,
[
out
]
ITfRange
**
ppStart
)
;
HRESULT
GetEnd
(
[
in
]
TfEditCookie
ec
,
[
out
]
ITfRange
**
ppEnd
)
;
typedef
[
uuid
(
bc7d979a
-
846
a
-
444
d
-
afef
-
0
a9bfa82b961
)
]
TS_STATUS
TF_STATUS
;
const
DWORD
TF_SD_READONLY
=
TS_SD_READONLY
;
const
DWORD
TF_SD_LOADING
=
TS_SD_LOADING
;
const
DWORD
TF_SS_DISJOINTSEL
=
TS_SS_DISJOINTSEL
;
const
DWORD
TF_SS_REGIONS
=
TS_SS_REGIONS
;
const
DWORD
TF_SS_TRANSITORY
=
TS_SS_TRANSITORY
;
HRESULT
GetActiveView
(
[
out
]
ITfContextView
**
ppView
)
;
HRESULT
EnumViews
(
[
out
]
IEnumTfContextViews
**
ppEnum
)
;
HRESULT
GetStatus
(
[
out
]
TF_STATUS
*
pdcs
)
;
HRESULT
GetProperty
(
[
in
]
REFGUID
guidProp
,
[
out
]
ITfProperty
**
ppProp
)
;
HRESULT
GetAppProperty
(
[
in
]
REFGUID
guidProp
,
[
out
]
ITfReadOnlyProperty
**
ppProp
)
;
HRESULT
TrackProperties
(
[
in
,
size_is
(
cProp
)
]
const
GUID
**
prgProp
,
[
in
]
ULONG
cProp
,
[
in
,
size_is
(
cAppProp
)
]
const
GUID
**
prgAppProp
,
[
in
]
ULONG
cAppProp
,
[
out
]
ITfReadOnlyProperty
**
ppProperty
)
;
HRESULT
EnumProperties
(
[
out
]
IEnumTfProperties
**
ppEnum
)
;
HRESULT
GetDocumentMgr
(
[
out
]
ITfDocumentMgr
**
ppDm
)
;
HRESULT
CreateRangeBackup
(
[
in
]
TfEditCookie
ec
,
[
in
]
ITfRange
*
pRange
,
[
out
]
ITfRangeBackup
**
ppBackup
)
;
}
;
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