ReactOS  0.4.12-dev-90-g2e2e63e
animate.c File Reference
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "vfw.h"
#include "mmsystem.h"
#include "comctl32.h"
#include "wine/debug.h"
#include "wine/heap.h"
Include dependency graph for animate.c:

Go to the source code of this file.

Classes

struct  ANIMATE_INFO
 

Macros

#define ANIMATE_COLOR_NONE   0xffffffff
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (animate)
 
static void ANIMATE_Notify (const ANIMATE_INFO *infoPtr, UINT notif)
 
static BOOL ANIMATE_LoadResW (ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPCWSTR lpName)
 
static BOOL ANIMATE_LoadFileW (ANIMATE_INFO *infoPtr, LPWSTR lpName)
 
static BOOL ANIMATE_DoStop (ANIMATE_INFO *infoPtr)
 
static void ANIMATE_Free (ANIMATE_INFO *infoPtr)
 
static void ANIMATE_TransparentBlt (ANIMATE_INFO const *infoPtr, HDC hdcDest, HDC hdcSource)
 
static BOOL ANIMATE_PaintFrame (ANIMATE_INFO *infoPtr, HDC hDC)
 
static BOOL ANIMATE_DrawFrame (ANIMATE_INFO *infoPtr, HDC hDC)
 
static LRESULT ANIMATE_Timer (ANIMATE_INFO *infoPtr)
 
static DWORD CALLBACK ANIMATE_AnimationThread (LPVOID ptr_)
 
static LRESULT ANIMATE_Play (ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WORD wTo)
 
static BOOL ANIMATE_GetAviInfo (ANIMATE_INFO *infoPtr)
 
static BOOL ANIMATE_GetAviCodec (ANIMATE_INFO *infoPtr)
 
static BOOL ANIMATE_OpenW (ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lpszName)
 
static BOOL ANIMATE_OpenA (ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPSTR lpszName)
 
static BOOL ANIMATE_Stop (ANIMATE_INFO *infoPtr)
 
static BOOL ANIMATE_Create (HWND hWnd, const CREATESTRUCTW *lpcs)
 
static LRESULT ANIMATE_Destroy (ANIMATE_INFO *infoPtr)
 
static BOOL ANIMATE_EraseBackground (ANIMATE_INFO const *infoPtr, HDC hdc)
 
