9 #define WIN32_NO_STATUS 11 #define COM_NO_WINDOWS_H 51 10, 25, 50, 100, 200, 400, 800, 1600
61 #define ANIME_TIMER_ID 9999 143 guid = FrameDimensionPage;
241 UINT ImageWidth, ImageHeight;
253 if (ImageHeight *
Rect.right <
Rect.bottom * ImageWidth)
255 if (
Rect.right < ImageWidth)
268 if (
Rect.bottom < ImageHeight)
302 DPRINT1(
"File %s not found!\n", szOpenFileName);
310 DPRINT1(
"GdipLoadImageFromFile() failed\n");
315 if (szOpenFileName && szOpenFileName[0])
345 DPRINT1(
"malloc() failed in pSaveImageAs()\n");
357 sizeRemain = sizeRemain + (((
wcslen(codecInfo[
j].FormatDescription) + (
wcslen(codecInfo[
j].FilenameExtension) * 2) + 5) *
sizeof(
WCHAR)));
361 sizeRemain = sizeRemain + (
sizeof(
WCHAR) * 2);
363 szFilterMask =
malloc(sizeRemain);
366 DPRINT1(
"cannot allocate memory for filter mask in pSaveImageAs()");
371 ZeroMemory(szSaveFileName,
sizeof(szSaveFileName));
386 StringCbPrintfExW(
c, sizeRemain, &
c, &sizeRemain, 0,
L"%ls (%ls)", codecInfo[
j].FormatDescription, codecInfo[
j].FilenameExtension);
390 sizeRemain -=
sizeof(*c);
396 sizeRemain -=
sizeof(*c);
411 DPRINT1(
"FIXME: save animation\n");
414 DPRINT1(
"GdipSaveImageToFile() failed\n");
424 DPRINT1(
"GdipSaveImageToFile() failed\n");
449 WCHAR szTitleBuf[800];
472 L"%ls%ls%ls", szResStr,
L" - ", pchFileTitle);
500 StringCbCopyW(szSearchPath,
sizeof(szSearchPath), szFirstFile);
507 DPRINT1(
"malloc() failed in pLoadFileList()\n");
516 DPRINT1(
"malloc() failed in pLoadFileList()\n");
525 StringCbCopyW(szFileTypes,
sizeof(szFileTypes), codecInfo[
j].FilenameExtension);
527 extension =
wcstok(szFileTypes,
L";");
528 while (extension !=
NULL)
543 currentNode = conductor;
549 if (!conductor->
Next)
551 DPRINT1(
"malloc() failed in pLoadFileList()\n");
554 root->Prev = conductor;
561 conductor->
Next->Prev = conductor;
562 conductor = conductor->
Next;
575 if (currentNode ==
NULL)
578 currentNode = conductor;
582 conductor = conductor->
Prev;
588 root->Prev = conductor;
589 conductor = currentNode;
622 "\x28\x00\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x01\x00\x04\x00\x00\x00" 623 "\x00\x00\x80\x00\x00\x00\x23\x2E\x00\x00\x23\x2E\x00\x00\x10\x00\x00\x00" 624 "\x00\x00\x00\x00\x99\x99\x99\x00\xCC\xCC\xCC\x00\x00\x00\x00\x00\x00\x00" 625 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 626 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 627 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x11\x11\x11" 628 "\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00" 629 "\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00" 630 "\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11" 631 "\x11\x11\x00\x00\x00\x00\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00" 632 "\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11" 633 "\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11" 634 "\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11";
643 UINT ImageWidth, ImageHeight;
644 INT ZoomedWidth, ZoomedHeight,
x,
y;
657 DPRINT1(
"BeginPaint() failed\n");
664 DPRINT1(
"GdipCreateFromHDC() failed\n");
693 x = (
rect.right - ZoomedWidth) / 2;
694 y = (
rect.bottom - ZoomedHeight) / 2;
701 margin.
top =
y + ZoomedHeight + 1;
706 margin.
bottom =
y + ZoomedHeight + 1;
710 margin.
left =
x + ZoomedWidth + 1;
714 DPRINT(
"x = %d, y = %d, ImageWidth = %u, ImageHeight = %u\n");
715 DPRINT(
"rect.right = %ld, rect.bottom = %ld\n",
rect.right,
rect.bottom);
716 DPRINT(
"ZoomPercents = %d, ZoomedWidth = %d, ZoomedHeight = %d\n",
1032 switch (pnmhdr->
code)
1040 idButton = (
UINT)lpttt->hdr.idFrom;
1132 WndClass.lpszClassName =
_T(
"shimgvw_window");
1149 wcscpy(szInitialFile, szFileName);
1209 DPRINT(
"ImageView_PrintTo() not implemented\n");
1215 DPRINT(
"ImageView_PrintToA() not implemented\n");
1221 DPRINT(
"ImageView_PrintToW() not implemented\n");
VOID WINAPI ImageView_PrintToW(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
SHIMGVW_SETTINGS shiSettings
GpStatus WINGDIPAPI GdipGetImageEncoders(UINT numEncoders, UINT size, ImageCodecInfo *encoders)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
static BOOL ImageView_LoadSettings()
#define TB_BUTTONSTRUCTSIZE
#define IDS_TOOLTIP_ROT_COUNCW
#define PropertyTagLoopCount
GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, GDIPCONST GUID *dimensionID, UINT *count)
static void ResetZoom(void)
struct _WINDOWPLACEMENT WINDOWPLACEMENT
GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR *filename, GpImage **image)
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
ACPI_SIZE strlen(const char *String)
GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width)
#define DLL_THREAD_ATTACH
#define IDS_TOOLTIP_NEXT_PIC
#define HKEY_CURRENT_USER
TW_UINT32 TW_UINT16 TW_UINT16 MSG
GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage *image, PROPID propid, UINT *size)
VOID WINAPI ImageView_FullscreenA(HWND hwnd, HINSTANCE hInst, LPCSTR path, int nShow)
BOOL WINAPI UpdateWindow(_In_ HWND)
_Check_return_ _CRTIMP wchar_t *__cdecl wcstok(_Inout_opt_z_ wchar_t *_Str, _In_z_ const wchar_t *_Delim)
VOID WINAPI ImageView_Fullscreen(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define INVALID_HANDLE_VALUE
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
#define DLL_PROCESS_ATTACH
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define WPF_RESTORETOMAXIMIZED
GpStatus WINGDIPAPI GdipGetImageFlags(GpImage *image, UINT *flags)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
struct SHIMGVW_FILENODE_INTERNAL * Next
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL Anime_Step(DWORD *pdwDelay)
GpStatus WINGDIPAPI GdipSaveImageToFile(GpImage *image, GDIPCONST WCHAR *filename, GDIPCONST CLSID *clsidEncoder, GDIPCONST EncoderParameters *encoderParams)
LRESULT CALLBACK ImageView_DispWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
VOID WINAPI ImageView_PrintTo(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
static const UINT ZoomSteps[]
static BOOL ImageView_CreateToolBar(HWND hwnd)
static IN DWORD IN LPVOID lpvReserved
BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn)
struct tagNMHDR * LPNMHDR
#define IDS_TOOLTIP_PREV_PIC
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
GpStatus WINGDIPAPI GdipGetImageDecodersSize(UINT *numDecoders, UINT *size)
GpStatus WINGDIPAPI GdipImageRotateFlip(GpImage *image, RotateFlipType type)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
LONG WINAPI RegCloseKey(HKEY hKey)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
static const WCHAR szText[]
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define IDS_TOOLTIP_ZOOM_OUT
GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode mode)
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
LRESULT CALLBACK ImageView_WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
static VOID pPrintImage(HWND hwnd)
_Out_opt_ int _Out_opt_ int * cy
DWORD Anime_GetFrameDelay(UINT nFrameIndex)
static SHIMGVW_FILENODE * pBuildFileList(LPWSTR szFirstFile)
#define PropertyTagFrameDelay
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
LONG WINAPI ImageView_CreateWindow(HWND hwnd, LPWSTR szFileName)
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
GpStatus WINGDIPAPI GdipGetImageRawFormat(GpImage *image, GUID *format)
GpStatus WINGDIPAPI GdipGetImageDecoders(UINT numDecoders, UINT size, ImageCodecInfo *decoders)
static VOID ImageView_UpdateWindow(HWND hwnd)
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
static BOOL Anime_LoadInfo(void)
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
SHIMGVW_FILENODE * currentFile
#define REG_OPTION_NON_VOLATILE
static void Anime_FreeInfo(void)
GpStatus WINGDIPAPI GdipImageSelectActiveFrame(GpImage *image, GDIPCONST GUID *dimensionID, UINT frame)
static VOID pLoadImageFromNode(SHIMGVW_FILENODE *node, HWND hwnd)
#define IDS_TOOLTIP_ZOOM_IN
GpStatus WINGDIPAPI GdipDrawImageRectI(GpGraphics *graphics, GpImage *image, INT x, INT y, INT width, INT height)
GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics, InterpolationMode mode)
static void ZoomInOrOut(BOOL bZoomIn)
void WINAPI GdiplusShutdown(ULONG_PTR)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
GpStatus WINGDIPAPI GdipGetPropertyItem(GpImage *image, PROPID propid, UINT size, PropertyItem *buffer)
VOID WINAPI ImageView_FullscreenW(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static VOID ImageView_OnMouseWheel(HWND hwnd, INT x, INT y, INT zDelta, UINT fwKeys)
static VOID pFreeFileList(SHIMGVW_FILENODE *root)
PropertyItem * m_pDelayItem
static VOID ImageView_OnSize(HWND hwnd, UINT state, INT cx, INT cy)
GpStatus WINGDIPAPI GdipGetImageEncodersSize(UINT *numEncoders, UINT *size)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
static void Anime_SetFrameIndex(UINT nFrameIndex)
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
#define IDS_TOOLTIP_SAVEAS
static VOID ImageView_DrawImage(HWND hwnd)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
static HBRUSH CreateCheckerBoardBrush(HDC hdc)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
Gdiplus::GdiplusStartupInput gdiplusStartupInput
BOOL WINAPI DllMain(IN HINSTANCE hinstDLL, IN DWORD dwReason, IN LPVOID lpvReserved)
static void ImageView_OnTimer(HWND hwnd)
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
struct SHIMGVW_FILENODE_INTERNAL * Prev
#define OFN_OVERWRITEPROMPT
VOID WINAPI PathUnquoteSpacesW(LPWSTR lpszPath)
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
STRSAFEAPI StringCbPrintfExW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat,...)
BOOL WINAPI IsZoomed(_In_ HWND)
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
static void pLoadImage(LPWSTR szOpenFileName)
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount(GpImage *image, UINT *count)
GLint GLint GLint GLint GLint GLint y
#define MultiByteToWideChar
static VOID EnableToolBarButtons(BOOL bEnable)
#define WS_OVERLAPPEDWINDOW
static void pSaveImageAs(HWND hwnd)
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList(GpImage *image, GUID *dimensionIDs, UINT count)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static VOID ImageView_InitControls(HWND hwnd)
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
static const TBBUTTON Buttons[]
static VOID ImageView_SaveSettings(HWND hwnd)
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
HBRUSH WINAPI CreateDIBPatternBrushPt(_In_ const VOID *pvPackedDIB, _In_ UINT uUsage)
#define IDS_TOOLTIP_ROT_CLOCKW
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
VOID WINAPI ImageView_PrintToA(HWND hwnd, HINSTANCE hInst, LPCSTR path, int nShow)
#define TB_SETEXTENDEDSTYLE
#define IDS_TOOLTIP_PRINT
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)