ReactOS 0.4.15-dev-7924-g5949c20
shimgvw.h File Reference
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <winreg.h>
#include <wingdi.h>
#include <wincon.h>
#include <objbase.h>
#include <gdiplus.h>
#include <shlwapi.h>
#include <strsafe.h>
#include <debug.h>
#include "resource.h"
Include dependency graph for shimgvw.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SHIMGVW_SETTINGS
 
struct  tagSHIMGVW_FILENODE
 
struct  tagANIME
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define INITGUID
 
#define WC_PREVIEW   L"ShImgVw:CPreviewWnd"
 
#define WC_ZOOM   L"ShImgVw:CZoomWnd"
 

Typedefs

typedef struct tagSHIMGVW_FILENODE SHIMGVW_FILENODE
 
typedef struct tagANIME ANIME
 
typedef struct tagANIMEPANIME
 

Functions

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 LPVOID QuickAlloc (SIZE_T cbSize, BOOL bZero)
 
static VOID QuickFree (LPVOID ptr)
 

Variables

HINSTANCE g_hInstance
 
GpImageg_pImage
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 12 of file shimgvw.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 13 of file shimgvw.h.

◆ INITGUID

#define INITGUID

Definition at line 14 of file shimgvw.h.

◆ WC_PREVIEW

#define WC_PREVIEW   L"ShImgVw:CPreviewWnd"

Definition at line 50 of file shimgvw.h.

◆ WC_ZOOM

#define WC_ZOOM   L"ShImgVw:CZoomWnd"

Definition at line 51 of file shimgvw.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 11 of file shimgvw.h.

Typedef Documentation

◆ ANIME

◆ PANIME

typedef struct tagANIME * PANIME

◆ SHIMGVW_FILENODE

Function Documentation

◆ Anime_FreeInfo()

void Anime_FreeInfo ( PANIME  pAnime)

Definition at line 12 of file anime.c.

13{
14 if (pAnime->m_pDelayItem)
15 {
16 QuickFree(pAnime->m_pDelayItem);
17 pAnime->m_pDelayItem = NULL;
18 }
19 pAnime->m_nFrameIndex = 0;
20 pAnime->m_nFrameCount = 0;
21 pAnime->m_nLoopIndex = 0;
22 pAnime->m_nLoopCount = (UINT)-1;
23}
#define NULL
Definition: types.h:112
unsigned int UINT
Definition: ndis.h:50
static VOID QuickFree(LPVOID ptr)
Definition: shimgvw.h:77
UINT m_nLoopCount
Definition: shimgvw.h:59
UINT m_nFrameIndex
Definition: shimgvw.h:56
UINT m_nLoopIndex
Definition: shimgvw.h:58
PropertyItem * m_pDelayItem
Definition: shimgvw.h:60
UINT m_nFrameCount
Definition: shimgvw.h:57

Referenced by Anime_LoadInfo(), and Preview_pFreeImage().

◆ Anime_LoadInfo()

BOOL Anime_LoadInfo ( PANIME  pAnime)

Definition at line 89 of file anime.c.

90{
91 UINT nDimCount = 0;
92 UINT cbItem;
94
95 Anime_Pause(pAnime);
96 Anime_FreeInfo(pAnime);
97
98 if (!g_pImage)
99 return FALSE;
100
102 if (nDimCount)
103 {
104 GUID *dims = (GUID *)QuickAlloc(nDimCount * sizeof(GUID), TRUE);
105 if (dims)
106 {
109 pAnime->m_nFrameCount = result;
110 QuickFree(dims);
111 }
112 }
113
114 result = 0;
116 cbItem = result;
117 if (cbItem)
118 {
119 pAnime->m_pDelayItem = (PropertyItem *)QuickAlloc(cbItem, FALSE);
121 }
122
123 result = 0;
125 cbItem = result;
126 if (cbItem)
127 {
128 PropertyItem *pItem = (PropertyItem *)QuickAlloc(cbItem, FALSE);
129 if (pItem)
130 {
131 if (GdipGetPropertyItem(g_pImage, PropertyTagLoopCount, cbItem, pItem) == Ok)
132 {
133 pAnime->m_nLoopCount = *(WORD *)pItem->value;
134 }
135 QuickFree(pItem);
136 }
137 }
138
139 Anime_Start(pAnime, 0);
140
141 return pAnime->m_pDelayItem != NULL;
142}
void Anime_Start(PANIME pAnime, DWORD dwDelay)
Definition: anime.c:35
void Anime_FreeInfo(PANIME pAnime)
Definition: anime.c:12
void Anime_Pause(PANIME pAnime)
Definition: anime.c:30
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, GDIPCONST GUID *dimensionID, UINT *count)
Definition: image.c:2913
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount(GpImage *image, UINT *count)
Definition: image.c:2933
GpStatus WINGDIPAPI GdipGetPropertyItem(GpImage *image, PROPID propid, UINT size, PropertyItem *buffer)
Definition: image.c:2682
GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage *image, PROPID propid, UINT *size)
Definition: image.c:2536
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList(GpImage *image, GUID *dimensionIDs, UINT count)
Definition: image.c:2948
unsigned short WORD
Definition: ntddk_ex.h:93
#define PropertyTagFrameDelay
#define PropertyTagLoopCount
@ Ok
Definition: gdiplustypes.h:26
GLuint64EXT * result
Definition: glext.h:11304
GpImage * g_pImage
Definition: shimgvw.c:28
static LPVOID QuickAlloc(SIZE_T cbSize, BOOL bZero)
Definition: shimgvw.h:72

