strmbase: Get rid of the "pfnGetClassWindowStyles" callback.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
81484b24f4
commit
b0b2c7d699
|
@ -53,6 +53,8 @@ typedef struct VideoRendererImpl
|
|||
LONG VideoWidth;
|
||||
LONG VideoHeight;
|
||||
LONG FullScreenMode;
|
||||
|
||||
DWORD saved_style;
|
||||
} VideoRendererImpl;
|
||||
|
||||
static inline VideoRendererImpl *impl_from_BaseWindow(BaseWindow *iface)
|
||||
|
@ -392,17 +394,6 @@ static void video_renderer_start_stream(BaseRenderer *iface)
|
|||
}
|
||||
}
|
||||
|
||||
static LPWSTR WINAPI VideoRenderer_GetClassWindowStyles(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx)
|
||||
{
|
||||
static const WCHAR classnameW[] = { 'W','i','n','e',' ','A','c','t','i','v','e','M','o','v','i','e',' ','C','l','a','s','s',0 };
|
||||
|
||||
*pClassStyles = 0;
|
||||
*pWindowStyles = WS_SIZEBOX;
|
||||
*pWindowStylesEx = 0;
|
||||
|
||||
return (LPWSTR)classnameW;
|
||||
}
|
||||
|
||||
static RECT WINAPI VideoRenderer_GetDefaultRect(BaseWindow *iface)
|
||||
{
|
||||
VideoRendererImpl *This = impl_from_BaseWindow(iface);
|
||||
|
@ -441,7 +432,6 @@ static const BaseRendererFuncTable BaseFuncTable =
|
|||
};
|
||||
|
||||
static const BaseWindowFuncTable renderer_BaseWindowFuncTable = {
|
||||
VideoRenderer_GetClassWindowStyles,
|
||||
VideoRenderer_GetDefaultRect,
|
||||
VideoRenderer_OnSize
|
||||
};
|
||||
|
@ -674,7 +664,7 @@ static HRESULT WINAPI VideoWindow_put_FullScreenMode(IVideoWindow *iface,
|
|||
FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, FullScreenMode);
|
||||
|
||||
if (FullScreenMode) {
|
||||
This->baseControlWindow.baseWindow.WindowStyles = GetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE);
|
||||
This->saved_style = GetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE);
|
||||
ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_HIDE);
|
||||
SetParent(This->baseControlWindow.baseWindow.hWnd, 0);
|
||||
SetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE, WS_POPUP);
|
||||
|
@ -684,7 +674,7 @@ static HRESULT WINAPI VideoWindow_put_FullScreenMode(IVideoWindow *iface,
|
|||
} else {
|
||||
ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_HIDE);
|
||||
SetParent(This->baseControlWindow.baseWindow.hWnd, This->baseControlWindow.hwndOwner);
|
||||
SetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE, This->baseControlWindow.baseWindow.WindowStyles);
|
||||
SetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE, This->saved_style);
|
||||
GetClientRect(This->baseControlWindow.baseWindow.hWnd, &This->DestRect);
|
||||
SetWindowPos(This->baseControlWindow.baseWindow.hWnd,0,This->DestRect.left,This->DestRect.top,This->DestRect.right,This->DestRect.bottom,SWP_NOZORDER|SWP_SHOWWINDOW);
|
||||
This->WindowPos = This->DestRect;
|
||||
|
|
|
@ -568,17 +568,6 @@ static const BaseRendererFuncTable BaseFuncTable =
|
|||
.renderer_pin_query_interface = vmr_pin_query_interface,
|
||||
};
|
||||
|
||||
static LPWSTR WINAPI VMR9_GetClassWindowStyles(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx)
|
||||
{
|
||||
static WCHAR classnameW[] = { 'I','V','M','R','9',' ','C','l','a','s','s', 0 };
|
||||
|
||||
*pClassStyles = 0;
|
||||
*pWindowStyles = WS_SIZEBOX;
|
||||
*pWindowStylesEx = 0;
|
||||
|
||||
return classnameW;
|
||||
}
|
||||
|
||||
static RECT WINAPI VMR9_GetDefaultRect(BaseWindow *This)
|
||||
{
|
||||
struct quartz_vmr* pVMR9 = impl_from_BaseWindow(This);
|
||||
|
@ -604,7 +593,6 @@ static BOOL WINAPI VMR9_OnSize(BaseWindow *This, LONG Width, LONG Height)
|
|||
}
|
||||
|
||||
static const BaseWindowFuncTable renderer_BaseWindowFuncTable = {
|
||||
VMR9_GetClassWindowStyles,
|
||||
VMR9_GetDefaultRect,
|
||||
VMR9_OnSize,
|
||||
};
|
||||
|
|
|
@ -110,33 +110,24 @@ HRESULT WINAPI BaseWindow_Destroy(BaseWindow *This)
|
|||
|
||||
HRESULT WINAPI BaseWindowImpl_PrepareWindow(BaseWindow *This)
|
||||
{
|
||||
WNDCLASSW winclass;
|
||||
static const WCHAR class_nameW[] = {'w','i','n','e','_','s','t','r','m','b','a','s','e','_','w','i','n','d','o','w',0};
|
||||
static const WCHAR windownameW[] = { 'A','c','t','i','v','e','M','o','v','i','e',' ','W','i','n','d','o','w',0 };
|
||||
WNDCLASSW winclass = {0};
|
||||
|
||||
This->pClassName = This->pFuncsTable->pfnGetClassWindowStyles(This, &This->ClassStyles, &This->WindowStyles, &This->WindowStylesEx);
|
||||
|
||||
winclass.style = This->ClassStyles;
|
||||
winclass.lpfnWndProc = WndProcW;
|
||||
winclass.cbClsExtra = 0;
|
||||
winclass.cbWndExtra = sizeof(BaseWindow*);
|
||||
winclass.hInstance = This->hInstance;
|
||||
winclass.hIcon = NULL;
|
||||
winclass.hCursor = NULL;
|
||||
winclass.hbrBackground = GetStockObject(BLACK_BRUSH);
|
||||
winclass.lpszMenuName = NULL;
|
||||
winclass.lpszClassName = This->pClassName;
|
||||
winclass.lpszClassName = class_nameW;
|
||||
if (!RegisterClassW(&winclass) && GetLastError() != ERROR_CLASS_ALREADY_EXISTS)
|
||||
{
|
||||
ERR("Unable to register window class: %u\n", GetLastError());
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
This->hWnd = CreateWindowExW(This->WindowStylesEx,
|
||||
This->pClassName, windownameW,
|
||||
This->WindowStyles,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, NULL, NULL, This->hInstance,
|
||||
NULL);
|
||||
This->hWnd = CreateWindowExW(0, class_nameW, windownameW, WS_SIZEBOX,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
NULL, NULL, This->hInstance, NULL);
|
||||
|
||||
if (!This->hWnd)
|
||||
{
|
||||
|
@ -305,7 +296,6 @@ HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG W
|
|||
SetWindowLongW(This->baseWindow.hWnd, GWL_STYLE, WindowStyle);
|
||||
SetWindowPos(This->baseWindow.hWnd, 0, 0, 0, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
|
||||
This->baseWindow.WindowStyles = WindowStyle;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -360,23 +360,17 @@ typedef struct tagBaseWindow
|
|||
LONG Width;
|
||||
LONG Height;
|
||||
HINSTANCE hInstance;
|
||||
LPWSTR pClassName;
|
||||
DWORD ClassStyles;
|
||||
DWORD WindowStyles;
|
||||
DWORD WindowStylesEx;
|
||||
HDC hDC;
|
||||
|
||||
const struct BaseWindowFuncTable* pFuncsTable;
|
||||
} BaseWindow;
|
||||
|
||||
typedef LPWSTR (WINAPI *BaseWindow_GetClassWindowStyles)(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx);
|
||||
typedef RECT (WINAPI *BaseWindow_GetDefaultRect)(BaseWindow *This);
|
||||
typedef BOOL (WINAPI *BaseWindow_OnSize)(BaseWindow *This, LONG Height, LONG Width);
|
||||
|
||||
typedef struct BaseWindowFuncTable
|
||||
{
|
||||
/* Required */
|
||||
BaseWindow_GetClassWindowStyles pfnGetClassWindowStyles;
|
||||
BaseWindow_GetDefaultRect pfnGetDefaultRect;
|
||||
/* Optional, WinProc Related */
|
||||
BaseWindow_OnSize pfnOnSize;
|
||||
|
|
Loading…
Reference in New Issue