static LRESULT ANIMATE_StyleChanged (ANIMATE_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
 
static LRESULT WINAPI ANIMATE_WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void ANIMATE_Register (void)
 
void ANIMATE_Unregister (void)
 

Variables

struct {
   HMODULE   hModule
 
      DWORD
 
      UINT
 
      DWORD_PTR
 
      LPBITMAPINFOHEADER
 
      LPVOID
 
fnIC
 

Macro Definition Documentation

◆ ANIMATE_COLOR_NONE

#define ANIMATE_COLOR_NONE   0xffffffff

Definition at line 86 of file animate.c.

Referenced by ANIMATE_Create(), ANIMATE_Free(), and ANIMATE_PaintFrame().

Function Documentation

◆ ANIMATE_AnimationThread()

static DWORD CALLBACK ANIMATE_AnimationThread ( LPVOID  ptr_)
static

Definition at line 384 of file animate.c.

Referenced by ANIMATE_Play().

385 {
386  ANIMATE_INFO *infoPtr = ptr_;
387  HANDLE event;
388  DWORD timeout;
389 
390  while(1)
391  {
392  HDC hDC = GetDC(infoPtr->hwndSelf);
393 
394  EnterCriticalSection(&infoPtr->cs);
395  ANIMATE_DrawFrame(infoPtr, hDC);
396  timeout = infoPtr->mah.dwMicroSecPerFrame;
397  event = infoPtr->hStopEvent;
398  LeaveCriticalSection(&infoPtr->cs);
399 
400  ReleaseDC(infoPtr->hwndSelf, hDC);
401 
402  /* time is in microseconds, we should convert it to milliseconds */
403  if ((event == 0) || WaitForSingleObject( event, (timeout+500)/1000) == WAIT_OBJECT_0)
404  break;
405  }
406  return TRUE;
407 }
#define HDC
Definition: msvc.h:22
#define TRUE
Definition: types.h:120
HDC WINAPI GetDC(_In_opt_ HWND)
HWND hwndSelf
Definition: animate.c:56
MainAVIHeader mah
Definition: animate.c:60
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
GLbitfield GLuint64 timeout
Definition: glext.h:7164
DWORD dwMicroSecPerFrame
Definition: vfw.h:941
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WAIT_OBJECT_0
Definition: winbase.h:387
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _cl_event * event
Definition: glext.h:7739
static HDC hDC
Definition: 3dtext.c:33
CRITICAL_SECTION cs
Definition: animate.c:70
HANDLE hStopEvent
Definition: animate.c:71
static BOOL ANIMATE_DrawFrame(ANIMATE_INFO *infoPtr, HDC hDC)
Definition: animate.c:340
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ ANIMATE_Create()

static BOOL ANIMATE_Create ( HWND  hWnd,
const CREATESTRUCTW lpcs 
)
static

Definition at line 795 of file animate.c.

Referenced by ANIMATE_WindowProc().

796 {
797  static const WCHAR msvfw32W[] = { 'm', 's', 'v', 'f', 'w', '3', '2', '.', 'd', 'l', 'l', 0 };
798  ANIMATE_INFO *infoPtr;
799 
800  if (!fnIC.hModule)
801  {
802  fnIC.hModule = LoadLibraryW(msvfw32W);
803  if (!fnIC.hModule) return FALSE;
804 
805  fnIC.fnICOpen = (void*)GetProcAddress(fnIC.hModule, "ICOpen");
806  fnIC.fnICClose = (void*)GetProcAddress(fnIC.hModule, "ICClose");
807  fnIC.fnICSendMessage = (void*)GetProcAddress(fnIC.hModule, "ICSendMessage");
808  fnIC.fnICDecompress = (void*)GetProcAddress(fnIC.hModule, "ICDecompress");
809  }
810 
811  /* allocate memory for info structure */
812  infoPtr = heap_alloc_zero(sizeof(*infoPtr));
813  if (!infoPtr) return FALSE;
814 
815  /* store crossref hWnd <-> info structure */
816  SetWindowLongPtrW(hWnd, 0, (DWORD_PTR)infoPtr);
817  infoPtr->hwndSelf = hWnd;
818  infoPtr->hwndNotify = lpcs->hwndParent;
820  infoPtr->hbmPrevFrame = 0;
821  infoPtr->dwStyle = lpcs->style;
822 
823  TRACE("Animate style=0x%08x, parent=%p\n", infoPtr->dwStyle, infoPtr->hwndNotify);
824 
825  InitializeCriticalSection(&infoPtr->cs);
826  infoPtr->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ANIMATE_INFO*->cs");
827 
828  return TRUE;
829 }
#define TRUE
Definition: types.h:120
#define ANIMATE_COLOR_NONE
Definition: animate.c:86
__wchar_t WCHAR
Definition: xmlstorage.h:180
HWND hWnd
Definition: settings.c:17
HWND hwndSelf
Definition: animate.c:56
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
#define LoadLibraryW(x)
Definition: compat.h:404
#define TRACE(s)
Definition: solgame.cpp:4
HBITMAP hbmPrevFrame
Definition: animate.c:83
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:859
DWORD dwStyle
Definition: animate.c:58
COLORREF transparentColor
Definition: animate.c:81
HWND hwndNotify
Definition: animate.c:57
DWORD_PTR
Definition: animate.c:47
uint32_t DWORD_PTR
Definition: typedefs.h:63
CRITICAL_SECTION cs
Definition: animate.c:70
#define GetProcAddress(x, y)
Definition: compat.h:410
#define SetWindowLongPtrW
Definition: winuser.h:5215
static struct @323 fnIC
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:852

◆ ANIMATE_Destroy()

static LRESULT ANIMATE_Destroy ( ANIMATE_INFO infoPtr)
static

Definition at line 832 of file animate.c.

Referenced by ANIMATE_WindowProc().

833 {
834  /* free avi data */
835  ANIMATE_Free(infoPtr);
836 
837  /* free animate info data */
838  SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0);
839 
840  infoPtr->cs.DebugInfo->Spare[0] = 0;
841  DeleteCriticalSection(&infoPtr->cs);
842  heap_free(infoPtr);
843 
844  return 0;
845 }
HWND hwndSelf
Definition: animate.c:56
static void ANIMATE_Free(ANIMATE_INFO *infoPtr)
Definition: animate.c:181
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:859
CRITICAL_SECTION cs
Definition: animate.c:70
#define SetWindowLongPtrW
Definition: winuser.h:5215
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:852
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ANIMATE_DoStop()

static BOOL ANIMATE_DoStop ( ANIMATE_INFO infoPtr)
static

Definition at line 138 of file animate.c.

Referenced by ANIMATE_DrawFrame(), ANIMATE_Free(), and ANIMATE_Stop().

139 {
140  BOOL stopped = FALSE;
141 
142  EnterCriticalSection(&infoPtr->cs);
143 
144  /* should stop playing */
145  if (infoPtr->hThread)
146  {
147  HANDLE handle = infoPtr->hThread;
148 
149  TRACE("stopping animation thread\n");
150  infoPtr->hThread = 0;
151  SetEvent( infoPtr->hStopEvent );
152 
153  if (infoPtr->threadId != GetCurrentThreadId())
154  {
155  LeaveCriticalSection(&infoPtr->cs); /* leave it a chance to run */
156  WaitForSingleObject( handle, INFINITE );
157  TRACE("animation thread stopped\n");
158  EnterCriticalSection(&infoPtr->cs);
159  }
160 
161  CloseHandle( handle );
162  CloseHandle( infoPtr->hStopEvent );
163  infoPtr->hStopEvent = 0;
164  stopped = TRUE;
165  }
166  if (infoPtr->uTimer) {
167  KillTimer(infoPtr->hwndSelf, infoPtr->uTimer);
168  infoPtr->uTimer = 0;
169  stopped = TRUE;
170  }
171 
172  LeaveCriticalSection(&infoPtr->cs);
173 
174  if (stopped)
175  ANIMATE_Notify(infoPtr, ACN_STOP);
176 
177  return TRUE;
178 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
DWORD threadId
Definition: animate.c:73
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
HWND hwndSelf
Definition: animate.c:56
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE hThread
Definition: animate.c:72
UINT uTimer
Definition: animate.c:74
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ACN_STOP
Definition: commctrl.h:4127
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
CRITICAL_SECTION cs
Definition: animate.c:70
HANDLE hStopEvent
Definition: animate.c:71
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define INFINITE
Definition: serial.h:102
static void ANIMATE_Notify(const ANIMATE_INFO *infoPtr, UINT notif)
Definition: animate.c:88

◆ ANIMATE_DrawFrame()

static BOOL ANIMATE_DrawFrame ( ANIMATE_INFO infoPtr,
HDC  hDC 
)
static

Definition at line 340 of file animate.c.

Referenced by ANIMATE_AnimationThread(), ANIMATE_Play(), and ANIMATE_Timer().

341 {
342  TRACE("Drawing frame %d (loop %d)\n", infoPtr->currFrame, infoPtr->nLoop);
343 
344  mmioSeek(infoPtr->hMMio, infoPtr->lpIndex[infoPtr->currFrame], SEEK_SET);
345  mmioRead(infoPtr->hMMio, infoPtr->indata, infoPtr->ash.dwSuggestedBufferSize);
346 
347  if (infoPtr->hic &&
348  fnIC.fnICDecompress(infoPtr->hic, 0, infoPtr->inbih, infoPtr->indata,
349  infoPtr->outbih, infoPtr->outdata) != ICERR_OK) {
350  WARN("Decompression error\n");
351  return FALSE;
352  }
353 
354  ANIMATE_PaintFrame(infoPtr, hDC);
355 
356  if (infoPtr->currFrame++ >= infoPtr->nToFrame) {
357  infoPtr->currFrame = infoPtr->nFromFrame;
358  if (infoPtr->nLoop != -1) {
359  if (--infoPtr->nLoop == 0) {
360  ANIMATE_DoStop(infoPtr);
361  }
362  }
363  }
364 
365  return TRUE;
366 }
AVIStreamHeader ash
Definition: animate.c:61
int nToFrame
Definition: animate.c:77
#define TRUE
Definition: types.h:120
static BOOL ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
Definition: animate.c:138
int nFromFrame
Definition: animate.c:76
#define WARN(fmt,...)
Definition: debug.h:111
LPVOID indata
Definition: animate.c:67
int nLoop
Definition: animate.c:78
#define ICERR_OK
Definition: vfw.h:50
LPBITMAPINFOHEADER outbih
Definition: animate.c:66
static BOOL ANIMATE_PaintFrame(ANIMATE_INFO *infoPtr, HDC hDC)
Definition: animate.c:252
LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
Definition: mmio.c:835
LPVOID outdata
Definition: animate.c:68
HMMIO hMMio
Definition: animate.c:55
#define SEEK_SET
Definition: jmemansi.c:26
#define TRACE(s)
Definition: solgame.cpp:4
LPDWORD lpIndex
Definition: animate.c:63
DWORD dwSuggestedBufferSize
Definition: vfw.h:969
static HDC hDC
Definition: 3dtext.c:33
int currFrame
Definition: animate.c:79
LPBITMAPINFOHEADER inbih
Definition: animate.c:62
LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch)
Definition: mmio.c:732
static struct @323 fnIC

◆ ANIMATE_EraseBackground()

static BOOL ANIMATE_EraseBackground ( ANIMATE_INFO const infoPtr,
HDC  hdc 
)
static

Definition at line 848 of file animate.c.

Referenced by ANIMATE_WindowProc().

849 {
850  RECT rect;
851  HBRUSH hBrush;
852 
853  hBrush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC,
854  (WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
855  GetClientRect(infoPtr->hwndSelf, &rect);
856  FillRect(hdc, &rect, hBrush ? hBrush : GetCurrentObject(hdc, OBJ_BRUSH));
857 
858  return TRUE;
859 }
#define TRUE
Definition: types.h:120
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1748
& rect
Definition: startmenu.cpp:1413
UINT_PTR WPARAM
Definition: windef.h:207
HDC hdc
Definition: msvc.h:53
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define OBJ_BRUSH
Definition: objidl.idl:1410
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:439
#define LPARAM
Definition: msvc.h:38

◆ ANIMATE_Free()

static void ANIMATE_Free ( ANIMATE_INFO infoPtr)
static

Definition at line 181 of file animate.c.

Referenced by ANIMATE_Destroy(), ANIMATE_OpenW(), and ANIMATE_WindowProc().

182 {
183  if (infoPtr->hMMio)
184  {
185  ANIMATE_DoStop(infoPtr);
186  mmioClose(infoPtr->hMMio, 0);
187  if (infoPtr->hRes)
188  {
189  FreeResource(infoPtr->hRes);
190  infoPtr->hRes = 0;
191  }
192  heap_free (infoPtr->lpIndex);
193  infoPtr->lpIndex = NULL;
194  if (infoPtr->hic)
195  {
196  fnIC.fnICClose(infoPtr->hic);
197  infoPtr->hic = 0;
198  }
199  heap_free (infoPtr->inbih);
200  infoPtr->inbih = NULL;
201  heap_free (infoPtr->outbih);
202  infoPtr->outbih = NULL;
203  heap_free (infoPtr->indata);
204  infoPtr->indata = NULL;
205  heap_free (infoPtr->outdata);
206  infoPtr->outdata = NULL;
207  if (infoPtr->hbmPrevFrame)
208  {
209  DeleteObject(infoPtr->hbmPrevFrame);
210  infoPtr->hbmPrevFrame = 0;
211  }
212 
213  memset(&infoPtr->mah, 0, sizeof(infoPtr->mah));
214  memset(&infoPtr->ash, 0, sizeof(infoPtr->ash));
215  infoPtr->nFromFrame = infoPtr->nToFrame = infoPtr->nLoop = infoPtr->currFrame = 0;
216  }
218 }
AVIStreamHeader ash
Definition: animate.c:61
int nToFrame
Definition: animate.c:77
static BOOL ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
Definition: animate.c:138
#define ANIMATE_COLOR_NONE
Definition: animate.c:86
int nFromFrame
Definition: animate.c:76
LPVOID indata
Definition: animate.c:67
int nLoop
Definition: animate.c:78
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
MMRESULT WINAPI mmioClose(HMMIO hmmio, UINT uFlags)
Definition: mmio.c:701
MainAVIHeader mah
Definition: animate.c:60
LPBITMAPINFOHEADER outbih
Definition: animate.c:66
LPVOID outdata
Definition: animate.c:68
HMMIO hMMio
Definition: animate.c:55
BOOL WINAPI FreeResource(HGLOBAL handle)
Definition: res.c:559
smooth NULL
Definition: ftsmooth.c:416
LPDWORD lpIndex
Definition: animate.c:63
HBITMAP hbmPrevFrame
Definition: animate.c:83
HGLOBAL hRes
Definition: animate.c:54
COLORREF transparentColor
Definition: animate.c:81
int currFrame
Definition: animate.c:79
#define memset(x, y, z)
Definition: compat.h:39
LPBITMAPINFOHEADER inbih
Definition: animate.c:62
static struct @323 fnIC
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ANIMATE_GetAviCodec()

static BOOL ANIMATE_GetAviCodec ( ANIMATE_INFO infoPtr)
static

Definition at line 646 of file animate.c.

Referenced by ANIMATE_OpenW().

647 {
648  DWORD outSize;
649 
650  /* check uncompressed AVI */
651  if ((infoPtr->ash.fccHandler == mmioFOURCC('D', 'I', 'B', ' ')) ||
652  (infoPtr->ash.fccHandler == mmioFOURCC('R', 'L', 'E', ' ')) ||
653  (infoPtr->ash.fccHandler == mmioFOURCC(0, 0, 0, 0)))
654  {
655  infoPtr->hic = 0;
656  return TRUE;
657  }
658 
659  /* try to get a decompressor for that type */
660  infoPtr->hic = fnIC.fnICOpen(ICTYPE_VIDEO, infoPtr->ash.fccHandler, ICMODE_DECOMPRESS);
661  if (!infoPtr->hic) {
662  WARN("Can't load codec for the file\n");
663  return FALSE;
664  }
665 
666  outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
667  (DWORD_PTR)infoPtr->inbih, 0L);
668 
669  infoPtr->outbih = heap_alloc_zero(outSize);
670  if (!infoPtr->outbih)
671  return FALSE;
672 
673  if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
674  (DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != ICERR_OK)
675  {
676  WARN("Can't get output BIH\n");
677  return FALSE;
678  }
679 
680  infoPtr->outdata = heap_alloc_zero(infoPtr->outbih->biSizeImage);
681  if (!infoPtr->outdata)
682  return FALSE;
683 
684  if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN,
685  (DWORD_PTR)infoPtr->inbih, (DWORD_PTR)infoPtr->outbih) != ICERR_OK) {
686  WARN("Can't begin decompression\n");
687  return FALSE;
688  }
689 
690  return TRUE;
691 }
AVIStreamHeader ash
Definition: animate.c:61
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:111
#define ICERR_OK
Definition: vfw.h:50
LPBITMAPINFOHEADER outbih
Definition: animate.c:66
FOURCC fccHandler
Definition: vfw.h:960
LPVOID outdata
Definition: animate.c:68
#define ICMODE_DECOMPRESS
Definition: vfw.h:269
#define ICM_DECOMPRESS_GET_FORMAT
Definition: vfw.h:106
#define ICTYPE_VIDEO
Definition: mmreg.h:531
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD biSizeImage
Definition: amvideo.idl:36
static const WCHAR L[]
Definition: oid.c:1087
#define mmioFOURCC(c0, c1, c2, c3)
Definition: mmsystem.h:38
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define ICM_DECOMPRESS_BEGIN
Definition: vfw.h:108
LPBITMAPINFOHEADER inbih
Definition: animate.c:62
static struct @323 fnIC

