Commit f7207259 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 940722

Mon Jul 18 23:55:13 MET DST 1994 * [if1632/call.S] CallTo16(): added `mov %eax,%edx' just before lcall, to make sure that DX contain the DLL's hinstance when initialised. CallTo32_16() added, equal to CallTo32() except for one thing: it saves DX and * [tools/build.c] Added some code to support 16 and 32 bit return values. * [1632/{kernel,user}.spec] Changed most of the `pascal' style to pascal_16 when function returned a 16bit value. Tue Jul 19 18:40:25 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) * [controls/menu.c] Reorganized sizing and drawing code to implement multi-line menus. Implemented MENUBREAK style. Use system colors to draw menus. * [objects/color.c] Bug fix in COLOR_IsSolid(). * [objects/font.c] Bug fix in FONT_GetMetrics(): calculate average character width only on existing chars (dialogs look much better). * [objects/text.c] Bug fix in DrawText(): use text color to underline mnemonic. * [windows/nonclient.c] Changed WM_NCHITTEST handling to cope with multi-line menu bars. * [windows/syscolor.c] Added system objects for menu colors. Mon Jul 18 19:32:08 PDT 1994 Andrew Lagodzinski (andrew@netcom.com) * [controls/menu.c] Fixed bug in SelectPrevItem that caused seperators to not be skipped when using the up arrow key.
parent 2d159fb7
----------------------------------------------------------------------
Mon Jul 18 23:55:13 MET DST 1994
* [if1632/call.S]
CallTo16(): added `mov %eax,%edx' just before lcall,
to make sure that DX contain the DLL's hinstance when
initialised.
CallTo32_16() added, equal to CallTo32() except for
one thing: it saves DX and
* [tools/build.c]
Added some code to support 16 and 32 bit return values.
* [1632/{kernel,user}.spec]
Changed most of the `pascal' style to pascal_16 when
function returned a 16bit value.
Tue Jul 19 18:40:25 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [controls/menu.c]
Reorganized sizing and drawing code to implement multi-line menus.
Implemented MENUBREAK style.
Use system colors to draw menus.
* [objects/color.c]
Bug fix in COLOR_IsSolid().
* [objects/font.c]
Bug fix in FONT_GetMetrics(): calculate average character width
only on existing chars (dialogs look much better).
* [objects/text.c]
Bug fix in DrawText(): use text color to underline mnemonic.
* [windows/nonclient.c]
Changed WM_NCHITTEST handling to cope with multi-line menu bars.
* [windows/syscolor.c]
Added system objects for menu colors.
Mon Jul 18 19:32:08 PDT 1994 Andrew Lagodzinski (andrew@netcom.com)
* [controls/menu.c]
Fixed bug in SelectPrevItem that caused seperators to not be
skipped when using the up arrow key.
----------------------------------------------------------------------
Thu Jul 14 17:50:45 1994 Bob Amstadt (bob@pooh)
* [Configure]
......
......@@ -37,7 +37,7 @@ static WNDCLASS WIDGETS_BuiltinClasses[] =
{ CS_GLOBALCLASS, (LONG(*)())EditWndProc, 0, 4,
0, 0, 0, 0, NULL, "EDIT" },
{ CS_GLOBALCLASS | CS_SAVEBITS, (LONG(*)())PopupMenuWndProc, 0, 8,
0, 0, 0, 0, NULL, "POPUPMENU" },
0, 0, 0, 0, NULL, POPUPMENU_CLASS_NAME },
{ CS_GLOBALCLASS, (LONG(*)())DesktopWndProc, 0, sizeof(DESKTOPINFO),
0, 0, 0, 0, NULL, DESKTOP_CLASS_NAME },
{ CS_GLOBALCLASS, (LONG(*)())DefDlgProc, 0, DLGWINDOWEXTRA,
......
......@@ -190,6 +190,7 @@ _CallTo16:
* Call entry point
*/
movw %ax,%ds
movw %ax,%di
.byte 0x66
lcall %fs:(%edx)
......@@ -284,11 +285,16 @@ _CallTo32:
/*
* Call entry point
*/
pushl %edx
pushw _IF1632_Saved16_ss
pushw _IF1632_Saved16_esp
pushl %eax
call _DLLRelay
popl %edx
popl %edx
popl %edx
/*
* Restore registers, but do not destroy return value.
*/
......@@ -327,6 +333,7 @@ noargs:
/*
* Last, but not least we need to move the high word from eax to dx
*/
pushl %eax
popw %dx
popw %dx
......@@ -335,6 +342,99 @@ noargs:
lret
/**********************************************************************
* CallTo32_16()
*
* This function is same one as CallTo32() except that the high
* word of EAX won't be moved to DX.
*/
.align 4
.globl _CallTo32_16
_CallTo32_16:
pushl %ebp
movl %esp,%ebp
/*
* Save registers. 286 mode does not have fs or gs.
*/
pushw %ds
pushw %es
/*
* Restore segment registers.
*/
pushl %eax
movw $UDATASEL,%ax
movw %ax,%ds
movw %ax,%es
popl %eax
/*
* Save old stack save variables, save stack registers, reload
* stack registers.
*/
pushl _IF1632_Saved16_esp
pushl _IF1632_Saved16_ebp
pushw _IF1632_Saved16_ss
movw %ss,_IF1632_Saved16_ss
movl %esp,_IF1632_Saved16_esp
movl %ebp,_IF1632_Saved16_ebp
movw _IF1632_Saved32_ss,%ss
movl _IF1632_Saved32_esp,%esp
movl _IF1632_Saved32_ebp,%ebp
/*
* Call entry point
*/
pushl %edx
pushw _IF1632_Saved16_ss
pushw _IF1632_Saved16_esp
pushl %eax
call _DLLRelay
popl %edx
popl %edx
popl %edx
/*
* Restore registers, but do not destroy return value.
*/
movw _IF1632_Saved16_ss,%ss
movl _IF1632_Saved16_esp,%esp
movl _IF1632_Saved16_ebp,%ebp
popw _IF1632_Saved16_ss
popl _IF1632_Saved16_ebp
popl _IF1632_Saved16_esp
popw %es
popw %ds
.align 2,0x90
leave
/*
* Now we need to ditch the parameter bytes that were left on the
* stack. We do this by effectively popping the number of bytes,
* and the return address, removing the parameters and then putting
* the return address back on the stack.
* Normally this field is filled in by the relevant function in
* the emulation library, since it should know how many bytes to
* expect.
*/
popw %gs:nbytes
cmpw $0,%gs:nbytes
je noargs2
popw %gs:offset
popw %gs:selector
addw %gs:nbytes,%esp
pushw %gs:selector
pushw %gs:offset
noargs2:
.byte 0x66
lret
/**********************************************************************
* ReturnFromRegisterFunc()
*/
.globl _ReturnFromRegisterFunc
......
......@@ -178,7 +178,7 @@ length 540
173 pascal LoadCursor(word ptr) LoadCursor(1 2)
174 pascal LoadIcon(word ptr) LoadIcon(1 2)
175 pascal LoadBitmap(word ptr) LoadBitmap(1 2)
176 pascal LoadString(word word ptr s_word) LoadString(1 2 3 4)
176 pascal16 LoadString(word word ptr s_word) LoadString(1 2 3 4)
177 pascal LoadAccelerators(word ptr) LoadAccelerators(1 2)
178 pascal TranslateAccelerator(word word ptr) TranslateAccelerator(1 2 3)
179 pascal GetSystemMetrics(word) GetSystemMetrics(1)
......@@ -228,9 +228,9 @@ length 540
220 pascal LoadMenuIndirect(ptr) LoadMenuIndirect(1)
221 pascal ScrollDC(word s_word s_word ptr ptr word ptr)
ScrollDC(1 2 3 4 5 6 7)
222 pascal GetKeyboardState(ptr) GetKeyboardState(1)
222 pascal16 GetKeyboardState(ptr) GetKeyboardState(1)
#223 SETKEYBOARDSTATE
224 pascal GetWindowTask(word) GetWindowTask(1)
224 pascal16 GetWindowTask(word) GetWindowTask(1)
225 pascal EnumTaskWindows(word ptr long) EnumTaskWindows(1 2 3)
#226 LOCKINPUT
227 pascal GetNextDlgGroupItem(word word word) GetNextDlgGroupItem(1 2 3)
......@@ -294,7 +294,7 @@ length 540
281 pascal GetSysColorBrush(word) GetSysColorBrush(1)
282 pascal SelectPalette(word word word) SelectPalette(1 2 3)
283 pascal RealizePalette(word) RealizePalette(1)
284 pascal GetFreeSystemResources(word) GetFreeSystemResources(1)
284 pascal16 GetFreeSystemResources(word) GetFreeSystemResources(1)
#285 BEAR285
286 pascal GetDesktopWindow() GetDesktopWindow()
#287 GETLASTACTIVEPOPUP
......@@ -366,15 +366,15 @@ length 540
421 pascal wvsprintf(ptr ptr ptr) wvsprintf(1 2 3)
#422 DLGDIRSELECTEX
#423 DLGDIRSELECTCOMBOBOXEX
430 pascal lstrcmp(ptr ptr) lstrcmp(1 2)
430 pascal16 lstrcmp(ptr ptr) lstrcmp(1 2)
431 pascal AnsiUpper(ptr) AnsiUpper(1)
432 pascal AnsiLower(ptr) AnsiLower(1)
433 pascal IsCharAlpha(byte) IsCharAlpha(1)
434 pascal IsCharAlphanumeric(byte) IsCharAlphanumeric(1)
435 pascal IsCharUpper(byte) IsCharUpper(1)
436 pascal IsCharLower(byte) IsCharLower(1)
437 pascal AnsiUpperBuff(ptr word) AnsiUpperBuff(1 2)
438 pascal AnsiLowerBuff(ptr word) AnsiLowerBuff(1 2)
433 pascal16 IsCharAlpha(byte) IsCharAlpha(1)
434 pascal16 IsCharAlphanumeric(byte) IsCharAlphanumeric(1)
435 pascal16 IsCharUpper(byte) IsCharUpper(1)
436 pascal16 IsCharLower(byte) IsCharLower(1)
437 pascal16 AnsiUpperBuff(ptr word) AnsiUpperBuff(1 2)
438 pascal16 AnsiLowerBuff(ptr word) AnsiLowerBuff(1 2)
445 pascal DefFrameProc(word word word word long) DefFrameProc(1 2 3 4 5)
447 pascal DefMDIChildProc(word word word long) DefMDIChildProc(1 2 3 4)
451 pascal TranslateMDISysAccel(word ptr) TranslateMDISysAccel(1 2)
......@@ -395,7 +395,7 @@ length 540
#465 DRAGDETECT
466 pascal DrawFocusRect(word ptr) DrawFocusRect(1 2)
#470 STRINGFUNC
471 pascal lstrcmpi(ptr ptr) lstrcmpi(1 2)
471 pascal16 lstrcmpi(ptr ptr) lstrcmpi(1 2)
472 pascal AnsiNext(ptr) AnsiNext(1 )
473 pascal AnsiPrev(ptr ptr) AnsiPrev(1 2)
#480 GETUSERLOCALOBJTYPE
......@@ -415,13 +415,13 @@ length 540
#509 WNETUNWATCHQUEUE
#510 WNETLOCKQUEUEDATA
#511 WNETUNLOCKQUEUEDATA
512 pascal WNetGetConnection(ptr ptr ptr) WNetGetConnection(1 2 3)
512 pascal16 WNetGetConnection(ptr ptr ptr) WNetGetConnection(1 2 3)
513 pascal WNetGetCaps(word) WNetGetCaps(1)
#514 WNETDEVICEMODE
#515 WNETBROWSEDIALOG
516 pascal WNetGetUser(ptr ptr ptr) WNetGetUser(1 2 3)
517 pascal WNetAddConnection(ptr ptr ptr) WNetAddConnection(1 2 3)
518 pascal WNetCancelConnection(ptr word) WNetCancelConnection(1 2)
517 pascal16 WNetAddConnection(ptr ptr ptr) WNetAddConnection(1 2 3)
518 pascal16 WNetCancelConnection(ptr word) WNetCancelConnection(1 2)
#519 WNETGETERROR
#520 WNETGETERRORTEXT
#521 WNETENABLE
......
......@@ -15,7 +15,7 @@ struct SysColorObjects
/* COLOR_BACKGROUND */
HBRUSH hbrushActiveCaption; /* COLOR_ACTIVECAPTION */
HBRUSH hbrushInactiveCaption; /* COLOR_INACTIVECAPTION */
/* COLOR_MENU */
HBRUSH hbrushMenu; /* COLOR_MENU */
HBRUSH hbrushWindow; /* COLOR_WINDOW */
HPEN hpenWindowFrame; /* COLOR_WINDOWFRAME */
/* COLOR_MENUTEXT */
......@@ -24,7 +24,7 @@ struct SysColorObjects
HBRUSH hbrushActiveBorder; /* COLOR_ACTIVEBORDER */
HBRUSH hbrushInactiveBorder; /* COLOR_INACTIVEBORDER */
/* COLOR_APPWORKSPACE */
/* COLOR_HIGHLIGHT */
HBRUSH hbrushHighlight; /* COLOR_HIGHLIGHT */
/* COLOR_HIGHLIGHTTEXT */
HBRUSH hbrushBtnFace; /* COLOR_BTNFACE */
HBRUSH hbrushBtnShadow; /* COLOR_BTNSHADOW */
......
......@@ -7,6 +7,7 @@
#if defined(__NetBSD__) || defined(__FreeBSD__)
#include <sys/syscall.h>
#include <sys/param.h>
#else
#include <syscall.h>
#endif
......@@ -20,13 +21,14 @@
#include "prototypes.h"
#include "win.h"
#if !defined(BSD4_4) || defined(linux)
char * cstack[4096];
#endif
struct sigaction segv_act;
#ifdef linux
extern void ___sig_restore();
extern void ___masksig_restore();
#endif
/* Similar to the sigaction function in libc, except it leaves alone the
restorer field */
......@@ -41,6 +43,7 @@ wine_sigaction(int sig,struct sigaction * new, struct sigaction * old)
errno = -sig;
return -1;
}
#endif
int do_int(int intnum, struct sigcontext_struct *scp)
{
......@@ -111,7 +114,7 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__)
/* set_es(0x27); set_ds(0x27); */
if(signal != SIGBUS)
if(signal != SIGBUS && signal != SIGSEGV && signal != SIGTRAP)
exit(1);
if(scp->sc_cs == 0x1f)
{
......@@ -181,7 +184,7 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
XUngrabServer(display);
XFlush(display);
fprintf(stderr,"In win_fault %x:%x\n", scp->sc_cs, scp->sc_eip);
#ifdef linux
#if defined(linux) || defined(__NetBSD__)
wine_debug(signal, scp); /* Enter our debugger */
#else
fprintf(stderr,"Stack: %x:%x\n", scp->sc_ss, scp->sc_esp);
......@@ -213,8 +216,23 @@ int init_wine_signals(void)
wine_sigaction(SIGTRAP, &segv_act, NULL); /* For breakpoints */
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__)
struct sigstack ss;
sigset_t sig_mask;
#ifdef BSD4_4
struct sigaltstack ss;
if ((ss.ss_base = malloc(MINSIGSTKSZ)) == NULL) {
fprintf(stderr, "Unable to allocate signal stack (%d bytes)\n",
MINSIGSTKSZ);
exit(1);
}
ss.ss_size = MINSIGSTKSZ;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) < 0) {
perror("sigstack");
exit(1);
}
#else
struct sigstack ss;
ss.ss_sp = (char *) (((unsigned int)(cstack) + sizeof(cstack) - 4) & ~3);
ss.ss_onstack = 0;
......@@ -222,12 +240,27 @@ int init_wine_signals(void)
perror("sigstack");
exit(1);
}
#endif
sigemptyset(&sig_mask);
segv_act.sa_handler = (__sighandler_t) win_fault;
segv_act.sa_handler = (void (*)) win_fault;
segv_act.sa_flags = SA_ONSTACK;
segv_act.sa_mask = sig_mask;
if (sigaction(SIGBUS, &segv_act, NULL) < 0) {
perror("sigaction");
perror("sigaction: SIGBUS");
exit(1);
}
segv_act.sa_handler = (void (*)) win_fault;
segv_act.sa_flags = SA_ONSTACK;
segv_act.sa_mask = sig_mask;
if (sigaction(SIGSEGV, &segv_act, NULL) < 0) {
perror("sigaction: SIGSEGV");
exit(1);
}
segv_act.sa_handler = (void (*)) win_fault; /* For breakpoints */
segv_act.sa_flags = SA_ONSTACK;
segv_act.sa_mask = sig_mask;
if (sigaction(SIGTRAP, &segv_act, NULL) < 0) {
perror("sigaction: SIGTRAP");
exit(1);
}
#endif
......
......@@ -18,8 +18,10 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include <fcntl.h>
#include <sys/ioctl.h>
#ifdef linux
#include <linux/soundcard.h>
#include <linux/cdrom.h>
#endif
#define SOUND_DEV "/dev/dsp"
#define CDAUDIO_DEV "/dev/sbpcd"
......@@ -37,6 +39,7 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#define CDFRAMES_PERMIN 4500
#define SECONDS_PERMIN 60
#ifdef linux
typedef struct {
int nUseCount; /* Incremented for each shared open */
BOOL fShareable; /* TRUE if first open was shareable */
......@@ -57,6 +60,7 @@ typedef struct {
} LINUX_CDAUDIO;
static LINUX_CDAUDIO CDADev[MAX_CDAUDIODRV];
#endif
UINT CDAUDIO_GetNumberOfTracks(UINT wDevID);
BOOL CDAUDIO_GetTracksInfo(UINT wDevID);
......@@ -72,6 +76,7 @@ DWORD CDAUDIO_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame);
*/
DWORD CDAUDIO_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
{
#ifdef linux
UINT wDevID;
int cdrom;
#ifdef DEBUG_CDAUDIO
......@@ -121,6 +126,9 @@ DWORD CDAUDIO_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
}
return 0;
#else
return MCIERR_HARDWARE;
#endif
}
/**************************************************************************
......@@ -128,12 +136,14 @@ DWORD CDAUDIO_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
*/
DWORD CDAUDIO_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciClose(%u, %08X, %08X);\n", wDevID, dwParam, lpParms);
#endif
if (CDADev[wDevID].lpdwTrackLen != NULL) free(CDADev[wDevID].lpdwTrackLen);
if (CDADev[wDevID].lpdwTrackPos != NULL) free(CDADev[wDevID].lpdwTrackPos);
close(CDADev[wDevID].unixdev);
#endif
}
/**************************************************************************
......@@ -142,6 +152,7 @@ DWORD CDAUDIO_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
DWORD CDAUDIO_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
LPMCI_GETDEVCAPS_PARMS lpParms)
{
#ifdef linux
#ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciGetDevCaps(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif
......@@ -183,6 +194,9 @@ DWORD CDAUDIO_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
}
printf("CDAUDIO_mciGetDevCaps // lpParms->dwReturn=%08X);\n", lpParms->dwReturn);
return 0;
#else
return MCIERR_INTERNAL;
#endif
}
/**************************************************************************
......@@ -190,6 +204,7 @@ DWORD CDAUDIO_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
*/
DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
{
#ifdef linux
#ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciInfo(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif
......@@ -207,6 +222,9 @@ DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
else
lpParms->dwRetSize = 0;
return 0;
#else
return MCIERR_INTERNAL;
#endif
}
/**************************************************************************
......@@ -214,6 +232,7 @@ DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
*/
DWORD CDAUDIO_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
{
#ifdef linux
#ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciStatus(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif
......@@ -315,6 +334,9 @@ DWORD CDAUDIO_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
}
printf("CDAUDIO_mciStatus // not MCI_STATUS_ITEM !\n");
return 0;
#else
return MMSYSERR_NOTENABLED;
#endif
}
......@@ -324,6 +346,7 @@ DWORD CDAUDIO_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
DWORD CDAUDIO_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame)
{
DWORD dwTime = 0;
#ifdef linux
UINT wTrack;
UINT wMinutes;
UINT wSeconds;
......@@ -372,6 +395,7 @@ TryAGAIN:
dwFormatType = MCI_FORMAT_TMSF;
goto TryAGAIN;
}
#endif
return dwTime;
}
......@@ -382,6 +406,7 @@ TryAGAIN:
DWORD CDAUDIO_CalcFrame(UINT wDevID, DWORD dwFormatType, DWORD dwTime)
{
DWORD dwFrame = 0;
#ifdef linux
UINT wTrack;
#ifdef DEBUG_CDAUDIO
printf("CDAUDIO_CalcFrame(%u, %08X, %lu);\n", wDevID, dwFormatType, dwTime);
......@@ -423,6 +448,7 @@ TryAGAIN:
dwFormatType = MCI_FORMAT_TMSF;
goto TryAGAIN;
}
#endif
return dwFrame;
}
......@@ -432,6 +458,7 @@ TryAGAIN:
*/
UINT CDAUDIO_GetNumberOfTracks(UINT wDevID)
{
#ifdef linux
struct cdrom_tochdr hdr;
if (CDADev[wDevID].nTracks == 0) {
if (ioctl(CDADev[wDevID].unixdev, CDROMREADTOCHDR, &hdr)) {
......@@ -441,6 +468,9 @@ UINT CDAUDIO_GetNumberOfTracks(UINT wDevID)
CDADev[wDevID].nTracks = hdr.cdth_trk1;
}
return CDADev[wDevID].nTracks;
#else
return (WORD)-1;
#endif
}
/**************************************************************************
......@@ -448,6 +478,7 @@ UINT CDAUDIO_GetNumberOfTracks(UINT wDevID)
*/
BOOL CDAUDIO_GetTracksInfo(UINT wDevID)
{
#ifdef linux
int i, length;
int start, last_start;
int total_length = 0;
......@@ -503,6 +534,9 @@ BOOL CDAUDIO_GetTracksInfo(UINT wDevID)
CDADev[wDevID].dwTotalLen = total_length;
printf("CDAUDIO_GetTracksInfo // total_len=%u\n", total_length);
return TRUE;
#else
return FALSE;
#endif
}
......@@ -511,6 +545,7 @@ BOOL CDAUDIO_GetTracksInfo(UINT wDevID)
*/
BOOL CDAUDIO_GetCDStatus(UINT wDevID)
{
#ifdef linux
int oldmode = CDADev[wDevID].mode;
CDADev[wDevID].sc.cdsc_format = CDROM_MSF;
if (ioctl(CDADev[wDevID].unixdev, CDROMSUBCHNL, &CDADev[wDevID].sc)) {
......@@ -565,6 +600,9 @@ BOOL CDAUDIO_GetCDStatus(UINT wDevID)
}
}
return TRUE;
#else
return FALSE;
#endif
}
/**************************************************************************
......@@ -572,6 +610,7 @@ BOOL CDAUDIO_GetCDStatus(UINT wDevID)
*/
DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
{
#ifdef linux
int start, end;
struct cdrom_msf msf;
#ifdef DEBUG_CDAUDIO
......@@ -625,6 +664,9 @@ DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
}
return 0;
#else
return MCIERR_HARDWARE;
#endif
}
/**************************************************************************
......@@ -632,6 +674,7 @@ DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
*/
DWORD CDAUDIO_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciStop(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif
......@@ -644,6 +687,9 @@ DWORD CDAUDIO_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
}
return 0;
#else
return MCIERR_HARDWARE;
#endif
}
/**************************************************************************
......@@ -651,6 +697,7 @@ DWORD CDAUDIO_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
*/
DWORD CDAUDIO_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciPause(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif
......@@ -663,6 +710,9 @@ DWORD CDAUDIO_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
}
return 0;
#else
return MCIERR_HARDWARE;
#endif
}
/**************************************************************************
......@@ -670,6 +720,7 @@ DWORD CDAUDIO_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
*/
DWORD CDAUDIO_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciResume(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif
......@@ -682,6 +733,9 @@ DWORD CDAUDIO_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
}
return 0;
#else
return MCIERR_HARDWARE;
#endif
}
/**************************************************************************
......@@ -689,6 +743,7 @@ DWORD CDAUDIO_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
*/
DWORD CDAUDIO_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
{
#ifdef linux
DWORD dwRet;
MCI_PLAY_PARMS PlayParms;
#ifdef DEBUG_CDAUDIO
......@@ -717,6 +772,9 @@ DWORD CDAUDIO_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
}
return dwRet;
#else
return MCIERR_HARDWARE;
#endif
}
......@@ -725,6 +783,7 @@ DWORD CDAUDIO_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
*/
DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
{
#ifdef linux
#ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciSet(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif
......@@ -775,6 +834,9 @@ DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
}
return 0;
#else
return MCIERR_HARDWARE;
#endif
}
......@@ -784,6 +846,7 @@ DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
LRESULT CDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
#ifdef linux
switch(wMsg) {
case DRV_LOAD:
return (LRESULT)1L;
......@@ -852,6 +915,9 @@ LRESULT CDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
default:
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
}
#else
return MCIERR_HARDWARE;
#endif
}
......
......@@ -14,7 +14,9 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include <fcntl.h>
#include <sys/ioctl.h>
#ifdef linux
#include <linux/soundcard.h>
#endif
#define SOUND_DEV "/dev/dsp"
#define MIXER_DEV "/dev/mixer"
......@@ -34,6 +36,7 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
*/
DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize)
{
#ifdef linux
int mixer;
int volume;
printf("AUX_GetDevCaps(%u, %08X, %u);\n", wDevID, lpCaps, dwSize);
......@@ -48,6 +51,9 @@ DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize)
}
close(mixer);
return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
}
......@@ -56,6 +62,7 @@ DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize)
*/
DWORD AUX_GetVolume(WORD wDevID, DWORD dwParam)
{
#ifdef linux
int mixer;
int volume;
printf("AUX_GetVolume(%u, %08X);\n", wDevID, dwParam);
......@@ -69,6 +76,9 @@ DWORD AUX_GetVolume(WORD wDevID, DWORD dwParam)
}
close(mixer);
return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
}
/**************************************************************************
......@@ -76,6 +86,7 @@ DWORD AUX_GetVolume(WORD wDevID, DWORD dwParam)
*/
DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
{
#ifdef linux
int mixer;
int volume = 50;
printf("AUX_SetVolume(%u, %08X);\n", wDevID, dwParam);
......@@ -89,6 +100,9 @@ DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
}
close(mixer);
return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
}
......
......@@ -233,7 +233,7 @@ WORD COLOR_ToPhysical( DC *dc, COLORREF color )
WORD *mapping;
if (!dc->u.x.pal.hMapping) return 0;
switch(color & 0xff000000)
switch(color >> 24)
{
case 0: /* RGB */
index = GetNearestPaletteIndex( STOCK_DEFAULT_PALETTE, color );
......
......@@ -16,6 +16,34 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#define MAX_FONTS 256
static LPLOGFONT lpLogFontList[MAX_FONTS] = { NULL };
#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \
(((cs)->rbearing|(cs)->lbearing| \
(cs)->ascent|(cs)->descent) == 0))
/*
* CI_GET_CHAR_INFO - return the charinfo struct for the indicated 8bit
* character. If the character is in the column and exists, then return the
* appropriate metrics (note that fonts with common per-character metrics will
* return min_bounds). If none of these hold true, try again with the default
* char.
*/
#define CI_GET_CHAR_INFO(fs,col,def,cs) \
{ \
cs = def; \
if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
if (fs->per_char == NULL) { \
cs = &fs->min_bounds; \
} else { \
cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \
if (CI_NONEXISTCHAR(cs)) cs = def; \
} \
} \
}
#define CI_GET_DEFAULT_INFO(fs,cs) \
CI_GET_CHAR_INFO(fs, fs->default_char, NULL, cs)
/***********************************************************************
* FONT_MatchFont
*
......@@ -86,7 +114,7 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font )
void FONT_GetMetrics( LOGFONT * logfont, XFontStruct * xfont,
TEXTMETRIC * metrics )
{
int average, i;
int average, i, count;
unsigned long prop;
metrics->tmAscent = xfont->ascent;
......@@ -116,13 +144,17 @@ void FONT_GetMetrics( LOGFONT * logfont, XFontStruct * xfont,
else
{
XCharStruct * charPtr = xfont->per_char;
average = 0;
average = count = 0;
for (i = metrics->tmFirstChar; i <= metrics->tmLastChar; i++)
{
average += charPtr->width;
if (!CI_NONEXISTCHAR( charPtr ))
{
average += charPtr->width;
count++;
}
charPtr++;
}
average /= metrics->tmLastChar - metrics->tmFirstChar + 1;
if (count) average = (average + count/2) / count;
}
metrics->tmAveCharWidth = average;
}
......@@ -373,33 +405,6 @@ DWORD SetMapperFlags(HDC hDC, DWORD dwFlag)
/***********************************************************************/
#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \
(((cs)->rbearing|(cs)->lbearing| \
(cs)->ascent|(cs)->descent) == 0))
/*
* CI_GET_CHAR_INFO - return the charinfo struct for the indicated 8bit
* character. If the character is in the column and exists, then return the
* appropriate metrics (note that fonts with common per-character metrics will
* return min_bounds). If none of these hold true, try again with the default
* char.
*/
#define CI_GET_CHAR_INFO(fs,col,def,cs) \
{ \
cs = def; \
if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
if (fs->per_char == NULL) { \
cs = &fs->min_bounds; \
} else { \
cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \
if (CI_NONEXISTCHAR(cs)) cs = def; \
} \
} \
}
#define CI_GET_DEFAULT_INFO(fs,cs) \
CI_GET_CHAR_INFO(fs, fs->default_char, NULL, cs)
/***********************************************************************
* GetCharWidth (GDI.350)
......
......@@ -235,8 +235,12 @@ int DrawText( HDC hdc, LPSTR str, int count, LPRECT rect, WORD flags )
if (!TextOut(hdc, x, y, line, len)) return 0;
if (prefix_offset != -1)
{
HPEN hpen = CreatePen( PS_SOLID, 1, GetTextColor(hdc) );
HPEN oldPen = SelectObject( hdc, hpen );
MoveTo(hdc, x + prefix_x, y + tm.tmAscent + 1 );
LineTo(hdc, x + prefix_end, y + tm.tmAscent + 1 );
SelectObject( hdc, oldPen );
DeleteObject( hpen );
}
if (strPtr)
......
......@@ -20,9 +20,10 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#define VARTYPE_LONG 2
#define VARTYPE_FARPTR 3
#define FUNCTYPE_PASCAL 16
#define FUNCTYPE_C 17
#define FUNCTYPE_REG 19
#define FUNCTYPE_PASCAL_16 15
#define FUNCTYPE_PASCAL 16
#define FUNCTYPE_C 17
#define FUNCTYPE_REG 19
#define EQUATETYPE_ABS 18
#define TYPE_RETURN 20
......@@ -372,7 +373,8 @@ ParseExportFunction(int ordinal, int type)
}
fdp->n_args_16 = i;
if (type == FUNCTYPE_PASCAL || type == FUNCTYPE_REG)
if (type == FUNCTYPE_PASCAL_16 || type == FUNCTYPE_PASCAL ||
type == FUNCTYPE_REG )
{
current_offset = 0;
for (i--; i >= 0; i--)
......@@ -521,6 +523,8 @@ ParseOrdinal(int ordinal)
return ParseExportFunction(ordinal, FUNCTYPE_PASCAL);
else if (stricmp(token, "pascal") == 0)
return ParseExportFunction(ordinal, FUNCTYPE_PASCAL);
else if (stricmp(token, "pascal16") == 0)
return ParseExportFunction(ordinal, FUNCTYPE_PASCAL_16);
else if (stricmp(token, "register") == 0)
return ParseExportFunction(ordinal, FUNCTYPE_REG);
else if (stricmp(token, "equate") == 0)
......@@ -755,6 +759,13 @@ main(int argc, char **argv)
fprintf(fp, "\torl\t$0x%08x,%%eax\n", DLLId << 16);
fprintf(fp, "\tjmp\t_CallTo32\n\n");
fprintf(fp, "\t.globl _%s_Dispatch_16\n", UpperDLLName);
fprintf(fp, "_%s_Dispatch_16:\n", UpperDLLName);
fprintf(fp, "\tandl\t$0x0000ffff,%%esp\n");
fprintf(fp, "\tandl\t$0x0000ffff,%%ebp\n");
fprintf(fp, "\torl\t$0x%08x,%%eax\n", DLLId << 16);
fprintf(fp, "\tjmp\t_CallTo32_16\n\n");
odp = OrdinalDefinitions;
for (i = 0; i <= Limit; i++, odp++)
{
......@@ -829,6 +840,13 @@ main(int argc, char **argv)
fprintf(fp, "\tjmp\t_%s_Dispatch\n\n", UpperDLLName);
break;
case FUNCTYPE_PASCAL_16:
fprintf(fp, "_%s_Ordinal_%d:\n", UpperDLLName, i);
fprintf(fp, "\tmovl\t$%d,%%eax\n", i);
fprintf(fp, "\tpushw\t$%d\n", fdp->arg_16_size);
fprintf(fp, "\tjmp\t_%s_Dispatch_16\n\n", UpperDLLName);
break;
case FUNCTYPE_C:
default:
fprintf(fp, "_%s_Ordinal_%d:\n", UpperDLLName, i);
......@@ -862,8 +880,8 @@ main(int argc, char **argv)
for (i = 0; i <= Limit; i++, odp++)
{
if (odp->valid &&
(odp->type == FUNCTYPE_PASCAL || odp->type == FUNCTYPE_C ||
odp->type == FUNCTYPE_REG))
(odp->type == FUNCTYPE_PASCAL || odp->type == FUNCTYPE_PASCAL_16 ||
odp->type == FUNCTYPE_REG || odp->type == FUNCTYPE_C ))
{
fdp = odp->additional_data;
fprintf(fp, "extern int %s();\n", fdp->internal_name);
......@@ -884,6 +902,7 @@ main(int argc, char **argv)
switch (odp->type)
{
case FUNCTYPE_PASCAL:
case FUNCTYPE_PASCAL_16:
case FUNCTYPE_REG:
fprintf(fp, " { 0x%x, %s_Ordinal_%d, ", UTEXTSEL, UpperDLLName, i);
fprintf(fp, "\042%s\042, ", odp->export_name);
......
......@@ -27,7 +27,8 @@ static HBITMAP hbitmapRestoreD = 0;
extern void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
POINT *minTrack, POINT *maxTrack ); /* winpos.c */
extern void CURSOR_SetWinCursor( HWND hwnd, HCURSOR hcursor ); /* cursor.c */
extern WORD MENU_GetMenuBarHeight( HWND hwnd, WORD menubarWidth ); /* menu.c */
extern WORD MENU_GetMenuBarHeight( HWND hwnd, WORD menubarWidth,
int orgX, int orgY ); /* menu.c */
/* Some useful macros */
......@@ -127,7 +128,8 @@ LONG NC_HandleNCCalcSize( HWND hwnd, NCCALCSIZE_PARAMS *params )
if (HAS_MENU(wndPtr))
{
params->rgrc[0].top += MENU_GetMenuBarHeight( hwnd,
params->rgrc[0].right - params->rgrc[0].left );
params->rgrc[0].right - params->rgrc[0].left,
-tmpRect.left, -tmpRect.top ) + 1;
}
return 0;
}
......@@ -178,43 +180,61 @@ static LONG NC_InternalNCHitTest( HWND hwnd, POINT pt )
GetWindowRect( hwnd, &rect );
if (!PtInRect( &rect, pt )) return HTNOWHERE;
ScreenToClient( hwnd, &pt );
GetClientRect( hwnd, &rect );
if (PtInRect( &rect, pt )) return HTCLIENT;
/* Check vertical scroll bar */
if (wndPtr->dwStyle & WS_VSCROLL)
{
rect.right += SYSMETRICS_CXVSCROLL;
if (PtInRect( &rect, pt )) return HTVSCROLL;
}
/* Check borders */
/* Check horizontal scroll bar */
if (wndPtr->dwStyle & WS_HSCROLL)
if (HAS_THICKFRAME( wndPtr->dwStyle ))
{
rect.bottom += SYSMETRICS_CYHSCROLL;
if (PtInRect( &rect, pt ))
InflateRect( &rect, -SYSMETRICS_CXFRAME, -SYSMETRICS_CYFRAME );
if (wndPtr->dwStyle & WS_BORDER)
InflateRect( &rect, -SYSMETRICS_CXBORDER, -SYSMETRICS_CYBORDER );
if (!PtInRect( &rect, pt ))
{
/* Check size box */
if ((wndPtr->dwStyle & WS_VSCROLL) &&
(pt.x >= rect.right - SYSMETRICS_CXVSCROLL)) return HTSIZE;
return HTHSCROLL;
/* Check top sizing border */
if (pt.y < rect.top)
{
if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTTOPLEFT;
if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTTOPRIGHT;
return HTTOP;
}
/* Check bottom sizing border */
if (pt.y >= rect.bottom)
{
if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTBOTTOMLEFT;
if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTBOTTOMRIGHT;
return HTBOTTOM;
}
/* Check left sizing border */
if (pt.x < rect.left)
{
if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPLEFT;
if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMLEFT;
return HTLEFT;
}
/* Check right sizing border */
if (pt.x >= rect.right)
{
if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPRIGHT;
if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMRIGHT;
return HTRIGHT;
}
}
}
/* Check menu */
if (HAS_MENU(wndPtr))
else /* No thick frame */
{
rect.top -= SYSMETRICS_CYMENU + 1;
if (PtInRect( &rect, pt )) return HTMENU;
if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle ))
InflateRect(&rect, -SYSMETRICS_CXDLGFRAME, -SYSMETRICS_CYDLGFRAME);
else if (wndPtr->dwStyle & WS_BORDER)
InflateRect(&rect, -SYSMETRICS_CXBORDER, -SYSMETRICS_CYBORDER);
if (!PtInRect( &rect, pt )) return HTBORDER;
}
/* Check caption */
if ((wndPtr->dwStyle & WS_CAPTION) == WS_CAPTION)
{
rect.top -= SYSMETRICS_CYCAPTION - 1;
if (PtInRect( &rect, pt ))
rect.top += SYSMETRICS_CYCAPTION - 1;
if (!PtInRect( &rect, pt ))
{
/* Check system menu */
if ((wndPtr->dwStyle & WS_SYSMENU) && (pt.x <= SYSMETRICS_CXSIZE))
......@@ -230,40 +250,42 @@ static LONG NC_InternalNCHitTest( HWND hwnd, POINT pt )
return HTCAPTION;
}
}
/* Check non-sizing border */
if (!HAS_THICKFRAME( wndPtr->dwStyle )) return HTBORDER;
/* Check top sizing border */
if (pt.y < rect.top)
{
if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTTOPLEFT;
if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTTOPRIGHT;
return HTTOP;
}
/* Check client area */
ScreenToClient( hwnd, &pt );
GetClientRect( hwnd, &rect );
if (PtInRect( &rect, pt )) return HTCLIENT;
/* Check vertical scroll bar */
/* Check bottom sizing border */
if (pt.y >= rect.bottom)
if (wndPtr->dwStyle & WS_VSCROLL)
{
if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTBOTTOMLEFT;
if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTBOTTOMRIGHT;
return HTBOTTOM;
rect.right += SYSMETRICS_CXVSCROLL;
if (PtInRect( &rect, pt )) return HTVSCROLL;
}
/* Check left sizing border */
if (pt.x < rect.left)
/* Check horizontal scroll bar */
if (wndPtr->dwStyle & WS_HSCROLL)
{
if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPLEFT;
if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMLEFT;
return HTLEFT;
rect.bottom += SYSMETRICS_CYHSCROLL;
if (PtInRect( &rect, pt ))
{
/* Check size box */
if ((wndPtr->dwStyle & WS_VSCROLL) &&
(pt.x >= rect.right - SYSMETRICS_CXVSCROLL))
return HTSIZE;
return HTHSCROLL;
}
}
/* Check right sizing border */
if (pt.x >= rect.right)
/* Check menu bar */
if (HAS_MENU(wndPtr))
{
if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPRIGHT;
if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMRIGHT;
return HTRIGHT;
if ((pt.y < 0) && (pt.x >= 0) && (pt.x < rect.right))
return HTMENU;
}
/* Should never get here */
......@@ -537,9 +559,9 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint )
#ifdef DEBUG_NONCLIENT
printf( "NC_DoNCPaint: %d %d\n", hwnd, hrgn );
#endif
if (!IsWindowVisible(hwnd)) return;
if (!wndPtr || !hrgn) return;
if (!(wndPtr->dwStyle & (WS_BORDER | WS_DLGFRAME | WS_THICKFRAME)))
if ((!(wndPtr->dwStyle & (WS_BORDER | WS_DLGFRAME | WS_THICKFRAME))) ||
(!(wndPtr->dwStyle & WS_VISIBLE)))
return; /* Nothing to do! */
if (hrgn == 1) hdc = GetDCEx( hwnd, 0, DCX_CACHE | DCX_WINDOW );
......@@ -594,27 +616,15 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint )
NC_DrawCaption( hdc, &r, hwnd, wndPtr->dwStyle, active );
}
if (wndPtr->wIDmenu != 0 &&
(wndPtr->dwStyle & WS_CHILD) != WS_CHILD) {
LPPOPUPMENU lpMenu = (LPPOPUPMENU) GlobalLock(wndPtr->wIDmenu);
if (lpMenu != NULL) {
int oldHeight;
CopyRect(&rect2, &rect);
/* Default MenuBar height */
if (lpMenu->Height == 0) lpMenu->Height = SYSMETRICS_CYMENU + 1;
oldHeight = lpMenu->Height;
rect2.bottom = rect2.top + oldHeight;
StdDrawMenuBar(hdc, &rect2, lpMenu, suppress_menupaint);
if (oldHeight != lpMenu->Height) {
printf("NC_DoNCPaint // menubar changed oldHeight=%d != lpMenu->Height=%d\n",
oldHeight, lpMenu->Height);
/* Reduce ClientRect according to MenuBar height */
wndPtr->rectClient.top -= oldHeight;
wndPtr->rectClient.top += lpMenu->Height;
}
GlobalUnlock(wndPtr->wIDmenu);
}
}
if (HAS_MENU(wndPtr))
{
LPPOPUPMENU lpMenu = (LPPOPUPMENU) GlobalLock( wndPtr->wIDmenu );
RECT r = rect;
r.bottom = rect.top + lpMenu->Height;
rect.top += lpMenu->Height;
StdDrawMenuBar( hdc, &r, lpMenu, suppress_menupaint );
GlobalUnlock( wndPtr->wIDmenu );
}
if (wndPtr->dwStyle & (WS_VSCROLL | WS_HSCROLL)) {
if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->VScroll != NULL) &&
......@@ -624,9 +634,6 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint )
bottom -= SYSMETRICS_CYHSCROLL;
SetRect(&rect2, rect.right - SYSMETRICS_CXVSCROLL,
rect.top, rect.right, bottom);
if (wndPtr->dwStyle & WS_CAPTION) rect.top += SYSMETRICS_CYSIZE;
if (wndPtr->wIDmenu != 0 && (wndPtr->dwStyle & WS_CHILD) != WS_CHILD)
rect2.top += SYSMETRICS_CYMENU + 1;
StdDrawScrollBar(hwnd, hdc, SB_VERT, &rect2, (LPHEADSCROLL)wndPtr->VScroll);
}
if ((wndPtr->dwStyle & WS_HSCROLL) && wndPtr->HScroll != NULL &&
......
......@@ -45,6 +45,8 @@ static char * DefSysColors[] =
static COLORREF SysColors[NUM_SYS_COLORS];
#define MAKE_SOLID(color) \
(PALETTEINDEX(GetNearestPaletteIndex(STOCK_DEFAULT_PALETTE,(color))))
/*************************************************************************
* SYSCOLOR_SetColor
......@@ -69,6 +71,8 @@ static void SYSCOLOR_SetColor( int index, COLORREF color )
sysColorObjects.hbrushInactiveCaption = CreateSolidBrush( color );
break;
case COLOR_MENU:
DeleteObject( sysColorObjects.hbrushMenu );
sysColorObjects.hbrushMenu = CreateSolidBrush( MAKE_SOLID(color) );
break;
case COLOR_WINDOW:
DeleteObject( sysColorObjects.hbrushWindow );
......@@ -95,7 +99,11 @@ static void SYSCOLOR_SetColor( int index, COLORREF color )
sysColorObjects.hbrushInactiveBorder = CreateSolidBrush( color );
break;
case COLOR_APPWORKSPACE:
break;
case COLOR_HIGHLIGHT:
DeleteObject( sysColorObjects.hbrushHighlight );
sysColorObjects.hbrushHighlight = CreateSolidBrush( MAKE_SOLID(color));
break;
case COLOR_HIGHLIGHTTEXT:
break;
case COLOR_BTNFACE:
......
......@@ -260,8 +260,11 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
#endif
/* 'soundrec.exe' has negative position !
Why ? For now, here a patch : */
if (x < 0) x = 0;
if (y < 0) y = 0;
if (!strcmp(className, "SoundRec"))
{
if (x < 0) x = 0;
if (y < 0) y = 0;
}
if (x == CW_USEDEFAULT) x = y = 0;
if (width == CW_USEDEFAULT)
{
......
......@@ -647,16 +647,21 @@ static BOOL WINPOS_InternalSetWindowPos( WINDOWPOS *winpos )
/* Send WM_NCPAINT message if needed */
if ((flags & (SWP_FRAMECHANGED | SWP_SHOWWINDOW)) ||
(!(flags & SWP_NOSIZE)) || (!(flags & SWP_NOMOVE)) ||
(!(flags & SWP_NOACTIVATE)) || (!(flags & SWP_NOZORDER)))
SendMessage( winpos->hwnd, WM_NCPAINT, 1, 0L );
#if 0
if ((flags & (SWP_FRAMECHANGED | SWP_SHOWWINDOW)) &&
(!(flags & SWP_NOREDRAW)) &&
(wndPtr->dwStyle & WS_VISIBLE))
InvalidateRect(winpos->hwnd, NULL, TRUE);
#endif
if (flags & SWP_SHOWWINDOW)
{
/* Repaint the window frame and background */
RedrawWindow( winpos->hwnd, NULL, 0,
RDW_INVALIDATE | RDW_FRAME | RDW_ERASENOW );
}
else
{
if ((flags & SWP_FRAMECHANGED) ||
(!(flags & SWP_NOSIZE)) ||
(!(flags & SWP_NOMOVE)) ||
(!(flags & SWP_NOACTIVATE)) ||
(!(flags & SWP_NOZORDER)))
SendMessage( winpos->hwnd, WM_NCPAINT, 1, 0L );
}
/* And last, send the WM_WINDOWPOSCHANGED message */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment