Commit 2d159fb7 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 940714

Thu Jul 14 17:50:45 1994 Bob Amstadt (bob@pooh) * [Configure] Autodetects Linux version (if running Linux). * [loader/signal.c] New signals for Linux. * [loader/ldtlib.c] New structure field in sys call. Sun Jul 10 19:31:34 1994 Olaf Flebbe (olaf@dragon) * [load/resource.c] fixed Memory (Resource) Leak. * [load/main.c] fixed a printf. Tue Jul 12 18:50:34 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) * [controls/desktop.c] Implemented desktop wallpaper (only 16 colors for now). * [controls/menu.c] [windows/nonclient.c] Preliminary work to allow multi-line menus. * [misc/main.c] No backing store on desktop window (not useful). * [objects/text.c] A few fixes to DrawText() to make underlines under mnemonic letters to look better. * [windows/graphics.c] More fixes to GRAPH_DrawArc(), and some fixes to Polygon(). Implemented PolyPolygon() (partially working). * [windows/winpos.c] New function WINPOS_SendNCCalcSize(). Cleaned up SetWindowPos() and added preliminary support for multi-line menus. Mon Jul 11 19:15:51 1994 Miguel de Icaza (miguel@sphinx) * [controls/edit.c] Changes to work as a library. * [if1632/callback.c] Ifdefed module. * [if1632/relay.c] Changes to allow linking with WineLib. * [include/windows.h] Added macro WINELIB_UNIMP * [loader/library.c] When compiling WineLib, GetProcAddress is not implemented yet. * [loader/main.c] Added empty InitDLL when using WineLib. * [loader/ne_image.c] Some parts of the loader are needed for WineLib, ifdefed correctly * [misc/{audio.c,mcicda.c,mmaux.c,mmsystem.c] Disable compilation of module when compiling WineLib. * [toolkit/heap.c] Fixed small bug. When passed an invalid handle WineLib would crash, now return NULL. * [toolkit/winmain.c] Call CreateNewTask in _WinMain. Sun Jul 10 09:08:02 1994 David Metcalfe <david@prism.demon.co.uk> * [controls/edit.c] [controls/widget.c] More changes to improve compatibility with Windows' edit control. Finished off tab stop support. Mon Jul 11 21:05:02 MET DST 1994 Erik Bos <erik@hacktic.nl> * [if1632/relay.c] # of ordinals in shell.dll changed to 103. * [loader/signal.c] sti, cli will now be ignored. * [objects/brush.c] Added stub for GetSysColorBrush().
parent 6b81b398
......@@ -4,3 +4,5 @@
- MDI does not send WM_GETMINMAX message.
- InitializeLoadedDLLs() can't init LZEXPAND.DLL. (cs:ip => 0:0)
- LoadCursor does not correctly handle bitmap cursors
- AllocCSToDSAlias() shouldn't alloc alias for the same segment multiple times.
- Dialogs don't support resources which are referred to as integers.
----------------------------------------------------------------------
Thu Jul 14 17:50:45 1994 Bob Amstadt (bob@pooh)
* [Configure]
Autodetects Linux version (if running Linux).
* [loader/signal.c]
New signals for Linux.
* [loader/ldtlib.c]
New structure field in sys call.
Sun Jul 10 19:31:34 1994 Olaf Flebbe (olaf@dragon)
* [load/resource.c]
fixed Memory (Resource) Leak.
* [load/main.c]
fixed a printf.
Tue Jul 12 18:50:34 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [controls/desktop.c]
Implemented desktop wallpaper (only 16 colors for now).
* [controls/menu.c] [windows/nonclient.c]
Preliminary work to allow multi-line menus.
* [misc/main.c]
No backing store on desktop window (not useful).
* [objects/text.c]
A few fixes to DrawText() to make underlines under mnemonic
letters to look better.
* [windows/graphics.c]
More fixes to GRAPH_DrawArc(), and some fixes to Polygon().
Implemented PolyPolygon() (partially working).
* [windows/winpos.c]
New function WINPOS_SendNCCalcSize().
Cleaned up SetWindowPos() and added preliminary support for
multi-line menus.
Mon Jul 11 19:15:51 1994 Miguel de Icaza (miguel@sphinx)
* [controls/edit.c]
Changes to work as a library.
* [if1632/callback.c]
Ifdefed module.
* [if1632/relay.c]
Changes to allow linking with WineLib.
* [include/windows.h]
Added macro WINELIB_UNIMP
* [loader/library.c]
When compiling WineLib, GetProcAddress is not implemented yet.
* [loader/main.c]
Added empty InitDLL when using WineLib.
* [loader/ne_image.c]
Some parts of the loader are needed for WineLib, ifdefed correctly
* [misc/{audio.c,mcicda.c,mmaux.c,mmsystem.c]
Disable compilation of module when compiling WineLib.
* [toolkit/heap.c]
Fixed small bug. When passed an invalid handle WineLib would
crash, now return NULL.
* [toolkit/winmain.c]
Call CreateNewTask in _WinMain.
Sun Jul 10 09:08:02 1994 David Metcalfe <david@prism.demon.co.uk>
* [controls/edit.c] [controls/widget.c]
More changes to improve compatibility with Windows' edit
control. Finished off tab stop support.
Mon Jul 11 21:05:02 MET DST 1994 Erik Bos <erik@hacktic.nl>
* [if1632/relay.c]
# of ordinals in shell.dll changed to 103.
* [loader/signal.c]
sti, cli will now be ignored.
* [objects/brush.c]
Added stub for GetSysColorBrush().
----------------------------------------------------------------------
Sun, 3 Jul 1994 20:15:56 +0100 (BST) David Metcalfe <david@prism.demon.co.uk>
* [controls/edit.c]
......
......@@ -47,11 +47,25 @@ else
NEWBUILD=''
fi
if [ -f /usr/include/linux/ldt.h ]
then
if grep -q seg_not_present /usr/include/linux/ldt.h
then
NEWLINUXLDT='#define NewLinuxLdt -DNEW_LDT_STRUCT'
ALLDEFINES="$ALLDEFINES -DNEW_LDT_STRUCT"
else
NEWLINUXLDT=''
fi
else
NEWLINUXLDT=''
fi
echo '/* autoconf.h generated automatically. Run Configure. */' > autoconf.h
echo $WINELIB >> autoconf.h
echo $SHORTNAMES >> autoconf.h
echo $NEWBUILD >> autoconf.h
echo $WINE_INI_GLOBAL >> autoconf.h
echo $NEWLINUXLDT >> autoconf.h
echo "#define AutoDefines $ALLDEFINES" >> autoconf.h
xmkmf -a
......@@ -6,10 +6,56 @@
static char Copyright[] = "Copyright Alexandre Julliard, 1994";
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include "win.h"
#include "desktop.h"
#include "prototypes.h"
/***********************************************************************
* DESKTOP_LoadBitmap
*
* Load a bitmap from a file. Used by SetDeskWallPaper().
*/
static HBITMAP DESKTOP_LoadBitmap( HDC hdc, char *filename )
{
BITMAPFILEHEADER *fileHeader;
BITMAPINFO *bitmapInfo;
HBITMAP hbitmap;
char *unixFileName, *buffer;
int file;
long size;
/* Read all the file into memory */
if (!(unixFileName = GetUnixFileName( filename ))) return 0;
if ((file = open( unixFileName, O_RDONLY )) == -1) return 0;
size = lseek( file, 0, SEEK_END );
if (!(buffer = (char *)malloc( size )))
{
close( file );
return 0;
}
lseek( file, 0, SEEK_SET );
size = read( file, buffer, size );
close( file );
fileHeader = (BITMAPFILEHEADER *)buffer;
bitmapInfo = (BITMAPINFO *)(buffer + sizeof(BITMAPFILEHEADER));
/* Check header content */
if ((fileHeader->bfType != 0x4d42) || (size < fileHeader->bfSize))
{
free( buffer );
return 0;
}
hbitmap = CreateDIBitmap( hdc, &bitmapInfo->bmiHeader, CBM_INIT,
buffer + fileHeader->bfOffBits,
bitmapInfo, DIB_RGB_COLORS );
free( buffer );
return hbitmap;
}
/***********************************************************************
......@@ -20,12 +66,49 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
static LONG DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc, DESKTOPINFO *infoPtr )
{
RECT rect;
/* Set colors in case pattern is a monochrome bitmap */
SetBkColor( hdc, RGB(0,0,0) );
SetTextColor( hdc, GetSysColor(COLOR_BACKGROUND) );
GetClientRect( hwnd, &rect );
FillRect( hdc, &rect, infoPtr->hbrushPattern );
/* Paint desktop pattern (only if wall paper does not cover everything) */
if (!infoPtr->hbitmapWallPaper ||
(!infoPtr->fTileWallPaper && (infoPtr->bitmapSize.cx < rect.right) &&
(infoPtr->bitmapSize.cy < rect.bottom)))
{
/* Set colors in case pattern is a monochrome bitmap */
SetBkColor( hdc, RGB(0,0,0) );
SetTextColor( hdc, GetSysColor(COLOR_BACKGROUND) );
FillRect( hdc, &rect, infoPtr->hbrushPattern );
}
/* Paint wall paper */
if (infoPtr->hbitmapWallPaper)
{
int x, y;
HDC hdcmem;
hdcmem = CreateCompatibleDC( hdc );
SelectObject( hdcmem, infoPtr->hbitmapWallPaper );
if (infoPtr->fTileWallPaper)
{
for (y = 0; y < rect.bottom; y += infoPtr->bitmapSize.cy)
for (x = 0; x < rect.right; x += infoPtr->bitmapSize.cx)
BitBlt( hdc, x, y,
infoPtr->bitmapSize.cx, infoPtr->bitmapSize.cy,
hdcmem, 0, 0, SRCCOPY );
}
else
{
x = (rect.left + rect.right - infoPtr->bitmapSize.cx) / 2;
y = (rect.top + rect.bottom - infoPtr->bitmapSize.cy) / 2;
if (x < 0) x = 0;
if (y < 0) y = 0;
BitBlt( hdc, x, y, infoPtr->bitmapSize.cx, infoPtr->bitmapSize.cy,
hdcmem, 0, 0, SRCCOPY );
}
DeleteDC( hdcmem );
}
return 1;
}
......@@ -50,6 +133,7 @@ LONG DesktopWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam )
infoPtr->hbrushPattern = 0;
infoPtr->hbitmapWallPaper = 0;
SetDeskPattern();
SetDeskWallPaper( (LPSTR)-1 );
break;
case WM_ERASEBKGND:
......@@ -77,6 +161,30 @@ BOOL SetDeskPattern()
*/
BOOL SetDeskWallPaper( LPSTR filename )
{
HBITMAP hbitmap;
HDC hdc;
char buffer[256];
WND *wndPtr = WIN_FindWndPtr( GetDesktopWindow() );
DESKTOPINFO *infoPtr = (DESKTOPINFO *)wndPtr->wExtra;
if (filename == (LPSTR)-1)
{
GetProfileString( "desktop", "WallPaper", "(None)", buffer, 256 );
filename = buffer;
}
hdc = GetDC( 0 );
hbitmap = DESKTOP_LoadBitmap( hdc, filename );
ReleaseDC( 0, hdc );
if (infoPtr->hbitmapWallPaper) DeleteObject( infoPtr->hbitmapWallPaper );
infoPtr->hbitmapWallPaper = hbitmap;
infoPtr->fTileWallPaper = GetProfileInt( "desktop", "TileWallPaper", 0 );
if (hbitmap)
{
BITMAP bmp;
GetObject( hbitmap, sizeof(bmp), (LPSTR)&bmp );
infoPtr->bitmapSize.cx = (bmp.bmWidth != 0) ? bmp.bmWidth : 1;
infoPtr->bitmapSize.cy = (bmp.bmHeight != 0) ? bmp.bmHeight : 1;
}
return TRUE;
}
......
......@@ -156,7 +156,7 @@ LONG PopupMenuWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
hwnd, lppop->Width, lppop->Height);
#endif
SetWindowPos(hwnd, 0, 0, 0, lppop->Width + 2, lppop->Height,
SWP_NOZORDER | SWP_NOMOVE);
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE );
#ifdef DEBUG_MENU
printf("PopupMenuWndProc // End of WM_SHOWWINDOW !\n");
#endif
......@@ -1135,7 +1135,7 @@ void MenuBarCalcSize(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop)
#endif
hOldFont = SelectObject(hDC, GetStockObject(SYSTEM_FONT));
lppop->CheckWidth = 0;
LineHeight = OldHeight = SYSMETRICS_CYMENU + 2;
LineHeight = OldHeight = SYSMETRICS_CYMENU + 1;
SetRect(&rect, lprect->left, lprect->top, 0, lprect->top + LineHeight);
lpitem2 = lppop->firstItem;
while (lpitem != NULL) {
......@@ -1202,6 +1202,29 @@ void MenuBarCalcSize(HDC hDC, LPRECT lprect, LPPOPUPMENU lppop)
/***********************************************************************
* MENU_GetMenuBarHeight
*
* Compute the size of the menu bar height. Used by NC_HandleNCCalcSize().
*/
WORD MENU_GetMenuBarHeight( HWND hwnd, WORD menubarWidth )
{
HDC hdc;
RECT rectBar;
WND *wndPtr;
LPPOPUPMENU lppop;
if (!(lppop = PopupMenuGetWindowAndStorage( hwnd, &wndPtr ))) return 0;
if (!wndPtr) return 0;
hdc = GetDC( hwnd );
SetRect( &rectBar, 0, 0, menubarWidth, SYSMETRICS_CYMENU );
MenuBarCalcSize( hdc, &rectBar, lppop );
ReleaseDC( hwnd, hdc );
printf( "MENU_GetMenuBarHeight: returning %d\n", lppop->Height );
return lppop->Height;
}
/***********************************************************************
* FindMenuItem
*/
LPMENUITEM FindMenuItem(HMENU hMenu, WORD nPos, WORD wFlags)
......@@ -1844,7 +1867,7 @@ BOOL TrackPopupMenu(HMENU hMenu, WORD wFlags, short x, short y,
}
}
else {
ShowWindow(lppop->hWnd, SW_SHOW);
ShowWindow(lppop->hWnd, SW_SHOWNOACTIVATE);
}
if (!lppop->BarFlag) {
PopupMenuCalcSize(lppop->hWnd);
......@@ -1853,7 +1876,7 @@ BOOL TrackPopupMenu(HMENU hMenu, WORD wFlags, short x, short y,
x, y, lppop->Width, lppop->Height);
#endif
SetWindowPos(lppop->hWnd, 0, x, y, lppop->Width + 2, lppop->Height,
SWP_NOZORDER);
SWP_NOACTIVATE | SWP_NOZORDER);
}
SetFocus(lppop->hWnd);
if (!MenuHasFocus) {
......@@ -2208,7 +2231,7 @@ BOOL SetMenu(HWND hWnd, HMENU hMenu)
#endif
if (GetCapture() == hWnd) ReleaseCapture();
if (wndPtr->window != 0) {
flags = SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED;
flags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED;
/* if (!IsWindowVisible(hWnd)) flags |= SWP_NOREDRAW; */
flags |= SWP_NOREDRAW;
if (hMenu == 0) {
......
......@@ -34,9 +34,9 @@ static WNDCLASS WIDGETS_BuiltinClasses[] =
0, 0, 0, 0, NULL, "LISTBOX" },
{ CS_GLOBALCLASS, (LONG(*)())ComboBoxWndProc, 0, 8,
0, 0, 0, 0, NULL, "COMBOBOX" },
{ CS_GLOBALCLASS, (LONG(*)())EditWndProc, 0, 2,
{ CS_GLOBALCLASS, (LONG(*)())EditWndProc, 0, 4,
0, 0, 0, 0, NULL, "EDIT" },
{ CS_GLOBALCLASS, (LONG(*)())PopupMenuWndProc, 0, 8,
{ CS_GLOBALCLASS | CS_SAVEBITS, (LONG(*)())PopupMenuWndProc, 0, 8,
0, 0, 0, 0, NULL, "POPUPMENU" },
{ CS_GLOBALCLASS, (LONG(*)())DesktopWndProc, 0, sizeof(DESKTOPINFO),
0, 0, 0, 0, NULL, DESKTOP_CLASS_NAME },
......
......@@ -3,10 +3,16 @@
MODULE = if1632
#ifdef WINELIB
SRCS = \
callback.c \
relay.c
#else
SRCS = \
call.S \
callback.c \
relay.c
#endif
DLLOBJS = \
dll_gdi.o \
......@@ -23,6 +29,10 @@ DLLOBJS = \
dll_win87em.o \
dll_winsock.o
#ifdef WINELIB
DLLOBJS=
#endif
OBJS1= $(SRCS:.S=.o)
#ifndef NewBuild
......
#ifndef WINELIB
static char RCSId[] = "$Id: wine.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
......@@ -324,3 +325,4 @@ void Throw (LPCATCHBUF cbuf, int val)
#endif
longjmp (sb -> buffer, val);
}
#endif /* !WINELIB */
......@@ -273,7 +273,7 @@ length 490
CreateRoundRectRgn(1 2 3 4 5 6)
445 pascal CreateDIBPatternBrush(word word) CreateDIBPatternBrush(1 2)
#449 pascal DEVICECOLORMATCH
#450 pascal POLYPOLYGON
450 pascal PolyPolygon(word ptr ptr word) PolyPolygon(1 2 3 4)
451 pascal CreatePolyPolygonRgn(ptr ptr word word)
CreatePolyPolygonRgn(1 2 3 4)
#452 pascal GDISEEGDIDO
......
......@@ -24,24 +24,31 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#define DEBUG_RELAY /* */
#ifdef WINELIB
#define WineLibSkip(x) 0
#else
#define WineLibSkip(x) x
#endif
struct dll_name_table_entry_s dll_builtin_table[N_BUILTINS] =
{
{ "KERNEL", KERNEL_table, 410, 1 },
{ "USER", USER_table, 540, 2 },
{ "GDI", GDI_table, 490, 3 },
{ "UNIXLIB", UNIXLIB_table, 10, 4 },
{ "WIN87EM", WIN87EM_table, 10, 5 },
{ "SHELL", SHELL_table, 256, 6 },
{ "SOUND", SOUND_table, 20, 7 },
{ "KEYBOARD",KEYBOARD_table,137, 8 },
{ "WINSOCK", WINSOCK_table, 155, 9 },
{ "STRESS", STRESS_table, 15, 10},
{ "MMSYSTEM",MMSYSTEM_table,1226,11},
{ "SYSTEM", SYSTEM_table, 20 ,12},
{ "TOOLHELP",TOOLHELP_table, 83, 13},
{ "KERNEL", WineLibSkip(KERNEL_table), 410, 1 },
{ "USER", WineLibSkip(USER_table), 540, 2 },
{ "GDI", WineLibSkip(GDI_table), 490, 3 },
{ "UNIXLIB", WineLibSkip(UNIXLIB_table), 10, 4 },
{ "WIN87EM", WineLibSkip(WIN87EM_table), 10, 5 },
{ "SHELL", WineLibSkip(SHELL_table), 103, 6 },
{ "SOUND", WineLibSkip(SOUND_table), 20, 7 },
{ "KEYBOARD",WineLibSkip(KEYBOARD_table),137, 8 },
{ "WINSOCK", WineLibSkip(WINSOCK_table), 155, 9 },
{ "STRESS", WineLibSkip(STRESS_table), 15, 10},
{ "MMSYSTEM",WineLibSkip(MMSYSTEM_table),1226,11},
{ "SYSTEM", WineLibSkip(SYSTEM_table), 20 ,12},
{ "TOOLHELP",WineLibSkip(TOOLHELP_table), 83, 13},
};
/* don't forget to increase N_BUILTINS in dll.h if you add a dll */
#ifndef WINELIB
unsigned short *Stack16Frame;
extern unsigned long IF1632_Saved16_esp;
......@@ -211,6 +218,7 @@ DLLRelay(unsigned int func_num, unsigned int seg_off)
Stack16Frame = saved_Stack16Frame;
return ret_val;
}
#endif
/**********************************************************************
* FindDLLTable
......@@ -222,8 +230,11 @@ FindDLLTable(char *dll_name)
for (i = 0; i < N_BUILTINS; i++)
if (strcasecmp(dll_builtin_table[i].dll_name, dll_name) == 0)
#ifdef WINELIB
return dll_builtin_table[i].dll_number;
#else
return dll_builtin_table[i].dll_table;
#endif
return NULL;
}
......@@ -258,6 +269,7 @@ ReturnArg(int arg)
return arg;
}
#ifndef WINELIB
#ifdef WINESTAT
void winestat(){
int i, j;
......@@ -294,3 +306,4 @@ void winestat(){
printf("TOTAL: %d of %d implemented (%3.1f %%)\n",timplemented, tused, perc);
}
#endif /* WINESTAT */
#endif /* !WINELIB */
name system
id 12
length 20
6 pascal GetSystemmsecCount() GetTickCount()
......@@ -11,10 +11,10 @@ length 83
# 56 1 090e LOCALINFO exported, shared data
# 57 1 095e LOCALFIRST exported, shared data
# 58 1 09e9 LOCALNEXT exported, shared data
#59 pascal ModuleFirst(ptr) ModuleFirst(1)
#60 pascal ModuleNext(ptr) ModuleNext(1)
#61 pascal ModuleFindName(ptr ptr) ModuleFindName(1 2)
#62 pascal ModuleFindHandle(ptr word) ModuleFindHandle(1 2)
59 pascal ModuleFirst(ptr) ModuleFirst(1)
60 pascal ModuleNext(ptr) ModuleNext(1)
61 pascal ModuleFindName(ptr ptr) ModuleFindName(1 2)
62 pascal ModuleFindHandle(ptr word) ModuleFindHandle(1 2)
# 63 1 0caa TASKFIRST exported, shared data
# 64 1 0ced TASKNEXT exported, shared data
# 65 1 0d2e TASKFINDHANDLE exported, shared data
......
......@@ -291,6 +291,7 @@ length 540
278 pascal GetDeskTopHwnd() GetDesktopWindow()
#279 OLDSETDESKPATTERN
#280 SETSYSTEMMENU
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)
......
......@@ -13,6 +13,8 @@ typedef struct
{
HBRUSH hbrushPattern;
HBITMAP hbitmapWallPaper;
SIZE bitmapSize;
BOOL fTileWallPaper;
} DESKTOPINFO;
extern BOOL DESKTOP_SetPattern(char *pattern );
......
......@@ -1038,6 +1038,15 @@ typedef struct tagLOGPEN
typedef struct { BYTE rgbBlue, rgbGreen, rgbRed, rgbReserved; } RGBQUAD;
typedef struct { BYTE rgbtBlue, rgbtGreen, rgbtRed; } RGBTRIPLE;
typedef struct
{
UINT bfType;
DWORD bfSize WINE_PACKED;
UINT bfReserved1 WINE_PACKED;
UINT bfReserved2 WINE_PACKED;
DWORD bfOffBits WINE_PACKED;
} BITMAPFILEHEADER;
typedef struct tagBITMAPINFOHEADER
{
DWORD biSize;
......@@ -2899,7 +2908,7 @@ Fd(BOOL,FloodFill,HDC,a,short,b,short,c,DWORD,d)
Fd(BOOL,GetCharWidth,HDC,a,WORD,b,WORD,c,LPINT,d)
Fd(BOOL,HiliteMenuItem,HWND,a,HMENU,b,WORD,c,WORD,d)
Fd(BOOL,MoveToEx,HDC,a,short,b,short,c,LPPOINT,d)
Fd(BOOL,PolyPolygon,HDC,a,LPPOINT,b,LPINT,c,int,d)
Fd(BOOL,PolyPolygon,HDC,a,LPPOINT,b,LPINT,c,WORD,d)
Fd(BOOL,PostAppMessage,HANDLE,a,WORD,b,WORD,c,LONG,d)
Fd(BOOL,RedrawWindow,HWND,a,LPRECT,b,HRGN,c,UINT,d)
Fd(BOOL,SetBitmapDimensionEx,HBITMAP,a,short,b,short,c,LPSIZE,d)
......@@ -3022,4 +3031,7 @@ Fl(int,SetDIBitsToDevice,HDC,a,short,b,short,c,WORD,d,WORD,e,WORD,f,WORD,g,WORD,
Fm(int,StretchDIBits,HDC,a,WORD,b,WORD,c,WORD,d,WORD,e,WORD,f,WORD,g,WORD,h,WORD,i,LPSTR,j,LPBITMAPINFO,k,WORD,l,DWORD,m)
Fn(HFONT,CreateFont,int,a,int,b,int,c,int,d,int,e,BYTE,f,BYTE,g,BYTE,h,BYTE,i,BYTE,j,BYTE,k,BYTE,l,BYTE,m,LPSTR,n)
#ifdef WINELIB
#define WINELIB_UNIMP(x) fprintf (stderr, "WineLib: Unimplemented %s\n", x)
#endif
#endif /* WINDOWS_H */
......@@ -64,6 +64,9 @@ set_ldt_entry(int entry, unsigned long base, unsigned int limit,
ldt_info.contents = contents;
ldt_info.read_exec_only = read_only_flag;
ldt_info.limit_in_pages = limit_in_pages_flag;
#ifdef NEW_LDT_STRUCT
ldt_info.seg_not_present = 0;
#endif
return modify_ldt(1, &ldt_info, sizeof(ldt_info));
#endif
......
......@@ -212,6 +212,9 @@ void FreeLibrary(HANDLE hLib)
*/
FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
{
#ifdef WINELIB
WINELIB_UNIMP ("GetProcAddress");
#else
int i, sel, addr, ret;
register struct w_files *w = wine_files;
int ordinal, len;
......@@ -312,6 +315,7 @@ FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
sel = (ret >> 16);
printf("GetProcAddress // ret=%08X sel=%04X addr=%04X\n", ret, sel, addr);
return (FARPROC) ret;
#endif /* WINELIB */
}
/* internal dlls */
......
......@@ -358,7 +358,7 @@ void InitDLL(struct w_files *wpnt)
rv = CallTo16(cs_reg << 16 | ip_reg, ds_reg);
printf ("rv = %x\n", rv);
} else
printf("%s skipped\n");
printf("%s skipped\n", wpnt->name);
}
}
......@@ -399,4 +399,9 @@ void InitializeLoadedDLLs(struct w_files *wpnt)
for( ; wpnt != final_wpnt; wpnt = wpnt->next)
InitDLL(wpnt);
}
#else /* #ifndef WINELIB */
void InitDLL(struct w_files *wpnt)
{
}
#endif /* #ifndef WINELIB */
......@@ -51,6 +51,7 @@ void load_ne_header (int fd, struct ne_header_s *ne_header)
myerror("Unable to read NE header from file");
}
}
#endif
/**********************************************************************
* LoadNEImage
......@@ -68,6 +69,7 @@ HINSTANCE LoadNEImage(struct w_files *wpnt)
status = lseek(wpnt->fd, wpnt->mz_header->ne_offset, SEEK_SET);
load_ne_header (wpnt->fd, wpnt->ne_header);
#ifndef WINELIB
/*
* Create segment selectors.
*/
......@@ -83,7 +85,7 @@ HINSTANCE LoadNEImage(struct w_files *wpnt)
wpnt->hinstance = (wpnt->
selector_table[wpnt->ne_header->auto_data_seg-1].
selector);
#endif
/* Get the lookup table. This is used for looking up the addresses
of functions that are exported */
......@@ -131,6 +133,7 @@ HINSTANCE LoadNEImage(struct w_files *wpnt)
if (strcasecmp(buff, wpnt->name) != 0 )
LoadImage(buff, DLL, 0);
}
#ifndef WINELIB
/* fixup references */
for (segment = 0; segment < wpnt->ne_header->n_segment_tab; segment++)
......@@ -139,7 +142,7 @@ HINSTANCE LoadNEImage(struct w_files *wpnt)
FixupFunctionPrologs(wpnt);
InitializeLoadedDLLs(wpnt);
#endif
return(wpnt->hinstance);
}
......@@ -197,6 +200,7 @@ GetModuleName(struct w_files * wpnt, int index, char *buffer)
}
#ifndef WINELIB
/**********************************************************************
* FixupSegment
*/
......@@ -458,4 +462,4 @@ FixupSegment(struct w_files * wpnt, int segment_num)
return 0;
}
#endif
#endif /* !WINELIB */
......@@ -948,6 +948,7 @@ HANDLE FreeResource(HANDLE hResData)
GlobalFree(r->info_mem);
return 0;
}
rp = r;
}
return hResData;
......
......@@ -90,8 +90,15 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
/* First take care of a few preliminaries */
#ifdef linux
if(signal != SIGSEGV && signal != SIGTRAP)
if(signal != SIGSEGV
&& signal != SIGILL
#ifdef SIGBUS
&& signal != SIGBUS
#endif
&& signal != SIGTRAP)
{
exit(1);
}
/* And back up over the int3 instruction. */
if(signal == SIGTRAP) {
......@@ -151,6 +158,14 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
scp->sc_eip++;
break;
case 0xfa: /* cli, ignored */
scp->sc_eip++;
break;
case 0xfb: /* sti, ignored */
scp->sc_eip++;
break;
default:
fprintf(stderr, "Unexpected Windows program segfault"
" - opcode = %x\n", *instr);
......@@ -191,6 +206,10 @@ int init_wine_signals(void)
segv_act.sa_restorer =
(void (*)()) (((unsigned int)(cstack) + sizeof(cstack) - 4) & ~3);
wine_sigaction(SIGSEGV, &segv_act, NULL);
wine_sigaction(SIGILL, &segv_act, NULL);
#ifdef SIGBUS
wine_sigaction(SIGBUS, &segv_act, NULL);
#endif
wine_sigaction(SIGTRAP, &segv_act, NULL); /* For breakpoints */
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__)
......
......@@ -3,7 +3,7 @@
*
* Copyright 1994 Martin Ayotte
*/
#ifndef WINELIB
#define DEBUG_MCIWAVE
static char Copyright[] = "Copyright Martin Ayotte, 1994";
......@@ -1507,3 +1507,4 @@ DWORD modMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
}
#endif /* !WINELIB */
......@@ -287,16 +287,10 @@ static void MAIN_CreateDesktop( int argc, char *argv[] )
StructureNotifyMask;
win_attr.cursor = XCreateFontCursor( display, XC_top_left_arrow );
if (Options.nobackingstore)
win_attr.backing_store = NotUseful;
else
win_attr.backing_store = Always;
rootWindow = XCreateWindow( display, DefaultRootWindow(display),
desktopX, desktopY, width, height, 0,
CopyFromParent, InputOutput, CopyFromParent,
CWEventMask | CWCursor |
CWBackingStore, &win_attr );
CWEventMask | CWCursor, &win_attr );
/* Set window manager properties */
......
......@@ -3,7 +3,7 @@
*
* Copyright 1994 Martin Ayotte
*/
#ifndef WINELIB
static char Copyright[] = "Copyright Martin Ayotte, 1994";
/*
......@@ -857,3 +857,4 @@ LRESULT CDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
/*-----------------------------------------------------------------------*/
#endif
......@@ -3,7 +3,7 @@
*
* Copyright 1994 Martin Ayotte
*/
#ifndef WINELIB
static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include "stdio.h"
......@@ -114,3 +114,4 @@ DWORD auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
}
#endif /* !WINELIB */
......@@ -3,7 +3,7 @@
*
* Copyright 1993 Martin Ayotte
*/
#ifndef WINELIB
static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include "stdio.h"
......@@ -614,9 +614,14 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS lpParms)
printf("MCI_OPEN // wDeviceID=%04X !\n", lpParms->wDeviceID);
switch(dwDevTyp) {
case MCI_DEVTYPE_CD_AUDIO:
return CDAUDIO_DriverProc(0, 0, MCI_OPEN_DRIVER,
#ifdef WINELIB
WINELIB_UNIMP ("CDAUDIO_DriverProc");
#else
return CDAUDIO_DriverProc(0, 0, MCI_OPEN_DRIVER,
dwParam, (DWORD)lpParms);
case MCI_DEVTYPE_WAVEFORM_AUDIO:
#endif
case MCI_DEVTYPE_WAVEFORM_AUDIO:
return WAVE_DriverProc(0, 0, MCI_OPEN_DRIVER,
dwParam, (DWORD)lpParms);
case MCI_DEVTYPE_SEQUENCER:
......@@ -646,8 +651,10 @@ DWORD mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
printf("mciClose(%u, %08X, %08X)\n", wDevID, dwParam, lpParms);
switch(mciDrv[wDevID].wType) {
case MCI_DEVTYPE_CD_AUDIO:
#ifndef WINELIB
dwRet = CDAUDIO_DriverProc(mciDrv[wDevID].wDeviceID, 0,
MCI_CLOSE, dwParam, (DWORD)lpParms);
#endif
break;
case MCI_DEVTYPE_WAVEFORM_AUDIO:
dwRet = WAVE_DriverProc(mciDrv[wDevID].wDeviceID, 0,
......@@ -692,8 +699,11 @@ DWORD mciSendCommand(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2)
default:
switch(mciDrv[wDevID].wType) {
case MCI_DEVTYPE_CD_AUDIO:
#ifndef WINELIB
return CDAUDIO_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
wMsg, dwParam1, dwParam2);
#endif
case MCI_DEVTYPE_WAVEFORM_AUDIO:
return WAVE_DriverProc(mciDrv[wDevID].wDeviceID, hDrv,
wMsg, dwParam1, dwParam2);
......@@ -1984,7 +1994,9 @@ LRESULT WINAPI DrvSendMessage(HDRVR hDriver, WORD msg, LPARAM lParam1, LPARAM lP
DWORD dwDevID = 0;
printf("DrvSendMessage(%04X, %04X, %08X, %08X);\n",
hDriver, msg, lParam1, lParam2);
#ifndef WINELIB
return CDAUDIO_DriverProc(dwDevID, hDriver, msg, lParam1, lParam2);
#endif
}
/**************************************************************************
......@@ -2007,3 +2019,4 @@ LRESULT DrvDefDriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
#endif
......@@ -143,6 +143,13 @@ DWORD SetBrushOrg( HDC hdc, short x, short y )
return retval;
}
/***********************************************************************
* GetSysColorBrush (USER.281)
*/
WORD GetSysColorBrush(WORD x)
{
return GetStockObject(GRAY_BRUSH);
}
/***********************************************************************
* BRUSH_DeleteObject
......
......@@ -74,7 +74,7 @@ static char *TEXT_NextLine(HDC hdc, char *str, int *count, char *dest,
case PREFIX:
if (!(format & DT_NOPREFIX))
{
prefix_offset = j + 1;
prefix_offset = j;
i++;
}
else
......@@ -177,7 +177,7 @@ int DrawText( HDC hdc, LPSTR str, int count, LPRECT rect, WORD flags )
SIZE size;
char *strPtr;
static char line[1024];
int len, lh, prefix_x, prefix_len;
int len, lh, prefix_x, prefix_end;
TEXTMETRIC tm;
int x = rect->left, y = rect->top;
int width = rect->right - rect->left;
......@@ -214,10 +214,10 @@ int DrawText( HDC hdc, LPSTR str, int count, LPRECT rect, WORD flags )
if (prefix_offset != -1)
{
GetTextExtentPoint(hdc, line, prefix_offset - 1, &size);
GetTextExtentPoint(hdc, line, prefix_offset, &size);
prefix_x = size.cx;
GetTextExtentPoint(hdc, line + prefix_offset, 1, &size);
prefix_len = size.cx;
GetTextExtentPoint(hdc, line, prefix_offset + 1, &size);
prefix_end = size.cx - 1;
}
if (!GetTextExtentPoint(hdc, line, len, &size)) return 0;
......@@ -235,8 +235,8 @@ 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)
{
MoveTo(hdc, x + prefix_x, y + size.cy);
LineTo(hdc, x + prefix_x + prefix_len, y + size.cy);
MoveTo(hdc, x + prefix_x, y + tm.tmAscent + 1 );
LineTo(hdc, x + prefix_end, y + tm.tmAscent + 1 );
}
if (strPtr)
......
......@@ -121,7 +121,7 @@ char *LocalLock (HANDLE hMem)
#ifdef DEBUG_HEAP
printf (">%d->%p\n", hMem, *m);
#endif
return *m;
return m ? *m : 0;
}
HANDLE LocalReAlloc (HANDLE hMem, WORD flags, WORD bytes)
......@@ -196,6 +196,16 @@ HANDLE GlobalLinearUnlock (HANDLE hMem)
return GlobalUnlock (hMem);
}
int HEAP_LocalSize ()
{
return 0;
}
int HEAP_LocalFindHeap ()
{
return 0;
}
#ifdef UNIMPLEMENTED
void *GlobalQuickAlloc(int size)
{
......
......@@ -8,6 +8,7 @@ _WinMain (int argc, char *argv [])
{
int ret_val;
char filename [4096];
HANDLE hTaskMain;
GetPrivateProfileString("wine", "SystemResources", "sysres.dll",
filename, sizeof(filename), WINE_INI);
......@@ -18,6 +19,7 @@ _WinMain (int argc, char *argv [])
printf("System Resources Loaded // hSysRes='%04X'\n", hSysRes);
USER_InitApp (hSysRes);
hTaskMain = CreateNewTask (1); /* This is not correct */
ret_val = WinMain (1, /* hInstance */
0, /* hPrevInstance */
"", /* lpszCmdParam */
......
......@@ -22,6 +22,7 @@ extern LONG NC_HandleNCLButtonDown( HWND hwnd, WORD wParam, LONG lParam );
extern LONG NC_HandleNCLButtonDblClk( HWND hwnd, WORD wParam, LONG lParam );
extern LONG NC_HandleSysCommand( HWND hwnd, WORD wParam, POINT pt );
extern LONG NC_HandleSetCursor( HWND hwnd, WORD wParam, LONG lParam );
extern LONG WINPOS_HandleWindowPosChanging( WINDOWPOS *winpos ); /* winpos.c */
extern void NC_TrackSysMenu( HWND hwnd ); /* menu.c */
extern BOOL ActivateMenuBarFocus(HWND hWnd); /* menu.c */
......@@ -126,6 +127,9 @@ LONG DefWindowProc( HWND hwnd, WORD msg, WORD wParam, LONG lParam )
if (wParam) SetFocus( hwnd );
break;
case WM_WINDOWPOSCHANGING:
return WINPOS_HandleWindowPosChanging( (WINDOWPOS *)lParam );
case WM_WINDOWPOSCHANGED:
{
WINDOWPOS * winPos = (WINDOWPOS *)lParam;
......
......@@ -105,8 +105,8 @@ BOOL MoveToEx( HDC hdc, short x, short y, LPPOINT pt )
BOOL GRAPH_DrawArc( HDC hdc, int left, int top, int right, int bottom,
int xstart, int ystart, int xend, int yend, int lines )
{
int xcenter, ycenter;
double start_angle, end_angle, diff_angle;
int xcenter, ycenter, istart_angle, idiff_angle;
double start_angle, end_angle;
XPoint points[3];
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
......@@ -151,16 +151,15 @@ BOOL GRAPH_DrawArc( HDC hdc, int left, int top, int right, int bottom,
(double)(xstart-xcenter)*(bottom-top) );
end_angle = atan2( (double)(ycenter-yend)*(right-left),
(double)(xend-xcenter)*(bottom-top) );
diff_angle = end_angle - start_angle;
if (diff_angle < 0.0) diff_angle += 2*PI;
istart_angle = (int)(start_angle * 180 * 64 / PI);
idiff_angle = (int)((end_angle - start_angle) * 180 * 64 / PI );
if (idiff_angle <= 0) idiff_angle += 360 * 64;
if (left > right) swap_int( &left, &right );
if (top > bottom) swap_int( &top, &bottom );
XDrawArc( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1,
(int)(start_angle * 180 * 64 / PI),
(int)(diff_angle * 180 * 64 / PI) );
right-left-1, bottom-top-1, istart_angle, idiff_angle );
if (!lines) return TRUE;
points[0].x = dc->w.DCOrgX + xcenter + (int)(cos(start_angle) * (right-left) / 2);
......@@ -656,7 +655,7 @@ BOOL Polygon (HDC hdc, LPPOINT pt, int count)
{
register int i;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
XPoint *points = (XPoint *) malloc (sizeof (XPoint) * count+1);
XPoint *points = (XPoint *) malloc (sizeof (XPoint) * (count+1));
if (!dc)
{
......@@ -666,29 +665,78 @@ BOOL Polygon (HDC hdc, LPPOINT pt, int count)
return TRUE;
}
if (DC_SetupGCForBrush( dc ))
for (i = 0; i < count; i++)
{
for (i = 0; i < count; i++)
{
points [i].x = dc->w.DCOrgX + XLPTODP(dc, pt [i].x);
points [i].y = dc->w.DCOrgY + YLPTODP(dc, pt [i].y);
}
points [count] = points [0];
points[i].x = dc->w.DCOrgX + XLPTODP( dc, pt[i].x );
points[i].y = dc->w.DCOrgY + YLPTODP( dc, pt[i].y );
}
points[count] = points[0];
if (DC_SetupGCForBrush( dc ))
XFillPolygon( display, dc->u.x.drawable, dc->u.x.gc,
points, count, Complex, CoordModeOrigin);
if (DC_SetupGCForPen ( dc ))
points, count+1, Complex, CoordModeOrigin);
if (DC_SetupGCForPen ( dc ))
XDrawLines( display, dc->u.x.drawable, dc->u.x.gc,
points, count+1, CoordModeOrigin );
free( points );
return TRUE;
}
/**********************************************************************
* PolyPolygon (GDI.450)
*/
BOOL PolyPolygon( HDC hdc, LPPOINT pt, LPINT counts, WORD polygons )
{
int i;
HRGN hrgn;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
/* MF_MetaPoly(dc, META_POLYGON, pt, count); */
return TRUE;
}
/* The points should be converted to device coords before */
/* creating the region. But as CreatePolyPolygonRgn is not */
/* really correct either, it doesn't matter much... */
/* At least the outline will be correct :-) */
hrgn = CreatePolyPolygonRgn( pt, counts, polygons, dc->w.polyFillMode );
PaintRgn( hdc, hrgn );
DeleteObject( hrgn );
/* Draw the outline of the polygons */
if (DC_SetupGCForPen ( dc ))
{
int i, j, max = 0;
XPoint *points;
for (i = 0; i < polygons; i++) if (counts[i] > max) max = counts[i];
points = (XPoint *) malloc( sizeof(XPoint) * (max+1) );
for (i = 0; i < polygons; i++)
{
for (j = 0; j < counts[i]; j++)
{
points[j].x = dc->w.DCOrgX + XLPTODP( dc, pt->x );
points[j].y = dc->w.DCOrgY + YLPTODP( dc, pt->y );
pt++;
}
points[j] = points[0];
XDrawLines( display, dc->u.x.drawable, dc->u.x.gc,
points, count, CoordModeOrigin );
points, j + 1, CoordModeOrigin );
}
free( points );
}
free ((void *) points);
return (TRUE);
return TRUE;
}
/**********************************************************************
* FloodFill_rec -- FloodFill helper function
*
......
......@@ -26,8 +26,8 @@ ICON_Iconify(HWND hwnd)
WND *parwPtr;
#ifdef DEBUG_ICON
#endif
printf("ICON_Iconify %d\n", hwnd);
#endif
parwPtr = WIN_FindWndPtr(wndPtr->hwndParent);
if (parwPtr == NULL) {
......@@ -40,8 +40,10 @@ ICON_Iconify(HWND hwnd)
printf("argh, couldn't find icon\n");
exit(1);
}
#ifdef DEBUG_ICON
printf("parent edge values are %d, %d\n", parwPtr->rectWindow.left,
parwPtr->rectWindow.bottom);
#endif
wndPtr->ptIconPos.x = parwPtr->rectWindow.left + 10;
wndPtr->ptIconPos.y = parwPtr->rectWindow.bottom - 80;
......@@ -68,7 +70,9 @@ ICON_Iconify(HWND hwnd)
XMapWindow(display, wndPtr->icon);
SendMessage(hwnd, WM_PAINTICON, 0, 0);
#ifdef DEBUG_ICON
printf("done with iconify\n");
#endif
}
......@@ -94,7 +98,7 @@ BOOL ICON_isAtPoint(HWND hwnd, POINT pt)
iconWidth = 64;
iconHeight = 64;
}
#define DEBUG_ICON 1
#ifdef DEBUG_ICON
printf("icon x,y is %d,%d\n",
wndPtr->ptIconPos.x, wndPtr->ptIconPos.y);
......@@ -124,7 +128,9 @@ BOOL ICON_isAtPoint(HWND hwnd, POINT pt)
(wndPtr->dwStyle & WS_VISIBLE) &&
!(wndPtr->dwExStyle & WS_EX_TRANSPARENT))
{
#ifdef DEBUG_ICON
printf("got a winner!\n");
#endif
return 1;
}
......@@ -142,10 +148,14 @@ HWND ICON_findIconFromPoint(POINT pt)
if ( !(wndPtr=WIN_FindWndPtr(hwnd))) return 0;
if (ICON_isAtPoint(hwnd, pt)) {
#ifdef DEBUG_ICON
printf("returning\n");
#endif
return hwndRet = hwnd;
} else {
#ifdef DEBUG_ICON
printf("checking child\n");
#endif
hwnd = wndPtr->hwndChild;
}
}
......@@ -157,7 +167,9 @@ ICON_Deiconify(HWND hwnd)
{
WND *wndPtr = WIN_FindWndPtr( hwnd );
#ifdef DEBUG_ICON
printf("deiconifying\n");
#endif
XUnmapWindow(display, wndPtr->icon);
wndPtr->dwStyle &= ~WS_MINIMIZE;
/* wndPtr->rectNormal = myrect;
......
......@@ -27,6 +27,7 @@ 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 */
/* Some useful macros */
......@@ -117,13 +118,17 @@ LONG NC_HandleNCCalcSize( HWND hwnd, NCCALCSIZE_PARAMS *params )
if (!wndPtr) return 0;
NC_AdjustRect( &tmpRect, wndPtr->dwStyle,
HAS_MENU(wndPtr), wndPtr->dwExStyle );
NC_AdjustRect( &tmpRect, wndPtr->dwStyle, FALSE, wndPtr->dwExStyle );
params->rgrc[0].left -= tmpRect.left;
params->rgrc[0].top -= tmpRect.top;
params->rgrc[0].right -= tmpRect.right;
params->rgrc[0].bottom -= tmpRect.bottom;
if (HAS_MENU(wndPtr))
{
params->rgrc[0].top += MENU_GetMenuBarHeight( hwnd,
params->rgrc[0].right - params->rgrc[0].left );
}
return 0;
}
......
......@@ -24,6 +24,11 @@ extern Colormap COLOR_WinColormap;
extern void EVENT_RegisterWindow( Window w, HWND hwnd ); /* event.c */
extern void CURSOR_SetWinCursor( HWND hwnd, HCURSOR hcursor ); /* cursor.c */
extern void WINPOS_ChangeActiveWindow( HWND hwnd, BOOL mouseMsg ); /*winpos.c*/
extern LONG WINPOS_SendNCCalcSize( HWND hwnd, BOOL calcValidRect,
RECT *newWindowRect, RECT *oldWindowRect,
RECT *oldClientRect, WINDOWPOS *winpos,
RECT *newClientRect ); /* winpos.c */
extern HMENU CopySysMenu(); /* menu.c */
extern LONG MDIClientWndProc(HWND hwnd, WORD message,
WORD wParam, LONG lParam); /* mdi.c */
......@@ -453,19 +458,8 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
if (!wmcreate) wmcreate = -1;
else
{
/* Send WM_NCCALCSIZE message */
NCCALCSIZE_PARAMS *params;
HANDLE hparams;
hparams = USER_HEAP_ALLOC( GMEM_MOVEABLE, sizeof(*params) );
if (hparams)
{
params = (NCCALCSIZE_PARAMS *) USER_HEAP_ADDR( hparams );
params->rgrc[0] = wndPtr->rectWindow;
params->lppos = NULL;
SendMessage( hwnd, WM_NCCALCSIZE, FALSE, (LONG)params );
wndPtr->rectClient = params->rgrc[0];
USER_HEAP_FREE( hparams );
}
WINPOS_SendNCCalcSize( hwnd, FALSE, &wndPtr->rectWindow,
NULL, NULL, NULL, &wndPtr->rectClient );
wmcreate = SendMessage( hwnd, WM_CREATE, 0, (LONG)createStruct );
}
......
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