◆ ANIMATE_GetAviInfo()

static BOOL ANIMATE_GetAviInfo ( ANIMATE_INFO infoPtr)
static

Definition at line 478 of file animate.c.

Referenced by ANIMATE_OpenW().

479 {
480  MMCKINFO ckMainRIFF;
481  MMCKINFO mmckHead;
482  MMCKINFO mmckList;
483  MMCKINFO mmckInfo;
484  DWORD numFrame;
485  DWORD insize;
486 
487  if (mmioDescend(infoPtr->hMMio, &ckMainRIFF, NULL, 0) != 0) {
488  WARN("Can't find 'RIFF' chunk\n");
489  return FALSE;
490  }
491 
492  if ((ckMainRIFF.ckid != FOURCC_RIFF) ||
493  (ckMainRIFF.fccType != mmioFOURCC('A', 'V', 'I', ' '))) {
494  WARN("Can't find 'AVI ' chunk\n");
495  return FALSE;
496  }
497 
498  mmckHead.fccType = mmioFOURCC('h', 'd', 'r', 'l');
499  if (mmioDescend(infoPtr->hMMio, &mmckHead, &ckMainRIFF, MMIO_FINDLIST) != 0) {
500  WARN("Can't find 'hdrl' list\n");
501  return FALSE;
502  }
503 
504  mmckInfo.ckid = mmioFOURCC('a', 'v', 'i', 'h');
505  if (mmioDescend(infoPtr->hMMio, &mmckInfo, &mmckHead, MMIO_FINDCHUNK) != 0) {
506  WARN("Can't find 'avih' chunk\n");
507  return FALSE;
508  }
509 
510  mmioRead(infoPtr->hMMio, (LPSTR)&infoPtr->mah, sizeof(infoPtr->mah));
511 
512  TRACE("mah.dwMicroSecPerFrame=%d\n", infoPtr->mah.dwMicroSecPerFrame);
513  TRACE("mah.dwMaxBytesPerSec=%d\n", infoPtr->mah.dwMaxBytesPerSec);
514  TRACE("mah.dwPaddingGranularity=%d\n", infoPtr->mah.dwPaddingGranularity);
515  TRACE("mah.dwFlags=%d\n", infoPtr->mah.dwFlags);
516  TRACE("mah.dwTotalFrames=%d\n", infoPtr->mah.dwTotalFrames);
517  TRACE("mah.dwInitialFrames=%d\n", infoPtr->mah.dwInitialFrames);
518  TRACE("mah.dwStreams=%d\n", infoPtr->mah.dwStreams);
519  TRACE("mah.dwSuggestedBufferSize=%d\n", infoPtr->mah.dwSuggestedBufferSize);
520  TRACE("mah.dwWidth=%d\n", infoPtr->mah.dwWidth);
521  TRACE("mah.dwHeight=%d\n", infoPtr->mah.dwHeight);
522 
523  mmioAscend(infoPtr->hMMio, &mmckInfo, 0);
524 
525  mmckList.fccType = mmioFOURCC('s', 't', 'r', 'l');
526  if (mmioDescend(infoPtr->hMMio, &mmckList, &mmckHead, MMIO_FINDLIST) != 0) {
527  WARN("Can't find 'strl' list\n");
528  return FALSE;
529  }
530 
531  mmckInfo.ckid = mmioFOURCC('s', 't', 'r', 'h');
532  if (mmioDescend(infoPtr->hMMio, &mmckInfo, &mmckList, MMIO_FINDCHUNK) != 0) {
533  WARN("Can't find 'strh' chunk\n");
534  return FALSE;
535  }
536 
537  mmioRead(infoPtr->hMMio, (LPSTR)&infoPtr->ash, sizeof(infoPtr->ash));
538 
539  TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(infoPtr->ash.fccType)),
540  HIBYTE(LOWORD(infoPtr->ash.fccType)),
541  LOBYTE(HIWORD(infoPtr->ash.fccType)),
542  HIBYTE(HIWORD(infoPtr->ash.fccType)));
543  TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(infoPtr->ash.fccHandler)),
544  HIBYTE(LOWORD(infoPtr->ash.fccHandler)),
545  LOBYTE(HIWORD(infoPtr->ash.fccHandler)),
546  HIBYTE(HIWORD(infoPtr->ash.fccHandler)));
547  TRACE("ash.dwFlags=%d\n", infoPtr->ash.dwFlags);
548  TRACE("ash.wPriority=%d\n", infoPtr->ash.wPriority);
549  TRACE("ash.wLanguage=%d\n", infoPtr->ash.wLanguage);
550  TRACE("ash.dwInitialFrames=%d\n", infoPtr->ash.dwInitialFrames);
551  TRACE("ash.dwScale=%d\n", infoPtr->ash.dwScale);
552  TRACE("ash.dwRate=%d\n", infoPtr->ash.dwRate);
553  TRACE("ash.dwStart=%d\n", infoPtr->ash.dwStart);
554  TRACE("ash.dwLength=%d\n", infoPtr->ash.dwLength);
555  TRACE("ash.dwSuggestedBufferSize=%d\n", infoPtr->ash.dwSuggestedBufferSize);
556  TRACE("ash.dwQuality=%d\n", infoPtr->ash.dwQuality);
557  TRACE("ash.dwSampleSize=%d\n", infoPtr->ash.dwSampleSize);
558  TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", infoPtr->ash.rcFrame.top, infoPtr->ash.rcFrame.left,
559  infoPtr->ash.rcFrame.bottom, infoPtr->ash.rcFrame.right);
560 
561  mmioAscend(infoPtr->hMMio, &mmckInfo, 0);
562 
563  mmckInfo.ckid = mmioFOURCC('s', 't', 'r', 'f');
564  if (mmioDescend(infoPtr->hMMio, &mmckInfo, &mmckList, MMIO_FINDCHUNK) != 0) {
565  WARN("Can't find 'strh' chunk\n");
566  return FALSE;
567  }
568 
569  infoPtr->inbih = heap_alloc_zero(mmckInfo.cksize);
570  if (!infoPtr->inbih) {
571  WARN("Can't alloc input BIH\n");
572  return FALSE;
573  }
574 
575  mmioRead(infoPtr->hMMio, (LPSTR)infoPtr->inbih, mmckInfo.cksize);
576 
577  TRACE("bih.biSize=%d\n", infoPtr->inbih->biSize);
578  TRACE("bih.biWidth=%d\n", infoPtr->inbih->biWidth);
579  TRACE("bih.biHeight=%d\n", infoPtr->inbih->biHeight);
580  TRACE("bih.biPlanes=%d\n", infoPtr->inbih->biPlanes);
581  TRACE("bih.biBitCount=%d\n", infoPtr->inbih->biBitCount);
582  TRACE("bih.biCompression=%d\n", infoPtr->inbih->biCompression);
583  TRACE("bih.biSizeImage=%d\n", infoPtr->inbih->biSizeImage);
584  TRACE("bih.biXPelsPerMeter=%d\n", infoPtr->inbih->biXPelsPerMeter);
585  TRACE("bih.biYPelsPerMeter=%d\n", infoPtr->inbih->biYPelsPerMeter);
586  TRACE("bih.biClrUsed=%d\n", infoPtr->inbih->biClrUsed);
587  TRACE("bih.biClrImportant=%d\n", infoPtr->inbih->biClrImportant);
588 
589  mmioAscend(infoPtr->hMMio, &mmckInfo, 0);
590 
591  mmioAscend(infoPtr->hMMio, &mmckList, 0);
592 
593 #if 0
594  /* an AVI has 0 or 1 video stream, and to be animated should not contain
595  * an audio stream, so only one strl is allowed
596  */
597  mmckList.fccType = mmioFOURCC('s', 't', 'r', 'l');
598  if (mmioDescend(infoPtr->hMMio, &mmckList, &mmckHead, MMIO_FINDLIST) == 0) {
599  WARN("There should be a single 'strl' list\n");
600  return FALSE;
601  }
602 #endif
603 
604  mmioAscend(infoPtr->hMMio, &mmckHead, 0);
605 
606  /* no need to read optional JUNK chunk */
607 
608  mmckList.fccType = mmioFOURCC('m', 'o', 'v', 'i');
609  if (mmioDescend(infoPtr->hMMio, &mmckList, &ckMainRIFF, MMIO_FINDLIST) != 0) {
610  WARN("Can't find 'movi' list\n");
611  return FALSE;
612  }
613 
614  /* FIXME: should handle the 'rec ' LIST when present */
615 
616  infoPtr->lpIndex = heap_alloc_zero(infoPtr->mah.dwTotalFrames * sizeof(DWORD));
617  if (!infoPtr->lpIndex)
618  return FALSE;
619 
620  numFrame = insize = 0;
621  while (mmioDescend(infoPtr->hMMio, &mmckInfo, &mmckList, 0) == 0 &&
622  numFrame < infoPtr->mah.dwTotalFrames) {
623  infoPtr->lpIndex[numFrame] = mmckInfo.dwDataOffset;
624  if (insize < mmckInfo.cksize)
625  insize = mmckInfo.cksize;
626  numFrame++;
627  mmioAscend(infoPtr->hMMio, &mmckInfo, 0);
628  }
629  if (numFrame != infoPtr->mah.dwTotalFrames) {
630  WARN("Found %d frames (/%d)\n", numFrame, infoPtr->mah.dwTotalFrames);
631  return FALSE;
632  }
633  if (insize > infoPtr->ash.dwSuggestedBufferSize) {
634  WARN("insize=%d suggestedSize=%d\n", insize, infoPtr->ash.dwSuggestedBufferSize);
635  infoPtr->ash.dwSuggestedBufferSize = insize;
636  }
637 
638  infoPtr->indata = heap_alloc_zero(infoPtr->ash.dwSuggestedBufferSize);
639  if (!infoPtr->indata)
640  return FALSE;
641 
642  return TRUE;
643 }
DWORD dwFlags
Definition: vfw.h:944
DWORD dwInitialFrames
Definition: vfw.h:964
AVIStreamHeader ash
Definition: animate.c:61
#define TRUE
Definition: types.h:120
DWORD biClrImportant
Definition: amvideo.idl:40
#define LOBYTE(W)
Definition: jmemdos.c:487
DWORD dwInitialFrames
Definition: vfw.h:946
LONG biXPelsPerMeter
Definition: amvideo.idl:37
MMRESULT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags)
Definition: mmio.c:1204
DWORD dwLength
Definition: vfw.h:968
#define WARN(fmt,...)
Definition: debug.h:111
DWORD dwDataOffset
Definition: mmsystem.h:1510
LPVOID indata
Definition: animate.c:67
#define HIBYTE(W)
Definition: jmemdos.c:486
DWORD dwStart
Definition: vfw.h:967
MainAVIHeader mah
Definition: animate.c:60
DWORD dwFlags
Definition: vfw.h:961
char * LPSTR
Definition: xmlstorage.h:182
LONG biYPelsPerMeter
Definition: amvideo.idl:38
DWORD dwMicroSecPerFrame
Definition: vfw.h:941
FOURCC fccHandler
Definition: vfw.h:960
HMMIO hMMio
Definition: animate.c:55
DWORD biCompression
Definition: amvideo.idl:35
smooth NULL
Definition: ftsmooth.c:416
#define MMIO_FINDCHUNK
Definition: mmsystem.h:551
FOURCC fccType
Definition: vfw.h:959
FOURCC fccType
Definition: mmsystem.h:1509
DWORD dwStreams
Definition: vfw.h:947
WORD wPriority
Definition: vfw.h:962
#define TRACE(s)
Definition: solgame.cpp:4
LPDWORD lpIndex
Definition: animate.c:63
DWORD dwSuggestedBufferSize
Definition: vfw.h:969
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD biSizeImage
Definition: amvideo.idl:36
DWORD cksize
Definition: mmsystem.h:1508
DWORD dwMaxBytesPerSec
Definition: vfw.h:942
DWORD dwQuality
Definition: vfw.h:970
#define FOURCC_RIFF
Definition: mmsystem.h:564
#define mmioFOURCC(c0, c1, c2, c3)
Definition: mmsystem.h:38
DWORD dwSampleSize
Definition: vfw.h:971
const unsigned char unsigned long insize
Definition: jpeglib.h:982
DWORD dwTotalFrames
Definition: vfw.h:945
DWORD dwSuggestedBufferSize
Definition: vfw.h:948
FOURCC ckid
Definition: mmsystem.h:1507
MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, const MMCKINFO *lpckParent, UINT uFlags)
Definition: mmio.c:1106
DWORD dwWidth
Definition: vfw.h:949
DWORD dwScale
Definition: vfw.h:965
#define HIWORD(l)
Definition: typedefs.h:246
struct AVIStreamHeader::@3129 rcFrame
DWORD dwPaddingGranularity
Definition: vfw.h:943
#define MMIO_FINDLIST
Definition: mmsystem.h:553
DWORD dwHeight
Definition: vfw.h:950
WORD wLanguage
Definition: vfw.h:963
LPBITMAPINFOHEADER inbih
Definition: animate.c:62
#define LOWORD(l)
Definition: pedump.c:82
DWORD dwRate
Definition: vfw.h:966
LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch)
Definition: mmio.c:732

