ReactOS  0.4.15-dev-2721-g5912c11
shimgvw.c File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <winreg.h>
#include <wingdi.h>
#include <wincon.h>
#include <windowsx.h>
#include <objbase.h>
#include <commctrl.h>
#include <commdlg.h>
#include <gdiplus.h>
#include <tchar.h>
#include <shlobj.h>
#include <strsafe.h>
#include <shlwapi.h>
#include <shellapi.h>
#include <debug.h>
#include "shimgvw.h"
Include dependency graph for shimgvw.c:

Go to the source code of this file.

Classes

struct  TB_BUTTON_CONFIG
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define INITGUID
 
#define NDEBUG
 
#define MIN_ZOOM   ZoomSteps[0]
 
#define MAX_ZOOM   ZoomSteps[_countof(ZoomSteps)-1]
 
#define DEFINE_BTN_INFO(_name)   { TBICON_##_name, IDC_##_name, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }
 
#define DEFINE_BTN_SEPARATOR   { 15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0 }
 
#define DEFINE_BTN_CONFIG(_name)   { IDB_##_name, IDS_TOOLTIP_##_name }
 
#define ANIME_TIMER_ID   9999
 

Functions

static void Anime_FreeInfo (void)
 
static BOOL Anime_LoadInfo (void)
 
static void Anime_SetFrameIndex (UINT nFrameIndex)
 
DWORD Anime_GetFrameDelay (UINT nFrameIndex)
 
BOOL Anime_Step (DWORD *pdwDelay)
 
static void UpdateZoom (UINT NewZoom)
 
static void ZoomInOrOut (BOOL bZoomIn)
 
static void ResetZoom (void)
 
static void pLoadImage (LPCWSTR szOpenFileName)
 
static void pSaveImageAs (HWND hwnd)
 
static VOID pPrintImage (HWND hwnd)
 
static VOID EnableToolBarButtons (BOOL bEnable)
 
static VOID pLoadImageFromNode (SHIMGVW_FILENODE *node, HWND hwnd)
 
static SHIMGVW_FILENODEpBuildFileList (LPWSTR szFirstFile)
 
static VOID pFreeFileList (SHIMGVW_FILENODE *root)
 
static VOID ImageView_UpdateWindow (HWND hwnd)
 
static HBRUSH CreateCheckerBoardBrush (HDC hdc)
 
static VOID ImageView_DrawImage (HWND hwnd)
 
static BOOL ImageView_LoadSettings (VOID)
 
static VOID ImageView_SaveSettings (HWND hwnd)
 
static BOOL ImageView_CreateToolBar (HWND hwnd)
 
static void ImageView_OnTimer (HWND hwnd)
 
LRESULT CALLBACK ImageView_DispWndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
 
static VOID ImageView_InitControls (HWND hwnd)
 
static VOID ImageView_OnMouseWheel (HWND hwnd, INT x, INT y, INT zDelta, UINT fwKeys)
 
static VOID ImageView_OnSize (HWND hwnd, UINT state, INT cx, INT cy)
 
static LRESULT ImageView_Delete (HWND hwnd)
 
static LRESULT ImageView_Modify (HWND hwnd)
 
LRESULT CALLBACK ImageView_WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
 
LONG WINAPI ImageView_CreateWindow (HWND hwnd, LPCWSTR szFileName)
 
