forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththumbnail_handler.h
43 lines (31 loc) · 1.04 KB
/
thumbnail_handler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Desktop Integration
// Copyright (C) 2017 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef DESKTOP_THUMBNAIL_HANDLER_H_INCLUDED
#define DESKTOP_THUMBNAIL_HANDLER_H_INCLUDED
#include "base/win/comptr.h"
#include <propsys.h>
#include <thumbcache.h>
namespace desktop {
class ThumbnailHandler : public IInitializeWithStream,
public IThumbnailProvider {
public:
static HRESULT CreateInstance(REFIID riid, void** ppvObject);
// IUnknown
IFACEMETHODIMP QueryInterface(REFIID riid, void** ppv);
IFACEMETHODIMP_(ULONG) AddRef();
IFACEMETHODIMP_(ULONG) Release();
// IInitializeWithStream
IFACEMETHODIMP Initialize(IStream* pStream, DWORD grfMode);
// IThumbnailProvider
IFACEMETHODIMP GetThumbnail(UINT cx, HBITMAP* phbmp, WTS_ALPHATYPE* pdwAlpha);
private:
ThumbnailHandler();
virtual ~ThumbnailHandler();
long m_ref;
base::ComPtr<IStream> m_stream;
};
} // namespace desktop
#endif