Release 0.6

Tue Jan  4 13:01:33 1994  David Metcalfe <david@prism.demon.co.uk>

        * [window/caret.c]
        Modified code to use system timer.

Jan 9, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)

	* [windows/win.c]
	Windows create if required new XLIB MenuBar & CaptionBar.

	* [windows/defwnd.c]
	WM_CALCSIZE Move & Resize caption, menubar & scrollbars.
	(I'm not sure it's the good place for it, but it work...)

	* [loader/resource.c]
	optimize in FindResourceByNumber, make lseek() if next type ...

	* [controls/scroll.c]
	scrollbar buttons are now using system resources bitmaps.

	* [controls/caption.c] - new file ...
	captionbar showing title, close button with SysMenu,
	and other buttons using system resources bitmaps.

	* [controls/menu.c]
	New functions: SetMenuItemBitmaps() with 'glues',
	Make new version of LoadMenu() & ParseMenu(),
	( put #define USE_POPUPMENU ).
	Implementation of MenuBar functions.
	
	* [sysres.dll]
	New bitmaps for system such OBM_CLOSE, OBM_MINIMIZE, OBM_UPARROWI.
	New SYSMENU menu, it don't work yet ! :-((

Tue Jan 11 05:27:45 1994  julliard@di.epfl.ch (Alexandre Julliard

	* [memory/atom.c]
	Fixed a bug that could cause atoms to be case-sensitive.

	* [misc/rect.c]
	Bug fix in SubtractRect().

	* [objects/clipping.c]
	Bug fix when setting the clip mask to an empty region.

	* [windows/dce.c]
	Bug fix in ReleaseDC().

	* [windows/dialog.c]
	Call AdjustWindowRectEx() before creating the dialog window.
	Added support for DS_MODALFRAME style.

	* [windows/event.c]
	Cleaned up event handling and removed old Xt stuff.
	Moved double-click handling to windows/message.c

	* [windows/focus.c]
	Bug fix: only set the X focus when the window is viewable.

	* [windows/graphics.c]
	Rewritten DrawReliefRect() to use brush instead of pen, and
	to use the system colors.

	* [windows/message.c]
	Implemented WM_NCHITTEST message sending, and non-client
	mouse messages.
	Cleaned up double-click handling, and removed the Xt code.

	* [windows/nonclient.c]  (New file)
	Implemented AdjustWindowRect().
	Implemented WM_NCCALCSIZE, WM_NCHITTEST and WM_NCPAINT handling.

	* [windows/painting.c]
	Added sending of the WM_NCPAINT message in BeginPaint().

	* [windows/sysmetrics.c] [include/sysmetrics.h]  (New files)
	Implemented system metrics.

	* [windows/win.c]
	Bug fix in setting the parent and owner in CreateWindow().
	Removed the Xt code.

	* [windows/winpos.c]
	Added sending of the WM_NCPAINT message in SetWindowPos().
	Removed the Xt code.
diff --git a/include/caption.h b/include/caption.h
new file mode 100644
index 0000000..0c951c3
--- /dev/null
+++ b/include/caption.h
@@ -0,0 +1,17 @@
+/*
+ *   Caption Bar definitions
+ */
+
+
+typedef struct tagHEADCAPTION {
+    HBITMAP	hClose;
+    HBITMAP	hMinim;
+    HBITMAP	hMaxim;
+    HMENU	hSysMenu;
+    RECT	rectClose;
+    RECT	rectMinim;
+    RECT	rectMaxim;
+} HEADCAPTION;
+typedef HEADCAPTION FAR* LPHEADCAPTION;
+
+
diff --git a/include/gdi.h b/include/gdi.h
index aade98d..b077135 100644
--- a/include/gdi.h
+++ b/include/gdi.h
@@ -282,7 +282,10 @@
 extern BOOL GDI_FreeObject( HANDLE );
 extern GDIOBJHDR * GDI_GetObjPtr( HANDLE, WORD );
 
-extern Display * XT_display;
-extern Screen * XT_screen;
+extern Display * XT_display;  /* Will be removed */
+extern Screen * XT_screen;    /* Will be removed */
+
+extern Display * display;
+extern Screen * screen;
 
 #endif  /* GDI_H */
diff --git a/include/menu.h b/include/menu.h
index edc0bec..fa74240 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -13,7 +13,6 @@
 #include <X11/Xaw/Command.h>
 #include <X11/Xaw/Box.h>
 
-#include "windows.h"
 
 typedef struct tagMENUITEM
 {
@@ -23,7 +22,9 @@
     struct tagMENUITEM *parent;
     WORD	item_flags;
     WORD	item_id;
-    char       *item_text;
+    WORD	sel_key;
+    char	*shortcut;
+    char	*item_text;
     Widget	w;
     Widget	menu_w;
     char	menu_name[10];
@@ -46,11 +47,15 @@
 typedef struct tagPOPUPMENU
 {
     HWND	hWnd;			/* PopupMenu window handle	  */
+    HWND	hWndParent;		/* Parent opupMenu window handle  */
     HWND	ownerWnd;		/* Owner window			  */
     WORD	nItems;    		/* Number of items on menu	  */
     MENUITEM   *firstItem;
     WORD	FocusedItem;
     WORD	MouseFlags;
+    WORD	BarFlags;
+    WORD	Width;
+    WORD	Height;
 } POPUPMENU, *LPPOPUPMENU;
 
 typedef struct
diff --git a/include/sysmetrics.h b/include/sysmetrics.h
new file mode 100644
index 0000000..186d213
--- /dev/null
+++ b/include/sysmetrics.h
@@ -0,0 +1,55 @@
+/*
+ * System metrics definitions
+ *
+ * Copyright 1994 Alexandre Julliard
+ */
+
+#ifndef SYSMETRICS_H
+#define SYSMETRICS_H
+
+#include "windows.h"
+
+
+  /* Constant system metrics */
+#define SYSMETRICS_CXVSCROLL         16
+#define SYSMETRICS_CYHSCROLL         16
+#define SYSMETRICS_CYCAPTION         20
+#define SYSMETRICS_CXBORDER           1
+#define SYSMETRICS_CYBORDER           1
+#define SYSMETRICS_CXDLGFRAME         4
+#define SYSMETRICS_CYDLGFRAME         4
+#define SYSMETRICS_CYVTHUMB          16
+#define SYSMETRICS_CXHTHUMB          16
+#define SYSMETRICS_CXICON            32
+#define SYSMETRICS_CYICON            32
+#define SYSMETRICS_CXCURSOR          32
+#define SYSMETRICS_CYCURSOR          32
+#define SYSMETRICS_CYMENU            18
+#define SYSMETRICS_CYVSCROLL         16
+#define SYSMETRICS_CXHSCROLL         16
+#define SYSMETRICS_CXMIN            100
+#define SYSMETRICS_CYMIN             28
+#define SYSMETRICS_CXSIZE            18
+#define SYSMETRICS_CYSIZE            18
+#define SYSMETRICS_CXMINTRACK       100
+#define SYSMETRICS_CYMINTRACK        28
+#define SYSMETRICS_CXICONSPACING     20
+#define SYSMETRICS_CYICONSPACING     20
+
+  /* Some non-constant system metrics */
+#define SYSMETRICS_CXSCREEN            sysMetrics[SM_CXSCREEN]
+#define SYSMETRICS_CYSCREEN            sysMetrics[SM_CYSCREEN]
+#define SYSMETRICS_CXFULLSCREEN        sysMetrics[SM_CXFULLSCREEN]
+#define SYSMETRICS_CYFULLSCREEN        sysMetrics[SM_CYFULLSCREEN]
+#define SYSMETRICS_SWAPBUTTON          sysMetrics[SM_SWAPBUTTON]
+#define SYSMETRICS_CXFRAME             sysMetrics[SM_CXFRAME]
+#define SYSMETRICS_CYFRAME             sysMetrics[SM_CYFRAME]
+#define SYSMETRICS_CXDOUBLECLK         sysMetrics[SM_CXDOUBLECLK]
+#define SYSMETRICS_CYDOUBLECLK         sysMetrics[SM_CYDOUBLECLK]
+#define SYSMETRICS_MENUDROPALIGNMENT   sysMetrics[SM_MENUDROPALIGNMENT]
+
+
+extern short sysMetrics[SM_CMETRICS];
+
+
+#endif
diff --git a/include/win.h b/include/win.h
index b90675d..8bb8d57 100644
--- a/include/win.h
+++ b/include/win.h
@@ -7,7 +7,7 @@
 #ifndef WIN_H
 #define WIN_H
 
-#include <X11/Intrinsic.h>
+#include <X11/Xlib.h>
 
 #include "windows.h"
 #include "menu.h"
@@ -40,11 +40,10 @@
     WORD         wIDmenu;        /* ID or hmenu (from CreateWindow) */
     HANDLE       hText;          /* Handle of window text */
     WORD         flags;          /* Misc. flags */
-    Widget       shellWidget;    /* For top-level windows */
-    Widget       winWidget;      /* For all windows */
-    Widget       compositeWidget;/* For top-level windows */
     Window       window;         /* X window */
     LPMENUBAR	 menuBarPtr;	 /* Menu bar */
+    HWND	 hWndMenuBar;	 /* Menu bar */
+    HWND	 hWndCaption;	 /* Caption bar */
     WORD         wExtra[1];      /* Window extra bytes */
 } WND;
 
@@ -54,6 +53,7 @@
 #define WIN_GOT_SIZEMSG         0x04  /* WM_SIZE has been sent to the window */
 #define WIN_OWN_DC              0x08  /* Win class has style CS_OWNDC */
 #define WIN_CLASS_DC            0x10  /* Win class has style CS_CLASSDC */
+#define WIN_DOUBLE_CLICKS       0x20  /* Win class has style CS_DBLCLKS */
 
   /* Window functions */
 WND *WIN_FindWndPtr( HWND hwnd );
diff --git a/include/windows.h b/include/windows.h
index ae37d54..7cfecdc 100644
--- a/include/windows.h
+++ b/include/windows.h
@@ -238,6 +238,49 @@
 #define WVR_REDRAW          (WVR_HREDRAW | WVR_VREDRAW)
 #define WVR_VALIDRECTS      0x0400
 
+  /* WM_NCHITTEST return codes */
+#define HTERROR             (-2)
+#define HTTRANSPARENT       (-1)
+#define HTNOWHERE           0
+#define HTCLIENT            1
+#define HTCAPTION           2
+#define HTSYSMENU           3
+#define HTSIZE              4
+#define HTMENU              5
+#define HTHSCROLL           6
+#define HTVSCROLL           7
+#define HTMINBUTTON         8
+#define HTMAXBUTTON         9
+#define HTLEFT              10
+#define HTRIGHT             11
+#define HTTOP               12
+#define HTTOPLEFT           13
+#define HTTOPRIGHT          14
+#define HTBOTTOM            15
+#define HTBOTTOMLEFT        16
+#define HTBOTTOMRIGHT       17
+#define HTBORDER            18
+#define HTGROWBOX           HTSIZE
+#define HTREDUCE            HTMINBUTTON
+#define HTZOOM              HTMAXBUTTON
+
+  /* WM_SYSCOMMAND parameters */
+#define SC_SIZE         0xf000
+#define SC_MOVE         0xf010
+#define SC_MINIMIZE     0xf020
+#define SC_MAXIMIZE     0xf030
+#define SC_NEXTWINDOW   0xf040
+#define SC_PREVWINDOW   0xf050
+#define SC_CLOSE        0xf060
+#define SC_VSCROLL      0xf070
+#define SC_HSCROLL      0xf080
+#define SC_MOUSEMENU    0xf090
+#define SC_KEYMENU      0xf100
+#define SC_ARRANGE      0xf110
+#define SC_RESTORE      0xf120
+#define SC_TASKLIST     0xf130
+#define SC_SCREENSAVE   0xf140
+#define SC_HOTKEY       0xf150
 
   /* Dialogs */
 
@@ -794,6 +837,8 @@
 #define SM_PENWINDOWS         41
 #define SM_DBCSENABLED        42
 
+#define SM_CMETRICS           43
+
   /* Device-independent bitmaps */
 
 typedef struct { BYTE rgbBlue, rgbGreen, rgbRed, rgbReserved; } RGBQUAD;
@@ -1058,6 +1103,63 @@
 #define IDC_SIZEWE MAKEINTRESOURCE(32544)
 #define IDC_SIZENS MAKEINTRESOURCE(32545)
 
+/* OEM Resource Ordinal Numbers */
+#define OBM_CLOSE           32754
+#define OBM_UPARROW         32753
+#define OBM_DNARROW         32752
+#define OBM_RGARROW         32751
+#define OBM_LFARROW         32750
+#define OBM_REDUCE          32749
+#define OBM_ZOOM            32748
+#define OBM_RESTORE         32747
+#define OBM_REDUCED         32746
+#define OBM_ZOOMD           32745
+#define OBM_RESTORED        32744
+#define OBM_UPARROWD        32743
+#define OBM_DNARROWD        32742
+#define OBM_RGARROWD        32741
+#define OBM_LFARROWD        32740
+#define OBM_MNARROW         32739
+#define OBM_COMBO           32738
+#define OBM_UPARROWI        32737
+#define OBM_DNARROWI        32736
+#define OBM_RGARROWI        32735
+#define OBM_LFARROWI        32734
+
+#define OBM_OLD_CLOSE       32767
+#define OBM_SIZE            32766
+#define OBM_OLD_UPARROW     32765
+#define OBM_OLD_DNARROW     32764
+#define OBM_OLD_RGARROW     32763
+#define OBM_OLD_LFARROW     32762
+#define OBM_BTSIZE          32761
+#define OBM_CHECK           32760
+#define OBM_CHECKBOXES      32759
+#define OBM_BTNCORNERS      32758
+#define OBM_OLD_REDUCE      32757
+#define OBM_OLD_ZOOM        32756
+#define OBM_OLD_RESTORE     32755
+
+#define OCR_NORMAL          32512
+#define OCR_IBEAM           32513
+#define OCR_WAIT            32514
+#define OCR_CROSS           32515
+#define OCR_UP              32516
+#define OCR_SIZE            32640
+#define OCR_ICON            32641
+#define OCR_SIZENWSE        32642
+#define OCR_SIZENESW        32643
+#define OCR_SIZEWE          32644
+#define OCR_SIZENS          32645
+#define OCR_SIZEALL         32646
+#define OCR_ICOCUR          32647
+
+#define OIC_SAMPLE          32512
+#define OIC_HAND            32513
+#define OIC_QUES            32514
+#define OIC_BANG            32515
+#define OIC_NOTE            32516
+
   /* Stock GDI objects for GetStockObject() */
 
 #define WHITE_BRUSH	    0
@@ -1097,10 +1199,25 @@
 
 #define WM_NCCREATE         0x0081
 #define WM_NCDESTROY        0x0082
-#define WM_NCCALCSIZE	    0x0083
+#define WM_NCCALCSIZE       0x0083
+#define WM_NCHITTEST        0x0084
+#define WM_NCPAINT          0x0085
+#define WM_NCACTIVATE       0x0086
 
 #define WM_GETDLGCODE	    0x0087
 
+  /* Non-client mouse messages */
+#define WM_NCMOUSEMOVE      0x00a0
+#define WM_NCLBUTTONDOWN    0x00a1
+#define WM_NCLBUTTONUP      0x00a2
+#define WM_NCLBUTTONDBLCLK  0x00a3
+#define WM_NCRBUTTONDOWN    0x00a4
+#define WM_NCRBUTTONUP      0x00a5
+#define WM_NCRBUTTONDBLCLK  0x00a6
+#define WM_NCMBUTTONDOWN    0x00a7
+#define WM_NCMBUTTONUP      0x00a8
+#define WM_NCMBUTTONDBLCLK  0x00a9
+
   /* Keyboard messages */
 #define WM_KEYDOWN          0x0100
 #define WM_KEYUP            0x0101
@@ -1115,6 +1232,7 @@
 
 #define WM_INITDIALOG       0x0110 
 #define WM_COMMAND          0x0111
+#define WM_SYSCOMMAND       0x0112
 #define WM_TIMER	    0x0113
 #define WM_SYSTIMER	    0x0118
 
@@ -1166,6 +1284,14 @@
 #define PM_REMOVE	0x0001
 #define PM_NOYIELD	0x0002
 
+#define WM_SHOWWINDOW       0x0018
+
+/* WM_SHOWWINDOW wParam codes */
+#define SW_PARENTCLOSING    1
+#define SW_OTHERMAXIMIZED   2
+#define SW_PARENTOPENING    3
+#define SW_OTHERRESTORED    4
+
 enum { SW_HIDE, SW_SHOWNORMAL, SW_NORMAL, SW_SHOWMINIMIZED, SW_SHOWMAXIMIZED,
 	SW_MAXIMIZE, SW_SHOWNOACTIVATE, SW_SHOW, SW_MINIMIZE,
 	SW_SHOWMINNOACTIVE, SW_SHOWNA, SW_RESTORE };
@@ -1284,9 +1410,7 @@
 #define DT_NOPREFIX 2048
 #define DT_INTERNAL 4096
 
-
-
-
+/* Window Styles */
 #define WS_OVERLAPPED 0x00000000L
 #define WS_POPUP 0x80000000L
 #define WS_CHILD 0x40000000L
@@ -2022,7 +2146,7 @@
 Fa(WORD,GetRelAbs,HDC,a)
 Fa(WORD,GetROP2,HDC,a)
 Fa(WORD,GetStretchBltMode,HDC,a)
-Fa(int,GetSystemMetrics,short,a)
+Fa(int,GetSystemMetrics,WORD,a)
 Fa(int,GetWindowTextLength,HWND,a)
 Fa(int,RestoreVisRgn,HDC,a)
 Fa(int,SaveDC,HDC,a)
@@ -2347,7 +2471,7 @@
 Fd(int,MessageBox,HWND,a,LPSTR,b,LPSTR,c,WORD,d)
 Fd(int,SetScrollPos,HWND,a,int,b,int,c,BOOL,d)
 Fd(int,SetVoiceNote,int,a,int,b,int,c,int,d)
-Fd(void,AdjustWindowRectEx,LPRECT,a,LONG,b,BOOL,c,DWORD,d)
+Fd(void,AdjustWindowRectEx,LPRECT,a,DWORD,b,BOOL,c,DWORD,d)
 Fd(void,AnimatePalette,HPALETTE,a,WORD,b,WORD,c,LPPALETTEENTRY,d)
 Fd(void,CheckRadioButton,HWND,a,WORD,b,WORD,c,WORD,d)
 Fd(void,CreateCaret,HWND,a,HBITMAP,b,short,c,short,d)
diff --git a/include/wineopts.h b/include/wineopts.h
new file mode 100644
index 0000000..6f3e66b
--- /dev/null
+++ b/include/wineopts.h
@@ -0,0 +1,11 @@
+/* WINEOPTS.H
+ */
+
+#ifndef WINEOPTS_H
+#define WINEOPTS_H
+
+#include <stdio.h>
+
+FILE *SpyFp;
+
+#endif /* WINEOPTS_H */