VOID WINAPI ImageView_FullscreenW (HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
 
VOID WINAPI ImageView_Fullscreen (HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
 
VOID WINAPI ImageView_FullscreenA (HWND hwnd, HINSTANCE hInst, LPCSTR path, int nShow)
 
VOID WINAPI ImageView_PrintTo (HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
 
VOID WINAPI ImageView_PrintToA (HWND hwnd, HINSTANCE hInst, LPCSTR path, int nShow)
 
VOID WINAPI ImageView_PrintToW (HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
 
BOOL WINAPI DllMain (IN HINSTANCE hinstDLL, IN DWORD dwReason, IN LPVOID lpvReserved)
 

Variables

HINSTANCE hInstance
 
SHIMGVW_SETTINGS shiSettings
 
SHIMGVW_FILENODEcurrentFile
 
GpImageimage = NULL
 
WNDPROC PrevProc = NULL
 
HWND hDispWnd
 
HWND hToolBar
 
UINT ZoomPercents = 100
 
static const UINT ZoomSteps []
 
static const TBBUTTON Buttons []
 
static const TB_BUTTON_CONFIG BtnConfig []
 
UINT m_nFrameIndex = 0
 
UINT m_nFrameCount = 0
 
UINT m_nLoopIndex = 0
 
UINT m_nLoopCount = (UINT)-1
 
PropertyItemm_pDelayItem = NULL
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 10 of file shimgvw.c.

◆ ANIME_TIMER_ID

#define ANIME_TIMER_ID   9999

Definition at line 121 of file shimgvw.c.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 11 of file shimgvw.c.

◆ DEFINE_BTN_CONFIG

#define DEFINE_BTN_CONFIG (   _name)    { IDB_##_name, IDS_TOOLTIP_##_name }

Definition at line 94 of file shimgvw.c.

◆ DEFINE_BTN_INFO

#define DEFINE_BTN_INFO (   _name)    { TBICON_##_name, IDC_##_name, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }

Definition at line 64 of file shimgvw.c.

◆ DEFINE_BTN_SEPARATOR

#define DEFINE_BTN_SEPARATOR   { 15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0 }

Definition at line 67 of file shimgvw.c.

◆ INITGUID

#define INITGUID

Definition at line 12 of file shimgvw.c.

◆ MAX_ZOOM

#define MAX_ZOOM   ZoomSteps[_countof(ZoomSteps)-1]

Definition at line 55 of file shimgvw.c.

◆ MIN_ZOOM

#define MIN_ZOOM   ZoomSteps[0]

Definition at line 54 of file shimgvw.c.

◆ NDEBUG

#define NDEBUG

Definition at line 33 of file shimgvw.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 9 of file shimgvw.c.

Function Documentation

◆ Anime_FreeInfo()

static void Anime_FreeInfo ( void  )
static

Definition at line 123 of file shimgvw.c.

124 {
125  if (m_pDelayItem)
126  {
128  m_pDelayItem = NULL;
129  }
130  m_nFrameIndex = 0;
131  m_nFrameCount = 0;
132  m_nLoopIndex = 0;
133  m_nLoopCount = (UINT)-1;
134 }
#define free
Definition: debug_ros.c:5
UINT m_nLoopIndex
Definition: shimgvw.c:117
PropertyItem * m_pDelayItem
Definition: shimgvw.c:119
UINT m_nLoopCount
Definition: shimgvw.c:118
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT m_nFrameIndex
Definition: shimgvw.c:115
UINT m_nFrameCount
Definition: shimgvw.c:116

Referenced by Anime_LoadInfo(), and ImageView_CreateWindow().

◆ Anime_GetFrameDelay()

DWORD Anime_GetFrameDelay ( UINT  nFrameIndex)

Definition at line 210 of file shimgvw.c.

211 {
212  if (nFrameIndex < m_nFrameCount && m_pDelayItem)
213  {
214  return ((DWORD *)m_pDelayItem->value)[m_nFrameIndex] * 10;
215  }
216  return 0;
217 }
unsigned long DWORD
Definition: ntddk_ex.h:95
PropertyItem * m_pDelayItem
Definition: shimgvw.c:119
UINT m_nFrameIndex
Definition: shimgvw.c:115
UINT m_nFrameCount
Definition: shimgvw.c:116

Referenced by Anime_Step().

◆ Anime_LoadInfo()

static BOOL Anime_LoadInfo ( void  )
static

Definition at line 136 of file shimgvw.c.

137 {
138  GUID *dims;
139  UINT nDimCount = 0;
140  UINT cbItem;
141  UINT result;
142  PropertyItem *pItem;
143 
144  Anime_FreeInfo();
146 
147  if (!image)
148  return FALSE;
149 
151  if (nDimCount)
152  {
153  dims = (GUID *)calloc(nDimCount, sizeof(GUID));
154  if (dims)
155  {
156  GdipImageGetFrameDimensionsList(image, dims, nDimCount);
159  free(dims);
160  }
161  }
162 
163  result = 0;
165  cbItem = result;
166  if (cbItem)
167  {
168  m_pDelayItem = (PropertyItem *)malloc(cbItem);
170  }
171 
172  result = 0;
174  cbItem = result;
175  if (cbItem)
176  {
177  pItem = (PropertyItem *)malloc(cbItem);
178  if (pItem)
179  {
180  if (GdipGetPropertyItem(image, PropertyTagLoopCount, cbItem, pItem) == Ok)
181  {
182  m_nLoopCount = *(WORD *)pItem->value;
183  }
184  free(pItem);
185  }
186  }
187 
188  if (m_pDelayItem)
189  {
191  }
192 
193  return m_pDelayItem != NULL;
194 }
#define PropertyTagLoopCount
GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, GDIPCONST GUID *dimensionID, UINT *count)
Definition: image.c:2865
GLuint64EXT * result
Definition: glext.h:11304
#define free
Definition: debug_ros.c:5
GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage *image, PROPID propid, UINT *size)
Definition: image.c:2488
#define ANIME_TIMER_ID
Definition: shimgvw.c:121
#define FALSE
Definition: types.h:117
#define PropertyTagFrameDelay
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
static void Anime_FreeInfo(void)
Definition: shimgvw.c:123
unsigned short WORD
Definition: ntddk_ex.h:93
GpStatus WINGDIPAPI GdipGetPropertyItem(GpImage *image, PROPID propid, UINT size, PropertyItem *buffer)
Definition: image.c:2634
HWND hDispWnd
Definition: shimgvw.c:44
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
PropertyItem * m_pDelayItem
Definition: shimgvw.c:119
UINT m_nLoopCount
Definition: shimgvw.c:118
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount(GpImage *image, UINT *count)
Definition: image.c:2885
#define calloc
Definition: rosglue.h:14
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList(GpImage *image, GUID *dimensionIDs, UINT count)
Definition: image.c:2900
#define malloc
Definition: debug_ros.c:4
UINT m_nFrameCount
Definition: shimgvw.c:116

Referenced by pLoadImage().

◆ Anime_SetFrameIndex()

static void Anime_SetFrameIndex ( UINT  nFrameIndex)
static

Definition at line 196 of file shimgvw.c.

197 {
198  if (nFrameIndex < m_nFrameCount)
199  {
200  GUID guid = FrameDimensionTime;
201  if (Ok != GdipImageSelectActiveFrame(image, &guid, nFrameIndex))
202  {
203  guid = FrameDimensionPage;
204  GdipImageSelectActiveFrame(image, &guid, nFrameIndex);
205  }
206  }
207  m_nFrameIndex = nFrameIndex;
208 }
const GUID * guid
GpStatus WINGDIPAPI GdipImageSelectActiveFrame(GpImage *image, GDIPCONST GUID *dimensionID, UINT frame)
Definition: image.c:4302
UINT m_nFrameIndex
Definition: shimgvw.c:115
UINT m_nFrameCount
Definition: shimgvw.c:116

Referenced by Anime_Step().

◆ Anime_Step()

BOOL Anime_Step ( DWORD pdwDelay)

Definition at line 219 of file shimgvw.c.

220 {
221  *pdwDelay = INFINITE;
222  if (m_nLoopCount == (UINT)-1)
223  return FALSE;
224 
225  if (m_nFrameIndex + 1 < m_nFrameCount)
226  {
227  *pdwDelay = Anime_GetFrameDelay(m_nFrameIndex);
229  ++m_nFrameIndex;
230  return TRUE;
231  }
232 
233  if (m_nLoopCount == 0 || m_nLoopIndex < m_nLoopCount)
234  {
235  *pdwDelay = Anime_GetFrameDelay(m_nFrameIndex);
237  m_nFrameIndex = 0;
238  ++m_nLoopIndex;
239  return TRUE;
240  }
241 
242  return FALSE;
243 }
#define TRUE
Definition: types.h:120
UINT m_nLoopIndex
Definition: shimgvw.c:117
#define FALSE
Definition: types.h:117
DWORD Anime_GetFrameDelay(UINT nFrameIndex)
Definition: shimgvw.c:210
static void Anime_SetFrameIndex(UINT nFrameIndex)
Definition: shimgvw.c:196
UINT m_nLoopCount
Definition: shimgvw.c:118
unsigned int UINT
Definition: ndis.h:50
UINT m_nFrameIndex
Definition: shimgvw.c:115
UINT m_nFrameCount
Definition: shimgvw.c:116
#define INFINITE
Definition: serial.h:102

Referenced by ImageView_OnTimer().

◆ CreateCheckerBoardBrush()

static HBRUSH CreateCheckerBoardBrush ( HDC  hdc)
static

Definition at line 681 of file shimgvw.c.

682 {
683  static const CHAR pattern[] =
684  "\x28\x00\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x01\x00\x04\x00\x00\x00"
685  "\x00\x00\x80\x00\x00\x00\x23\x2E\x00\x00\x23\x2E\x00\x00\x10\x00\x00\x00"
686  "\x00\x00\x00\x00\x99\x99\x99\x00\xCC\xCC\xCC\x00\x00\x00\x00\x00\x00\x00"
687  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
688  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
689  "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x11\x11\x11"
690  "\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00"
691  "\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00"
692  "\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11"
693  "\x11\x11\x00\x00\x00\x00\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00"
694  "\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11"
695  "\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11"
696  "\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11";
697 
699 }
char CHAR
Definition: xmlstorage.h:175
#define DIB_RGB_COLORS
Definition: wingdi.h:366
HBRUSH WINAPI CreateDIBPatternBrushPt(_In_ const VOID *pvPackedDIB, _In_ UINT uUsage)
GLubyte * pattern
Definition: glext.h:7787

Referenced by ImageView_DrawImage().

◆ DllMain()

BOOL WINAPI DllMain ( IN HINSTANCE  hinstDLL,
IN DWORD  dwReason,
IN LPVOID  lpvReserved 
)

@DllMain

Core routine of the Utility Manager's library.

Parameters
[in]hDllInstanceThe entry point instance of the library.
[in]fdwReasonThe reason argument to indicate the motive DllMain is being called.
[in]lpvReservedReserved.
Returns
Returns TRUE when main call initialization has succeeded, FALSE otherwise.

Definition at line 1308 of file shimgvw.c.

1311 {
1312  switch (dwReason)
1313  {
1314  case DLL_PROCESS_ATTACH:
1315  case DLL_THREAD_ATTACH:
1316  hInstance = hinstDLL;
1317  break;
1318  }
1319 
1320  return TRUE;
1321 }
#define TRUE
Definition: types.h:120
#define DLL_THREAD_ATTACH
Definition: compat.h:132
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
DWORD dwReason
Definition: misc.cpp:154
HINSTANCE hInstance
Definition: shimgvw.c:38

◆ EnableToolBarButtons()

static VOID EnableToolBarButtons ( BOOL  bEnable)
static

Definition at line 499 of file shimgvw.c.

500 {
503 }
#define TB_ENABLEBUTTON
Definition: commctrl.h:1042
#define IDC_SAVEAS
Definition: resource.h:17
_In_ BOOL bEnable
Definition: winddi.h:3426
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hToolBar
Definition: shimgvw.c:44
#define IDC_PRINT
Definition: fontview.h:14

Referenced by pLoadImageFromNode().

◆ ImageView_CreateToolBar()

static BOOL ImageView_CreateToolBar ( HWND  hwnd)
static

Definition at line 859 of file shimgvw.c.

860 {
863  0, 0, 0, 0, hwnd,
864  0, hInstance, NULL);
865  if (hToolBar != NULL)
866  {
867  HIMAGELIST hImageList;
868 
871 
873  sizeof(Buttons[0]), 0);
874 
876  if (hImageList == NULL) return FALSE;
877 
878  for (UINT n = 0; n < _countof(BtnConfig); n++)
879  {
882  }
883 
885  0, (LPARAM)hImageList));
886 
888 
889  return TRUE;
890  }
891 
892  return FALSE;
893 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:1013
#define RGB(r, g, b)
Definition: precomp.h:62
#define TRUE
Definition: types.h:120
GLdouble n
Definition: glext.h:7729
static const TB_BUTTON_CONFIG BtnConfig[]
Definition: shimgvw.c:96
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define FALSE
Definition: types.h:117
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define TB_IMAGE_HEIGHT
Definition: shimgvw.h:4
#define CreateWindowEx
Definition: winuser.h:5730
#define TOOLBARCLASSNAME
Definition: commctrl.h:946
LONG_PTR LPARAM
Definition: windef.h:208
#define CCS_BOTTOM
Definition: commctrl.h:2244
#define TB_SETIMAGELIST
Definition: commctrl.h:1150
#define _countof(array)
Definition: sndvol32.h:68
#define ILC_COLOR24
Definition: commctrl.h:357
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define TB_ADDBUTTONS
Definition: commctrl.h:1271
#define ILC_MASK
Definition: commctrl.h:351
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define IMAGE_BITMAP
Definition: winuser.h:211
HINSTANCE hInstance
Definition: shimgvw.c:38
#define TB_IMAGE_WIDTH
Definition: shimgvw.h:3
HWND hToolBar
Definition: shimgvw.c:44
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:563
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static const TBBUTTON Buttons[]
Definition: shimgvw.c:71
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define WS_VISIBLE
Definition: pedump.c:620
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1190

Referenced by ImageView_InitControls().

◆ ImageView_CreateWindow()

LONG WINAPI ImageView_CreateWindow ( HWND  hwnd,
LPCWSTR  szFileName 
)

Definition at line 1158 of file shimgvw.c.

