Cleaned up a few USER dependencies.
This commit is contained in:
parent
e3b353e220
commit
946a4448af
|
@ -190,6 +190,10 @@ void THUNK_InitCallout(void)
|
|||
GETADDR( DispatchMessageA );
|
||||
GETADDR( RedrawWindow );
|
||||
GETADDR( WaitForInputIdle );
|
||||
GETADDR( MsgWaitForMultipleObjects );
|
||||
GETADDR( WindowFromDC );
|
||||
GETADDR( GetForegroundWindow );
|
||||
GETADDR( IsChild );
|
||||
GETADDR( MessageBoxA );
|
||||
GETADDR( MessageBoxW );
|
||||
#undef GETADDR
|
||||
|
|
|
@ -100,6 +100,12 @@ typedef struct
|
|||
void WINAPI (*UserYield16)( void );
|
||||
WORD WINAPI (*DestroyIcon32)( HGLOBAL16 handle, UINT16 flags );
|
||||
DWORD WINAPI (*WaitForInputIdle)( HANDLE hProcess, DWORD dwTimeOut );
|
||||
DWORD WINAPI (*MsgWaitForMultipleObjects)( DWORD nCount, HANDLE *pHandles,
|
||||
BOOL fWaitAll, DWORD dwMilliseconds,
|
||||
DWORD dwWakeMask );
|
||||
HWND WINAPI (*WindowFromDC)( HDC hDC );
|
||||
HWND WINAPI (*GetForegroundWindow)(void);
|
||||
BOOL WINAPI (*IsChild)( HWND parent, HWND child );
|
||||
|
||||
INT WINAPI (*MessageBoxA)( HWND hWnd, LPCSTR text, LPCSTR title, UINT type );
|
||||
INT WINAPI (*MessageBoxW)( HWND hwnd, LPCWSTR text, LPCWSTR title, UINT type );
|
||||
|
|
|
@ -31,7 +31,6 @@ VOID WINAPI KEYBOARD_Disable(VOID);
|
|||
|
||||
extern BOOL KEYBOARD_GetBeepActive(void);
|
||||
extern void KEYBOARD_SetBeepActive(BOOL bActivate);
|
||||
extern void KEYBOARD_Beep(void);
|
||||
|
||||
extern void KEYBOARD_SendEvent(BYTE bVk, BYTE bScan, DWORD dwFlags, DWORD posX, DWORD posY, DWORD time);
|
||||
|
||||
|
|
|
@ -431,7 +431,7 @@ void DOSVM_Wait( int read_pipe, HANDLE hObject )
|
|||
break;
|
||||
}
|
||||
/* nothing yet, block while waiting for something to do */
|
||||
waitret=MsgWaitForMultipleObjects(objc,objs,FALSE,INFINITE,QS_ALLINPUT);
|
||||
waitret=Callout.MsgWaitForMultipleObjects(objc,objs,FALSE,INFINITE,QS_ALLINPUT);
|
||||
if (waitret==(DWORD)-1) {
|
||||
ERR_(module)("dosvm wait error=%ld\n",GetLastError());
|
||||
}
|
||||
|
|
23
misc/main.c
23
misc/main.c
|
@ -29,7 +29,6 @@
|
|||
#include "winnls.h"
|
||||
#include "console.h"
|
||||
#include "monitor.h"
|
||||
#include "keyboard.h"
|
||||
#include "gdi.h"
|
||||
#include "user.h"
|
||||
#include "windef.h"
|
||||
|
@ -585,32 +584,14 @@ void MAIN_WineInit(void)
|
|||
atexit(called_at_exit);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MessageBeep16 (USER.104)
|
||||
*/
|
||||
void WINAPI MessageBeep16( UINT16 i )
|
||||
{
|
||||
MessageBeep( i );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* MessageBeep (USER32.390)
|
||||
*/
|
||||
BOOL WINAPI MessageBeep( UINT i )
|
||||
{
|
||||
KEYBOARD_Beep();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Beep (KERNEL32.11)
|
||||
*/
|
||||
BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDur )
|
||||
{
|
||||
static char beep = '\a';
|
||||
/* dwFreq and dwDur are ignored by Win95 */
|
||||
KEYBOARD_Beep();
|
||||
if (isatty(2)) write( 2, &beep, 1 );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,11 +16,9 @@
|
|||
#include "global.h"
|
||||
#include "cursoricon.h"
|
||||
#include "debugtools.h"
|
||||
#include "monitor.h"
|
||||
#include "wine/winuser16.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(bitmap)
|
||||
DECLARE_DEBUG_CHANNEL(resource)
|
||||
DEFAULT_DEBUG_CHANNEL(bitmap);
|
||||
|
||||
BITMAP_DRIVER *BITMAP_Driver = NULL;
|
||||
|
||||
|
@ -74,7 +72,10 @@ HBITMAP16 WINAPI CreateUserBitmap16( INT16 width, INT16 height, UINT16 planes,
|
|||
HBITMAP16 WINAPI CreateUserDiscardableBitmap16( WORD dummy,
|
||||
INT16 width, INT16 height )
|
||||
{
|
||||
return CreateUserBitmap16( width, height, 1, MONITOR_GetDepth(&MONITOR_PrimaryMonitor), NULL );
|
||||
HDC hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
|
||||
HBITMAP16 ret = CreateCompatibleBitmap16( hdc, width, height );
|
||||
DeleteDC( hdc );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,10 +10,9 @@
|
|||
#include "callback.h"
|
||||
#include "dc.h"
|
||||
#include "debugtools.h"
|
||||
#include "monitor.h"
|
||||
#include "palette.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(bitmap)
|
||||
DEFAULT_DEBUG_CHANNEL(bitmap);
|
||||
|
||||
/***********************************************************************
|
||||
* DIB_GetDIBWidthBytes
|
||||
|
@ -849,8 +848,14 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
|
|||
|
||||
/* Now create the bitmap */
|
||||
|
||||
handle = fColor ? CreateBitmap( width, height, 1, MONITOR_GetDepth(&MONITOR_PrimaryMonitor), NULL ) :
|
||||
CreateBitmap( width, height, 1, 1, NULL );
|
||||
if (fColor)
|
||||
{
|
||||
HDC tmpdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
|
||||
handle = CreateCompatibleBitmap( tmpdc, width, height );
|
||||
DeleteDC( tmpdc );
|
||||
}
|
||||
else handle = CreateBitmap( width, height, 1, 1, NULL );
|
||||
|
||||
if (!handle) return 0;
|
||||
|
||||
if (init == CBM_INIT)
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "color.h"
|
||||
#include "palette.h"
|
||||
#include "debugtools.h"
|
||||
#include "callback.h"
|
||||
#include "winerror.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(palette)
|
||||
|
@ -766,25 +767,17 @@ HPALETTE WINAPI SelectPalette(
|
|||
HPALETTE hPal, /* [in] Handle of logical color palette */
|
||||
BOOL bForceBackground) /* [in] Foreground/background mode */
|
||||
{
|
||||
WORD wBkgPalette = 1;
|
||||
PALETTEOBJ* lpt = (PALETTEOBJ*) GDI_GetObjPtr( hPal, PALETTE_MAGIC );
|
||||
WORD wBkgPalette = 1;
|
||||
|
||||
TRACE("dc=%04x,pal=%04x,force=%i\n", hDC, hPal, bForceBackground);
|
||||
if( !lpt ) return 0;
|
||||
|
||||
TRACE(" entries = %d\n", lpt->logpalette.palNumEntries);
|
||||
GDI_HEAP_UNLOCK( hPal );
|
||||
|
||||
if( hPal != STOCK_DEFAULT_PALETTE )
|
||||
if (!bForceBackground && (hPal != STOCK_DEFAULT_PALETTE))
|
||||
{
|
||||
HWND hWnd = WindowFromDC( hDC );
|
||||
HWND hActive = GetActiveWindow();
|
||||
|
||||
/* set primary palette if it's related to current active */
|
||||
|
||||
if((!hWnd || (hActive == hWnd || IsChild16(hActive,hWnd))) &&
|
||||
!bForceBackground )
|
||||
wBkgPalette = 0;
|
||||
HWND hwnd = Callout.WindowFromDC( hDC );
|
||||
if (hwnd)
|
||||
{
|
||||
HWND hForeground = Callout.GetForegroundWindow();
|
||||
/* set primary palette if it's related to current active */
|
||||
if (hForeground == hwnd || Callout.IsChild(hForeground,hwnd)) wBkgPalette = 0;
|
||||
}
|
||||
}
|
||||
return GDISelectPalette16( hDC, hPal, wBkgPalette);
|
||||
}
|
||||
|
@ -824,8 +817,8 @@ UINT WINAPI RealizePalette(
|
|||
/* Send palette change notification */
|
||||
|
||||
HWND hWnd;
|
||||
if( (hWnd = WindowFromDC( hDC )) )
|
||||
SendMessage16( HWND_BROADCAST, WM_PALETTECHANGED, hWnd, 0L);
|
||||
if( (hWnd = Callout.WindowFromDC( hDC )) )
|
||||
Callout.SendMessageA( HWND_BROADCAST, WM_PALETTECHANGED, hWnd, 0L);
|
||||
}
|
||||
|
||||
GDI_HEAP_UNLOCK( hDC );
|
||||
|
@ -843,13 +836,13 @@ INT16 WINAPI UpdateColors16( HDC16 hDC )
|
|||
|
||||
if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return 0;
|
||||
|
||||
hWnd = WindowFromDC( hDC );
|
||||
hWnd = Callout.WindowFromDC( hDC );
|
||||
|
||||
/* Docs say that we have to remap current drawable pixel by pixel
|
||||
* but it would take forever given the speed of XGet/PutPixel.
|
||||
*/
|
||||
if (hWnd && dc->w.devCaps->sizePalette )
|
||||
InvalidateRect( hWnd, NULL, FALSE );
|
||||
if (hWnd && dc->w.devCaps->sizePalette )
|
||||
Callout.RedrawWindow( hWnd, NULL, 0, RDW_INVALIDATE );
|
||||
|
||||
GDI_HEAP_UNLOCK( hDC );
|
||||
|
||||
|
|
|
@ -274,10 +274,18 @@ void KEYBOARD_SetBeepActive(BOOL bActivate)
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
* KEYBOARD_Beep
|
||||
* MessageBeep16 (USER.104)
|
||||
*/
|
||||
void KEYBOARD_Beep(void)
|
||||
void WINAPI MessageBeep16( UINT16 i )
|
||||
{
|
||||
USER_Driver->pBeep();
|
||||
MessageBeep( i );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MessageBeep (USER32.390)
|
||||
*/
|
||||
BOOL WINAPI MessageBeep( UINT i )
|
||||
{
|
||||
USER_Driver->pBeep();
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue