-
Notifications
You must be signed in to change notification settings - Fork 0
/
shimgvw.h
87 lines (74 loc) · 2.03 KB
/
shimgvw.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* PROJECT: ReactOS Picture and Fax Viewer
* LICENSE: GPL-2.0 (https://spdx.org/licenses/GPL-2.0)
* PURPOSE: Image file browsing and manipulation
* COPYRIGHT: Copyright Dmitry Chapyshev (dmitry@reactos.org)
* Copyright 2018-2023 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
*/
#pragma once
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define INITGUID
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <winreg.h>
#include <wingdi.h>
#include <wincon.h>
#ifdef __RSHIMGVW__
#include <winuser.h>
#include <winnetwk.h>
#endif
#include <objbase.h>
#include <gdiplus.h>
#include <shlwapi.h>
#include <strsafe.h>
#ifdef __RSHIMGVW__
typedef IStream* (WINAPI *FN_SHCreateMemStream)(const BYTE *lpbData, UINT dwDataLen);
#endif
#include <debug.h>
#include "resource.h"
extern HINSTANCE g_hInstance;
extern GpImage *g_pImage;
typedef struct
{
BOOL Maximized;
INT X;
INT Y;
INT Width;
INT Height;
} SHIMGVW_SETTINGS;
typedef struct tagSHIMGVW_FILENODE
{
WCHAR FileName[MAX_PATH];
struct tagSHIMGVW_FILENODE *Prev;
struct tagSHIMGVW_FILENODE *Next;
} SHIMGVW_FILENODE;
#define WC_PREVIEW L"ShImgVw:CPreviewWnd"
#define WC_ZOOM L"ShImgVw:CZoomWnd"
/* Animation */
typedef struct tagANIME
{
UINT m_nFrameIndex;
UINT m_nFrameCount;
UINT m_nLoopIndex;
UINT m_nLoopCount;
PropertyItem *m_pDelayItem;
HWND m_hwndTimer;
} ANIME, *PANIME;
void Anime_FreeInfo(PANIME pAnime);
BOOL Anime_LoadInfo(PANIME pAnime);
void Anime_SetTimerWnd(PANIME pAnime, HWND hwndTimer);
void Anime_SetFrameIndex(PANIME pAnime, UINT nFrameIndex);
void Anime_Start(PANIME pAnime, DWORD dwDelay);
void Anime_Pause(PANIME pAnime);
BOOL Anime_OnTimer(PANIME pAnime, WPARAM wParam);
static inline LPVOID QuickAlloc(SIZE_T cbSize, BOOL bZero)
{
return HeapAlloc(GetProcessHeap(), (bZero ? HEAP_ZERO_MEMORY : 0), cbSize);
}
static inline VOID QuickFree(LPVOID ptr)
{
HeapFree(GetProcessHeap(), 0, ptr);
}