◆ ANIMATE_LoadFileW()

static BOOL ANIMATE_LoadFileW ( ANIMATE_INFO infoPtr,
LPWSTR  lpName 
)
static

Definition at line 129 of file animate.c.

Referenced by ANIMATE_OpenW().

130 {
132 
133  if(!infoPtr->hMMio) return FALSE;
134  return TRUE;
135 }
#define MMIO_ALLOCBUF
Definition: mmsystem.h:532
#define TRUE
Definition: types.h:120
_In_ LPCSTR lpName
Definition: winbase.h:2729
HMMIO WINAPI mmioOpenW(LPWSTR szFileName, MMIOINFO *lpmmioinfo, DWORD dwOpenFlags)
Definition: mmio.c:669
#define MMIO_DENYWRITE
Definition: mmsystem.h:540
HMMIO hMMio
Definition: animate.c:55
#define MMIO_READ
Definition: mmsystem.h:535

◆ ANIMATE_LoadResW()

static BOOL ANIMATE_LoadResW ( ANIMATE_INFO infoPtr,
HINSTANCE  hInst,
LPCWSTR  lpName 
)
static

Definition at line 95 of file animate.c.

Referenced by ANIMATE_OpenW().

96 {
97  static const WCHAR aviW[] = { 'A', 'V', 'I', 0 };
98  HRSRC hrsrc;
99  MMIOINFO mminfo;
100  LPVOID lpAvi;
101 
102  hrsrc = FindResourceW(hInst, lpName, aviW);
103  if (!hrsrc)
104  return FALSE;
105 
106  infoPtr->hRes = LoadResource(hInst, hrsrc);
107  if (!infoPtr->hRes)
108  return FALSE;
109 
110  lpAvi = LockResource(infoPtr->hRes);
111  if (!lpAvi)
112  return FALSE;
113 
114  memset(&mminfo, 0, sizeof(mminfo));
115  mminfo.fccIOProc = FOURCC_MEM;
116  mminfo.pchBuffer = lpAvi;
117  mminfo.cchBuffer = SizeofResource(hInst, hrsrc);
118  infoPtr->hMMio = mmioOpenW(NULL, &mminfo, MMIO_READ);
119  if (!infoPtr->hMMio)
120  {
121  FreeResource(infoPtr->hRes);
122  return FALSE;
123  }
124 
125  return TRUE;
126 }
#define TRUE
Definition: types.h:120
FOURCC fccIOProc
Definition: mmsystem.h:1487
LONG cchBuffer
Definition: mmsystem.h:1491
__wchar_t WCHAR
Definition: xmlstorage.h:180
_In_ LPCSTR lpName
Definition: winbase.h:2729
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HMMIO WINAPI mmioOpenW(LPWSTR szFileName, MMIOINFO *lpmmioinfo, DWORD dwOpenFlags)
Definition: mmio.c:669
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
HMMIO hMMio
Definition: animate.c:55
BOOL WINAPI FreeResource(HGLOBAL handle)
Definition: res.c:559
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
smooth NULL
Definition: ftsmooth.c:416
#define MMIO_READ
Definition: mmsystem.h:535
HPSTR pchBuffer
Definition: mmsystem.h:1492
HGLOBAL hRes
Definition: animate.c:54
#define FOURCC_MEM
Definition: mmsystem.h:567
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define memset(x, y, z)
Definition: compat.h:39