1159 {
1162  WNDCLASSW WndClass = {0};
1163  WCHAR szBuf[512];
1164  WCHAR szInitialFile[MAX_PATH];
1165  HWND hMainWnd;
1166  MSG msg;
1167  HACCEL hKbdAccel;
1168  HRESULT hComRes;
1169  INITCOMMONCONTROLSEX Icc = { .dwSize = sizeof(Icc), .dwICC = ICC_WIN95_CLASSES };
1170 
1171  InitCommonControlsEx(&Icc);
1172 
1174  if (hComRes != S_OK && hComRes != S_FALSE)
1175  {
1176  DPRINT1("Warning, CoInitializeEx failed with code=%08X\n", (int)hComRes);
1177  }
1178 
1179  if (!ImageView_LoadSettings())
1180  {
1182  shiSettings.Left = 0;
1183  shiSettings.Top = 0;
1184  shiSettings.Right = 520;
1185  shiSettings.Bottom = 400;
1186  }
1187 
1188  // Initialize GDI+
1189  gdiplusStartupInput.GdiplusVersion = 1;
1190  gdiplusStartupInput.DebugEventCallback = NULL;
1191  gdiplusStartupInput.SuppressBackgroundThread = FALSE;
1192  gdiplusStartupInput.SuppressExternalCodecs = FALSE;
1193 
1195  pLoadImage(szFileName);
1196 
1197  // Create the window
1198  WndClass.lpszClassName = L"shimgvw_window";
1199  WndClass.lpfnWndProc = ImageView_WndProc;
1200  WndClass.hInstance = hInstance;
1201  WndClass.style = CS_HREDRAW | CS_VREDRAW;
1203  WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
1204  WndClass.hbrBackground = NULL; /* less flicker */
1205 
1206  if (!RegisterClassW(&WndClass)) return -1;
1207 
1208  LoadStringW(hInstance, IDS_APPTITLE, szBuf, _countof(szBuf));
1209  hMainWnd = CreateWindowExW(0, L"shimgvw_window", szBuf,
1212  0, 0, NULL, NULL, hInstance, NULL);
1213 
1214  // make sure the path has no quotes on it
1215  StringCbCopyW(szInitialFile, sizeof(szInitialFile), szFileName);
1216  PathUnquoteSpacesW(szInitialFile);
1217 
1218  currentFile = pBuildFileList(szInitialFile);
1219  if (currentFile)
1220  {
1222  }
1223 
1224  /* Create accelerator table for keystrokes */
1226 
1227  // Show it
1230 
1231  // Message Loop
1232  for (;;)
1233  {
1234  if (GetMessageW(&msg, NULL, 0, 0) <= 0)
1235  break;
1236 
1237  if (!TranslateAcceleratorW(hMainWnd, hKbdAccel, &msg))
1238  {
1241  }
1242  }
1243 
1244  /* Destroy accelerator table */
1245  DestroyAcceleratorTable(hKbdAccel);
1246 
1248 
1249  if (image)
1250  {
1252  image = NULL;
1253  }
1254 
1255  Anime_FreeInfo();
1256 
1258 
1259  /* Release COM resources */
1260  if (SUCCEEDED(hComRes))
1261  CoUninitialize();
1262 
1263  return -1;
1264 }
SHIMGVW_SETTINGS shiSettings
Definition: shimgvw.c:39
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IDS_APPTITLE
Definition: resource.h:3
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI UpdateWindow(_In_ HWND)
#define CS_HREDRAW
Definition: winuser.h:648
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static BOOL ImageView_LoadSettings(VOID)
Definition: shimgvw.c:817
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
uint32_t ULONG_PTR
Definition: typedefs.h:65
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
BOOL Maximized
Definition: shimgvw.h:10
#define ICC_WIN95_CLASSES
Definition: commctrl.h:66
#define FALSE
Definition: types.h:117
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
if SUCCEEDED(hr)
LRESULT CALLBACK ImageView_WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1028
#define CW_USEDEFAULT
Definition: winuser.h:225
#define S_FALSE
Definition: winerror.h:2357
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
static SHIMGVW_FILENODE * pBuildFileList(LPWSTR szFirstFile)
Definition: shimgvw.c:543
#define SW_SHOW
Definition: winuser.h:769
SHIMGVW_FILENODE * currentFile
Definition: shimgvw.c:40
#define WS_CAPTION
Definition: pedump.c:624
static void Anime_FreeInfo(void)
Definition: shimgvw.c:123
#define CS_VREDRAW
Definition: winuser.h:653
static VOID pLoadImageFromNode(SHIMGVW_FILENODE *node, HWND hwnd)
Definition: shimgvw.c:506
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
void WINAPI GdiplusShutdown(ULONG_PTR)
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
Definition: gdiplus.c:81
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
HWND hMainWnd
Definition: magnifier.c:32
static const WCHAR L[]
Definition: oid.c:1250
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
static VOID pFreeFileList(SHIMGVW_FILENODE *root)
Definition: shimgvw.c:656
#define LoadCursor
Definition: winuser.h:5787
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
Definition: image.c:2107
#define S_OK
Definition: intsafe.h:51
Gdiplus::GdiplusStartupInput gdiplusStartupInput
Definition: winmain.cpp:33
BOOL WINAPI DestroyAcceleratorTable(_In_ HACCEL)
ULONG_PTR gdiplusToken
Definition: winmain.cpp:34
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
VOID WINAPI PathUnquoteSpacesW(LPWSTR lpszPath)
Definition: path.c:1029
#define NULL
Definition: types.h:112
HINSTANCE hInstance
Definition: shimgvw.c:38
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define DPRINT1
Definition: precomp.h:8
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define IDR_ACCELERATOR
Definition: resource.h:91
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define IDI_APP_ICON
Definition: resource.h:4
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
#define WS_VISIBLE
Definition: pedump.c:620
static void pLoadImage(LPCWSTR szOpenFileName)
Definition: shimgvw.c:359
WCHAR WndClass[]
Definition: capicon.c:23

Referenced by ImageView_Fullscreen(), ImageView_FullscreenA(), and ImageView_FullscreenW().

◆ ImageView_Delete()

static LRESULT ImageView_Delete ( HWND  hwnd)
static

Definition at line 979 of file shimgvw.c.

980 {
981  DPRINT1("ImageView_Delete: unimplemented.\n");
982  return 0;
983 }
#define DPRINT1
Definition: precomp.h:8

Referenced by ImageView_WndProc().

◆ ImageView_DispWndProc()

