strmbase: Get rid of the "pfnPossiblyEatMessage" callback.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-10-15 16:00:17 -05:00 committed by Alexandre Julliard
parent 0854f67d09
commit 55b2251fef
4 changed files with 38 additions and 54 deletions

View File

@ -444,7 +444,6 @@ static const BaseWindowFuncTable renderer_BaseWindowFuncTable = {
VideoRenderer_GetClassWindowStyles,
VideoRenderer_GetDefaultRect,
NULL,
BaseControlWindowImpl_PossiblyEatMessage,
VideoRenderer_OnSize
};

View File

@ -607,7 +607,6 @@ static const BaseWindowFuncTable renderer_BaseWindowFuncTable = {
VMR9_GetClassWindowStyles,
VMR9_GetDefaultRect,
NULL,
BaseControlWindowImpl_PossiblyEatMessage,
VMR9_OnSize,
};

View File

@ -45,21 +45,49 @@ static LRESULT CALLBACK WndProcW(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
return BaseWindowImpl_OnReceiveMessage(This, hwnd, uMsg, wParam, lParam);
}
LRESULT WINAPI BaseWindowImpl_OnReceiveMessage(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI BaseWindowImpl_OnReceiveMessage(BaseWindow *This, HWND hwnd, INT message, WPARAM wparam, LPARAM lparam)
{
if (This->pFuncsTable->pfnPossiblyEatMessage && This->pFuncsTable->pfnPossiblyEatMessage(This, uMsg, wParam, lParam))
return 0;
BaseControlWindow *window = impl_from_BaseWindow(This);
switch (uMsg)
switch (message)
{
case WM_SIZE:
if (This->pFuncsTable->pfnOnSize)
return This->pFuncsTable->pfnOnSize(This, LOWORD(lParam), HIWORD(lParam));
else
return BaseWindowImpl_OnSize(This, LOWORD(lParam), HIWORD(lParam));
case WM_KEYDOWN:
case WM_KEYUP:
case WM_LBUTTONDBLCLK:
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_MBUTTONDBLCLK:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
case WM_MOUSEACTIVATE:
case WM_MOUSEMOVE:
case WM_NCLBUTTONDBLCLK:
case WM_NCLBUTTONDOWN:
case WM_NCLBUTTONUP:
case WM_NCMBUTTONDBLCLK:
case WM_NCMBUTTONDOWN:
case WM_NCMBUTTONUP:
case WM_NCMOUSEMOVE:
case WM_NCRBUTTONDBLCLK:
case WM_NCRBUTTONDOWN:
case WM_NCRBUTTONUP:
case WM_RBUTTONDBLCLK:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
if (window->hwndDrain)
{
PostMessageW(window->hwndDrain, message, wparam, lparam);
return 0;
}
break;
case WM_SIZE:
if (This->pFuncsTable->pfnOnSize)
return This->pFuncsTable->pfnOnSize(This, LOWORD(lparam), HIWORD(lparam));
else
return BaseWindowImpl_OnSize(This, LOWORD(lparam), HIWORD(lparam));
}
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
return DefWindowProcW(hwnd, message, wparam, lparam);
}
BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Width, LONG Height)
@ -147,46 +175,6 @@ HRESULT WINAPI BaseWindowImpl_DoneWithWindow(BaseWindow *This)
return S_OK;
}
BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
BaseControlWindow* pControlWindow = impl_from_BaseWindow(This);
if (pControlWindow->hwndDrain)
{
switch(uMsg)
{
case WM_KEYDOWN:
case WM_KEYUP:
case WM_LBUTTONDBLCLK:
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_MBUTTONDBLCLK:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
case WM_MOUSEACTIVATE:
case WM_MOUSEMOVE:
case WM_NCLBUTTONDBLCLK:
case WM_NCLBUTTONDOWN:
case WM_NCLBUTTONUP:
case WM_NCMBUTTONDBLCLK:
case WM_NCMBUTTONDOWN:
case WM_NCMBUTTONUP:
case WM_NCMOUSEMOVE:
case WM_NCRBUTTONDBLCLK:
case WM_NCRBUTTONDOWN:
case WM_NCRBUTTONUP:
case WM_RBUTTONDBLCLK:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
PostMessageW(pControlWindow->hwndDrain, uMsg, wParam, lParam);
return TRUE;
default:
break;
}
}
return FALSE;
}
HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow,
const IVideoWindowVtbl *lpVtbl, struct strmbase_filter *owner,
CRITICAL_SECTION *lock, struct strmbase_pin *pPin, const BaseWindowFuncTable *pFuncsTable)

View File

@ -371,7 +371,6 @@ typedef struct tagBaseWindow
typedef LPWSTR (WINAPI *BaseWindow_GetClassWindowStyles)(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx);
typedef RECT (WINAPI *BaseWindow_GetDefaultRect)(BaseWindow *This);
typedef BOOL (WINAPI *BaseWindow_PossiblyEatMessage)(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam);
typedef LRESULT (WINAPI *BaseWindow_OnReceiveMessage)(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam);
typedef BOOL (WINAPI *BaseWindow_OnSize)(BaseWindow *This, LONG Height, LONG Width);
@ -382,7 +381,6 @@ typedef struct BaseWindowFuncTable
BaseWindow_GetDefaultRect pfnGetDefaultRect;
/* Optional, WinProc Related */
BaseWindow_OnReceiveMessage pfnOnReceiveMessage;
BaseWindow_PossiblyEatMessage pfnPossiblyEatMessage;
BaseWindow_OnSize pfnOnSize;
} BaseWindowFuncTable;