◆ ANIMATE_Notify()

static void ANIMATE_Notify ( const ANIMATE_INFO infoPtr,
UINT  notif 
)
static

Definition at line 88 of file animate.c.

Referenced by ANIMATE_DoStop(), and ANIMATE_Play().

89 {
92  (LPARAM)infoPtr->hwndSelf);
93 }
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
HWND hwndSelf
Definition: animate.c:56
int WINAPI GetDlgCtrlID(_In_ HWND)
LONG_PTR LPARAM
Definition: windef.h:208
HWND hwndNotify
Definition: animate.c:57
#define WM_COMMAND
Definition: winuser.h:1716
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static IMMNotificationClient notif
Definition: mmdevenum.c:189

◆ ANIMATE_OpenA()

static BOOL ANIMATE_OpenA ( ANIMATE_INFO infoPtr,
HINSTANCE  hInstance,
LPSTR  lpszName 
)
static

Definition at line 764 of file animate.c.

Referenced by ANIMATE_WindowProc().

765 {
766  LPWSTR lpwszName;
767  LRESULT result;
768  INT len;
769 
770  if (IS_INTRESOURCE(lpszName))
771  return ANIMATE_OpenW(infoPtr, hInstance, (LPWSTR)lpszName);
772 
773  len = MultiByteToWideChar(CP_ACP, 0, lpszName, -1, NULL, 0);
774  lpwszName = heap_alloc(len * sizeof(WCHAR));
775  if (!lpwszName) return FALSE;
776  MultiByteToWideChar(CP_ACP, 0, lpszName, -1, lpwszName, len);
777 
778  result = ANIMATE_OpenW(infoPtr, hInstance, lpwszName);
779  heap_free (lpwszName);
780  return result;
781 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CP_ACP
Definition: compat.h:99
int32_t INT
Definition: typedefs.h:56
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
GLenum GLsizei len
Definition: glext.h:6722
static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lpszName)
Definition: animate.c:694
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LONG_PTR LRESULT
Definition: windef.h:209
GLuint64EXT * result
Definition: glext.h:11304
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ANIMATE_OpenW()

static BOOL ANIMATE_OpenW ( ANIMATE_INFO infoPtr,
HINSTANCE  hInstance,
LPWSTR  lpszName 
)
static

Definition at line 694 of file animate.c.

Referenced by ANIMATE_OpenA(), and ANIMATE_WindowProc().

695 {
696  HDC hdc;
697 
698  ANIMATE_Free(infoPtr);
699 
700  if (!lpszName)
701  {
702  TRACE("Closing avi.\n");
703  /* installer of thebat! v1.62 requires FALSE here */
704  return (infoPtr->hMMio != 0);
705  }
706 
707  if (!hInstance)
708  hInstance = (HINSTANCE)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_HINSTANCE);
709 
710  TRACE("(%s)\n", debugstr_w(lpszName));
711 
712  if (!IS_INTRESOURCE(lpszName))
713  {
714  if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName))
715  {
716  TRACE("No AVI resource found.\n");
717  if (!ANIMATE_LoadFileW(infoPtr, lpszName))
718  {
719  WARN("No AVI file found.\n");
720  return FALSE;
721  }
722  }
723  }
724  else
725  {
726  if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName))
727  {
728  WARN("No AVI resource found.\n");
729  return FALSE;
730  }
731  }
732 
733  if (!ANIMATE_GetAviInfo(infoPtr))
734  {
735  WARN("Can't get AVI information\n");
736  ANIMATE_Free(infoPtr);
737  return FALSE;
738  }
739 
740  if (!ANIMATE_GetAviCodec(infoPtr))
741  {
742  WARN("Can't get AVI Codec\n");
743  ANIMATE_Free(infoPtr);
744  return FALSE;
745  }
746 
747  hdc = GetDC(infoPtr->hwndSelf);
748  /* native looks at the top left pixel of the first frame here too. */
749  infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC,
750  (WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
751  ReleaseDC(infoPtr->hwndSelf, hdc);
752 
753  if (!(infoPtr->dwStyle & ACS_CENTER))
754  SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, infoPtr->mah.dwWidth, infoPtr->mah.dwHeight,
756 
757  if (infoPtr->dwStyle & ACS_AUTOPLAY)
758  return ANIMATE_Play(infoPtr, -1, 0, infoPtr->mah.dwTotalFrames - 1);
759 
760  return TRUE;
761 }
#define HDC
Definition: msvc.h:22
#define TRUE
Definition: types.h:120
HDC WINAPI GetDC(_In_opt_ HWND)
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1748
#define WARN(fmt,...)
Definition: debug.h:111
#define ACS_AUTOPLAY
Definition: commctrl.h:4115
HWND hwndSelf
Definition: animate.c:56
MainAVIHeader mah
Definition: animate.c:60
#define ACS_CENTER
Definition: commctrl.h:4113
#define GetWindowLongPtrW
Definition: winuser.h:4698
#define SWP_NOZORDER
Definition: winuser.h:1232
static void ANIMATE_Free(ANIMATE_INFO *infoPtr)
Definition: animate.c:181
UINT_PTR WPARAM
Definition: windef.h:207
HMMIO hMMio
Definition: animate.c:55
#define debugstr_w
Definition: kernel32.h:32
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC hdc
Definition: msvc.h:53
HBRUSH hbrushBG
Definition: animate.c:82
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define SWP_NOACTIVATE
Definition: winuser.h:1227
HANDLE HINSTANCE
Definition: typedefs.h:75
DWORD dwStyle
Definition: animate.c:58
HWND hwndNotify
Definition: animate.c:57
static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
Definition: animate.c:646
DWORD dwTotalFrames
Definition: vfw.h:945
static BOOL ANIMATE_LoadFileW(ANIMATE_INFO *infoPtr, LPWSTR lpName)
Definition: animate.c:129
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD dwWidth
Definition: vfw.h:949
static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WORD wTo)
Definition: animate.c:409
static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
Definition: animate.c:478
#define GWLP_HINSTANCE
Definition: winuser.h:850
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
DWORD dwHeight
Definition: vfw.h:950
static BOOL ANIMATE_LoadResW(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPCWSTR lpName)
Definition: animate.c:95
#define LPARAM
Definition: msvc.h:38