LRESULT CALLBACK ImageView_DispWndProc ( HWND  hwnd,
UINT  Message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 909 of file shimgvw.c.

910 {
911  switch (Message)
912  {
913  case WM_PAINT:
914  {
916  return 0L;
917  }
918  case WM_TIMER:
919  {
920  if (wParam == ANIME_TIMER_ID)
921  {
923  return 0;
924  }
925  break;
926  }
927  }
929 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WNDPROC PrevProc
Definition: shimgvw.c:42
#define ANIME_TIMER_ID
Definition: shimgvw.c:121
WPARAM wParam
Definition: combotst.c:138
#define WM_TIMER
Definition: winuser.h:1724
#define WM_PAINT
Definition: winuser.h:1602
CHAR Message[80]
Definition: alive.c:5
static const WCHAR L[]
Definition: oid.c:1250
static VOID ImageView_DrawImage(HWND hwnd)
Definition: shimgvw.c:702
static void ImageView_OnTimer(HWND hwnd)
Definition: shimgvw.c:895
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

Referenced by ImageView_InitControls().

◆ ImageView_DrawImage()

static VOID ImageView_DrawImage ( HWND  hwnd)
static

Definition at line 702 of file shimgvw.c.

703 {
704  GpGraphics *graphics;
705  UINT ImageWidth, ImageHeight;
706  INT ZoomedWidth, ZoomedHeight, x, y;
707  PAINTSTRUCT ps;
708  RECT rect, margin;
709  HDC hdc;
710  HBRUSH white;
711  HGDIOBJ hbrOld;
712  UINT uFlags;
713  WCHAR szText[128];
714  HGDIOBJ hFontOld;
715 
716  hdc = BeginPaint(hwnd, &ps);
717  if (!hdc)
718  {
719  DPRINT1("BeginPaint() failed\n");
720  return;
721  }
722 
723  GdipCreateFromHDC(hdc, &graphics);
724  if (!graphics)
725  {
726  DPRINT1("GdipCreateFromHDC() failed\n");
727  return;
728  }
729 
731  white = GetStockObject(WHITE_BRUSH);
732 
733  if (image == NULL)
734  {
735  FillRect(hdc, &rect, white);
736 
738 
739  SetTextColor(hdc, RGB(0, 0, 0));
741 
744  DT_NOPREFIX);
745  SelectObject(hdc, hFontOld);
746  }
747  else
748  {
749  GdipGetImageWidth(image, &ImageWidth);
750  GdipGetImageHeight(image, &ImageHeight);
751 
752  ZoomedWidth = (ImageWidth * ZoomPercents) / 100;
753  ZoomedHeight = (ImageHeight * ZoomPercents) / 100;
754 
755  x = (rect.right - ZoomedWidth) / 2;
756  y = (rect.bottom - ZoomedHeight) / 2;
757 
758  // Fill top part
759  margin = rect;
760  margin.bottom = y - 1;
761  FillRect(hdc, &margin, white);
762  // Fill bottom part
763  margin.top = y + ZoomedHeight + 1;
764  margin.bottom = rect.bottom;
765  FillRect(hdc, &margin, white);
766  // Fill left part
767  margin.top = y - 1;
768  margin.bottom = y + ZoomedHeight + 1;
769  margin.right = x - 1;
770  FillRect(hdc, &margin, white);
771  // Fill right part
772  margin.left = x + ZoomedWidth + 1;
773  margin.right = rect.right;
774  FillRect(hdc, &margin, white);
775 
776  DPRINT("x = %d, y = %d, ImageWidth = %u, ImageHeight = %u\n");
777  DPRINT("rect.right = %ld, rect.bottom = %ld\n", rect.right, rect.bottom);
778  DPRINT("ZoomPercents = %d, ZoomedWidth = %d, ZoomedHeight = %d\n",
779  ZoomPercents, ZoomedWidth, ZoomedWidth);
780 
781  if (ZoomPercents % 100 == 0)
782  {
785  }
786  else
787  {
790  }
791 
792  uFlags = 0;
794 
796  {
797  HBRUSH hbr = CreateCheckerBoardBrush(hdc);
798  hbrOld = SelectObject(hdc, hbr);
799  Rectangle(hdc, x - 1, y - 1, x + ZoomedWidth + 1, y + ZoomedHeight + 1);
800  SelectObject(hdc, hbrOld);
801  DeleteObject(hbr);
802  }
803  else
804  {
806  Rectangle(hdc, x - 1, y - 1, x + ZoomedWidth + 1, y + ZoomedHeight + 1);
807  SelectObject(hdc, hbrOld);
808  }
809 
810  GdipDrawImageRectI(graphics, image, x, y, ZoomedWidth, ZoomedHeight);
811  }
812  GdipDeleteGraphics(graphics);
813  EndPaint(hwnd, &ps);
814 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define RGB(r, g, b)
Definition: precomp.h:62
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width)
Definition: image.c:2342
#define NULL_BRUSH
Definition: wingdi.h:900
UINT ZoomPercents
Definition: shimgvw.c:47
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define WHITE_BRUSH
Definition: wingdi.h:901
GpStatus WINGDIPAPI GdipGetImageFlags(GpImage *image, UINT *flags)
Definition: image.c:5266
LONG left
Definition: windef.h:306
UINT uFlags
Definition: api.c:59
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:308
#define DT_NOPREFIX
Definition: winuser.h:537
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:58
& rect
Definition: startmenu.cpp:1413
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1034
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
Definition: image.c:2239
static const WCHAR szText[]
Definition: dialog.c:139
GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode mode)
Definition: graphics.c:6289
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
Definition: graphics.c:2581
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define TRANSPARENT
Definition: wingdi.h:949
#define DT_VCENTER
Definition: winuser.h:543
GpStatus WINGDIPAPI GdipDrawImageRectI(GpGraphics *graphics, GpImage *image, INT x, INT y, INT width, INT height)
Definition: graphics.c:3561
__wchar_t WCHAR
Definition: xmlstorage.h:180
GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics, InterpolationMode mode)
Definition: graphics.c:6143
#define _countof(array)
Definition: sndvol32.h:68
#define DEFAULT_GUI_FONT
Definition: wingdi.h:908
HDC hdc
Definition: main.c:9
static HBRUSH CreateCheckerBoardBrush(HDC hdc)
Definition: shimgvw.c:681
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define DT_SINGLELINE
Definition: winuser.h:540
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
Definition: graphics.c:2395
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
HINSTANCE hInstance
Definition: shimgvw.c:38
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define DPRINT1
Definition: precomp.h:8
LONG bottom
Definition: windef.h:309
#define DT_CENTER
Definition: winuser.h:527
#define DPRINT
Definition: sndvol32.h:71
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define IDS_NOPREVIEW
Definition: resource.h:62
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:17

Referenced by ImageView_DispWndProc().

◆ ImageView_Fullscreen()

VOID WINAPI ImageView_Fullscreen ( HWND  hwnd,
HINSTANCE  hInst,
LPCWSTR  path,
int  nShow 
)

Definition at line 1273 of file shimgvw.c.

