ReactOS
0.4.16-dev-2279-gc890759
CFontFolderViewCB.cpp
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS Font Shell Extension
3
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4
* PURPOSE: Fonts folder view callback implementation
5
* COPYRIGHT: Copyright 2026 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
6
*/
7
8
#include "
precomp.h
"
9
10
WINE_DEFAULT_DEBUG_CHANNEL
(fontext);
11
12
void
CFontFolderViewCB::Initialize
(
CFontExt
* pFontExt,
IShellView
*psv,
LPCITEMIDLIST
pidlParent)
13
{
14
ATLASSERT
(pFontExt);
15
ATLASSERT
(psv);
16
ATLASSERT
(pidlParent);
17
m_pFontExt
= pFontExt;
18
m_pShellView
= psv;
19
m_pidlParent
.Attach(
ILClone
(pidlParent));
20
if
(!
m_pidlParent
)
21
ERR
(
"m_pidlParent was null\n"
);
22
}
23
24
BOOL
CFontFolderViewCB::FilterEvent
(
PIDLIST_ABSOLUTE
* apidls,
LONG
lEvent
)
const
25
{
26
lEvent
&= ~SHCNE_INTERRUPT;
27
28
switch
(
lEvent
)
29
{
30
case
SHCNE_CREATE
:
31
case
SHCNE_RENAMEITEM
:
32
case
SHCNE_UPDATEDIR
:
33
// Refresh font cache and notify the system about the font change
34
if
(
g_FontCache
)
35
g_FontCache
->
Read
();
36
break
;
37
case
SHCNE_DELETE
:
38
break
;
39
default
:
40
return
TRUE
;
// We don't want this event
41
}
42
43
return
FALSE
;
44
}
45
46
STDMETHODIMP
47
CFontFolderViewCB::MessageSFVCB
(
UINT
uMsg,
WPARAM
wParam
,
LPARAM
lParam
)
48
{
49
switch
(uMsg)
50
{
51
case
SFVM_QUERYFSNOTIFY
:
// Registering change notification
52
{
53
if
(!
m_pShellView
|| !
m_pFontExt
)
54
return
E_FAIL
;
55
// Now, we can get the view window
56
m_pShellView
->GetWindow(&
m_hwndView
);
57
m_pFontExt
->
SetViewWindow
(
m_hwndView
);
58
return
S_OK
;
59
}
60
case
SFVM_FSNOTIFY
:
// Change notification
61
{
62
if
(
FilterEvent
((
PIDLIST_ABSOLUTE
*)
wParam
, (
LONG
)
lParam
))
63
return
S_FALSE
;
// Don't process
64
return
S_OK
;
65
}
66
}
67
return
E_NOTIMPL
;
68
}
ATLASSERT
#define ATLASSERT(x)
Definition:
CComVariant.cpp:10
g_FontCache
CFontCache * g_FontCache
Definition:
CFontCache.cpp:12
WINE_DEFAULT_DEBUG_CHANNEL
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition:
precomp.h:23
ERR
#define ERR(fmt,...)
Definition:
precomp.h:57
STDMETHODIMP
#define STDMETHODIMP
Definition:
basetyps.h:43
CFontCache::Read
void Read()
Definition:
CFontCache.cpp:243
CFontExt
Definition:
CFontExt.hpp:17
CFontExt::SetViewWindow
void SetViewWindow(HWND hwndView)
Definition:
CFontExt.cpp:114
CFontFolderViewCB::m_hwndView
HWND m_hwndView
Definition:
CFontFolderViewCB.h:16
CFontFolderViewCB::FilterEvent
BOOL FilterEvent(PIDLIST_ABSOLUTE *apidls, LONG lEvent) const
Definition:
CFontFolderViewCB.cpp:24
CFontFolderViewCB::Initialize
void Initialize(CFontExt *pFontExt, IShellView *psv, LPCITEMIDLIST pidlParent)
Definition:
CFontFolderViewCB.cpp:12
CFontFolderViewCB::MessageSFVCB
STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) override
Definition:
CFontFolderViewCB.cpp:47
CFontFolderViewCB::m_pidlParent
CComHeapPtr< ITEMIDLIST > m_pidlParent
Definition:
CFontFolderViewCB.h:17
CFontFolderViewCB::m_pShellView
CComPtr< IShellView > m_pShellView
Definition:
CFontFolderViewCB.h:15
CFontFolderViewCB::m_pFontExt
CFontExt * m_pFontExt
Definition:
CFontFolderViewCB.h:14
wParam
WPARAM wParam
Definition:
combotst.c:138
lParam
LPARAM lParam
Definition:
combotst.c:139
E_NOTIMPL
#define E_NOTIMPL
Definition:
ddrawi.h:99
E_FAIL
#define E_FAIL
Definition:
ddrawi.h:102
TRUE
#define TRUE
Definition:
types.h:120
FALSE
#define FALSE
Definition:
types.h:117
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
IShellView
Definition:
shobjidl.idl:724
S_OK
#define S_OK
Definition:
intsafe.h:52
LPARAM
LONG_PTR LPARAM
Definition:
minwindef.h:175
WPARAM
UINT_PTR WPARAM
Definition:
minwindef.h:174
UINT
unsigned int UINT
Definition:
ndis.h:50
LONG
long LONG
Definition:
pedump.c:60
ILClone
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition:
pidl.c:238
SHCNE_DELETE
#define SHCNE_DELETE
Definition:
shlobj.h:1899
SHCNE_RENAMEITEM
#define SHCNE_RENAMEITEM
Definition:
shlobj.h:1897
SHCNE_UPDATEDIR
#define SHCNE_UPDATEDIR
Definition:
shlobj.h:1909
SHCNE_CREATE
#define SHCNE_CREATE
Definition:
shlobj.h:1898
SFVM_FSNOTIFY
#define SFVM_FSNOTIFY
Definition:
shlobj.h:1314
SFVM_QUERYFSNOTIFY
#define SFVM_QUERYFSNOTIFY
Definition:
shlobj.h:1323
LPCITEMIDLIST
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition:
shtypes.idl:42
_ITEMIDLIST_ABSOLUTE
Definition:
shtypes.idl:46
lEvent
HANDLE lEvent
Definition:
tftpd.cpp:56
precomp.h
S_FALSE
#define S_FALSE
Definition:
winerror.h:3451
dll
shellext
fontext
CFontFolderViewCB.cpp
Generated on Sun Feb 15 2026 06:03:57 for ReactOS by
1.9.6