◆ ANIMATE_PaintFrame()

static BOOL ANIMATE_PaintFrame ( ANIMATE_INFO infoPtr,
HDC  hDC 
)
static

Definition at line 252 of file animate.c.

Referenced by ANIMATE_DrawFrame(), and ANIMATE_WindowProc().

253 {
254  void const *pBitmapData;
255  BITMAPINFO const *pBitmapInfo;
256  HDC hdcMem;
257  HBITMAP hbmOld;
258  int nOffsetX = 0;
259  int nOffsetY = 0;
260  int nWidth;
261  int nHeight;
262 
263  if (!hDC || !infoPtr->inbih)
264  return TRUE;
265 
266  if (infoPtr->hic )
267  {
268  pBitmapData = infoPtr->outdata;
269  pBitmapInfo = (LPBITMAPINFO)infoPtr->outbih;
270 
271  nWidth = infoPtr->outbih->biWidth;
272  nHeight = infoPtr->outbih->biHeight;
273  }
274  else
275  {
276  pBitmapData = infoPtr->indata;
277  pBitmapInfo = (LPBITMAPINFO)infoPtr->inbih;
278 
279  nWidth = infoPtr->inbih->biWidth;
280  nHeight = infoPtr->inbih->biHeight;
281  }
282 
283  if(!infoPtr->hbmPrevFrame)
284  {
285  infoPtr->hbmPrevFrame=CreateCompatibleBitmap(hDC, nWidth,nHeight );
286  }
287 
288  hdcMem = CreateCompatibleDC(hDC);
289  hbmOld = SelectObject(hdcMem, infoPtr->hbmPrevFrame);
290 
291  SetDIBits(hdcMem, infoPtr->hbmPrevFrame, 0, nHeight, pBitmapData, pBitmapInfo, DIB_RGB_COLORS);
292 
293  /*
294  * we need to get the transparent color even without ACS_TRANSPARENT,
295  * because the style can be changed later on and the color should always
296  * be obtained in the first frame
297  */
298  if(infoPtr->transparentColor == ANIMATE_COLOR_NONE)
299  {
300  infoPtr->transparentColor = GetPixel(hdcMem,0,0);
301  }
302 
303  if(infoPtr->dwStyle & ACS_TRANSPARENT)
304  {
305  HDC hdcFinal = CreateCompatibleDC(hDC);
306  HBITMAP hbmFinal = CreateCompatibleBitmap(hDC,nWidth, nHeight);
307  HBITMAP hbmOld2 = SelectObject(hdcFinal, hbmFinal);
308  RECT rect;
309 
310  SetRect(&rect, 0, 0, nWidth, nHeight);
311 
312  if(!infoPtr->hbrushBG)
313  infoPtr->hbrushBG = GetCurrentObject(hDC, OBJ_BRUSH);
314 
315  FillRect(hdcFinal, &rect, infoPtr->hbrushBG);
316  ANIMATE_TransparentBlt(infoPtr, hdcFinal, hdcMem);
317 
318  SelectObject(hdcFinal, hbmOld2);
319  SelectObject(hdcMem, hbmFinal);
320  DeleteDC(hdcFinal);
321  DeleteObject(infoPtr->hbmPrevFrame);
322  infoPtr->hbmPrevFrame = hbmFinal;
323  }
324 
325  if (infoPtr->dwStyle & ACS_CENTER)
326  {
327  RECT rect;
328 
329  GetWindowRect(infoPtr->hwndSelf, &rect);
330  nOffsetX = ((rect.right - rect.left) - nWidth)/2;
331  nOffsetY = ((rect.bottom - rect.top) - nHeight)/2;
332  }
333  BitBlt(hDC, nOffsetX, nOffsetY, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY);
334 
335  SelectObject(hdcMem, hbmOld);
336  DeleteDC(hdcMem);
337  return TRUE;
338 }
#define HDC
Definition: msvc.h:22
#define TRUE
Definition: types.h:120
#define HBITMAP
Definition: msvc.h:28
struct tagBITMAPINFO * LPBITMAPINFO
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
#define ANIMATE_COLOR_NONE
Definition: animate.c:86
LPVOID indata
Definition: animate.c:67
LONG top
Definition: windef.h:297
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HWND hwndSelf
Definition: animate.c:56
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define ACS_CENTER
Definition: commctrl.h:4113
LONG left
Definition: windef.h:296
LPBITMAPINFOHEADER outbih
Definition: animate.c:66
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
LONG right
Definition: windef.h:298
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:416
& rect
Definition: startmenu.cpp:1413
LPVOID outdata
Definition: animate.c:68
HBRUSH hbrushBG
Definition: animate.c:82
static void ANIMATE_TransparentBlt(ANIMATE_INFO const *infoPtr, HDC hdcDest, HDC hdcSource)
Definition: animate.c:220
HBITMAP hbmPrevFrame
Definition: animate.c:83
DWORD dwStyle
Definition: animate.c:58
COLORREF transparentColor
Definition: animate.c:81
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI DeleteDC(_In_ HDC)
#define OBJ_BRUSH
Definition: objidl.idl:1410
#define ACS_TRANSPARENT
Definition: commctrl.h:4114
LONG bottom
Definition: windef.h:299
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define DIB_RGB_COLORS
Definition: wingdi.h:365
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetDIBits(_In_opt_ HDC, _In_ HBITMAP, _In_ UINT, _In_ UINT, _In_ CONST VOID *, _In_ CONST BITMAPINFO *, _In_ UINT)
LPBITMAPINFOHEADER inbih
Definition: animate.c:62
#define SRCCOPY
Definition: wingdi.h:331
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:439
HDC hdcMem
Definition: welcome.c:104

◆ ANIMATE_Play()

static LRESULT ANIMATE_Play ( ANIMATE_INFO infoPtr,
UINT  cRepeat,
WORD  wFrom,
WORD  wTo 
)
static

Definition at line 409 of file animate.c.

Referenced by ANIMATE_OpenW(), and ANIMATE_WindowProc().

