86 #define ANIMATE_COLOR_NONE 0xffffffff 97 static const WCHAR aviW[] = {
'A',
'V',
'I', 0 };
114 memset(&mminfo, 0,
sizeof(mminfo));
149 TRACE(
"stopping animation thread\n");
157 TRACE(
"animation thread stopped\n");
254 void const *pBitmapData;
268 pBitmapData = infoPtr->
outdata;
276 pBitmapData = infoPtr->
indata;
330 nOffsetX = ((
rect.right -
rect.left) - nWidth)/2;
331 nOffsetY = ((
rect.bottom -
rect.top) - nHeight)/2;
350 WARN(
"Decompression error\n");
358 if (infoPtr->
nLoop != -1) {
359 if (--infoPtr->
nLoop == 0) {
416 TRACE(
"Already playing\n");
422 infoPtr->
nLoop = cRepeat;
427 TRACE(
"(repeat=%d from=%d to=%d);\n",
457 TRACE(
"Using a timer\n");
464 TRACE(
"Using an animation thread\n");
488 WARN(
"Can't find 'RIFF' chunk\n");
494 WARN(
"Can't find 'AVI ' chunk\n");
500 WARN(
"Can't find 'hdrl' list\n");
506 WARN(
"Can't find 'avih' chunk\n");
527 WARN(
"Can't find 'strl' list\n");
533 WARN(
"Can't find 'strh' chunk\n");
565 WARN(
"Can't find 'strh' chunk\n");
570 if (!infoPtr->
inbih) {
571 WARN(
"Can't alloc input BIH\n");
599 WARN(
"There should be a single 'strl' list\n");
610 WARN(
"Can't find 'movi' list\n");
622 numFrame < infoPtr->mah.dwTotalFrames) {
662 WARN(
"Can't load codec for the file\n");
669 infoPtr->
outbih = heap_alloc_zero(outSize);
676 WARN(
"Can't get output BIH\n");
686 WARN(
"Can't begin decompression\n");
702 TRACE(
"Closing avi.\n");
704 return (infoPtr->
hMMio != 0);
716 TRACE(
"No AVI resource found.\n");
719 WARN(
"No AVI file found.\n");
728 WARN(
"No AVI resource found.\n");
735 WARN(
"Can't get AVI information\n");
742 WARN(
"Can't get AVI Codec\n");
775 if (!lpwszName)
return FALSE;
797 static const WCHAR msvfw32W[] = {
'm',
's',
'v',
'f',
'w',
'3',
'2',
'.',
'd',
'l',
'l', 0 };
812 infoPtr = heap_alloc_zero(
sizeof(*infoPtr));
813 if (!infoPtr)
return FALSE;
817 infoPtr->hwndSelf =
hWnd;
820 infoPtr->hbmPrevFrame = 0;
821 infoPtr->dwStyle = lpcs->
style;
823 TRACE(
"Animate style=0x%08x, parent=%p\n", infoPtr->dwStyle, infoPtr->hwndNotify);
826 infoPtr->cs.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": ANIMATE_INFO*->cs");
864 TRACE(
"(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n",
913 case WM_STYLECHANGED:
void ANIMATE_Register(void)
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
struct tagBITMAPINFO * LPBITMAPINFO
static BOOL ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
#define ANIMATE_COLOR_NONE
#define WM_CTLCOLORSTATIC
MMRESULT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags)
static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
LPVOID WINAPI LockResource(HGLOBAL handle)
MMRESULT WINAPI mmioClose(HMMIO hmmio, UINT uFlags)
static BOOL ANIMATE_OpenA(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPSTR lpszName)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HMMIO WINAPI mmioOpenW(LPWSTR szFileName, MMIOINFO *lpmmioinfo, DWORD dwOpenFlags)
#define GetWindowLongPtrW
LPBITMAPINFOHEADER outbih
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static LRESULT ANIMATE_Destroy(ANIMATE_INFO *infoPtr)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
static BOOL ANIMATE_PaintFrame(ANIMATE_INFO *infoPtr, HDC hDC)
static void ANIMATE_Free(ANIMATE_INFO *infoPtr)
LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
GLbitfield GLuint64 timeout
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
static void * heap_alloc(size_t len)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
void ANIMATE_Unregister(void)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
int WINAPI GetDlgCtrlID(_In_ HWND)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
WINE_DEFAULT_DEBUG_CHANNEL(animate)
static BOOL ANIMATE_EraseBackground(ANIMATE_INFO const *infoPtr, HDC hdc)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI FreeResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
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)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
DWORD WINAPI GetCurrentThreadId(VOID)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
static LRESULT ANIMATE_StyleChanged(ANIMATE_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
#define IS_INTRESOURCE(i)
static void ANIMATE_TransparentBlt(ANIMATE_INFO const *infoPtr, HDC hdcDest, HDC hdcSource)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define ICMODE_DECOMPRESS
static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define ICM_DECOMPRESS_GET_FORMAT
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
const unsigned char size_t insize
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
PCRITICAL_SECTION_DEBUG DebugInfo
COLORREF transparentColor
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
#define mmioFOURCC(c0, c1, c2, c3)
DWORD dwSuggestedBufferSize
#define ICM_DECOMPRESS_BEGIN
static LRESULT ANIMATE_Timer(ANIMATE_INFO *infoPtr)
static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lpszName)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static BOOL ANIMATE_LoadFileW(ANIMATE_INFO *infoPtr, LPWSTR lpName)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI DeleteDC(_In_ HDC)
MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, const MMCKINFO *lpckParent, UINT uFlags)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WORD wTo)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr)
#define MultiByteToWideChar
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static BOOL ANIMATE_DrawFrame(ANIMATE_INFO *infoPtr, HDC hDC)
static BOOL ANIMATE_Stop(ANIMATE_INFO *infoPtr)
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
#define GetProcAddress(x, y)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SetWindowLongPtrW
DWORD dwPaddingGranularity
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
static void ANIMATE_Notify(const ANIMATE_INFO *infoPtr, UINT notif)
static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs)
int WINAPI SetDIBits(_In_opt_ HDC, _In_ HBITMAP, _In_ UINT, _In_ UINT, _In_ CONST VOID *, _In_ CONST BITMAPINFO *, _In_ UINT)
static BOOL ANIMATE_LoadResW(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPCWSTR lpName)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch)
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
static BOOL heap_free(void *mem)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
static IMMNotificationClient notif