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
80f862de
Commit
80f862de
authored
Sep 10, 2009
by
Francois Gouget
Committed by
Alexandre Julliard
Sep 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Reorder a couple of functions to avoid forward declarations.
parent
08c6eca9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
53 deletions
+52
-53
threadmgr.c
dlls/msctf/threadmgr.c
+52
-53
No files found.
dlls/msctf/threadmgr.c
View file @
80f862de
...
...
@@ -126,7 +126,6 @@ typedef struct tagEnumTfDocumentMgr {
}
EnumTfDocumentMgr
;
static
HRESULT
EnumTfDocumentMgr_Constructor
(
struct
list
*
head
,
IEnumTfDocumentMgrs
**
ppOut
);
LRESULT
CALLBACK
ThreadFocusHookProc
(
int
nCode
,
WPARAM
wParam
,
LPARAM
lParam
);
static
inline
ThreadMgr
*
impl_from_ITfSourceVtbl
(
ITfSource
*
iface
)
{
...
...
@@ -159,22 +158,6 @@ static inline ThreadMgr *impl_from_ITfSourceSingleVtbl(ITfSourceSingle* iface)
return
(
ThreadMgr
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
ThreadMgr
,
SourceSingleVtbl
));
}
static
HRESULT
SetupWindowsHook
(
ThreadMgr
*
This
)
{
if
(
!
This
->
focusHook
)
{
This
->
focusHook
=
SetWindowsHookExW
(
WH_CBT
,
ThreadFocusHookProc
,
0
,
GetCurrentThreadId
());
if
(
!
This
->
focusHook
)
{
ERR
(
"Unable to set focus hook
\n
"
);
return
E_FAIL
;
}
return
S_OK
;
}
return
S_FALSE
;
}
static
void
free_sink
(
ThreadMgrSink
*
sink
)
{
IUnknown_Release
(
sink
->
interfaces
.
pIUnknown
);
...
...
@@ -451,6 +434,58 @@ static HRESULT WINAPI ThreadMgr_SetFocus( ITfThreadMgr* iface, ITfDocumentMgr *p
return
S_OK
;
}
LRESULT
CALLBACK
ThreadFocusHookProc
(
int
nCode
,
WPARAM
wParam
,
LPARAM
lParam
)
{
ThreadMgr
*
This
;
This
=
TlsGetValue
(
tlsIndex
);
if
(
!
This
)
{
ERR
(
"Hook proc but no ThreadMgr for this thread. Serious Error
\n
"
);
return
0
;
}
if
(
!
This
->
focusHook
)
{
ERR
(
"Hook proc but no ThreadMgr focus Hook. Serious Error
\n
"
);
return
0
;
}
if
(
nCode
==
HCBT_SETFOCUS
)
/* focus change within our thread */
{
struct
list
*
cursor
;
LIST_FOR_EACH
(
cursor
,
&
This
->
AssociatedFocusWindows
)
{
AssociatedWindow
*
wnd
=
LIST_ENTRY
(
cursor
,
AssociatedWindow
,
entry
);
if
(
wnd
->
hwnd
==
(
HWND
)
wParam
)
{
TRACE
(
"Triggering Associated window focus
\n
"
);
if
(
This
->
focus
!=
wnd
->
docmgr
)
ThreadMgr_SetFocus
((
ITfThreadMgr
*
)
This
,
wnd
->
docmgr
);
break
;
}
}
}
return
CallNextHookEx
(
This
->
focusHook
,
nCode
,
wParam
,
lParam
);
}
static
HRESULT
SetupWindowsHook
(
ThreadMgr
*
This
)
{
if
(
!
This
->
focusHook
)
{
This
->
focusHook
=
SetWindowsHookExW
(
WH_CBT
,
ThreadFocusHookProc
,
0
,
GetCurrentThreadId
());
if
(
!
This
->
focusHook
)
{
ERR
(
"Unable to set focus hook
\n
"
);
return
E_FAIL
;
}
return
S_OK
;
}
return
S_FALSE
;
}
static
HRESULT
WINAPI
ThreadMgr_AssociateFocus
(
ITfThreadMgr
*
iface
,
HWND
hwnd
,
ITfDocumentMgr
*
pdimNew
,
ITfDocumentMgr
**
ppdimPrev
)
{
...
...
@@ -1436,39 +1471,3 @@ void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *tm, ITfDocumentMgr *mgr)
}
FIXME
(
"ITfDocumenMgr %p not found in this thread
\n
"
,
mgr
);
}
LRESULT
CALLBACK
ThreadFocusHookProc
(
int
nCode
,
WPARAM
wParam
,
LPARAM
lParam
)
{
ThreadMgr
*
This
;
This
=
TlsGetValue
(
tlsIndex
);
if
(
!
This
)
{
ERR
(
"Hook proc but no ThreadMgr for this thread. Serious Error
\n
"
);
return
0
;
}
if
(
!
This
->
focusHook
)
{
ERR
(
"Hook proc but no ThreadMgr focus Hook. Serious Error
\n
"
);
return
0
;
}
if
(
nCode
==
HCBT_SETFOCUS
)
/* focus change within our thread */
{
struct
list
*
cursor
;
LIST_FOR_EACH
(
cursor
,
&
This
->
AssociatedFocusWindows
)
{
AssociatedWindow
*
wnd
=
LIST_ENTRY
(
cursor
,
AssociatedWindow
,
entry
);
if
(
wnd
->
hwnd
==
(
HWND
)
wParam
)
{
TRACE
(
"Triggering Associated window focus
\n
"
);
if
(
This
->
focus
!=
wnd
->
docmgr
)
ThreadMgr_SetFocus
((
ITfThreadMgr
*
)
This
,
wnd
->
docmgr
);
break
;
}
}
}
return
CallNextHookEx
(
This
->
focusHook
,
nCode
,
wParam
,
lParam
);
}
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