410 {
411  /* nothing opened */
412  if (!infoPtr->hMMio)
413  return FALSE;
414 
415  if (infoPtr->hThread || infoPtr->uTimer) {
416  TRACE("Already playing\n");
417  return TRUE;
418  }
419 
420  infoPtr->nFromFrame = wFrom;
421  infoPtr->nToFrame = wTo;
422  infoPtr->nLoop = cRepeat;
423 
424  if (infoPtr->nToFrame == 0xFFFF)
425  infoPtr->nToFrame = infoPtr->mah.dwTotalFrames - 1;
426 
427  TRACE("(repeat=%d from=%d to=%d);\n",
428  infoPtr->nLoop, infoPtr->nFromFrame, infoPtr->nToFrame);
429 
430  if (infoPtr->nFromFrame >= infoPtr->mah.dwTotalFrames &&
431  (SHORT)infoPtr->nFromFrame < 0)
432  infoPtr->nFromFrame = 0;
433 
434  if (infoPtr->nFromFrame > infoPtr->nToFrame ||
435  infoPtr->nToFrame >= infoPtr->mah.dwTotalFrames)
436  return FALSE;
437 
438  infoPtr->currFrame = infoPtr->nFromFrame;
439 
440  /* seek - doesn't need to start a thread or set a timer and neither
441  * does it send a notification */
442  if (infoPtr->nFromFrame == infoPtr->nToFrame)
443  {
444  HDC hDC;
445 
446  if ((hDC = GetDC(infoPtr->hwndSelf)) != 0)
447  {
448  ANIMATE_DrawFrame(infoPtr, hDC);
449 
450  ReleaseDC(infoPtr->hwndSelf, hDC);
451  }
452  return TRUE;
453  }
454 
455  if (infoPtr->dwStyle & ACS_TIMER)
456  {
457  TRACE("Using a timer\n");
458  /* create a timer to display AVI */
459  infoPtr->uTimer = SetTimer(infoPtr->hwndSelf, 1,
460  infoPtr->mah.dwMicroSecPerFrame / 1000, NULL);
461  }
462  else
463  {
464  TRACE("Using an animation thread\n");
465  infoPtr->hStopEvent = CreateEventW( NULL, TRUE, FALSE, NULL );
467  infoPtr, 0, &infoPtr->threadId);
468  if(!infoPtr->hThread) return FALSE;
469 
470  }
471 
472  ANIMATE_Notify(infoPtr, ACN_START);
473 
474  return TRUE;
475 }
#define HDC
Definition: msvc.h:22
int nToFrame
Definition: animate.c:77
#define TRUE
Definition: types.h:120
DWORD threadId
Definition: animate.c:73
HDC WINAPI GetDC(_In_opt_ HWND)
int nFromFrame
Definition: animate.c:76
static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
Definition: animate.c:384
#define ACN_START
Definition: commctrl.h:4126
int nLoop
Definition: animate.c:78
HWND hwndSelf
Definition: animate.c:56
MainAVIHeader mah
Definition: animate.c:60
DWORD dwMicroSecPerFrame
Definition: vfw.h:941
#define ACS_TIMER
Definition: commctrl.h:4116
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
HMMIO hMMio
Definition: animate.c:55
short SHORT
Definition: pedump.c:59
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:112
smooth NULL
Definition: ftsmooth.c:416
HANDLE hThread
Definition: animate.c:72
UINT uTimer
Definition: animate.c:74
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwStyle
Definition: animate.c:58
DWORD dwTotalFrames
Definition: vfw.h:945
static HDC hDC
Definition: 3dtext.c:33
HANDLE hStopEvent
Definition: animate.c:71
int currFrame
Definition: animate.c:79
static BOOL ANIMATE_DrawFrame(ANIMATE_INFO *infoPtr, HDC hDC)
Definition: animate.c:340
static void ANIMATE_Notify(const ANIMATE_INFO *infoPtr, UINT notif)
Definition: animate.c:88

◆ ANIMATE_Register()

void ANIMATE_Register ( void  )

Definition at line 965 of file animate.c.

Referenced by DllMain().

966 {
967  WNDCLASSW wndClass;
968 
969  ZeroMemory(&wndClass, sizeof(WNDCLASSW));
970  wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
971  wndClass.lpfnWndProc = ANIMATE_WindowProc;
972  wndClass.cbClsExtra = 0;
973  wndClass.cbWndExtra = sizeof(ANIMATE_INFO *);
974  wndClass.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW);
975  wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
976  wndClass.lpszClassName = ANIMATE_CLASSW;
977 
978  RegisterClassW(&wndClass);
979 }
UINT style
Definition: winuser.h:3129
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define ZeroMemory
Definition: winbase.h:1635
int cbClsExtra
Definition: winuser.h:3131
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
WNDPROC lpfnWndProc
Definition: winuser.h:3130
LPCWSTR lpszClassName
Definition: winuser.h:3138
int cbWndExtra
Definition: winuser.h:3132
static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: animate.c:876
#define CS_GLOBALCLASS
Definition: winuser.h:647
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define ANIMATE_CLASSW
Definition: commctrl.h:4108
#define COLOR_BTNFACE
Definition: winuser.h:918
#define CS_DBLCLKS
Definition: winuser.h:646
HCURSOR hCursor
Definition: winuser.h:3135
HBRUSH hbrBackground
Definition: winuser.h:3136
#define IDC_ARROW
Definition: winuser.h:682

◆ ANIMATE_Stop()

static BOOL ANIMATE_Stop ( ANIMATE_INFO infoPtr)
static

Definition at line 784 of file animate.c.

Referenced by ANIMATE_WindowProc().

785 {
786  /* nothing opened */
787  if (!infoPtr->hMMio)
788  return FALSE;
789 
790  ANIMATE_DoStop(infoPtr);
791  return TRUE;
792 }
#define TRUE
Definition: types.h:120
static BOOL ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
Definition: animate.c:138
HMMIO hMMio
Definition: animate.c:55

◆ ANIMATE_StyleChanged()

static LRESULT ANIMATE_StyleChanged ( ANIMATE_INFO infoPtr,
WPARAM  wStyleType,
const STYLESTRUCT lpss 
)
static

Definition at line 862 of file animate.c.

Referenced by ANIMATE_WindowProc().

863 {
864  TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n",
865  wStyleType, lpss->styleOld, lpss->styleNew);
866 
867  if (wStyleType != GWL_STYLE) return 0;
868 
869  infoPtr->dwStyle = lpss->styleNew;
870 
871  InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
872  return 0;
873 }
#define TRUE
Definition: types.h:120
HWND hwndSelf
Definition: animate.c:56
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
DWORD dwStyle
Definition: animate.c:58
#define GWL_STYLE
Definition: winuser.h:846
DWORD styleNew
Definition: winuser.h:3635
DWORD styleOld
Definition: winuser.h:3634

◆ ANIMATE_Timer()

static LRESULT ANIMATE_Timer ( ANIMATE_INFO infoPtr)
static

Definition at line 368 of file animate.c.

Referenced by ANIMATE_WindowProc().

369 {
370  HDC hDC;
371 
372  if ((hDC = GetDC(infoPtr->hwndSelf)) != 0)
373  {
374  EnterCriticalSection(&infoPtr->cs);
375  ANIMATE_DrawFrame(infoPtr, hDC);
376  LeaveCriticalSection(&infoPtr->cs);
377 
378  ReleaseDC(infoPtr->hwndSelf, hDC);
379  }
380 
381  return 0;
382 }
#define HDC
Definition: msvc.h:22
HDC WINAPI GetDC(_In_opt_ HWND)
HWND hwndSelf
Definition: animate.c:56
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static HDC hDC
Definition: 3dtext.c:33
CRITICAL_SECTION cs
Definition: animate.c:70
static BOOL ANIMATE_DrawFrame(ANIMATE_INFO *infoPtr, HDC hDC)
Definition: animate.c:340
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ ANIMATE_TransparentBlt()

static void ANIMATE_TransparentBlt ( ANIMATE_INFO const infoPtr,
HDC  hdcDest,
HDC  hdcSource 
)
static

Definition at line 220 of file animate.c.

Referenced by ANIMATE_PaintFrame().