1274 {
1276 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LONG WINAPI ImageView_CreateWindow(HWND hwnd, LPCWSTR szFileName)
Definition: shimgvw.c:1158

◆ ImageView_FullscreenA()

VOID WINAPI ImageView_FullscreenA ( HWND  hwnd,
HINSTANCE  hInst,
LPCSTR  path,
int  nShow 
)

Definition at line 1279 of file shimgvw.c.

1280 {
1281  WCHAR szFile[MAX_PATH];
1282 
1283  if (MultiByteToWideChar(CP_ACP, 0, path, -1, szFile, _countof(szFile)))
1284  {
1285  ImageView_CreateWindow(hwnd, szFile);
1286  }
1287 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LONG WINAPI ImageView_CreateWindow(HWND hwnd, LPCWSTR szFileName)
Definition: shimgvw.c:1158
#define CP_ACP
Definition: compat.h:109
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
#define MultiByteToWideChar
Definition: compat.h:110

◆ ImageView_FullscreenW()

VOID WINAPI ImageView_FullscreenW ( HWND  hwnd,
HINSTANCE  hInst,
LPCWSTR  path,
int  nShow 
)

Definition at line 1267 of file shimgvw.c.

1268 {
1270 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LONG WINAPI ImageView_CreateWindow(HWND hwnd, LPCWSTR szFileName)
Definition: shimgvw.c:1158

◆ ImageView_InitControls()

static VOID ImageView_InitControls ( HWND  hwnd)
static

Definition at line 932 of file shimgvw.c.

933 {
937 
939 
942  0, 0, 0, 0, hwnd, NULL, hInstance, NULL);
943 
946 
948 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
SHIMGVW_SETTINGS shiSettings
Definition: shimgvw.c:39
WNDPROC PrevProc
Definition: shimgvw.c:42
#define TRUE
Definition: types.h:120
#define CS_HREDRAW
Definition: winuser.h:648
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LRESULT CALLBACK ImageView_DispWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:909
#define SetWindowLongPtr
Definition: treelist.c:70
static BOOL ImageView_CreateToolBar(HWND hwnd)
Definition: shimgvw.c:859
#define GCL_STYLE
Definition: winuser.h:665
BOOL Maximized
Definition: shimgvw.h:10
#define WC_STATIC
Definition: commctrl.h:4682
LONG_PTR LPARAM
Definition: windef.h:208
#define SetClassLongPtr
Definition: winuser.h:5823
#define CS_VREDRAW
Definition: winuser.h:653
HWND hDispWnd
Definition: shimgvw.c:44
static const WCHAR L[]
Definition: oid.c:1250
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define NULL
Definition: types.h:112
HINSTANCE hInstance
Definition: shimgvw.c:38
#define WS_VISIBLE
Definition: pedump.c:620
#define SW_MAXIMIZE
Definition: winuser.h:766

Referenced by ImageView_WndProc().

◆ ImageView_LoadSettings()

static BOOL ImageView_LoadSettings ( VOID  )
static

Definition at line 817 of file shimgvw.c.

818 {
819  HKEY hKey;
820  DWORD dwSize;
821  LONG nError;
822 
823  nError = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\shimgvw", 0, KEY_READ, &hKey);
824  if (nError)
825  return FALSE;
826 
827  dwSize = sizeof(shiSettings);
828  nError = RegQueryValueExW(hKey, L"Settings", NULL, NULL, (LPBYTE)&shiSettings, &dwSize);
829  RegCloseKey(hKey);
830 
831  return !nError;
832 }
SHIMGVW_SETTINGS shiSettings
Definition: shimgvw.c:39
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by ImageView_CreateWindow().

◆ ImageView_Modify()

static LRESULT ImageView_Modify ( HWND  hwnd)
static

Definition at line 986 of file shimgvw.c.

987 {
988  int nChars = GetFullPathNameW(currentFile->FileName, 0, NULL, NULL);
989  LPWSTR pszPathName;
990  SHELLEXECUTEINFOW sei;
991 
992  if (!nChars)
993  {
994  DPRINT1("ImageView_Modify: failed to get full path name.\n");
995  return 1;
996  }
997 
998  pszPathName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, nChars * sizeof(WCHAR));
999  if (pszPathName == NULL)
1000  {
1001  DPRINT1("HeapAlloc() failed in ImageView_Modify()\n");
1002  return 1;
1003  }
1004 
1005  GetFullPathNameW(currentFile->FileName, nChars, pszPathName, NULL);
1006 
1007  sei.cbSize = sizeof(sei);
1008  sei.fMask = 0;
1009  sei.hwnd = NULL;
1010  sei.lpVerb = L"edit";
1011  sei.lpFile = pszPathName;
1012  sei.lpParameters = NULL;
1013  sei.lpDirectory = NULL;
1014  sei.nShow = SW_SHOWNORMAL;
1015  sei.hInstApp = NULL;
1016 
1017  if (!ShellExecuteExW(&sei))
1018  {
1019  DPRINT1("ImageView_Modify: ShellExecuteExW() failed with code %08X\n", (int)GetLastError());
1020  }
1021 
1022  HeapFree(GetProcessHeap(), 0, pszPathName);
1023 
1024  return 0;
1025 }
HINSTANCE hInstApp
Definition: shellapi.h:334
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
LPCWSTR lpDirectory
Definition: shellapi.h:332
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2263
WCHAR FileName[MAX_PATH]
Definition: shimgvw.h:19
SHIMGVW_FILENODE * currentFile
Definition: shimgvw.c:40
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR L[]
Definition: oid.c:1250
#define SW_SHOWNORMAL
Definition: winuser.h:764
LPCWSTR lpParameters
Definition: shellapi.h:331
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ImageView_WndProc().

◆ ImageView_OnMouseWheel()

static VOID ImageView_OnMouseWheel ( HWND  hwnd,
INT  x,
INT  y,
INT  zDelta,
UINT  fwKeys 
)
static

Definition at line 951 of file shimgvw.c.

952 {
953  if (zDelta != 0)
954  {
955  ZoomInOrOut(zDelta > 0);
956  }
957 }
static void ZoomInOrOut(BOOL bZoomIn)
Definition: shimgvw.c:275

Referenced by ImageView_WndProc().

◆ ImageView_OnSize()

static VOID ImageView_OnSize ( HWND  hwnd,
UINT  state,
INT  cx,
INT  cy 
)
static

Definition at line 960 of file shimgvw.c.

961 {
962  RECT rc;
963 
965 
966  GetWindowRect(hToolBar, &rc);
967 
968  MoveWindow(hDispWnd, 0, 0, cx, cy - (rc.bottom - rc.top), TRUE);
969 
970  /* is it maximized or restored? */
972  {
973  /* reset zoom */
974  ResetZoom();
975  }
976 }
static void ResetZoom(void)
Definition: shimgvw.c:314
#define SIZE_MAXIMIZED
Definition: winuser.h:2482
#define TRUE
Definition: types.h:120
#define SIZE_RESTORED
Definition: winuser.h:2480
LONG top
Definition: windef.h:307
#define TB_AUTOSIZE
Definition: commctrl.h:1137
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:585
HWND hDispWnd
Definition: shimgvw.c:44
static int state
Definition: maze.c:121
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
_Out_opt_ int * cx
Definition: commctrl.h:585
HWND hToolBar
Definition: shimgvw.c:44
LONG bottom
Definition: windef.h:309
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by ImageView_WndProc().

◆ ImageView_OnTimer()

static void ImageView_OnTimer ( HWND  hwnd)
static

Definition at line 895 of file shimgvw.c.

896 {
897  DWORD dwDelay;
898 
901 
902  if (Anime_Step(&dwDelay))
903  {
904  SetTimer(hwnd, ANIME_TIMER_ID, dwDelay, NULL);
905  }
906 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL Anime_Step(DWORD *pdwDelay)
Definition: shimgvw.c:219
#define ANIME_TIMER_ID
Definition: shimgvw.c:121
#define FALSE
Definition: types.h:117
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define NULL
Definition: types.h:112

Referenced by ImageView_DispWndProc().

◆ ImageView_PrintTo()

VOID WINAPI ImageView_PrintTo ( HWND  hwnd,
HINSTANCE  hInst,
LPCWSTR  path,
int  nShow 
)

Definition at line 1290 of file shimgvw.c.

1291 {
1292  DPRINT("ImageView_PrintTo() not implemented\n");
1293 }
#define DPRINT
Definition: sndvol32.h:71

◆ ImageView_PrintToA()

VOID WINAPI ImageView_PrintToA ( HWND  hwnd,
HINSTANCE  hInst,
LPCSTR  path,
int  nShow 
)

Definition at line 1296 of file shimgvw.c.

1297 {
1298  DPRINT("ImageView_PrintToA() not implemented\n");
1299 }
#define DPRINT
Definition: sndvol32.h:71

◆ ImageView_PrintToW()

VOID WINAPI ImageView_PrintToW ( HWND  hwnd,
HINSTANCE  hInst,
LPCWSTR  path,
int  nShow 
)

Definition at line 1302 of file shimgvw.c.

1303 {
1304  DPRINT("ImageView_PrintToW() not implemented\n");
1305 }
#define DPRINT
Definition: sndvol32.h:71

◆ ImageView_SaveSettings()

static VOID ImageView_SaveSettings ( HWND  hwnd)
static

Definition at line 835 of file shimgvw.c.

836 {
837  WINDOWPLACEMENT wp;
838  HKEY hKey;
839 
841  wp.length = sizeof(WINDOWPLACEMENT);
842  GetWindowPlacement(hwnd, &wp);
843 
849 
850  if (RegCreateKeyEx(HKEY_CURRENT_USER, _T("Software\\ReactOS\\shimgvw"), 0, NULL,
852  {
853  RegSetValueEx(hKey, _T("Settings"), 0, REG_BINARY, (LPBYTE)&shiSettings, sizeof(SHIMGVW_SETTINGS));
854  RegCloseKey(hKey);
855  }
856 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
SHIMGVW_SETTINGS shiSettings
Definition: shimgvw.c:39
struct _WINDOWPLACEMENT WINDOWPLACEMENT
#define ERROR_SUCCESS
Definition: deptool.c:10
#define REG_BINARY
Definition: nt_native.h:1496
#define SW_HIDE
Definition: winuser.h:762
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG top
Definition: windef.h:307
#define WPF_RESTORETOMAXIMIZED
Definition: winuser.h:2507
LONG left
Definition: windef.h:306
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG right
Definition: windef.h:308
BOOL Maximized
Definition: shimgvw.h:10
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
#define _T(x)
Definition: vfdio.h:22
FxAutoRegKey hKey
BOOL WINAPI IsZoomed(_In_ HWND)
#define NULL
Definition: types.h:112
RECT rcNormalPosition
Definition: winuser.h:3270
LONG bottom
Definition: windef.h:309
#define RegSetValueEx
Definition: winreg.h:533
#define RegCreateKeyEx
Definition: winreg.h:501

Referenced by ImageView_WndProc().

◆ ImageView_UpdateWindow()

static VOID ImageView_UpdateWindow ( HWND  hwnd)
static

Definition at line 675 of file shimgvw.c.

676 {
679 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI UpdateWindow(_In_ HWND)
#define FALSE
Definition: types.h:117
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define NULL
Definition: types.h:112

Referenced by ImageView_WndProc().

◆ ImageView_WndProc()

LRESULT CALLBACK ImageView_WndProc ( HWND  hwnd,
UINT  Message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1028 of file shimgvw.c.

1029 {
1030  switch (Message)
1031  {
1032  case WM_CREATE:
1033  {
1035  return 0L;
1036  }
1037 
1038  case WM_COMMAND:
1039  {
1040  switch (LOWORD(wParam))
1041  {
1042  case IDC_PREV_PIC:
1045  break;
1046 
1047  case IDC_NEXT_PIC:
1050  break;
1051 
1052  case IDC_BEST_FIT:
1053  DPRINT1("IDC_BEST_FIT unimplemented\n");
1054  break;
1055 
1056  case IDC_REAL_SIZE:
1057  UpdateZoom(100);
1058  return 0;
1059 
1060  case IDC_SLIDE_SHOW:
1061  DPRINT1("IDC_SLIDE_SHOW unimplemented\n");
1062  break;
1063 
1064  case IDC_ZOOM_IN:
1065  ZoomInOrOut(TRUE);
1066  break;
1067 
1068  case IDC_ZOOM_OUT:
1069  ZoomInOrOut(FALSE);
1070  break;
1071 
1072  case IDC_SAVEAS:
1073  pSaveImageAs(hwnd);
1074  break;
1075 
1076  case IDC_PRINT:
1077  pPrintImage(hwnd);
1078  break;
1079 
1080  case IDC_ROT_CLOCKW:
1081  if (image)
1082  {
1085  }
1086  break;
1087 
1088  case IDC_ROT_COUNCW:
1089  if (image)
1090  {
1093  }
1094  break;
1095 
1096  case IDC_DELETE:
1097  return ImageView_Delete(hwnd);
1098 
1099  case IDC_MODIFY:
1100  return ImageView_Modify(hwnd);
1101  }
1102  }
1103  break;
1104 
1105  case WM_MOUSEWHEEL:
1109  break;
1110 
1111  case WM_NOTIFY:
1112  {
1113  LPNMHDR pnmhdr = (LPNMHDR)lParam;
1114 
1115  switch (pnmhdr->code)
1116  {
1117  case TTN_GETDISPINFO:
1118  {
1119  LPTOOLTIPTEXTW lpttt;
1120 
1121  lpttt = (LPTOOLTIPTEXTW)lParam;
1122  lpttt->hinst = hInstance;
1123 
1124  lpttt->lpszText = MAKEINTRESOURCEW(BtnConfig[lpttt->hdr.idFrom - IDC_TOOL_BASE].ids);
1125  return 0;
1126  }
1127  }
1128  break;
1129  }
1130  case WM_SIZING:
1131  {
1132  LPRECT pRect = (LPRECT)lParam;
1133  if (pRect->right-pRect->left < 350)
1134  pRect->right = pRect->left + 350;
1135 
1136  if (pRect->bottom-pRect->top < 290)
1137  pRect->bottom = pRect->top + 290;
1138  return TRUE;
1139  }
1140  case WM_SIZE:
1141  {
1143  return 0;
1144  }
1145  case WM_DESTROY:
1146  {
1149  PostQuitMessage(0);
1150  break;
1151  }
1152  }
1153 
1155 }
#define IDC_ROT_CLOCKW
Definition: resource.h:36
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void UpdateZoom(UINT NewZoom)
Definition: shimgvw.c:245
#define IDC_MODIFY
Definition: resource.h:41
WNDPROC PrevProc
Definition: shimgvw.c:42
#define IDC_ZOOM_OUT
Definition: resource.h:35
#define TRUE
Definition: types.h:120
#define IDC_REAL_SIZE
Definition: resource.h:32
#define WM_MOUSEWHEEL
Definition: treelist.c:96
LONG top
Definition: windef.h:307
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
static const TB_BUTTON_CONFIG BtnConfig[]
Definition: shimgvw.c:96
#define IDC_DELETE
Definition: resource.h:38
LONG left
Definition: windef.h:306
struct SHIMGVW_FILENODE_INTERNAL * Next
Definition: shimgvw.h:21
LONG right
Definition: windef.h:308
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_TOOL_BASE
Definition: resource.h:27
UINT code
Definition: winuser.h:3134
GpStatus WINGDIPAPI GdipImageRotateFlip(GpImage *image, RotateFlipType type)
Definition: image.c:5358
static LRESULT ImageView_Modify(HWND hwnd)
Definition: shimgvw.c:986
#define FALSE
Definition: types.h:117
short SHORT
Definition: pedump.c:59
static VOID pPrintImage(HWND hwnd)
Definition: shimgvw.c:493
#define TTN_GETDISPINFO
Definition: commctrl.h:1878
#define IDC_ROT_COUNCW
Definition: resource.h:37
#define WM_SIZING
Definition: winuser.h:1789
LONG_PTR LPARAM
Definition: windef.h:208
#define LPRECT
Definition: precomp.h:28
#define IDC_ZOOM_IN
Definition: resource.h:34
static VOID ImageView_UpdateWindow(HWND hwnd)
Definition: shimgvw.c:675
#define WM_DESTROY
Definition: winuser.h:1591
#define IDC_SAVEAS
Definition: resource.h:17
SHIMGVW_FILENODE * currentFile
Definition: shimgvw.c:40
static VOID pLoadImageFromNode(SHIMGVW_FILENODE *node, HWND hwnd)
Definition: shimgvw.c:506
#define WM_SIZE
Definition: winuser.h:1593
#define IDC_SLIDE_SHOW
Definition: resource.h:33
static void ZoomInOrOut(BOOL bZoomIn)
Definition: shimgvw.c:275
#define LPTOOLTIPTEXTW
Definition: commctrl.h:1887
static LRESULT ImageView_Delete(HWND hwnd)
Definition: shimgvw.c:979
HWND hDispWnd
Definition: shimgvw.c:44
CHAR Message[80]
Definition: alive.c:5
static const WCHAR L[]
Definition: oid.c:1250
static VOID ImageView_OnMouseWheel(HWND hwnd, INT x, INT y, INT zDelta, UINT fwKeys)
Definition: shimgvw.c:951
static VOID ImageView_OnSize(HWND hwnd, UINT state, INT cx, INT cy)
Definition: shimgvw.c:960
#define WM_COMMAND
Definition: winuser.h:1722
#define GWLP_WNDPROC
Definition: treelist.c:66
struct SHIMGVW_FILENODE_INTERNAL * Prev
Definition: shimgvw.h:20
#define IDC_NEXT_PIC
Definition: resource.h:30
#define IDC_BEST_FIT
Definition: resource.h:31
unsigned int UINT
Definition: ndis.h:50
HINSTANCE hInstance
Definition: shimgvw.c:38
#define DPRINT1
Definition: precomp.h:8
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
#define IDC_PREV_PIC
Definition: resource.h:29
#define WM_CREATE
Definition: winuser.h:1590
#define HIWORD(l)
Definition: typedefs.h:247
static void pSaveImageAs(HWND hwnd)
Definition: shimgvw.c:384
LONG bottom
Definition: windef.h:309
static VOID ImageView_InitControls(HWND hwnd)
Definition: shimgvw.c:932
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static VOID ImageView_SaveSettings(HWND hwnd)
Definition: shimgvw.c:835
#define IDC_PRINT
Definition: fontview.h:14
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by ImageView_CreateWindow().

◆ pBuildFileList()

static SHIMGVW_FILENODE* pBuildFileList ( LPWSTR  szFirstFile)
static

Definition at line 543 of file shimgvw.c.

544 {
545  HANDLE hFindHandle;
546  WCHAR *extension;
547  WCHAR szSearchPath[MAX_PATH];
548  WCHAR szSearchMask[MAX_PATH];
549  WCHAR szFileTypes[MAX_PATH];
550  WIN32_FIND_DATAW findData;
551  SHIMGVW_FILENODE *currentNode = NULL;
553  SHIMGVW_FILENODE *conductor = NULL;
554  ImageCodecInfo *codecInfo;
555  UINT num;
556  UINT size;
557  UINT j;
558 
559  StringCbCopyW(szSearchPath, sizeof(szSearchPath), szFirstFile);
560  PathRemoveFileSpecW(szSearchPath);
561 
563  codecInfo = malloc(size);
564  if (!codecInfo)
565  {
566  DPRINT1("malloc() failed in pLoadFileList()\n");
567  return NULL;
568  }
569 
570  GdipGetImageDecoders(num, size, codecInfo);
571 
572  root = malloc(sizeof(SHIMGVW_FILENODE));
573  if (!root)
574  {
575  DPRINT1("malloc() failed in pLoadFileList()\n");
576  free(codecInfo);
577  return NULL;
578  }
579 
580  conductor = root;
581 
582  for (j = 0; j < num; ++j)
583  {
584  StringCbCopyW(szFileTypes, sizeof(szFileTypes), codecInfo[j].FilenameExtension);
585 
586  extension = wcstok(szFileTypes, L";");
587  while (extension != NULL)
588  {
589  PathCombineW(szSearchMask, szSearchPath, extension);
590 
591  hFindHandle = FindFirstFileW(szSearchMask, &findData);
592  if (hFindHandle != INVALID_HANDLE_VALUE)
593  {
594  do
595  {
596  PathCombineW(conductor->FileName, szSearchPath, findData.cFileName);
597 
598  // compare the name of the requested file with the one currently found.
599  // if the name matches, the current node is returned by the function.
600  if (wcscmp(szFirstFile, conductor->FileName) == 0)
601  {
602  currentNode = conductor;
603  }
604 
605  conductor->Next = malloc(sizeof(SHIMGVW_FILENODE));
606 
607  // if malloc fails, make circular what we have and return it
608  if (!conductor->Next)
609  {
610  DPRINT1("malloc() failed in pLoadFileList()\n");
611 
612  conductor->Next = root;
613  root->Prev = conductor;
614 
615  FindClose(hFindHandle);
616  free(codecInfo);
617  return conductor;
618  }
619 
620  conductor->Next->Prev = conductor;
621  conductor = conductor->Next;
622  }
623  while (FindNextFileW(hFindHandle, &findData) != 0);
624 
625  FindClose(hFindHandle);
626  }
627 
628  extension = wcstok(NULL, L";");
629  }
630  }
631 
632  // we now have a node too much in the list. In case the requested file was not found,
633  // we use this node to store the name of it, otherwise we free it.
634  if (currentNode == NULL)
635  {
636  StringCchCopyW(conductor->FileName, MAX_PATH, szFirstFile);
637  currentNode = conductor;
638  }
639  else
640  {
641  conductor = conductor->Prev;
642  free(conductor->Next);
643  }
644 
645  // link the last node with the first one to make the list circular
646  conductor->Next = root;
647  root->Prev = conductor;
648  conductor = currentNode;
649 
650  free(codecInfo);
651 
652  return conductor;
653 }
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
Definition: path.c:624
#define free
Definition: debug_ros.c:5
struct _root root
_Check_return_ _CRTIMP wchar_t *__cdecl wcstok(_Inout_opt_z_ wchar_t *_Str, _In_z_ const wchar_t *_Delim)
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
struct SHIMGVW_FILENODE_INTERNAL * Next
Definition: shimgvw.h:21
GpStatus WINGDIPAPI GdipGetImageDecodersSize(UINT *numDecoders, UINT *size)
Definition: image.c:4946
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
GpStatus WINGDIPAPI GdipGetImageDecoders(UINT numDecoders, UINT size, ImageCodecInfo *decoders)
Definition: image.c:4970
WCHAR FileName[MAX_PATH]
Definition: shimgvw.h:19
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
GLuint GLuint num
Definition: glext.h:9618
static const WCHAR L[]
Definition: oid.c:1250
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
struct SHIMGVW_FILENODE_INTERNAL * Prev
Definition: shimgvw.h:20
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
#define malloc
Definition: debug_ros.c:4
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
Definition: path.c:189
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502

Referenced by ImageView_CreateWindow().

◆ pFreeFileList()

static VOID pFreeFileList ( SHIMGVW_FILENODE root)
static

Definition at line 656 of file shimgvw.c.

657 {
658  SHIMGVW_FILENODE *conductor;
659 
660  if (!root)
661  return;
662 
663  root->Prev->Next = NULL;
664  root->Prev = NULL;
665 
666  while (root)
667  {
668  conductor = root;
669  root = conductor->Next;
670  free(conductor);
671  }
672 }
#define free
Definition: debug_ros.c:5
struct _root root
struct SHIMGVW_FILENODE_INTERNAL * Next
Definition: shimgvw.h:21
#define NULL
Definition: types.h:112

Referenced by ImageView_CreateWindow().

◆ pLoadImage()

static void pLoadImage ( LPCWSTR  szOpenFileName)
static

Definition at line 359 of file shimgvw.c.

360 {
361  /* check file presence */
362  if (GetFileAttributesW(szOpenFileName) == 0xFFFFFFFF)
363  {
364  DPRINT1("File %s not found!\n", szOpenFileName);
365  return;
366  }
367 
368  /* load now */
369  GdipLoadImageFromFile(szOpenFileName, &image);
370  if (!image)
371  {
372  DPRINT1("GdipLoadImageFromFile() failed\n");
373  return;
374  }
375  Anime_LoadInfo();
376 
377  if (szOpenFileName && szOpenFileName[0])
378  SHAddToRecentDocs(SHARD_PATHW, szOpenFileName);
379 
380  /* Reset zoom and redraw display */
381  ResetZoom();
382 }
static void ResetZoom(void)
Definition: shimgvw.c:314
GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR *filename, GpImage **image)
Definition: image.c:2928
void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
Definition: shellord.c:809
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
static BOOL Anime_LoadInfo(void)
Definition: shimgvw.c:136
#define SHARD_PATHW
Definition: shlobj.h:1103
#define DPRINT1
Definition: precomp.h:8

Referenced by ImageView_CreateWindow(), and pLoadImageFromNode().

◆ pLoadImageFromNode()

static VOID pLoadImageFromNode ( SHIMGVW_FILENODE node,
HWND  hwnd 
)
static

Definition at line 506 of file shimgvw.c.

507 {
508  WCHAR szTitleBuf[800];
509  WCHAR szResStr[512];
510  LPWSTR pchFileTitle;
511 
512  if (image)
513  {
515  image = NULL;
516  }
517 
518  if (node == NULL)
519  {
521  return;
522  }
523 
524  pLoadImage(node->FileName);
525 
526  LoadStringW(hInstance, IDS_APPTITLE, szResStr, _countof(szResStr));
527  if (image != NULL)
528  {
529  pchFileTitle = PathFindFileNameW(node->FileName);
530  StringCbPrintfW(szTitleBuf, sizeof(szTitleBuf),
531  L"%ls%ls%ls", szResStr, L" - ", pchFileTitle);
532  SetWindowTextW(hwnd, szTitleBuf);
533  }
534  else
535  {
536  SetWindowTextW(hwnd, szResStr);
537  }
538 
540 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDS_APPTITLE
Definition: resource.h:3
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define FALSE
Definition: types.h:117
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:389
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
static const WCHAR L[]
Definition: oid.c:1250
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
Definition: image.c:2107
#define NULL
Definition: types.h:112
HINSTANCE hInstance
Definition: shimgvw.c:38
static VOID EnableToolBarButtons(BOOL bEnable)
Definition: shimgvw.c:499
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static void pLoadImage(LPCWSTR szOpenFileName)
Definition: shimgvw.c:359
Definition: dlist.c:348

Referenced by ImageView_CreateWindow(), and ImageView_WndProc().

◆ pPrintImage()

static VOID pPrintImage ( HWND  hwnd)
static

Definition at line 493 of file shimgvw.c.

494 {
495  /* FIXME */
496 }

Referenced by ImageView_WndProc().

◆ pSaveImageAs()

static void pSaveImageAs ( HWND  hwnd)
static

Definition at line 384 of file shimgvw.c.

385 {
387  ImageCodecInfo *codecInfo;
388  WCHAR szSaveFileName[MAX_PATH];
389  WCHAR *szFilterMask;
390  GUID rawFormat;
391  UINT num;
392  UINT size;
393  size_t sizeRemain;
394  UINT j;
395  WCHAR *c;
396 
397  if (image == NULL)
398  return;
399 
401  codecInfo = malloc(size);
402  if (!codecInfo)
403  {
404  DPRINT1("malloc() failed in pSaveImageAs()\n");
405  return;
406  }
407 
408  GdipGetImageEncoders(num, size, codecInfo);
409  GdipGetImageRawFormat(image, &rawFormat);
410 
411  sizeRemain = 0;
412 
413  for (j = 0; j < num; ++j)
414  {
415  // Every pair needs space for the Description, twice the Extensions, 1 char for the space, 2 for the braces and 2 for the NULL terminators.
416  sizeRemain = sizeRemain + (((wcslen(codecInfo[j].FormatDescription) + (wcslen(codecInfo[j].FilenameExtension) * 2) + 5) * sizeof(WCHAR)));
417  }
418 
419  /* Add two more chars for the last terminator */
420  sizeRemain = sizeRemain + (sizeof(WCHAR) * 2);
421 
422  szFilterMask = malloc(sizeRemain);
423  if (!szFilterMask)
424  {
425  DPRINT1("cannot allocate memory for filter mask in pSaveImageAs()");
426  free(codecInfo);
427  return;
428  }
429 
430  ZeroMemory(szSaveFileName, sizeof(szSaveFileName));
431  ZeroMemory(szFilterMask, sizeRemain);
432  ZeroMemory(&sfn, sizeof(sfn));
433  sfn.lStructSize = sizeof(sfn);
434  sfn.hwndOwner = hwnd;
436  sfn.lpstrFile = szSaveFileName;
437  sfn.lpstrFilter = szFilterMask;
440 
441  c = szFilterMask;
442 
443  for (j = 0; j < num; ++j)
444  {
445  StringCbPrintfExW(c, sizeRemain, &c, &sizeRemain, 0, L"%ls (%ls)", codecInfo[j].FormatDescription, codecInfo[j].FilenameExtension);
446 
447  /* Skip the NULL character */
448  c++;
449  sizeRemain -= sizeof(*c);
450 
451  StringCbPrintfExW(c, sizeRemain, &c, &sizeRemain, 0, L"%ls", codecInfo[j].FilenameExtension);
452 
453  /* Skip the NULL character */
454  c++;
455  sizeRemain -= sizeof(*c);
456 
457  if (IsEqualGUID(&rawFormat, &codecInfo[j].FormatID) != FALSE)
458  {
459  sfn.nFilterIndex = j + 1;
460  }
461  }
462 
463  if (GetSaveFileNameW(&sfn))
464  {
465  if (m_pDelayItem)
466  {
467  /* save animation */
469 
470  DPRINT1("FIXME: save animation\n");
471  if (GdipSaveImageToFile(image, szSaveFileName, &codecInfo[sfn.nFilterIndex - 1].Clsid, NULL) != Ok)
472  {
473  DPRINT1("GdipSaveImageToFile() failed\n");
474  }
475 
477  }
478  else
479  {
480  /* save non-animation */
481  if (GdipSaveImageToFile(image, szSaveFileName, &codecInfo[sfn.nFilterIndex - 1].Clsid, NULL) != Ok)
482  {
483  DPRINT1("GdipSaveImageToFile() failed\n");
484  }
485  }
486  }
487 
488  free(szFilterMask);
489  free(codecInfo);
490 }
#define OFN_EXPLORER
Definition: commdlg.h:104
HINSTANCE hInstance
Definition: commdlg.h:362
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
DWORD Flags
Definition: commdlg.h:373
GpStatus WINGDIPAPI GdipGetImageEncoders(UINT numEncoders, UINT size, ImageCodecInfo *encoders)
Definition: image.c:5021
LPCWSTR lpstrFilter
Definition: commdlg.h:363
#define free
Definition: debug_ros.c:5
LPWSTR lpstrFile
Definition: commdlg.h:367
#define ZeroMemory
Definition: winbase.h:1664
GpStatus WINGDIPAPI GdipSaveImageToFile(GpImage *image, GDIPCONST WCHAR *filename, GDIPCONST CLSID *clsidEncoder, GDIPCONST EncoderParameters *encoderParams)
Definition: image.c:4428
#define ANIME_TIMER_ID
Definition: shimgvw.c:121
BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn)
Definition: filedlg.c:4742
DWORD lStructSize
Definition: commdlg.h:360
#define FALSE
Definition: types.h:117
GpStatus WINGDIPAPI GdipGetImageRawFormat(GpImage *image, GUID *format)
Definition: image.c:2306
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
DWORD nFilterIndex
Definition: commdlg.h:366
GLsizeiptr size
Definition: glext.h:5919
OPENFILENAMEW sfn
Definition: eventvwr.c:120
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
const GLubyte * c
Definition: glext.h:8905
GLuint GLuint num
Definition: glext.h:9618
DWORD nMaxFile
Definition: commdlg.h:368
HWND hDispWnd
Definition: shimgvw.c:44
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
HWND hwndOwner
Definition: commdlg.h:361
static const WCHAR L[]
Definition: oid.c:1250
PropertyItem * m_pDelayItem
Definition: shimgvw.c:119
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
GpStatus WINGDIPAPI GdipGetImageEncodersSize(UINT *numEncoders, UINT *size)
Definition: image.c:4997
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
STRSAFEAPI StringCbPrintfExW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:623
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
HINSTANCE hInstance
Definition: shimgvw.c:38
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define DPRINT1
Definition: precomp.h:8
#define c
Definition: ke_i.h:80
#define malloc
Definition: debug_ros.c:4

Referenced by ImageView_WndProc().

◆ ResetZoom()

static void ResetZoom ( void  )
static

Definition at line 314 of file shimgvw.c.

315 {
316  RECT Rect;
317  UINT ImageWidth, ImageHeight, NewZoom;
318 
319  if (image == NULL)
320  return;
321 
322  /* get disp window size and image size */
324  GdipGetImageWidth(image, &ImageWidth);
325  GdipGetImageHeight(image, &ImageHeight);
326 
327  /* compare two aspect rates. same as
328  (ImageHeight / ImageWidth < Rect.bottom / Rect.right) in real */
329  if (ImageHeight * Rect.right < Rect.bottom * ImageWidth)
330  {
331  if (Rect.right < ImageWidth)
332  {
333  /* it's large, shrink it */
334  NewZoom = (Rect.right * 100) / ImageWidth;
335  }
336  else
337  {
338  /* it's small. show as original size */
339  NewZoom = 100;
340  }
341  }
342  else
343  {
344  if (Rect.bottom < ImageHeight)
345  {
346  /* it's large, shrink it */
347  NewZoom = (Rect.bottom * 100) / ImageHeight;
348  }
349  else
350  {
351  /* it's small. show as original size */
352  NewZoom = 100;
353  }
354  }
355 
356  UpdateZoom(NewZoom);
357 }
static void UpdateZoom(UINT NewZoom)
Definition: shimgvw.c:245
GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width)
Definition: image.c:2342
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
Definition: image.c:2239
HWND hDispWnd
Definition: shimgvw.c:44
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
struct Rect Rect

Referenced by ImageView_OnSize(), and pLoadImage().

◆ UpdateZoom()

static void UpdateZoom ( UINT  NewZoom)
static

Definition at line 245 of file shimgvw.c.

246 {
247  BOOL bEnableZoomIn, bEnableZoomOut;
248 
249  /* If zoom has not been changed, ignore it */
250  if (ZoomPercents == NewZoom)
251  return;
252 
253  ZoomPercents = NewZoom;
254 
255  /* Check if a zoom button of the toolbar must be grayed */
256  bEnableZoomIn = bEnableZoomOut = TRUE;
257 
258  if (NewZoom >= MAX_ZOOM)
259  {
260  bEnableZoomIn = FALSE;
261  }
262  else if (NewZoom <= MIN_ZOOM)
263  {
264  bEnableZoomOut = FALSE;
265  }
266 
267  /* Update the state of the zoom buttons */
270 
271  /* Redraw the display window */
273 }
#define IDC_ZOOM_OUT
Definition: resource.h:35
#define TRUE
Definition: types.h:120
UINT ZoomPercents
Definition: shimgvw.c:47
#define MAX_ZOOM
Definition: shimgvw.c:55
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TB_ENABLEBUTTON
Definition: commctrl.h:1042
#define IDC_ZOOM_IN
Definition: resource.h:34
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HWND hDispWnd
Definition: shimgvw.c:44
#define MIN_ZOOM
Definition: shimgvw.c:54
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NULL
Definition: types.h:112
HWND hToolBar
Definition: shimgvw.c:44

Referenced by ImageView_WndProc(), ResetZoom(), and ZoomInOrOut().

◆ ZoomInOrOut()

static void ZoomInOrOut ( BOOL  bZoomIn)
static

Definition at line 275 of file shimgvw.c.

276 {
277  UINT i, NewZoom;
278 
279  if (image == NULL)
280  return;
281 
282  if (bZoomIn) /* zoom in */
283  {
284  /* find next step */
285  for (i = 0; i < _countof(ZoomSteps); ++i)
286  {
287  if (ZoomPercents < ZoomSteps[i])
288  break;
289  }
290  if (i == _countof(ZoomSteps))
291  NewZoom = MAX_ZOOM;
292  else
293  NewZoom = ZoomSteps[i];
294  }
295  else /* zoom out */
296  {
297  /* find previous step */
298  for (i = _countof(ZoomSteps); i > 0; )
299  {
300  --i;
301  if (ZoomSteps[i] < ZoomPercents)
302  break;
303  }
304  if (i < 0)
305  NewZoom = MIN_ZOOM;
306  else
307  NewZoom = ZoomSteps[i];
308  }
309 
310  /* Update toolbar and refresh screen */
311  UpdateZoom(NewZoom);
312 }
static void UpdateZoom(UINT NewZoom)
Definition: shimgvw.c:245
UINT ZoomPercents
Definition: shimgvw.c:47
#define MAX_ZOOM
Definition: shimgvw.c:55
static const UINT ZoomSteps[]
Definition: shimgvw.c:49
#define _countof(array)
Definition: sndvol32.h:68
#define MIN_ZOOM
Definition: shimgvw.c:54
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112

Referenced by ImageView_OnMouseWheel(), and ImageView_WndProc().

Variable Documentation

◆ BtnConfig

const TB_BUTTON_CONFIG BtnConfig[]
static
Initial value:
=
{
DEFINE_BTN_CONFIG(PREV_PIC),
DEFINE_BTN_CONFIG(NEXT_PIC),
DEFINE_BTN_CONFIG(BEST_FIT),
DEFINE_BTN_CONFIG(REAL_SIZE),
DEFINE_BTN_CONFIG(ZOOM_OUT),
DEFINE_BTN_CONFIG(ROT_CLOCKW),
DEFINE_BTN_CONFIG(ROT_COUNCW),
}
#define MODIFY(p, i, v)
Definition: check.c:44
#define SLIDE_SHOW
#define DEFINE_BTN_CONFIG(_name)
Definition: shimgvw.c:94
#define DELETE
Definition: nt_native.h:57

Definition at line 96 of file shimgvw.c.

Referenced by ImageView_CreateToolBar(), and ImageView_WndProc().

◆ Buttons

const TBBUTTON Buttons[]
static
Initial value:
=
{
DEFINE_BTN_INFO(PREV_PIC),
DEFINE_BTN_INFO(NEXT_PIC),
DEFINE_BTN_INFO(BEST_FIT),
DEFINE_BTN_INFO(REAL_SIZE),
DEFINE_BTN_INFO(ZOOM_IN),
DEFINE_BTN_INFO(ZOOM_OUT),
DEFINE_BTN_INFO(ROT_CLOCKW),
DEFINE_BTN_INFO(ROT_COUNCW),
DEFINE_BTN_INFO(SAVEAS),
}
#define MODIFY(p, i, v)
Definition: check.c:44
#define DEFINE_BTN_SEPARATOR
Definition: shimgvw.c:67
#define DEFINE_BTN_INFO(_name)
Definition: shimgvw.c:64
#define SLIDE_SHOW
#define DELETE
Definition: nt_native.h:57

Definition at line 71 of file shimgvw.c.

Referenced by ImageView_CreateToolBar().

◆ currentFile

SHIMGVW_FILENODE* currentFile

Definition at line 40 of file shimgvw.c.

Referenced by ImageView_CreateWindow(), ImageView_Modify(), and ImageView_WndProc().

◆ hDispWnd

◆ hInstance

◆ hToolBar

HWND hToolBar

◆ image

Definition at line 41 of file shimgvw.c.

◆ m_nFrameCount

UINT m_nFrameCount = 0

◆ m_nFrameIndex

UINT m_nFrameIndex = 0

Definition at line 115 of file shimgvw.c.

Referenced by Anime_FreeInfo(), Anime_GetFrameDelay(), Anime_SetFrameIndex(), and Anime_Step().

◆ m_nLoopCount

UINT m_nLoopCount = (UINT)-1

Definition at line 118 of file shimgvw.c.

Referenced by Anime_FreeInfo(), Anime_LoadInfo(), and Anime_Step().

◆ m_nLoopIndex

UINT m_nLoopIndex = 0

Definition at line 117 of file shimgvw.c.

Referenced by Anime_FreeInfo(), and Anime_Step().

◆ m_pDelayItem

PropertyItem* m_pDelayItem = NULL

Definition at line 119 of file shimgvw.c.

Referenced by Anime_FreeInfo(), Anime_GetFrameDelay(), Anime_LoadInfo(), and pSaveImageAs().

◆ PrevProc

WNDPROC PrevProc = NULL

Definition at line 42 of file shimgvw.c.

Referenced by ImageView_DispWndProc(), ImageView_InitControls(), and ImageView_WndProc().

◆ shiSettings

◆ ZoomPercents

UINT ZoomPercents = 100

Definition at line 47 of file shimgvw.c.

Referenced by ImageView_DrawImage(), UpdateZoom(), and ZoomInOrOut().

◆ ZoomSteps

const UINT ZoomSteps[]
static
Initial value:
=
{
10, 25, 50, 100, 200, 400, 800, 1600
}

Definition at line 49 of file shimgvw.c.

Referenced by ZoomInOrOut().