Referenced by Preview_pLoadImage().

◆ Anime_OnTimer()

BOOL Anime_OnTimer ( PANIME  pAnime,
WPARAM  wParam 
)

Definition at line 76 of file anime.c.

77{
78 DWORD dwDelay;
79
81 return FALSE;
82
83 Anime_Pause(pAnime);
84 if (Anime_Step(pAnime, &dwDelay))
85 Anime_Start(pAnime, dwDelay);
86 return TRUE;
87}
BOOL Anime_Step(PANIME pAnime, DWORD *pdwDelay)
Definition: anime.c:50
#define ANIME_TIMER_ID
Definition: anime.c:10
WPARAM wParam
Definition: combotst.c:138
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by ZoomWndProc().

◆ Anime_Pause()

void Anime_Pause ( PANIME  pAnime)

Definition at line 30 of file anime.c.

31{
33}
HWND m_hwndTimer
Definition: shimgvw.h:61
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by Anime_LoadInfo(), Anime_OnTimer(), Preview_pSaveImage(), and Preview_pSaveImageAs().

◆ Anime_SetFrameIndex()

void Anime_SetFrameIndex ( PANIME  pAnime,
UINT  nFrameIndex 
)

Definition at line 144 of file anime.c.

145{
146 if (nFrameIndex < pAnime->m_nFrameCount)
147 {
148 GUID guid = FrameDimensionTime;
149 if (Ok != GdipImageSelectActiveFrame(g_pImage, &guid, nFrameIndex))
150 {
151 guid = FrameDimensionPage;
153 }
154 }
155 pAnime->m_nFrameIndex = nFrameIndex;
156}
GpStatus WINGDIPAPI GdipImageSelectActiveFrame(GpImage *image, GDIPCONST GUID *dimensionID, UINT frame)
Definition: image.c:4350
const GUID * guid

Referenced by Anime_Step().

◆ Anime_SetTimerWnd()

void Anime_SetTimerWnd ( PANIME  pAnime,
HWND  hwndTimer 
)

Definition at line 25 of file anime.c.

26{
27 pAnime->m_hwndTimer = hwndTimer;
28}

Referenced by Preview_OnCreate().

◆ Anime_Start()

void Anime_Start ( PANIME  pAnime,
DWORD  dwDelay 
)

Definition at line 35 of file anime.c.

36{
37 if (pAnime->m_pDelayItem)
38 SetTimer(pAnime->m_hwndTimer, ANIME_TIMER_ID, dwDelay, NULL);
39}
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)

Referenced by Anime_LoadInfo(), Anime_OnTimer(), Preview_pSaveImage(), and Preview_pSaveImageAs().

◆ QuickAlloc()

static LPVOID QuickAlloc ( SIZE_T  cbSize,
BOOL  bZero 
)
inlinestatic

Definition at line 72 of file shimgvw.h.

73{
74 return HeapAlloc(GetProcessHeap(), (bZero ? HEAP_ZERO_MEMORY : 0), cbSize);
75}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134

Referenced by Anime_LoadInfo(), MemStreamFromFile(), pBuildFileList(), Preview_OnCreate(), Preview_pSaveImage(), and Preview_pSaveImageAs().

◆ QuickFree()

static VOID QuickFree ( LPVOID  ptr)
inlinestatic

Definition at line 77 of file shimgvw.h.

78{
80}
#define HeapFree(x, y, z)
Definition: compat.h:735
static PVOID ptr
Definition: dispmode.c:27

Referenced by Anime_FreeInfo(), Anime_LoadInfo(), MemStreamFromFile(), pBuildFileList(), pFreeFileList(), Preview_OnCreate(), Preview_OnDestroy(), Preview_pSaveImage(), and Preview_pSaveImageAs().

Variable Documentation

◆ g_hInstance

HINSTANCE g_hInstance
extern

Definition at line 18 of file MainWindow.cpp.

◆ g_pImage