221 {
222  HDC hdcMask;
223  HBITMAP hbmMask;
224  HBITMAP hbmOld;
225 
226  /* create a transparency mask */
227  hdcMask = CreateCompatibleDC(hdcDest);
228  hbmMask = CreateBitmap(infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, 1,1,NULL);
229  hbmOld = SelectObject(hdcMask, hbmMask);
230 
231  SetBkColor(hdcSource,infoPtr->transparentColor);
232  BitBlt(hdcMask,0,0,infoPtr->inbih->biWidth, infoPtr->inbih->biHeight,hdcSource,0,0,SRCCOPY);
233 
234  /* mask the source bitmap */
235  SetBkColor(hdcSource, RGB(0,0,0));
236  SetTextColor(hdcSource, RGB(255,255,255));
237  BitBlt(hdcSource, 0, 0, infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, hdcMask, 0, 0, SRCAND);
238 
239  /* mask the destination bitmap */
240  SetBkColor(hdcDest, RGB(255,255,255));
241  SetTextColor(hdcDest, RGB(0,0,0));
242  BitBlt(hdcDest, 0, 0, infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, hdcMask, 0, 0, SRCAND);
243 
244  /* combine source and destination */
245  BitBlt(hdcDest,0,0,infoPtr->inbih->biWidth, infoPtr->inbih->biHeight,hdcSource,0,0,SRCPAINT);
246 
247  SelectObject(hdcMask, hbmOld);
248  DeleteObject(hbmMask);
249  DeleteDC(hdcMask);
250 }
#define SRCPAINT
Definition: wingdi.h:332
#define HDC
Definition: msvc.h:22
#define HBITMAP
Definition: msvc.h:28
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:416
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
smooth NULL
Definition: ftsmooth.c:416
#define RGB(r, g, b)
Definition: wingdi.h:2917
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:784
BOOL WINAPI DeleteDC(_In_ HDC)
#define SRCAND
Definition: wingdi.h:328
#define SRCCOPY
Definition: wingdi.h:331
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)

◆ ANIMATE_Unregister()

void ANIMATE_Unregister ( void  )

Definition at line 982 of file animate.c.

Referenced by DllMain().

983 {
985 }
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
smooth NULL
Definition: ftsmooth.c:416
#define ANIMATE_CLASSW
Definition: commctrl.h:4108

◆ ANIMATE_WindowProc()

static LRESULT WINAPI ANIMATE_WindowProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 876 of file animate.c.

Referenced by ANIMATE_Register().

877 {
878  ANIMATE_INFO *infoPtr = (ANIMATE_INFO *)GetWindowLongPtrW(hWnd, 0);
879 
880  TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hWnd, uMsg, wParam, lParam);
881  if (!infoPtr && (uMsg != WM_NCCREATE))
882  return DefWindowProcW(hWnd, uMsg, wParam, lParam);
883  switch (uMsg)
884  {
885  case ACM_OPENA:
886  return ANIMATE_OpenA(infoPtr, (HINSTANCE)wParam, (LPSTR)lParam);
887 
888  case ACM_OPENW:
889  return ANIMATE_OpenW(infoPtr, (HINSTANCE)wParam, (LPWSTR)lParam);
890 
891  case ACM_PLAY:
892  return ANIMATE_Play(infoPtr, (INT)wParam, LOWORD(lParam), HIWORD(lParam));
893 
894  case ACM_STOP:
895  return ANIMATE_Stop(infoPtr);
896 
897  case WM_CLOSE:
898  ANIMATE_Free(infoPtr);
899  return 0;
900 
901  case WM_NCCREATE:
902  return ANIMATE_Create(hWnd, (LPCREATESTRUCTW)lParam);
903 
904  case WM_NCHITTEST:
905  return HTTRANSPARENT;
906 
907  case WM_DESTROY:
908  return ANIMATE_Destroy(infoPtr);
909 
910  case WM_ERASEBKGND:
911  return ANIMATE_EraseBackground(infoPtr, (HDC)wParam);
912 
913  case WM_STYLECHANGED:
914  return ANIMATE_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
915 
916  case WM_TIMER:
917  return ANIMATE_Timer(infoPtr);
918 
919  case WM_PRINTCLIENT:
920  case WM_PAINT:
921  {
922  /* the animation has not decompressed
923  * (and displayed) the first frame yet, don't paint
924  */
925  if (!infoPtr->hbmPrevFrame)
926  {
927  /* default paint handling */
928  return DefWindowProcW(hWnd, uMsg, wParam, lParam);
929  }
930 
931  if (wParam)
932  {
933  EnterCriticalSection(&infoPtr->cs);
934  ANIMATE_PaintFrame(infoPtr, (HDC)wParam);
935  LeaveCriticalSection(&infoPtr->cs);
936  }
937  else
938  {
939  PAINTSTRUCT ps;
940  HDC hDC = BeginPaint(infoPtr->hwndSelf, &ps);
941 
942  EnterCriticalSection(&infoPtr->cs);
943  ANIMATE_PaintFrame(infoPtr, hDC);
944  LeaveCriticalSection(&infoPtr->cs);
945 
946  EndPaint(infoPtr->hwndSelf, &ps);
947  }
948  }
949  break;
950 
951  case WM_SIZE:
952  if (infoPtr->dwStyle & ACS_CENTER)
953  InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
954  return DefWindowProcW(hWnd, uMsg, wParam, lParam);
955 
956  default:
957  if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
958  ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
959 
960  return DefWindowProcW(hWnd, uMsg, wParam, lParam);
961  }
962  return 0;
963 }
#define HDC
Definition: msvc.h:22
#define HTTRANSPARENT
Definition: winuser.h:2427
#define TRUE
Definition: types.h:120
#define ACM_OPENW
Definition: commctrl.h:4119
#define ACM_STOP
Definition: commctrl.h:4124
HWND hwndSelf
Definition: animate.c:56
static BOOL ANIMATE_OpenA(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPSTR lpszName)
Definition: animate.c:764
#define WM_NCHITTEST
Definition: winuser.h:1668
#define ACS_CENTER
Definition: commctrl.h:4113
#define GetWindowLongPtrW
Definition: winuser.h:4698
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static LRESULT ANIMATE_Destroy(ANIMATE_INFO *infoPtr)
Definition: animate.c:832
char * LPSTR
Definition: xmlstorage.h:182
#define WM_NCCREATE
Definition: winuser.h:1665
static BOOL ANIMATE_PaintFrame(ANIMATE_INFO *infoPtr, HDC hDC)
Definition: animate.c:252
static void ANIMATE_Free(ANIMATE_INFO *infoPtr)
Definition: animate.c:181
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
#define WM_PRINTCLIENT
Definition: richedit.h:70
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static BOOL ANIMATE_EraseBackground(ANIMATE_INFO const *infoPtr, HDC hdc)
Definition: animate.c:848
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
smooth NULL
Definition: ftsmooth.c:416
#define WM_DESTROY
Definition: winuser.h:1591
static LRESULT ANIMATE_StyleChanged(ANIMATE_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
Definition: animate.c:862
#define TRACE(s)
Definition: solgame.cpp:4
#define ACM_PLAY
Definition: commctrl.h:4123
#define WM_SIZE
Definition: winuser.h:1593
#define WM_TIMER
Definition: winuser.h:1718
#define WM_CLOSE
Definition: winuser.h:1603
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HBITMAP hbmPrevFrame
Definition: animate.c:83
#define WM_PAINT
Definition: winuser.h:1602
DWORD dwStyle
Definition: animate.c:58
#define WM_APP
Definition: eventvwr.h:70
static LRESULT ANIMATE_Timer(ANIMATE_INFO *infoPtr)
Definition: animate.c:368
#define WM_USER
Definition: winuser.h:1856
static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lpszName)
Definition: animate.c:694
#define ERR(fmt,...)
Definition: debug.h:109
#define ACM_OPENA
Definition: commctrl.h:4118
static HDC hDC
Definition: 3dtext.c:33
CRITICAL_SECTION cs
Definition: animate.c:70
static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WORD wTo)
Definition: animate.c:409
#define HIWORD(l)
Definition: typedefs.h:246
static BOOL ANIMATE_Stop(ANIMATE_INFO *infoPtr)
Definition: animate.c:784
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
Definition: commctrl.c:1745
#define WM_ERASEBKGND
Definition: winuser.h:1607
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs)
Definition: animate.c:795
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( animate  )

Variable Documentation

◆ DWORD

Definition at line 45 of file animate.c.

◆ DWORD_PTR

Definition at line 47 of file animate.c.

Referenced by ANIMATE_Create().

◆ fnIC

struct { ... } fnIC

◆ hModule

◆ LPBITMAPINFOHEADER

Definition at line 48 of file animate.c.

◆ LPVOID

Definition at line 48 of file animate.c.

◆ UINT

Definition at line 45 of file animate.c.