From 3ed37e0869fceba410c87e571ab6b19b645c61a9 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 7 Nov 1994 18:20:42 +0000 Subject: [PATCH] Release 941107 Sun Nov 6 18:52:04 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) * [objects/oembitmap.c] (New file) Added possibility to use .xpm files for OEM bitmaps. * [include/bitmaps/obm*] (New files) Redrawn all OEM bitmaps in xpm format. * [objects/font.c] Add space for internal leading when using a negative font height. Stubs for AddFontResource() and RemoveFontResource(). Fix in FONT_Init() for uninitialised default font. * [windows/dialog.c] Make font height negative as it is really a point size and not a pixel size; dialogs using 8-point fonts look better now. * [windows/graphics.c] Fixed the fix :-) for Pie() to make it work for Arc() and Chord() also. * [windows/nonclient.c] A few changes for new OEM bitmaps. Sun Nov 6 18:22:18 1994 Michael Patra * [windows/class.c] The names of local classes have to be stored using GlobalAtom*. Otherwise they couldn't be accessed from other modules (e.g. BWCC) * [if1632/call.S] CallTo16(cx): It's possible to set the contents of the cx-register. * [loader/ne_image.c] InitNEDLL(): The size of the local heap is now passed in the cx- register when initializing a DLL. * [memory/heap.c] LocalInit(): The case start==0 is now handled in the way it should. * [windows/win.c] GetWindowLong(): If the adress of the windows function is requested it's no longer returned if it's within the Wine code (and therefore unreachable by a windows program). This makes Borland's OWL happy. * [controls/edit.c] EDIT_GetStr(): Added handling for off<0. Sun Nov 6 17:37:14 1994 Chris Jones * [loader/library.c] Fixed infinite loop bug when two DLLs refer to each other (fixes hangup of Quicken during loading). Thu Nov 04 12:00:00 1994 Jan Willamowius (jan@janhh.sh.sub.de) * [misc/dos_fs.c] Bug fix: The size of a disk an the available space is now returned in bytes instead of (incorrectly) KBytes. Thu Nov 03 12:00:00 1994 Jan Willamowius (jan@janhh.sh.sub.de) * [windows/graphics.c] Bug fix: Pie segments are now filled with correct brush. Thu Nov 3 10:40:09 1994 Martin von Loewis (martin@cs.csufresno.edu) * [Imakefile] generate rc.o before loader.o * [controls/menu.c] CopySysMenu: generate SYSMENU on the fly, eliminate hSysMenu * [include/resource.h] Add struct ResourceTable * [loader/bitmap.h] Load system bitmaps from sysresbmTable * [misc/clipboard.c] [windows/event.c] IsClipboardFormatAvailable,EVENT_SelectionRequest: bug fixes * [rc/Imakefile] generate rc.o from sysres.o and sysresbm.o. Added -lfl * [rc/rc.y] change style handling to allow ( S1 | S2 ) | S3 * [rc/sysres.rc] [rc/sysresbm.rc] Put bitmaps and icons to sysresbm, everything else to sysres * [rc/winerc.c] [rc/winerc.h] Added -o, -c flags. New function set_out_file. Output to files. * [windows/dialog.c] DialogBoxIndirectPtr, DialogBoxIndirectParamPtr: New functions * [windows/nonclient.c] Create AboutWine dialog from template pointer --- ChangeLog | 108 ++ Configure | 16 +- Imakefile | 11 +- autoconf.h | 9 +- controls/combo.c | 6 +- controls/edit.c | 18 +- controls/listbox.c | 19 +- controls/menu.c | 32 +- if1632/call.S | 34 +- if1632/callback.c | 13 +- if1632/gdi.spec | 3 +- include/bitmaps/obm_btncorners | 15 + include/bitmaps/obm_btsize | 20 + include/bitmaps/obm_check | 19 + include/bitmaps/obm_checkboxes | 44 + include/bitmaps/obm_close | 25 + include/bitmaps/obm_combo | 14 + include/bitmaps/obm_dnarrow | 25 + include/bitmaps/obm_dnarrowd | 24 + include/bitmaps/obm_dnarrowi | 24 + include/bitmaps/obm_lfarrow | 25 + include/bitmaps/obm_lfarrowd | 24 + include/bitmaps/obm_lfarrowi | 24 + include/bitmaps/obm_mnarrow | 16 + include/bitmaps/obm_old_close | 24 + include/bitmaps/obm_old_dnarrow | 20 + include/bitmaps/obm_old_lfarrow | 20 + include/bitmaps/obm_old_reduce | 24 + include/bitmaps/obm_old_restore | 24 + include/bitmaps/obm_old_rgarrow | 20 + include/bitmaps/obm_old_uparrow | 20 + include/bitmaps/obm_old_zoom | 24 + include/bitmaps/obm_reduce | 26 + include/bitmaps/obm_reduced | 25 + include/bitmaps/obm_restore | 26 + include/bitmaps/obm_restored | 25 + include/bitmaps/obm_rgarrow | 25 + include/bitmaps/obm_rgarrowd | 24 + include/bitmaps/obm_rgarrowi | 24 + include/bitmaps/obm_size | 18 + include/bitmaps/obm_uparrow | 25 + include/bitmaps/obm_uparrowd | 24 + include/bitmaps/obm_uparrowi | 24 + include/bitmaps/obm_zoom | 26 + include/bitmaps/obm_zoomd | 25 + include/class.h | 6 +- include/dialog.h | 2 + include/gdi.h | 3 + include/prototypes.h | 25 - include/registers.h | 5 +- include/resource.h | 6 + include/segmem.h | 9 +- include/windows.h | 4 + include/wine.h | 2 +- loader/ldt.c | 2 +- loader/ldtlib.c | 1 - loader/library.c | 37 +- loader/ne_image.c | 11 +- loader/resource.c | 23 +- loader/selector.c | 2 +- loader/signal.c | 10 +- loader/task.c | 2 +- memory/heap.c | 15 + misc/atom.c | 3 +- misc/clipboard.c | 2 +- misc/dos_fs.c | 10 +- misc/message.c | 4 +- objects/Imakefile | 1 + objects/bitblt.c | 6 +- objects/bitmap.c | 64 -- objects/brush.c | 4 +- objects/font.c | 45 +- objects/oembitmap.c | 238 ++++ rc/Imakefile | 12 +- rc/rc.h | 1 + rc/rc.y | 6 +- rc/sysres.h | 21 + rc/sysres.rc | 1822 ++++-------------------------- rc/sysresbm.h | 59 + rc/sysresbm.rc | 1851 +++++++++++++++++++++++++++++++ rc/winerc.c | 70 +- tools/build.c | 6 +- windows/caret.c | 8 +- windows/class.c | 45 +- windows/cursor.c | 2 +- windows/defdlg.c | 3 +- windows/dialog.c | 29 +- windows/event.c | 5 +- windows/graphics.c | 15 +- windows/mdi.c | 2 +- windows/nonclient.c | 52 +- windows/scroll.c | 5 +- windows/win.c | 22 +- 93 files changed, 3745 insertions(+), 1894 deletions(-) create mode 100644 include/bitmaps/obm_btncorners create mode 100644 include/bitmaps/obm_btsize create mode 100644 include/bitmaps/obm_check create mode 100644 include/bitmaps/obm_checkboxes create mode 100644 include/bitmaps/obm_close create mode 100644 include/bitmaps/obm_combo create mode 100644 include/bitmaps/obm_dnarrow create mode 100644 include/bitmaps/obm_dnarrowd create mode 100644 include/bitmaps/obm_dnarrowi create mode 100644 include/bitmaps/obm_lfarrow create mode 100644 include/bitmaps/obm_lfarrowd create mode 100644 include/bitmaps/obm_lfarrowi create mode 100644 include/bitmaps/obm_mnarrow create mode 100644 include/bitmaps/obm_old_close create mode 100644 include/bitmaps/obm_old_dnarrow create mode 100644 include/bitmaps/obm_old_lfarrow create mode 100644 include/bitmaps/obm_old_reduce create mode 100644 include/bitmaps/obm_old_restore create mode 100644 include/bitmaps/obm_old_rgarrow create mode 100644 include/bitmaps/obm_old_uparrow create mode 100644 include/bitmaps/obm_old_zoom create mode 100644 include/bitmaps/obm_reduce create mode 100644 include/bitmaps/obm_reduced create mode 100644 include/bitmaps/obm_restore create mode 100644 include/bitmaps/obm_restored create mode 100644 include/bitmaps/obm_rgarrow create mode 100644 include/bitmaps/obm_rgarrowd create mode 100644 include/bitmaps/obm_rgarrowi create mode 100644 include/bitmaps/obm_size create mode 100644 include/bitmaps/obm_uparrow create mode 100644 include/bitmaps/obm_uparrowd create mode 100644 include/bitmaps/obm_uparrowi create mode 100644 include/bitmaps/obm_zoom create mode 100644 include/bitmaps/obm_zoomd create mode 100644 objects/oembitmap.c create mode 100644 rc/sysres.h create mode 100644 rc/sysresbm.h create mode 100644 rc/sysresbm.rc diff --git a/ChangeLog b/ChangeLog index 37409fe1897..f73a4aa356d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,106 @@ +Sun Nov 6 18:52:04 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) + + * [objects/oembitmap.c] (New file) + Added possibility to use .xpm files for OEM bitmaps. + + * [include/bitmaps/obm*] (New files) + Redrawn all OEM bitmaps in xpm format. + + * [objects/font.c] + Add space for internal leading when using a negative font height. + Stubs for AddFontResource() and RemoveFontResource(). + Fix in FONT_Init() for uninitialised default font. + + * [windows/dialog.c] + Make font height negative as it is really a point size and not a + pixel size; dialogs using 8-point fonts look better now. + + * [windows/graphics.c] + Fixed the fix :-) for Pie() to make it work for Arc() and Chord() also. + + * [windows/nonclient.c] + A few changes for new OEM bitmaps. + +Sun Nov 6 18:22:18 1994 Michael Patra + + * [windows/class.c] + The names of local classes have to be stored using GlobalAtom*. + Otherwise they couldn't be accessed from other modules (e.g. BWCC) + + * [if1632/call.S] + CallTo16(cx): It's possible to set the contents of the cx-register. + + * [loader/ne_image.c] + InitNEDLL(): The size of the local heap is now passed in the cx- + register when initializing a DLL. + + * [memory/heap.c] + LocalInit(): The case start==0 is now handled in the way it should. + + * [windows/win.c] + GetWindowLong(): If the adress of the windows function is requested + it's no longer returned if it's within the Wine code (and therefore + unreachable by a windows program). This makes Borland's OWL happy. + + * [controls/edit.c] + EDIT_GetStr(): Added handling for off<0. + +Sun Nov 6 17:37:14 1994 Chris Jones + + * [loader/library.c] + Fixed infinite loop bug when two DLLs refer to each other (fixes + hangup of Quicken during loading). + +Thu Nov 04 12:00:00 1994 Jan Willamowius (jan@janhh.sh.sub.de) + + * [misc/dos_fs.c] + Bug fix: The size of a disk an the available space + is now returned in bytes instead of (incorrectly) + KBytes. + +Thu Nov 03 12:00:00 1994 Jan Willamowius (jan@janhh.sh.sub.de) + + * [windows/graphics.c] + Bug fix: Pie segments are now filled with correct brush. + +Thu Nov 3 10:40:09 1994 Martin von Loewis (martin@cs.csufresno.edu) + + * [Imakefile] + generate rc.o before loader.o + + * [controls/menu.c] + CopySysMenu: generate SYSMENU on the fly, eliminate hSysMenu + + * [include/resource.h] + Add struct ResourceTable + + * [loader/bitmap.h] + Load system bitmaps from sysresbmTable + + * [misc/clipboard.c] + [windows/event.c] + IsClipboardFormatAvailable,EVENT_SelectionRequest: bug fixes + + * [rc/Imakefile] + generate rc.o from sysres.o and sysresbm.o. Added -lfl + + * [rc/rc.y] + change style handling to allow ( S1 | S2 ) | S3 + + * [rc/sysres.rc] + [rc/sysresbm.rc] + Put bitmaps and icons to sysresbm, everything else to sysres + + * [rc/winerc.c] + [rc/winerc.h] + Added -o, -c flags. New function set_out_file. Output to files. + + * [windows/dialog.c] + DialogBoxIndirectPtr, DialogBoxIndirectParamPtr: New functions + + * [windows/nonclient.c] + Create AboutWine dialog from template pointer + ---------------------------------------------------------------------- Sun Oct 30 13:01:18 1994 Alexandre Julliard (julliard@lamisun.epfl.ch) @@ -346,6 +449,11 @@ Sat Oct 15 17:35:00 PDT 1994 * [debugger/info.c] symbolic backtrace for 32-bit stack. Breaks 16-bit bt. +Sun Sep 25 12:00:00 PDT 1994 + + * [rc/rc.y] [rc/rc.h] [rc/rc.l] [rc/winerc.c] + Files created + Sun Sep 18 11:04:45 MET DST 1994 Dag Asheim (dash@ifi.uio.no) * [misc/spy.c] diff --git a/Configure b/Configure index 9dc4e9ec504..da4a11a3224 100644 --- a/Configure +++ b/Configure @@ -41,6 +41,7 @@ else # if [ "$input" = 'y' -o "$input" = 'Y' ] # then # PROCEMU='#define PROCEMU' +# ALLDEFINES="$ALLDEFINES -DPROCEMU" # echo # echo -n 'bochs directory [/usr/src/bochs]? ' # read input @@ -65,6 +66,17 @@ else SHORTNAMES='' fi +echo +echo -n 'Use the XPM library (Y/N) [N]? ' +read input +if [ "$input" = 'y' -o "$input" = 'Y' ] +then + XPM='#define USE_XPM' + ALLDEFINES="$ALLDEFINES -DUSE_XPM" +else + XPM='' +fi + prompt "Global configfile name" WINE_CONFIGFILE /usr/local/etc/wine.conf WINE_INI_GLOBAL='#define WINE_INI_GLOBAL "'$WINE_CONFIGFILE'"' @@ -179,16 +191,16 @@ fi NEWLINUXLDT='' if grep -s seg_not_present /usr/include/linux/ldt.h 2> /dev/null then - NEWLINUXLDT='#define NEW_LDT_STRUCT' + ALLDEFINES="$ALLDEFINES -DNEW_LDT_STRUCT" fi cat > autoconf.h << EOF /* autoconf.h generated automatically. Run Configure. */ $WINELIB $SHORTNAMES +$XPM $NEWBUILD $WINE_INI_GLOBAL -$NEWLINUXLDT $ENDIAN $PROCEMUDIR #define AutoDefines $ALLDEFINES diff --git a/Imakefile b/Imakefile index 9a38b3d7e77..7c97769fda7 100644 --- a/Imakefile +++ b/Imakefile @@ -27,10 +27,10 @@ COMMONSUBDIRS = \ controls \ etc \ include \ + rc \ loader \ misc \ objects \ - rc \ test \ windows @@ -51,6 +51,7 @@ COMMONOBJS = \ loader.o \ misc.o \ objects.o \ + rc.o \ windows.o /* @@ -86,12 +87,18 @@ SYSLIBS = -ll -lm -lgnumalloc SYSLIBS = -lm -lg #endif +#ifdef USE_XPM +XPM_LIB = -lXpm +#else +XPM_LIB = +#endif + MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) AllTarget(wine.sym) #ifndef WINELIB -NormalProgramTarget(wine,$(EMUOBJS) $(COMMONOBJS),$(DEPXLIB),$(XLIB),$(SYSLIBS)) +NormalProgramTarget(wine,$(EMUOBJS) $(COMMONOBJS),$(DEPXLIB),$(XPM_LIB) $(XLIB),$(SYSLIBS)) #else NormalLibraryTarget(wine,$(LIBOBJS) $(COMMONOBJS)) #endif diff --git a/autoconf.h b/autoconf.h index 223fbc15817..3309b25ce93 100644 --- a/autoconf.h +++ b/autoconf.h @@ -1,2 +1,9 @@ /* autoconf.h generated automatically. Run Configure. */ -#error You must run Configure before you can build the makefiles. + + + + +#define WINE_INI_GLOBAL "/home/alex/wine/wine.conf" + + +#define AutoDefines -DNEW_LDT_STRUCT diff --git a/controls/combo.c b/controls/combo.c index fbf10f1f1b2..4aed28adb11 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -57,7 +57,7 @@ LONG ComboBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) case WM_CREATE: wndPtr = WIN_FindWndPtr(hwnd); if (wndPtr == NULL) return 0; - dprintf_combo(stddeb,"Combo WM_CREATE %p !\n", lphc); + dprintf_combo(stddeb,"Combo WM_CREATE %d !\n", hwnd); if (hComboBit == (HBITMAP)NULL) hComboBit = LoadBitmap((HINSTANCE)NULL, MAKEINTRESOURCE(OBM_COMBO)); GetObject(hComboBit, sizeof(BITMAP), (LPSTR)&bm); @@ -388,6 +388,7 @@ LONG ComboBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) dprintf_combo(stddeb,"ComboBox CB_SHOWDROPDOWN !\n"); lphc = ComboGetStorageHeader(hwnd); if (lphc == NULL) return 0; + wndPtr = WIN_FindWndPtr(hwnd); lphc->dwState = lphc->dwState | CB_SHOWDROPDOWN; if (wParam != 0) { GetWindowRect(hwnd, &rect); @@ -481,6 +482,7 @@ void ComboBoxStaticOwnerDraw(HWND hWnd, LPHEADCOMBO lphc) SendMessage(lphc->hWndLBox, LB_GETTEXT, y, (LPARAM)str); ptr = (LPSTR)SendMessage(lphc->hWndLBox, LB_GETITEMDATA, y, 0L); } + hDC = GetDC(hWnd); hBrush = SendMessage(GetParent(hWnd), WM_CTLCOLOR, (WORD)hDC, MAKELONG(hWnd, CTLCOLOR_STATIC)); if (hBrush == (HBRUSH)NULL) hBrush = GetStockObject(WHITE_BRUSH); @@ -490,9 +492,9 @@ void ComboBoxStaticOwnerDraw(HWND hWnd, LPHEADCOMBO lphc) lpdis = (LPDRAWITEMSTRUCT) USER_HEAP_ADDR(hTemp); if (lpdis == NULL) { printf("ComboBox Ownerdraw // Error allocating DRAWITEMSTRUCT !\n"); + ReleaseDC( hWnd, hDC ); return; } - hDC = GetDC(hWnd); FillRect(hDC, &lphc->RectEdit, hBrush); lpdis->hDC = hDC; if (y != LB_ERR) lpdis->itemID = y - 1; diff --git a/controls/edit.c b/controls/edit.c index 81e5b4f6209..bbaa91743f6 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -16,7 +16,6 @@ static char Copyright[] = "Copyright David W. Metcalfe, 1994"; #include "win.h" #include "class.h" #include "user.h" -#include "scroll.h" #include "stddebug.h" /* #define DEBUG_EDIT */ /* #undef DEBUG_EDIT */ @@ -583,7 +582,7 @@ long EDIT_CreateMsg(HWND hwnd, LONG lParam) memset(text, ' ', (ClientWidth(wndPtr) / charWidths[32]) + 2); /* set up text cursor for edit class */ - CLASS_FindClassByName("EDIT", &classPtr); + CLASS_FindClassByName("EDIT", 0, &classPtr); classPtr->wc.hCursor = LoadCursor(0, IDC_IBEAM); /* paint background on first WM_PAINT */ @@ -1093,18 +1092,18 @@ HANDLE EDIT_GetStr(HWND hwnd, char *lp, int off, int len, int *diff) { HANDLE hStr; char *str; - int ch = 0, i = 0, j, s_i; + int ch = 0, i = 0, j, s_i=0; int ch1; - dprintf_edit(stddeb,"EDIT_GetStr %s %d %d\n", lp, off, len); + dprintf_edit(stddeb,"EDIT_GetStr lp='%s' off=%d len=%d\n", lp, off, len); + if (off<0) off=0; while (i < off) { s_i = i; i += EDIT_CharWidth(hwnd, (BYTE)(*(lp + ch)), i); ch++; } - /* if stepped past _off_, go back a character */ if (i - off) { @@ -1113,7 +1112,6 @@ HANDLE EDIT_GetStr(HWND hwnd, char *lp, int off, int len, int *diff) } *diff = off - i; ch1 = ch; - while (i < len + off) { i += EDIT_CharWidth(hwnd, (BYTE)(*(lp + ch)), i); @@ -2176,7 +2174,7 @@ void EDIT_MouseMoveMsg(HWND hwnd, WORD wParam, LONG lParam) int EDIT_PixelToChar(HWND hwnd, int row, int *pixel) { - int ch = 0, i = 0, s_i; + int ch = 0, i = 0, s_i = 0; char *text; dprintf_edit(stddeb,"EDIT_PixelToChar: row=%d, pixel=%d\n", row, *pixel); @@ -2214,12 +2212,14 @@ LONG EDIT_SetTextMsg(HWND hwnd, LONG lParam) if (strlen((char *)lParam) <= es->MaxTextLen) { - len = strlen((char *)lParam); + len = ( lParam? strlen((char *)lParam) : 0 ); EDIT_ClearText(hwnd); es->textlen = len; es->hText = EDIT_HeapReAlloc(hwnd, es->hText, len + 3); text = EDIT_HeapAddr(hwnd, es->hText); - strcpy(text, (char *)lParam); + if (lParam) + strcpy(text, (char *)lParam); + text[len] = '\0'; text[len + 1] = '\0'; text[len + 2] = '\0'; EDIT_BuildTextPointers(hwnd); diff --git a/controls/listbox.c b/controls/listbox.c index b5d59b785b7..430609f42fe 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -19,7 +19,6 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993"; #include "msdos.h" #include "wine.h" #include "listbox.h" -#include "scroll.h" #include "prototypes.h" #include "stddebug.h" /* #define DEBUG_LISTBOX */ @@ -58,11 +57,6 @@ int ListBoxFindNextMatch(HWND hwnd, WORD wChar); ((wndPtr->dwStyle & LBS_OWNERDRAWVARIABLE) != LBS_OWNERDRAWVARIABLE) ) || \ ((wndPtr->dwStyle & LBS_HASSTRINGS) == LBS_HASSTRINGS) ) -#define HasStrings(wndPtr) ( \ - ( ((wndPtr->dwStyle & LBS_OWNERDRAWFIXED) != LBS_OWNERDRAWFIXED) && \ - ((wndPtr->dwStyle & LBS_OWNERDRAWVARIABLE) != LBS_OWNERDRAWVARIABLE) ) || \ - ((wndPtr->dwStyle & LBS_HASSTRINGS) == LBS_HASSTRINGS) ) - /*********************************************************************** * ListBoxWndProc @@ -399,6 +393,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) wRet = ListBoxAddString(hwnd, (LPSTR)lParam); return wRet; case LB_GETTEXT: + dprintf_listbox(stddeb, "LB_GETTEXT wParam=%d\n",wParam); wRet = ListBoxGetText(hwnd, wParam, (LPSTR)lParam, FALSE); return wRet; case LB_INSERTSTRING: @@ -423,7 +418,8 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) case LB_GETHORIZONTALEXTENT: return wRet; case LB_GETITEMDATA: - lRet = ListBoxGetText(hwnd, wParam, (LPSTR)lParam, HasStrings(wndPtr)); + dprintf_listbox(stddeb, "LB_GETITEMDATA wParam=%x\n", wParam); + lRet = ListBoxGetText(hwnd, wParam, (LPSTR)lParam, TRUE); return lRet; case LB_GETITEMHEIGHT: ListBoxGetItemRect(hwnd, wParam, &rect); @@ -460,6 +456,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam ) case LB_SETHORIZONTALEXTENT: return wRet; case LB_SETITEMDATA: + dprintf_listbox(stddeb, "LB_SETITEMDATA wParam=%x lParam=%lx\n", wParam, lParam); wRet = ListBoxSetItemData(hwnd, wParam, lParam); return wRet; case LB_SETTABSTOPS: @@ -960,6 +957,8 @@ int ListBoxGetText(HWND hwnd, UINT uIndex, LPSTR OutStr, BOOL bItemData) LPHEADLIST lphl; LPLISTSTRUCT lpls; UINT Count; + if ((!OutStr)&&(!bItemData)) + fprintf(stderr, "ListBoxGetText // OutStr==NULL\n"); if (!bItemData) *OutStr=0; lphl = ListBoxGetWindowAndStorage(hwnd, &wndPtr); if (lphl == NULL) return LB_ERR; @@ -1083,6 +1082,8 @@ int ListBoxResetContent(HWND hwnd) if (lphl == NULL) return LB_ERR; lpls = lphl->lpFirst; if (lpls == NULL) return LB_ERR; + dprintf_listbox(stddeb, "ListBoxResetContent // ItemCount = %d\n", + lphl->ItemsCount); for(i = 0; i <= lphl->ItemsCount; i++) { lpls2 = lpls; lpls = (LPLISTSTRUCT)lpls->lpNext; @@ -1097,8 +1098,8 @@ int ListBoxResetContent(HWND hwnd) lphl->lpFirst = NULL; lphl->FirstVisible = 1; lphl->ItemsCount = 0; - lphl->ItemFocused = -1; - lphl->PrevFocused = -1; + lphl->ItemFocused = -1; + lphl->PrevFocused = -1; if ((wndPtr->dwStyle && LBS_NOTIFY) != 0) SendMessage(lphl->hWndLogicParent, WM_COMMAND, wndPtr->wIDmenu, MAKELONG(hwnd, LBN_SELCHANGE)); diff --git a/controls/menu.c b/controls/menu.c index 3d5fef02404..8bc650f2d1e 100644 --- a/controls/menu.c +++ b/controls/menu.c @@ -67,7 +67,6 @@ extern BOOL GRAPH_DrawBitmap( HDC hdc, HBITMAP hbitmap, int xdest, int ydest, extern HINSTANCE hSysRes; -static HMENU hSysMenu = 0; static HBITMAP hStdCheck = 0; static HBITMAP hStdMnArrow = 0; @@ -97,14 +96,6 @@ BOOL MENU_Init() arrow_bitmap_width = bm.bmWidth; arrow_bitmap_height = bm.bmHeight; - /* Load system menu */ - - if (!(hSysMenu = LoadMenu( hSysRes, "SYSMENU" ))) - { - fprintf(stderr,"SysMenu not found in system resources !\n"); - return FALSE; - } - return TRUE; } @@ -1075,13 +1066,12 @@ static BOOL MENU_ButtonUp( HWND hwndOwner, HMENU hmenu, HMENU *hmenuCurrent, static BOOL MENU_MouseMove( HWND hwndOwner, HMENU hmenu, HMENU *hmenuCurrent, POINT pt ) { - POPUPMENU *menu; MENUITEM *item; + POPUPMENU *menu = (POPUPMENU *) USER_HEAP_ADDR( hmenu ); WORD id = NO_SELECTED_ITEM; if (hmenu) { - menu = (POPUPMENU *) USER_HEAP_ADDR( hmenu ); item = MENU_FindItemByCoords( menu, pt.x, pt.y, &id ); if (!item) /* Maybe in system menu */ { @@ -2049,20 +2039,16 @@ HMENU LoadMenuIndirect(LPSTR menu_template) HMENU CopySysMenu() { HMENU hMenu; - LPPOPUPMENU sysmenu, menu; - MENUITEM *item; - int i; + LPPOPUPMENU menu; + extern unsigned char sysres_MENU_SYSMENU[]; - sysmenu = (LPPOPUPMENU) USER_HEAP_ADDR(hSysMenu); - if (!(hMenu = CreatePopupMenu())) return 0; - menu = (POPUPMENU *) USER_HEAP_ADDR( hMenu ); - menu->wFlags |= MF_SYSMENU; - item = (MENUITEM *) USER_HEAP_ADDR( sysmenu->hItems ); - for (i = 0; i < sysmenu->nItems; i++, item++) - { - AppendMenu( hMenu, item->item_flags, item->item_id, item->item_text ); + hMenu=LoadMenuIndirect(sysres_MENU_SYSMENU); + if(!hMenu){ + dprintf_menu(stddeb,"No SYSMENU\n"); + return 0; } - + menu = (POPUPMENU*) USER_HEAP_ADDR(hMenu); + menu->wFlags |= MF_SYSMENU|MF_POPUP; dprintf_menu(stddeb,"CopySysMenu hMenu=%04X !\n", hMenu); return hMenu; } diff --git a/if1632/call.S b/if1632/call.S index 5a6b10b2c91..2d5ed8db62a 100644 --- a/if1632/call.S +++ b/if1632/call.S @@ -8,9 +8,9 @@ #define UDATASEL 0x27 #endif #ifdef __ELF__ -#define A( addr) addr +#define A(addr) addr #else -#define A( addr) _##addr +#define A(addr) _##addr #endif .data jump_target: @@ -21,22 +21,22 @@ return_value: * Places to keep info about the current 32-bit stack frame. */ .globl A( IF1632_Saved32_esp), A(IF1632_Saved32_ebp), A(IF1632_Saved32_ss) -A(IF1632_Saved32_esp): +A(IF1632_Saved32_esp:) .long 0 -A(IF1632_Saved32_ebp): +A(IF1632_Saved32_ebp:) .long 0 -A(IF1632_Saved32_ss): +A(IF1632_Saved32_ss:) .word 0 /********************************************************************** * Places to keep info about the current 16-bit stack frame. */ .globl A(IF1632_Saved16_esp),A(IF1632_Saved16_ebp),A(IF1632_Saved16_ss) -A(IF1632_Saved16_esp): +A(IF1632_Saved16_esp:) .long 0 -A(IF1632_Saved16_ebp): +A(IF1632_Saved16_ebp:) .long 0 -A(IF1632_Saved16_ss): +A(IF1632_Saved16_ss:) .word 0 nbytes: @@ -62,7 +62,7 @@ offset: */ .align 4 .globl A(CallToInit16) -A(CallToInit16): +A(CallToInit16:) pushl %ebp movl %esp,%ebp @@ -154,17 +154,20 @@ A(CallToInit16): ret /********************************************************************** - * int CallTo16(unsigned long csip, unsigned short ds) + * int CallTo16 (unsigned long csip, unsigned short ds) + * int CallTo16cx(unsigned long csip, unsigned long dscx); * * Stack: 0 ebp * 4 eip * 8 target ip * 10 target cs * 12 target ds + * 14 target cx (only CallTo16cx) */ .align 4 - .globl A(CallTo16) -A(CallTo16): + .globl A(CallTo16), A(CallTo16cx) +A(CallTo16:) +A(CallTo16cx:) pushl %ebp movl %esp,%ebp @@ -175,6 +178,7 @@ A(CallTo16): movl %eax,jump_target lea jump_target,%edx movw 12(%ebp),%ax + movw 14(%ebp),%cx /* * Switch to 16-bit stack @@ -252,7 +256,7 @@ A(CallTo16): */ .align 4 .globl A(CallTo32) -A(CallTo32): +A(CallTo32:) pushl %ebp movl %esp,%ebp @@ -354,7 +358,7 @@ noargs: */ .align 4 .globl A(CallTo32_16) -A(CallTo32_16): +A(CallTo32_16:) pushl %ebp movl %esp,%ebp @@ -443,7 +447,7 @@ noargs2: * ReturnFromRegisterFunc() */ .globl A(ReturnFromRegisterFunc) -A(ReturnFromRegisterFunc): +A(ReturnFromRegisterFunc:) /* * Restore 16-bit stack */ diff --git a/if1632/callback.c b/if1632/callback.c index 6f27756961f..5e8d5eb1b1b 100644 --- a/if1632/callback.c +++ b/if1632/callback.c @@ -32,11 +32,6 @@ struct thunk_s unsigned char thunk[10]; }; -static __inline__ int Is16bitAddress(void *address) -{ - return ((unsigned int) address - >= (((FIRST_SELECTOR << 3) | 0x0007) << 16)); -} /********************************************************************** * PushOn16 @@ -197,7 +192,7 @@ LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message, exit(1); } } - else if (Is16bitAddress(func)) + else if (IS_16_BIT_ADDRESS(func)) { dprintf_callback(stddeb, "CallWindowProc // 16bit func=%p !\n", func); PushOn16( CALLBACK_SIZE_WORD, hwnd ); @@ -219,7 +214,7 @@ LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message, */ void CallLineDDAProc(FARPROC func, short xPos, short yPos, long lParam) { - if (Is16bitAddress(func)) + if (IS_16_BIT_ADDRESS(func)) { PushOn16( CALLBACK_SIZE_WORD, xPos ); PushOn16( CALLBACK_SIZE_WORD, yPos ); @@ -238,7 +233,7 @@ void CallLineDDAProc(FARPROC func, short xPos, short yPos, long lParam) */ DWORD CallHookProc( HOOKPROC func, short code, WPARAM wParam, LPARAM lParam ) { - if (Is16bitAddress(func)) + if (IS_16_BIT_ADDRESS(func)) { PushOn16( CALLBACK_SIZE_WORD, code ); PushOn16( CALLBACK_SIZE_WORD, wParam ); @@ -257,7 +252,7 @@ DWORD CallHookProc( HOOKPROC func, short code, WPARAM wParam, LPARAM lParam ) */ BOOL CallGrayStringProc(FARPROC func, HDC hdc, LPARAM lParam, INT cch ) { - if (Is16bitAddress(func)) + if (IS_16_BIT_ADDRESS(func)) { PushOn16( CALLBACK_SIZE_WORD, hdc ); PushOn16( CALLBACK_SIZE_LONG, lParam ); diff --git a/if1632/gdi.spec b/if1632/gdi.spec index 2eee652a5a7..7eb7ebe3394 100644 --- a/if1632/gdi.spec +++ b/if1632/gdi.spec @@ -125,6 +125,7 @@ length 490 105 pascal16 SelectVisRgn(word word) SelectVisRgn(1 2) 106 pascal SetBitmapBits(word long ptr) SetBitmapBits(1 2 3) 117 pascal SetDCOrg(word s_word s_word) SetDCOrg(1 2 3) +119 pascal16 AddFontResource(ptr) AddFontResource(1) #121 pascal Death #122 pascal ReSurRection 123 pascal16 PlayMetaFile(word word) PlayMetaFile(1 2) @@ -140,7 +141,7 @@ length 490 133 pascal16 GetEnvironment(ptr ptr word) GetEnvironment(1 2 3) 134 pascal16 GetRgnBox(word ptr) GetRgnBox(1 2) #135 pascal ScanLr -#136 pascal RemoveFontResource +136 pascal16 RemoveFontResource(ptr) RemoveFontResource(1) 148 pascal SetBrushOrg(word s_word s_word) SetBrushOrg(1 2 3) 149 pascal GetBrushOrg(word) GetBrushOrg(1) 150 pascal16 UnrealizeObject(word) UnrealizeObject(1) diff --git a/include/bitmaps/obm_btncorners b/include/bitmaps/obm_btncorners new file mode 100644 index 00000000000..de1fe0fbbe7 --- /dev/null +++ b/include/bitmaps/obm_btncorners @@ -0,0 +1,15 @@ +/* XPM */ +static char * obm_btncorners[] = { +"30 10 2 1", +" c white", +". c black", +" ", +" .... ", +" .... ...... ", +" . . .. .. .... ", +" . . .. .. .... ", +" . . .. .. .... ", +" . . .. .. .... ", +" .... ...... ", +" .... ", +" "}; diff --git a/include/bitmaps/obm_btsize b/include/bitmaps/obm_btsize new file mode 100644 index 00000000000..c31b35e1279 --- /dev/null +++ b/include/bitmaps/obm_btsize @@ -0,0 +1,20 @@ +/* XPM */ +static char * obm_btsize[] = { +"15 15 2 1", +" c black", +". c white", +" ", +" ....... ..... ", +" ....... ..... ", +" ....... ..... ", +" ....... ..... ", +" ....... ..... ", +" ....... ..... ", +" ....... ..... ", +" ..... ", +" ............. ", +" ............. ", +" ............. ", +" ............. ", +" ............. ", +" "}; diff --git a/include/bitmaps/obm_check b/include/bitmaps/obm_check new file mode 100644 index 00000000000..c6e8a242b27 --- /dev/null +++ b/include/bitmaps/obm_check @@ -0,0 +1,19 @@ +/* XPM */ +static char * obm_check[] = { +"14 14 2 1", +" c white", +". c black", +" ", +" . ", +" . ", +" .. ", +" . ", +" .. ", +" .. . ", +" .. .. ", +" . . ", +" ... ", +" . ", +" ", +" ", +" "}; diff --git a/include/bitmaps/obm_checkboxes b/include/bitmaps/obm_checkboxes new file mode 100644 index 00000000000..ba46442bbdd --- /dev/null +++ b/include/bitmaps/obm_checkboxes @@ -0,0 +1,44 @@ +/* XPM */ +static char * obm_checkboxes[] = { +"56 39 2 1", +" c black", +". c white", +" . . . .", +" ........... . ......... . . .", +" ........... . . ....... . . ......... . ....... .", +" ........... . .. ..... .. . ......... . . ..... . .", +" ........... . ... ... ... . ......... . .. ... .. .", +" ........... . .... . .... . ......... . ... . ... .", +" ........... . ..... ..... . ......... . .... .... .", +" ........... . .... . .... . ......... . ... . ... .", +" ........... . ... ... ... . ......... . .. ... .. .", +" ........... . .. ..... .. . ......... . . ..... . .", +" ........... . . ....... . . ......... . ....... .", +" ........... . ......... . . .", +" . . . .", +"..... ........... ........... ........... ......", +"... ... ....... ... ....... ....... ....", +".. ....... ..... ....... ..... ... ..... ... ...", +". ......... ... ... ... ... ....... ... . . ..", +". ......... ... .. .. ... ....... ... . . ..", +" ........... . .. .. . ......... . . . .", +" ........... . .. .. . ......... . . . .", +" ........... . .. .. . ......... . . . .", +". ......... ... .. .. ... ....... ... . . ..", +". ......... ... ... ... ... ....... ... . . ..", +".. ....... ..... ....... ..... ... ..... ... ...", +"... ... ....... ... ....... ....... ....", +"..... ........... ........... ........... ......", +".............. ............... .", +".............. . . . . . . ............... .", +".............. . . . . . ............... . . . . . .", +".............. . . . . . . ............... . . . . .", +".............. . . . . . ............... . . . . . .", +".............. . . . . . . ............... . . . . .", +".............. . . . . . ............... . . . . . .", +".............. . . . . . . ............... . . . . .", +".............. . . . . . ............... . . . . . .", +".............. . . . . . . ............... . . . . .", +".............. . . . . . ............... . . . . . .", +".............. . . . . . . ............... .", +".............. ............... ."}; diff --git a/include/bitmaps/obm_close b/include/bitmaps/obm_close new file mode 100644 index 00000000000..66c6e32fbed --- /dev/null +++ b/include/bitmaps/obm_close @@ -0,0 +1,25 @@ +/* XPM */ +static char * obm_close[] = { +"36 18 4 1", +" s button_face c grey75", +". s window_frame c black", +"X c white", +"o s button_shadow c grey50", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ............. ....... ", +" .XXXXXXXXXXX.o .XXXXX.o ", +" .............o .......o ", +" ooooooooooooo ooooooo ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/include/bitmaps/obm_combo b/include/bitmaps/obm_combo new file mode 100644 index 00000000000..a6f03ac9364 --- /dev/null +++ b/include/bitmaps/obm_combo @@ -0,0 +1,14 @@ +/* XPM */ +static char * obm_combo[] = { +"7 9 2 1", +" c white", +". c black", +" ... ", +" ... ", +" ... ", +".......", +" ..... ", +" ... ", +" . ", +" ", +"......."}; diff --git a/include/bitmaps/obm_dnarrow b/include/bitmaps/obm_dnarrow new file mode 100644 index 00000000000..61a9db56e56 --- /dev/null +++ b/include/bitmaps/obm_dnarrow @@ -0,0 +1,25 @@ +/* XPM */ +static char * obm_dnarrow[] = { +"17 17 5 1", +" s window_frame c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +"O s button_text c black", +" ", +" ..............X ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .oooooOOOooooXX ", +" .oooooOOOooooXX ", +" .oooooOOOooooXX ", +" .oooOOOOOOOooXX ", +" .ooooOOOOOoooXX ", +" .oooooOOOooooXX ", +" .ooooooOoooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .XXXXXXXXXXXXXX ", +" XXXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_dnarrowd b/include/bitmaps/obm_dnarrowd new file mode 100644 index 00000000000..c7c493562af --- /dev/null +++ b/include/bitmaps/obm_dnarrowd @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_dnarrowd[] = { +"17 17 4 1", +" s window_frame c black", +". s button_shadow c grey50", +"X s button_face c grey75", +"o s button_text c black", +" ", +" ............... ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXoooXXXXX ", +" .XXXXXXoooXXXXX ", +" .XXXXXXoooXXXXX ", +" .XXXXoooooooXXX ", +" .XXXXXoooooXXXX ", +" .XXXXXXoooXXXXX ", +" .XXXXXXXoXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_dnarrowi b/include/bitmaps/obm_dnarrowi new file mode 100644 index 00000000000..4c91ee8cf8a --- /dev/null +++ b/include/bitmaps/obm_dnarrowi @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_dnarrowi[] = { +"17 17 4 1", +" s button_text c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +" ", +" ..............X ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .oooooXXXooooXX ", +" .oooooXXX.oooXX ", +" .oooooXXX.oooXX ", +" .oooXXXXXXXooXX ", +" .ooooXXXXX..oXX ", +" .oooooXXX..ooXX ", +" .ooooooX..oooXX ", +" .ooooooo.ooooXX ", +" .ooooooooooooXX ", +" .XXXXXXXXXXXXXX ", +" XXXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_lfarrow b/include/bitmaps/obm_lfarrow new file mode 100644 index 00000000000..ae5845cd80f --- /dev/null +++ b/include/bitmaps/obm_lfarrow @@ -0,0 +1,25 @@ +/* XPM */ +static char * obm_lfarrow[] = { +"17 17 5 1", +" s window_frame c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +"O s button_text c black", +" ", +" ..............X ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooOoooooXX ", +" .oooooOOoooooXX ", +" .ooooOOOOOOooXX ", +" .oooOOOOOOOooXX ", +" .ooooOOOOOOooXX ", +" .oooooOOoooooXX ", +" .ooooooOoooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .XXXXXXXXXXXXXX ", +" XXXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_lfarrowd b/include/bitmaps/obm_lfarrowd new file mode 100644 index 00000000000..93660439373 --- /dev/null +++ b/include/bitmaps/obm_lfarrowd @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_lfarrowd[] = { +"17 17 4 1", +" s window_frame c black", +". s button_shadow c grey50", +"X s button_face c grey75", +"o s button_text c black", +" ", +" ............... ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXoXXXXXX ", +" .XXXXXXooXXXXXX ", +" .XXXXXooooooXXX ", +" .XXXXoooooooXXX ", +" .XXXXXooooooXXX ", +" .XXXXXXooXXXXXX ", +" .XXXXXXXoXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_lfarrowi b/include/bitmaps/obm_lfarrowi new file mode 100644 index 00000000000..13880a107d5 --- /dev/null +++ b/include/bitmaps/obm_lfarrowi @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_lfarrowi[] = { +"17 17 4 1", +" s button_text c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +" ", +" ..............X ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooX.ooooXX ", +" .oooooXX.ooooXX ", +" .ooooXXXXXXooXX ", +" .oooXXXXXXX.oXX ", +" .ooooXXXXXX.oXX ", +" .oooooXXo...oXX ", +" .ooooooX.ooooXX ", +" .ooooooo.ooooXX ", +" .ooooooooooooXX ", +" .XXXXXXXXXXXXXX ", +" XXXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_mnarrow b/include/bitmaps/obm_mnarrow new file mode 100644 index 00000000000..8748a023592 --- /dev/null +++ b/include/bitmaps/obm_mnarrow @@ -0,0 +1,16 @@ +/* XPM */ +static char * obm_mnarrow[] = { +"7 11 2 1", +" c white", +". c black", +" ", +" . ", +" .. ", +" ... ", +" .... ", +" ..... ", +" .... ", +" ... ", +" .. ", +" . ", +" "}; diff --git a/include/bitmaps/obm_old_close b/include/bitmaps/obm_old_close new file mode 100644 index 00000000000..90a33e0a6bb --- /dev/null +++ b/include/bitmaps/obm_old_close @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_old_close[] = { +"50 19 2 1", +" c white", +". c black", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" .................... .......... ", +" . .. . .. ", +" . .. . .. ", +" ..................... ........... ", +" .................... .......... ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/include/bitmaps/obm_old_dnarrow b/include/bitmaps/obm_old_dnarrow new file mode 100644 index 00000000000..1c3f98743ba --- /dev/null +++ b/include/bitmaps/obm_old_dnarrow @@ -0,0 +1,20 @@ +/* XPM */ +static char * obm_old_dnarrow[] = { +"15 15 2 1", +" s button_highlight c white", +". s button_text c black", +" ", +" ", +" ", +" ... ", +" ... ", +" ... ", +" ... ", +" ......... ", +" ....... ", +" ..... ", +" ... ", +" . ", +" ", +" ", +" "}; diff --git a/include/bitmaps/obm_old_lfarrow b/include/bitmaps/obm_old_lfarrow new file mode 100644 index 00000000000..04b8097160a --- /dev/null +++ b/include/bitmaps/obm_old_lfarrow @@ -0,0 +1,20 @@ +/* XPM */ +static char * obm_old_lfarrow[] = { +"15 15 2 1", +" s button_highlight c white", +". s button_text c black", +" ", +" ", +" ", +" . ", +" .. ", +" ... ", +" ........ ", +" ......... ", +" ........ ", +" ... ", +" .. ", +" . ", +" ", +" ", +" "}; diff --git a/include/bitmaps/obm_old_reduce b/include/bitmaps/obm_old_reduce new file mode 100644 index 00000000000..6f8cf017915 --- /dev/null +++ b/include/bitmaps/obm_old_reduce @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_old_reduce[] = { +"25 19 2 1", +" c white", +". c black", +" ", +" ", +" ", +" ..... ", +" . . ", +" . .. ", +" . .. ", +" . .. ", +" . .. ", +" . .. ", +" . .. ", +" .... .... ", +" . ... ", +" . ... ", +" . ... ", +" . ... ", +" ... ", +" . ", +" "}; diff --git a/include/bitmaps/obm_old_restore b/include/bitmaps/obm_old_restore new file mode 100644 index 00000000000..404ea55306a --- /dev/null +++ b/include/bitmaps/obm_old_restore @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_old_restore[] = { +"25 19 2 1", +" c white", +". c black", +" ", +" ", +" ..... . ", +" . .. . .. ", +" . .. . .. ", +" . .. . .. ", +" . .. . .. ", +" . ...... ..... ", +" . .. . .... ", +" . .. . .. ", +" .... ...... .. ", +" . .... .. ", +" . ... . .. ", +" . ... . .. ", +" . ... . .. ", +" ... ...... ", +" . ..... ", +" ", +" "}; diff --git a/include/bitmaps/obm_old_rgarrow b/include/bitmaps/obm_old_rgarrow new file mode 100644 index 00000000000..8dcc49ac9e7 --- /dev/null +++ b/include/bitmaps/obm_old_rgarrow @@ -0,0 +1,20 @@ +/* XPM */ +static char * obm_old_rgarrow[] = { +"15 15 2 1", +" s button_highlight c white", +". s button_text c black", +" ", +" ", +" ", +" . ", +" .. ", +" ... ", +" ........ ", +" ......... ", +" ........ ", +" ... ", +" .. ", +" . ", +" ", +" ", +" "}; diff --git a/include/bitmaps/obm_old_uparrow b/include/bitmaps/obm_old_uparrow new file mode 100644 index 00000000000..24513bbb9cf --- /dev/null +++ b/include/bitmaps/obm_old_uparrow @@ -0,0 +1,20 @@ +/* XPM */ +static char * obm_old_uparrow[] = { +"15 15 2 1", +" s button_highlight c white", +". s button_text c black", +" ", +" ", +" ", +" . ", +" ... ", +" ..... ", +" ....... ", +" ......... ", +" ... ", +" ... ", +" ... ", +" ... ", +" ", +" ", +" "}; diff --git a/include/bitmaps/obm_old_zoom b/include/bitmaps/obm_old_zoom new file mode 100644 index 00000000000..4127bc626fe --- /dev/null +++ b/include/bitmaps/obm_old_zoom @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_old_zoom[] = { +"25 19 2 1", +" c white", +". c black", +" ", +" ", +" . ", +" . .. ", +" . .. ", +" . .. ", +" . .. ", +" .... ..... ", +" . .... ", +" . .. ", +" . .. ", +" . .. ", +" . .. ", +" . .. ", +" . .. ", +" ...... ", +" ..... ", +" ", +" "}; diff --git a/include/bitmaps/obm_reduce b/include/bitmaps/obm_reduce new file mode 100644 index 00000000000..ff45ecb5722 --- /dev/null +++ b/include/bitmaps/obm_reduce @@ -0,0 +1,26 @@ +/* XPM */ +static char * obm_reduce[] = { +"19 18 5 1", +" s window_frame c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +"O s button_text c black", +" .................X", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .ooooOOOOOOOooooXX", +" .oooooOOOOOoooooXX", +" .ooooooOOOooooooXX", +" .oooooooOoooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .XXXXXXXXXXXXXXXXX", +" XXXXXXXXXXXXXXXXXX"}; diff --git a/include/bitmaps/obm_reduced b/include/bitmaps/obm_reduced new file mode 100644 index 00000000000..a6e3a957ac6 --- /dev/null +++ b/include/bitmaps/obm_reduced @@ -0,0 +1,25 @@ +/* XPM */ +static char * obm_reduced[] = { +"19 18 4 1", +" s window_frame c black", +". s button_shadow c grey50", +"X s button_face c grey75", +"o s button_text c black", +" ..................", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXoooooooXXXXX", +" .XXXXXXoooooXXXXXX", +" .XXXXXXXoooXXXXXXX", +" .XXXXXXXXoXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX"}; diff --git a/include/bitmaps/obm_restore b/include/bitmaps/obm_restore new file mode 100644 index 00000000000..43737033f93 --- /dev/null +++ b/include/bitmaps/obm_restore @@ -0,0 +1,26 @@ +/* XPM */ +static char * obm_restore[] = { +"19 18 5 1", +" s window_frame c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +"O s button_text c black", +" .................X", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooOoooooooXX", +" .ooooooOOOooooooXX", +" .oooooOOOOOoooooXX", +" .ooooOOOOOOOooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .ooooOOOOOOOooooXX", +" .oooooOOOOOoooooXX", +" .ooooooOOOooooooXX", +" .oooooooOoooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .XXXXXXXXXXXXXXXXX", +" XXXXXXXXXXXXXXXXXX"}; diff --git a/include/bitmaps/obm_restored b/include/bitmaps/obm_restored new file mode 100644 index 00000000000..156b39a8e8a --- /dev/null +++ b/include/bitmaps/obm_restored @@ -0,0 +1,25 @@ +/* XPM */ +static char * obm_restored[] = { +"19 18 4 1", +" s window_frame c black", +". s button_shadow c grey50", +"X s button_face c grey75", +"o s button_text c black", +" ..................", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXoXXXXXXXX", +" .XXXXXXXoooXXXXXXX", +" .XXXXXXoooooXXXXXX", +" .XXXXXoooooooXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXoooooooXXXXX", +" .XXXXXXoooooXXXXXX", +" .XXXXXXXoooXXXXXXX", +" .XXXXXXXXoXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX"}; diff --git a/include/bitmaps/obm_rgarrow b/include/bitmaps/obm_rgarrow new file mode 100644 index 00000000000..9ccf10ae8fd --- /dev/null +++ b/include/bitmaps/obm_rgarrow @@ -0,0 +1,25 @@ +/* XPM */ +static char * obm_rgarrow[] = { +"17 17 5 1", +" s window_frame c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +"O s button_text c black", +" ", +" ..............X ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooOoooooXX ", +" .ooooooOOooooXX ", +" .oooOOOOOOoooXX ", +" .oooOOOOOOOooXX ", +" .oooOOOOOOoooXX ", +" .ooooooOOooooXX ", +" .ooooooOoooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .XXXXXXXXXXXXXX ", +" XXXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_rgarrowd b/include/bitmaps/obm_rgarrowd new file mode 100644 index 00000000000..023426593d3 --- /dev/null +++ b/include/bitmaps/obm_rgarrowd @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_rgarrowd[] = { +"17 17 4 1", +" s window_frame c black", +". s button_shadow c grey50", +"X s button_face c grey75", +"o s button_text c black", +" ", +" ............... ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXoXXXXXX ", +" .XXXXXXXooXXXXX ", +" .XXXXooooooXXXX ", +" .XXXXoooooooXXX ", +" .XXXXooooooXXXX ", +" .XXXXXXXooXXXXX ", +" .XXXXXXXoXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_rgarrowi b/include/bitmaps/obm_rgarrowi new file mode 100644 index 00000000000..b6cfb3939be --- /dev/null +++ b/include/bitmaps/obm_rgarrowi @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_rgarrowi[] = { +"17 17 4 1", +" s button_text c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +" ", +" ..............X ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooXoooooXX ", +" .ooooooXXooooXX ", +" .oooXXXXXXoooXX ", +" .oooXXXXXXXooXX ", +" .oooXXXXXX..oXX ", +" .oooo..XX..ooXX ", +" .ooooooX..oooXX ", +" .ooooooo.ooooXX ", +" .ooooooooooooXX ", +" .XXXXXXXXXXXXXX ", +" XXXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_size b/include/bitmaps/obm_size new file mode 100644 index 00000000000..7760ae5b697 --- /dev/null +++ b/include/bitmaps/obm_size @@ -0,0 +1,18 @@ +/* XPM */ +static char * obm_size[] = { +"13 13 2 1", +" c white", +". c black", +" ", +" ", +" ", +" ", +" ", +" ", +"........ ", +"........ ", +" ... ", +" ... ", +" ... ", +" ... ", +" ... "}; diff --git a/include/bitmaps/obm_uparrow b/include/bitmaps/obm_uparrow new file mode 100644 index 00000000000..532d54d8791 --- /dev/null +++ b/include/bitmaps/obm_uparrow @@ -0,0 +1,25 @@ +/* XPM */ +static char * obm_uparrow[] = { +"17 17 5 1", +" s window_frame c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +"O s button_text c black", +" ", +" ..............X ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooOoooooXX ", +" .oooooOOOooooXX ", +" .ooooOOOOOoooXX ", +" .oooOOOOOOOooXX ", +" .oooooOOOooooXX ", +" .oooooOOOooooXX ", +" .oooooOOOooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .XXXXXXXXXXXXXX ", +" XXXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_uparrowd b/include/bitmaps/obm_uparrowd new file mode 100644 index 00000000000..a4c3688980e --- /dev/null +++ b/include/bitmaps/obm_uparrowd @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_uparrowd[] = { +"17 17 4 1", +" s window_frame c black", +". s button_shadow c grey50", +"X s button_face c grey75", +"o s button_text c black", +" ", +" ............... ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXoXXXXXX ", +" .XXXXXXoooXXXXX ", +" .XXXXXoooooXXXX ", +" .XXXXoooooooXXX ", +" .XXXXXXoooXXXXX ", +" .XXXXXXoooXXXXX ", +" .XXXXXXoooXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" .XXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_uparrowi b/include/bitmaps/obm_uparrowi new file mode 100644 index 00000000000..d186beffb67 --- /dev/null +++ b/include/bitmaps/obm_uparrowi @@ -0,0 +1,24 @@ +/* XPM */ +static char * obm_uparrowi[] = { +"17 17 4 1", +" s button_text c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +" ", +" ..............X ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooooooooXX ", +" .ooooooXoooooXX ", +" .oooooXXXooooXX ", +" .ooooXXXXXoooXX ", +" .oooXXXXXXXooXX ", +" .ooo..XXXo..oXX ", +" .oooooXXX.oooXX ", +" .oooooXXX.oooXX ", +" .oooooo...oooXX ", +" .ooooooooooooXX ", +" .XXXXXXXXXXXXXX ", +" XXXXXXXXXXXXXXX ", +" "}; diff --git a/include/bitmaps/obm_zoom b/include/bitmaps/obm_zoom new file mode 100644 index 00000000000..71bf6fde196 --- /dev/null +++ b/include/bitmaps/obm_zoom @@ -0,0 +1,26 @@ +/* XPM */ +static char * obm_zoom[] = { +"19 18 5 1", +" s window_frame c black", +". s button_highlight c white", +"X s button_shadow c grey50", +"o s button_face c grey75", +"O s button_text c black", +" .................X", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooOoooooooXX", +" .ooooooOOOooooooXX", +" .oooooOOOOOoooooXX", +" .ooooOOOOOOOooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .oooooooooooooooXX", +" .XXXXXXXXXXXXXXXXX", +" XXXXXXXXXXXXXXXXXX"}; diff --git a/include/bitmaps/obm_zoomd b/include/bitmaps/obm_zoomd new file mode 100644 index 00000000000..1e12ea167f3 --- /dev/null +++ b/include/bitmaps/obm_zoomd @@ -0,0 +1,25 @@ +/* XPM */ +static char * obm_zoomd[] = { +"19 18 4 1", +" s window_frame c black", +". s button_shadow c grey50", +"X s button_face c grey75", +"o s button_text c black", +" ..................", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXoXXXXXXXX", +" .XXXXXXXoooXXXXXXX", +" .XXXXXXoooooXXXXXX", +" .XXXXXoooooooXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX", +" .XXXXXXXXXXXXXXXXX"}; diff --git a/include/class.h b/include/class.h index 3812122f267..07531bdd524 100644 --- a/include/class.h +++ b/include/class.h @@ -11,6 +11,8 @@ #define CLASS_MAGIC 0x4b4e /* 'NK' */ +#pragma pack(1) + /* !! Don't change this structure (see GetClassLong()) */ typedef struct tagCLASS { @@ -23,8 +25,10 @@ typedef struct tagCLASS WORD wExtra[1]; /* Class extra bytes */ } CLASS; +#pragma pack(4) -HCLASS CLASS_FindClassByName( char * name, CLASS **ptr ); + +HCLASS CLASS_FindClassByName( char * name, WORD hinstance, CLASS **ptr ); CLASS * CLASS_FindClassPtr( HCLASS hclass ); diff --git a/include/dialog.h b/include/dialog.h index 3cc5452abc2..1c9cf342840 100644 --- a/include/dialog.h +++ b/include/dialog.h @@ -9,6 +9,7 @@ #include "windows.h" +#pragma pack(1) /* Dialog info structure. * This structure is stored into the window extra bytes (cbWndExtra). @@ -64,5 +65,6 @@ typedef struct LPSTR faceName; } DLGTEMPLATE; +#pragma pack(4) #endif /* DIALOG_H */ diff --git a/include/gdi.h b/include/gdi.h index bc553df5cc6..b6890357246 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -27,6 +27,7 @@ #define METAFILE_MAGIC 0x4f50 #define METAFILE_DC_MAGIC 0x4f51 +#pragma pack(1) typedef struct tagREGION { @@ -82,6 +83,8 @@ typedef struct tagRGNOBJ REGION region; } RGNOBJ; +#pragma pack(4) + typedef struct { WORD version; /* 0: driver version */ diff --git a/include/prototypes.h b/include/prototypes.h index 536d41180b9..2b94d25d2ee 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -142,35 +142,10 @@ extern void sync_profiles(void); extern void SpyInit(void); -/* controls/button.c */ - -extern LONG ButtonWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam); - -/* controls/combo.c */ - -extern LONG ComboBoxWndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam); - /* controls/desktop.c */ -extern LONG DesktopWndProc (HWND hwnd, WORD message, WORD wParam, LONG lParam); extern BOOL DESKTOP_SetPattern(char *pattern); -/* controls/listbox.c */ - -extern LONG ListBoxWndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam); - -/* controls/menu.c */ - -extern LONG PopupMenuWndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam); - -/* controls/scrollbar.c */ - -extern LONG ScrollBarWndProc(HWND hWnd, WORD message, WORD wParam, LONG lParam); - -/* controls/static.c */ - -extern LONG StaticWndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam); - /* controls/widget.c */ extern BOOL WIDGETS_Init(void); diff --git a/include/registers.h b/include/registers.h index 0284abf816e..26a7774d194 100644 --- a/include/registers.h +++ b/include/registers.h @@ -2,7 +2,6 @@ #define __WINE_REGISTERS_H #include -#include "autoconf.h" #ifndef PROCEMU @@ -33,7 +32,11 @@ #define DI context->sc_edi #define SI context->sc_esi #define SP context->sc_esp +#ifndef __FreeBSD__ +#define EFL context->sc_eflags +#else #define EFL context->sc_efl +#endif #define EIP context->sc_eip #define SetCflag (EFL |= 0x00000001) diff --git a/include/resource.h b/include/resource.h index 36b2b26eb2f..e889999faa3 100644 --- a/include/resource.h +++ b/include/resource.h @@ -20,4 +20,10 @@ typedef struct resource_s { struct w_files *wpnt; } RESOURCE; +struct ResourceTable{ + int id,type; + char *name; + unsigned char* value; + unsigned size; +}; #endif /* __WINE_RESOURCE_H */ diff --git a/include/segmem.h b/include/segmem.h index 047fea05245..4aa3f86739e 100644 --- a/include/segmem.h +++ b/include/segmem.h @@ -33,12 +33,12 @@ extern unsigned short SelectorMap[MAX_SELECTORS]; #ifdef HAVE_IPC -#define SAFEMAKEPTR(s, o) (((int) (s) << 16) | ((o) & 0xffff)) +#define SAFEMAKEPTR(s, o) ((void *)(((int) (s) << 16) | ((o) & 0xffff))) #define FIXPTR(p) (p) #else #define SAFEMAKEPTR(s, o) \ - (((int) SelectorMap[SelectorMap[(s) >> 3] & SELECTOR_INDEXMASK] << 19) \ - | 0x70000 | ((o) & 0xffff)) + ((void *)(((int)SelectorMap[SelectorMap[(s) >> 3] & SELECTOR_INDEXMASK] \ + << 19) | 0x70000 | ((o) & 0xffff))) #define FIXPTR(p) SAFEMAKEPTR((unsigned long) (p) >> 16, (p)) #endif @@ -77,6 +77,9 @@ extern int IPCCopySelector(int i_old, unsigned long new, int swap_type); #define FIRST_SELECTOR 8 +#define IS_16_BIT_ADDRESS(addr) \ + ((unsigned int)(addr) >= (((FIRST_SELECTOR << 3) | 0x0007) << 16)) + extern SEGDESC Segments[]; #endif /* SEGMEM_H */ diff --git a/include/windows.h b/include/windows.h index 96d80eaf170..9691868a9fa 100644 --- a/include/windows.h +++ b/include/windows.h @@ -122,6 +122,8 @@ typedef PAINTSTRUCT *LPPAINTSTRUCT; #define WINE_PACKED __attribute__ ((packed)) #endif +#pragma pack(1) + /* Window classes */ typedef LONG (*WNDPROC)(HWND, UINT, WPARAM, LPARAM); @@ -2341,6 +2343,8 @@ typedef METAFILEPICT *LPMETAFILEPICT; #define META_CREATEBITMAP 0x06FE #define META_CREATEREGION 0x06FF +#pragma pack(4) + #define F(ret,name) ret name(void); #define Fa(ret,name,t1,a1) ret name(t1 a1); diff --git a/include/wine.h b/include/wine.h index 51603863727..cc2ef88ff54 100644 --- a/include/wine.h +++ b/include/wine.h @@ -25,7 +25,7 @@ struct sigcontext_struct { unsigned long sc_err; unsigned long sc_eip; unsigned short sc_cs, __csh; - unsigned long sc_efl; + unsigned long sc_eflags; unsigned long esp_at_signal; unsigned short sc_ss, __ssh; unsigned long i387; diff --git a/loader/ldt.c b/loader/ldt.c index ebcd5749149..0fd4c0082aa 100644 --- a/loader/ldt.c +++ b/loader/ldt.c @@ -81,7 +81,7 @@ print_ldt() { printf("Entry %2d: Base %08lx, Limit %05lx, DPL %d, Type %d\n", i, base_addr, limit, dpl, type); - printf(" SYSTEM: %08x %08x\n", *lp, *(lp-1)); + printf(" SYSTEM: %08lx %08lx\n", *lp, *(lp-1)); } } } diff --git a/loader/ldtlib.c b/loader/ldtlib.c index 6e4c30baa25..45465605aaa 100644 --- a/loader/ldtlib.c +++ b/loader/ldtlib.c @@ -5,7 +5,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; #include #include #include -#include "autoconf.h" #include "stddebug.h" /* #define DEBUG_LDT */ /* #undef DEBUG_LDT */ diff --git a/loader/library.c b/loader/library.c index 1f9291d7249..3b13860e5b5 100644 --- a/loader/library.c +++ b/loader/library.c @@ -96,7 +96,7 @@ void InitializeLoadedDLLs(struct w_files *wpnt) static flagReadyToRun = 0; struct w_files *final_wpnt; - dprintf_module(stddeb,"InitializeLoadedDLLs(%08lX)\n", wpnt); + dprintf_module(stddeb,"InitializeLoadedDLLs(%p)\n", wpnt); if (wpnt == NULL) { @@ -221,28 +221,39 @@ HINSTANCE LoadImage(char *module, int filetype, int change_dir) read(wpnt->fd, &header, sizeof(header)); handle = 0; + + /* + * Stick this file into the list of loaded files so we don't try to reload + * it again if another module references this module. Do this before + * calling loadNEImage because we might get back here before loadNEImage + * returns. + */ + if(wine_files == NULL) + wine_files = wpnt; + else { + wpnt1 = wine_files; + while(wpnt1->next) + wpnt1 = wpnt1->next; + wpnt1->next = wpnt; + } + wpnt->next = NULL; + if (header[0] == 'N' && header[1] == 'E') handle = LoadNEImage(wpnt); if (header[0] == 'P' && header[1] == 'E') - handle = LoadPEImage(wpnt); + handle = LoadPEImage(wpnt); wpnt->hinstance = handle; if (handle > 32) { - /* ok, loaded, add to the end of the list */ - if(wine_files == NULL) - wine_files = wpnt; - else { - wpnt1 = wine_files; - while(wpnt1->next) - wpnt1 = wpnt1->next; - wpnt1->next = wpnt; - } - wpnt->next = NULL; - return handle; } else { fprintf(stderr, "wine: (%s) unknown fileformat !\n", wpnt->filename); + /* Remove this module from the list of loaded modules */ + if (wine_files == wpnt) + wine_files = NULL; + else + wpnt1->next = NULL; close(wpnt->fd); free(wpnt->filename); free(wpnt->name); diff --git a/loader/ne_image.c b/loader/ne_image.c index 5584fec1295..4e2e45b8882 100644 --- a/loader/ne_image.c +++ b/loader/ne_image.c @@ -33,6 +33,7 @@ extern HANDLE CreateNewTask(HINSTANCE hInst); extern void InitializeLoadedDLLs(struct w_files *wpnt); extern int CallToInit16(unsigned long csip, unsigned long sssp, unsigned short ds); +extern int CallTo16cx(unsigned long csip, unsigned long dscx); extern void CallTo32(); extern char WindowsPath[256]; extern unsigned short WIN_StackSize; @@ -472,7 +473,7 @@ int StartNEprogram(struct w_files *wpnt) void InitNEDLL(struct w_files *wpnt) { - int cs_reg, ds_reg, ip_reg, rv; + int cs_reg, ds_reg, ip_reg, cx_reg, rv; /* * Is this a library? */ @@ -490,11 +491,13 @@ void InitNEDLL(struct w_files *wpnt) cs_reg = wpnt->ne->selector_table[wpnt->ne->ne_header->cs-1].selector; ip_reg = wpnt->ne->ne_header->ip; + cx_reg = wpnt->ne->ne_header->local_heap_length; + if (cs_reg) { - dprintf_dll(stddeb,"Initializing %s, cs:ip %04x:%04x, ds %04x\n", - wpnt->name, cs_reg, ip_reg, ds_reg); + dprintf_dll(stddeb,"Initializing %s, cs:ip %04x:%04x, ds %04x, cx %04x\n", + wpnt->name, cs_reg, ip_reg, ds_reg, cx_reg); - rv = CallTo16(cs_reg << 16 | ip_reg, ds_reg); + rv = CallTo16cx(cs_reg << 16 | ip_reg, ds_reg | (cx_reg<<16)); dprintf_exec(stddeb,"rv = %x\n", rv); } else dprintf_exec(stddeb,"%s skipped\n", wpnt->name); diff --git a/loader/resource.c b/loader/resource.c index f1ed5cbc690..7a841ae5654 100644 --- a/loader/resource.c +++ b/loader/resource.c @@ -24,6 +24,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993"; /* #define DEBUG_ACCEL */ /* #undef DEBUG_ACCEL */ #include "debug.h" +#include "../rc/sysresbm.h" #define MIN(a,b) ((a) < (b) ? (a) : (b)) @@ -32,7 +33,7 @@ extern HINSTANCE hSysRes; extern int NE_FindResource(HANDLE, LPSTR, LPSTR, RESOURCE *); extern int PE_FindResource(HANDLE, LPSTR, LPSTR, RESOURCE *); -extern HBITMAP BITMAP_LoadOEMBitmap( WORD id ); /* objects/bitmap.c */ +extern HBITMAP OBM_LoadOEMBitmap( WORD id ); /* objects/oembitmap.c */ #define PrintId(name) \ if (HIWORD((DWORD)name)) \ @@ -731,10 +732,23 @@ LoadBitmap(HANDLE instance, LPSTR bmp_name) #endif if (!instance) { - hbitmap = BITMAP_LoadOEMBitmap(((int) bmp_name) & 0xffff); + struct ResourceTable *it; + hbitmap = OBM_LoadOEMBitmap(((int) bmp_name) & 0xffff); if (hbitmap) return hbitmap; - } + /* Load from sysresbm */ + dprintf_resource(stddeb,"Searching for %d\n",bmp_name); + for(it=sysresbmTable;it;it++){ + if(it->type==NE_RSCTYPE_BITMAP) + if((((int)bmp_name & 0xFFFF0000) == 0)) + {if(it->id==(int)bmp_name)break;} + else if(!strcmp(it->name,bmp_name))break; + } + if(!it)return 0; + dprintf_resource(stddeb,"Found %s\n",it->name); + lp=it->value; + rsc_mem=(HANDLE)NULL; + } else { /* Load from file - indent this code properly later */ rsc_mem = RSC_LoadResource(instance, bmp_name, (LPSTR) NE_RSCTYPE_BITMAP, &image_size); @@ -745,12 +759,13 @@ LoadBitmap(HANDLE instance, LPSTR bmp_name) return 0; } lp = (long *) GlobalLinearLock(rsc_mem); - if (!(hdc = GetDC(0))) lp = NULL; if (lp == NULL) { GlobalFree(rsc_mem); return 0; } + } /* Load from file */ + if (!(hdc = GetDC(0))) lp = NULL; size = CONV_LONG (*lp); if (size == sizeof(BITMAPCOREHEADER)){ CONV_BITMAPCOREHEADER (lp); diff --git a/loader/selector.c b/loader/selector.c index eb17a27734c..adb9e69628f 100644 --- a/loader/selector.c +++ b/loader/selector.c @@ -770,7 +770,7 @@ CreateEnvironment(void) /* * Display environment */ - dprintf_selectors(stddeb, "Environment at %08.8x\n", s->base_addr); + dprintf_selectors(stddeb, "Environment at %p\n", s->base_addr); for (p = s->base_addr; *p; p += strlen(p) + 1) dprintf_selectors(stddeb, " %s\n", p); diff --git a/loader/signal.c b/loader/signal.c index aa5f467a6b5..6527f1ecc0b 100644 --- a/loader/signal.c +++ b/loader/signal.c @@ -34,7 +34,7 @@ extern int do_int2a(struct sigcontext_struct *); extern int do_int2f(struct sigcontext_struct *); extern int do_int31(struct sigcontext_struct *); -#if !defined(BSD4_4) || defined(linux) +#if !defined(BSD4_4) || defined(linux) || defined(__FreeBSD__) char * cstack[4096]; #endif struct sigaction segv_act; @@ -200,7 +200,7 @@ static void win_fault(int signal, int code, struct sigcontext *scp) XUngrabServer(display); XFlush(display); fprintf(stderr,"In win_fault %x:%lx\n", scp->sc_cs, scp->sc_eip); -#if defined(linux) || defined(__NetBSD__) +#if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__) wine_debug(signal, scp); /* Enter our debugger */ #else fprintf(stderr,"Stack: %x:%x\n", scp->sc_ss, scp->sc_esp); @@ -233,7 +233,7 @@ int init_wine_signals(void) #endif #if defined(__NetBSD__) || defined(__FreeBSD__) sigset_t sig_mask; -#ifdef BSD4_4 +#if defined(BSD4_4) && !defined (__FreeBSD__) struct sigaltstack ss; if ((ss.ss_base = malloc(MINSIGSTKSZ)) == NULL) { @@ -308,7 +308,11 @@ test_memory( char *p, int write ) *p = c; ret = TRUE; } +#ifdef linux wine_sigaction(SIGSEGV, &old_act, NULL); +#else + sigaction(SIGSEGV, &old_act, NULL); +#endif return ret; } diff --git a/loader/task.c b/loader/task.c index 693612fbe57..4f999214f2f 100644 --- a/loader/task.c +++ b/loader/task.c @@ -137,7 +137,7 @@ HANDLE CreateNewTask(HINSTANCE hInst, HTASK hTaskParent) } hTask = GlobalAlloc(GMEM_MOVEABLE, sizeof(WINETASKENTRY)); lpNewTask = (LPWINETASKENTRY) GlobalLock(hTask); - dprintf_task(stddeb,"CreateNewTask entry allocated %08X\n", lpNewTask); + dprintf_task(stddeb,"CreateNewTask entry allocated %p\n", lpNewTask); if (lpNewTask == NULL) return 0; if (lpTaskList == NULL) { lpTaskList = lpNewTask; diff --git a/memory/heap.c b/memory/heap.c index fa2956bb6b5..722e32da9a0 100644 --- a/memory/heap.c +++ b/memory/heap.c @@ -479,6 +479,21 @@ WIN16_LocalInit(unsigned int segment, unsigned int start, unsigned int end) segment = Stack16Frame[6]; } + dprintf_heap(stddeb, "WIN16_LocalInit segment=%04x start=%04x end=%04x\n", segment, start, end); + + /* start=0 doesn't mean the first byte of the segment if the segment + is an auto data segment. Instead it should start after the actual + data (and the stack if there is one). As we don't know the length + of the data and stack right now, we simply put the local heap at the + end of the segment */ + if ((start==0)&&(Segments[segment>>3].owner==segment)) + { + return; + start = Segments[segment>>3].length-end-2; + end = Segments[segment>>3].length-1; + dprintf_heap(stddeb, "Changed to start=%04x end=%04x\n",start,end); + } + if (lh == NULL) { HEAP_LocalInit(owner, diff --git a/misc/atom.c b/misc/atom.c index f8f7d0758d3..2822350e5e6 100644 --- a/misc/atom.c +++ b/misc/atom.c @@ -321,7 +321,8 @@ ATOM DeleteAtom( ATOM atom ) */ ATOM FindAtom( LPCSTR str ) { - if (!*LOCALATOMTABLE()) InitAtomTable( DEFAULT_ATOMTABLE_SIZE ); + if (!*LOCALATOMTABLE()) return 0; + /* if (!*LOCALATOMTABLE()) InitAtomTable( DEFAULT_ATOMTABLE_SIZE );*/ return ATOM_FindAtom( *LOCALATOMTABLE(), str ); } diff --git a/misc/clipboard.c b/misc/clipboard.c index 391031457ce..bef9f01b1a9 100644 --- a/misc/clipboard.c +++ b/misc/clipboard.c @@ -312,7 +312,7 @@ BOOL IsClipboardFormatAvailable(WORD wFormat) { LPCLIPFORMAT lpFormat = ClipFormats; dprintf_clipboard(stddeb,"IsClipboardFormatAvailable(%04X) !\n", wFormat); - if(wFormat == CF_TEXT) /* obtain selection as text if possible */ + if(wFormat == CF_TEXT && !wineOwnsSelection) /* obtain selection as text if possible */ return GetClipboardData(CF_TEXT)!=0; while(TRUE) { if (lpFormat == NULL) return FALSE; diff --git a/misc/dos_fs.c b/misc/dos_fs.c index f6ba92f4bbf..2b5efb31461 100644 --- a/misc/dos_fs.c +++ b/misc/dos_fs.c @@ -21,7 +21,7 @@ #include #endif #if defined(__NetBSD__) || defined(__FreeBSD__) -#include +#include #include #endif @@ -93,7 +93,7 @@ void ChopOffSlash(char *path) void DOS_InitFS(void) { int x; - char drive[2], temp[256], *ptr; + char drive[2], temp[256]; GetPrivateProfileString("wine", "windows", "c:\\windows", WindowsDirectory, sizeof(WindowsDirectory), WINE_INI); @@ -250,12 +250,14 @@ int DOS_ValidDirectory(char *name) { char *dirname; struct stat s; + dprintf_dosfs(stddeb, "DOS_ValidDirectory: '%s'\n", name); if ((dirname = GetUnixFileName(name)) == NULL) return 0; if (stat(dirname,&s)) return 0; if (!S_ISDIR(s.st_mode)) return 0; + dprintf_dosfs(stddeb, "==> OK\n"); return 1; } @@ -543,8 +545,8 @@ int DOS_GetFreeSpace(int drive, long *size, long *available) return 0; } - *size = info.f_bsize * info.f_blocks / 1024; - *available = info.f_bavail * info.f_bsize / 1024; + *size = info.f_bsize * info.f_blocks; + *available = info.f_bavail * info.f_bsize; return 1; } diff --git a/misc/message.c b/misc/message.c index 50637369077..976c86b87fa 100644 --- a/misc/message.c +++ b/misc/message.c @@ -303,10 +303,10 @@ LONG SystemMessageBoxProc(HWND hWnd, WORD message, WORD wParam, LONG lParam) DrawIcon(hDC, lpmb->rectIcon.left, lpmb->rectIcon.top, lpmb->hIcon); DrawText(hDC, lpmb->Str, -1, &rect, - DT_CALCRECT | DT_CENTER | DT_WORDBREAK); + DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_WORDBREAK); rect.top = lpmb->rectStr.bottom / 2 - rect.bottom / 2; rect.bottom = lpmb->rectStr.bottom / 2 + rect.bottom / 2; - DrawText(hDC, lpmb->Str, -1, &rect, DT_CENTER | DT_WORDBREAK); + DrawText(hDC, lpmb->Str, -1, &rect, DT_LEFT | DT_VCENTER | DT_WORDBREAK); SetTextColor(hDC, OldTextColor); EndPaint(hWnd, &ps); dprintf_msgbox(stddeb, "MessageBox End of WM_PAINT !\n"); diff --git a/objects/Imakefile b/objects/Imakefile index 81e345a34f6..d4d24f72da3 100644 --- a/objects/Imakefile +++ b/objects/Imakefile @@ -16,6 +16,7 @@ SRCS = \ gdiobj.c \ linedda.c \ metafile.c \ + oembitmap.c \ palette.c \ pen.c \ region.c \ diff --git a/objects/bitblt.c b/objects/bitblt.c index 0aa4e9a12d5..05f17df7362 100644 --- a/objects/bitblt.c +++ b/objects/bitblt.c @@ -380,9 +380,9 @@ static __inline__ int muldiv64( int m1, int m2, int d ) __asm__( "imull %%edx\n\t" "idivl %3\n\t" - : "=a" (result) /* out */ - : "a" (m1), "d" (m2), "g" (d) /* in */ - : "ax", "dx" /* mod */ + : "=&a" (result) /* out */ + : "0" (m1), "d" (m2), "g" (d) /* in */ + : "%edx" /* mod */ ); return result; #else diff --git a/objects/bitmap.c b/objects/bitmap.c index 2b540e6618b..b4054fc5ec8 100644 --- a/objects/bitmap.c +++ b/objects/bitmap.c @@ -19,11 +19,6 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993"; /* #define DEBUG_BITMAP /* */ #include "debug.h" - /* Include OEM bitmaps */ -#include "bitmaps/check_boxes" -#include "bitmaps/check_mark" -#include "bitmaps/menu_arrow" - /* GCs used for B&W and color bitmap operations */ GC BITMAP_monoGC = 0, BITMAP_colorGC = 0; @@ -81,65 +76,6 @@ static XImage *BITMAP_BmpToImage( BITMAP * bmp, void * bmpData ) } -/*********************************************************************** - * BITMAP_LoadOEMBitmap - */ -HBITMAP BITMAP_LoadOEMBitmap( WORD id ) -{ - BITMAPOBJ * bmpObjPtr; - HBITMAP hbitmap; - WORD width, height; - char *data; - - switch(id) - { - case OBM_MNARROW: - width = menu_arrow_width; - height = menu_arrow_height; - data = menu_arrow_bits; - break; - - case OBM_CHECKBOXES: - width = check_boxes_width; - height = check_boxes_height; - data = check_boxes_bits; - break; - - case OBM_CHECK: - width = check_mark_width; - height = check_mark_height; - data = check_mark_bits; - break; - - default: - return 0; - } - - /* Create the BITMAPOBJ */ - if (!(hbitmap = GDI_AllocObject( sizeof(BITMAPOBJ), BITMAP_MAGIC ))) - return 0; - bmpObjPtr = (BITMAPOBJ *) GDI_HEAP_ADDR( hbitmap ); - bmpObjPtr->size.cx = 0; - bmpObjPtr->size.cy = 0; - bmpObjPtr->bitmap.bmType = 0; - bmpObjPtr->bitmap.bmWidth = width; - bmpObjPtr->bitmap.bmHeight = height; - bmpObjPtr->bitmap.bmWidthBytes = (width + 15) / 16 * 2; - bmpObjPtr->bitmap.bmPlanes = 1; - bmpObjPtr->bitmap.bmBitsPixel = 1; - bmpObjPtr->bitmap.bmBits = NULL; - - /* Create the pixmap */ - if (!(bmpObjPtr->pixmap = XCreateBitmapFromData( display, rootWindow, - data, width, height ))) - { - GDI_HEAP_FREE( hbitmap ); - return 0; - } - return hbitmap; -} - - /*********************************************************************** * CreateBitmap (GDI.48) */ diff --git a/objects/brush.c b/objects/brush.c index 6555d6c2f51..cc3797a30a4 100644 --- a/objects/brush.c +++ b/objects/brush.c @@ -50,7 +50,7 @@ HBRUSH CreateBrushIndirect( LOGBRUSH * brush ) HBRUSH CreateHatchBrush( short style, COLORREF color ) { LOGBRUSH logbrush = { BS_HATCHED, color, style }; - dprintf_gdi(stddeb, "CreateHatchBrush: %d %06x\n", style, color ); + dprintf_gdi(stddeb, "CreateHatchBrush: %d %06lx\n", style, color ); if ((style < 0) || (style >= NB_HATCH_STYLES)) return 0; return CreateBrushIndirect( &logbrush ); } @@ -119,7 +119,7 @@ HBRUSH CreateDIBPatternBrush( HANDLE hbitmap, WORD coloruse ) HBRUSH CreateSolidBrush( COLORREF color ) { LOGBRUSH logbrush = { BS_SOLID, color, 0 }; - dprintf_gdi(stddeb, "CreateSolidBrush: %06x\n", color ); + dprintf_gdi(stddeb, "CreateSolidBrush: %06lx\n", color ); return CreateBrushIndirect( &logbrush ); } diff --git a/objects/font.c b/objects/font.c index 111984d3246..2e6480bec2a 100644 --- a/objects/font.c +++ b/objects/font.c @@ -65,9 +65,9 @@ void Font_Init( void ) int i; if( GetPrivateProfileString("fonts", NULL, "*", temp, sizeof(temp), WINE_INI) > 2 ) { - for( ptr = temp, i = 1; strlen(ptr) != 0; ptr += strlen(ptr) + 1, i++ ) + for( ptr = temp, i = 1; strlen(ptr) != 0; ptr += strlen(ptr) + 1 ) if( strcmp( ptr, "default" ) ) - FontNames[i].window = strdup( ptr ); + FontNames[i++].window = strdup( ptr ); FontSize = i; for( i = 1; i < FontSize; i++ ) { @@ -75,8 +75,7 @@ void Font_Init( void ) FontNames[i].x11 = strdup( temp ); } GetPrivateProfileString("fonts", "default", "*", temp, sizeof(temp), WINE_INI); - if( *temp == '*' ) - FontNames[0].x11 = strdup( temp ); + FontNames[0].x11 = strdup( temp ); } else { FontNames[0].window = NULL; FontNames[0].x11 = "bitstream-courier"; @@ -114,7 +113,7 @@ static const char *FONT_TranslateName( char *winFaceName ) * * Find a X font matching the logical font. */ -static XFontStruct * FONT_MatchFont( LOGFONT * font ) +static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc ) { char pattern[100]; const char *family, *weight, *charset; @@ -125,8 +124,17 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font ) weight = (font->lfWeight > 550) ? "bold" : "medium"; slant = font->lfItalic ? 'i' : 'r'; - height = abs(font->lfHeight * 10); - width = font->lfWidth * 10; + height = font->lfHeight * dc->w.VportExtX / dc->w.WndExtX; + if (height == 0) height = 120; /* Default height = 12 */ + else if (height < 0) + { + /* If height is negative, it means the height of the characters */ + /* *without* the internal leading. So we adjust it a bit to */ + /* compensate. 5/4 seems to give good results for small fonts. */ + height = 10 * (-height * 5 / 4); + } + else height *= 10; + width = 10 * (font->lfWidth * dc->w.VportExtY / dc->w.WndExtY); spacing = (font->lfPitchAndFamily & FIXED_PITCH) ? 'm' : (font->lfPitchAndFamily & VARIABLE_PITCH) ? 'p' : '*'; charset = (font->lfCharSet == ANSI_CHARSET) ? "iso8859-1" : "*-*"; @@ -304,7 +312,7 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font ) if (!stockPtr || !stockPtr->fstruct) { - fontStruct = FONT_MatchFont( &font->logfont ); + fontStruct = FONT_MatchFont( &font->logfont, dc ); } else { @@ -521,6 +529,27 @@ BOOL GetCharWidth(HDC hdc, WORD wFirstChar, WORD wLastChar, LPINT lpBuffer) return TRUE; } + +/*********************************************************************** + * AddFontResource (GDI.119) + */ +int AddFontResource( LPSTR str ) +{ + fprintf( stdnimp, "STUB: AddFontResource('%s')\n", str ); + return 1; +} + + +/*********************************************************************** + * RemoveFontResource (GDI.136) + */ +BOOL RemoveFontResource( LPSTR str ) +{ + fprintf( stdnimp, "STUB: RemoveFontResource('%s')\n", str ); + return TRUE; +} + + /************************************************************************* * ParseFontParms [internal] */ diff --git a/objects/oembitmap.c b/objects/oembitmap.c new file mode 100644 index 00000000000..f33d60b3bd2 --- /dev/null +++ b/objects/oembitmap.c @@ -0,0 +1,238 @@ +/* + * GDI OEM bitmap objects + * + * Copyright 1994 Alexandre Julliard + */ + +static char Copyright[] = "Copyright Alexandre Julliard, 1994"; + +#include +#include +#ifdef USE_XPM +#include +#endif +#include "gdi.h" +#include "bitmap.h" +#include "stddebug.h" +/* #define DEBUG_BITMAP */ +#include "debug.h" + +#define OBM_FIRST OBM_LFARROWI /* First OEM bitmap */ +#define OBM_LAST OBM_OLD_CLOSE /* Last OEM bitmap */ + +#ifdef USE_XPM + + /* Known symbolic names for colors. Use these whenever possible. */ +struct sys_colors_symbols +{ + char *symbol; + WORD syscolor; +}; + +static const struct sys_colors_symbols OBM_Color_Symbols[] = +{ + { "button_face", COLOR_BTNFACE }, + { "button_shadow", COLOR_BTNSHADOW }, + { "button_highlight", COLOR_BTNHIGHLIGHT } +}; + + /* Include OEM pixmaps */ +#include "bitmaps/obm_lfarrowi" +#include "bitmaps/obm_rgarrowi" +#include "bitmaps/obm_dnarrowi" +#include "bitmaps/obm_uparrowi" +#include "bitmaps/obm_combo" +#include "bitmaps/obm_mnarrow" +#include "bitmaps/obm_lfarrowd" +#include "bitmaps/obm_rgarrowd" +#include "bitmaps/obm_dnarrowd" +#include "bitmaps/obm_uparrowd" +#include "bitmaps/obm_restored" +#include "bitmaps/obm_zoomd" +#include "bitmaps/obm_reduced" +#include "bitmaps/obm_restore" +#include "bitmaps/obm_zoom" +#include "bitmaps/obm_reduce" +#include "bitmaps/obm_lfarrow" +#include "bitmaps/obm_rgarrow" +#include "bitmaps/obm_dnarrow" +#include "bitmaps/obm_uparrow" +#include "bitmaps/obm_close" +#include "bitmaps/obm_old_restore" +#include "bitmaps/obm_old_zoom" +#include "bitmaps/obm_old_reduce" +#include "bitmaps/obm_btncorners" +#include "bitmaps/obm_checkboxes" +#include "bitmaps/obm_check" +#include "bitmaps/obm_btsize" +#include "bitmaps/obm_old_lfarrow" +#include "bitmaps/obm_old_rgarrow" +#include "bitmaps/obm_old_dnarrow" +#include "bitmaps/obm_old_uparrow" +#include "bitmaps/obm_size" +#include "bitmaps/obm_old_close" + +static const struct +{ + char** data; /* Pointer to bitmap data */ + BOOL color; /* Is it a color bitmap? */ +} OBM_Pixmaps_Data[OBM_LAST-OBM_FIRST+1] = { + { obm_lfarrowi, TRUE }, /* OBM_LFARROWI */ + { obm_rgarrowi, TRUE }, /* OBM_RGARROWI */ + { obm_dnarrowi, TRUE }, /* OBM_DNARROWI */ + { obm_uparrowi, TRUE }, /* OBM_UPARROWI */ + { obm_combo, FALSE }, /* OBM_COMBO */ + { obm_mnarrow, FALSE }, /* OBM_MNARROW */ + { obm_lfarrowd, TRUE }, /* OBM_LFARROWD */ + { obm_rgarrowd, TRUE }, /* OBM_RGARROWD */ + { obm_dnarrowd, TRUE }, /* OBM_DNARROWD */ + { obm_uparrowd, TRUE }, /* OBM_UPARROWD */ + { obm_restored, TRUE }, /* OBM_RESTORED */ + { obm_zoomd, TRUE }, /* OBM_ZOOMD */ + { obm_reduced, TRUE }, /* OBM_REDUCED */ + { obm_restore, TRUE }, /* OBM_RESTORE */ + { obm_zoom, TRUE }, /* OBM_ZOOM */ + { obm_reduce, TRUE }, /* OBM_REDUCE */ + { obm_lfarrow, TRUE }, /* OBM_LFARROW */ + { obm_rgarrow, TRUE }, /* OBM_RGARROW */ + { obm_dnarrow, TRUE }, /* OBM_DNARROW */ + { obm_uparrow, TRUE }, /* OBM_UPARROW */ + { obm_close, TRUE }, /* OBM_CLOSE */ + { obm_old_restore, FALSE }, /* OBM_OLD_RESTORE */ + { obm_old_zoom, FALSE }, /* OBM_OLD_ZOOM */ + { obm_old_reduce, FALSE }, /* OBM_OLD_REDUCE */ + { obm_btncorners, FALSE }, /* OBM_BTNCORNERS */ + { obm_checkboxes, FALSE }, /* OBM_CHECKBOXES */ + { obm_check, FALSE }, /* OBM_CHECK */ + { obm_btsize, FALSE }, /* OBM_BTSIZE */ + { obm_old_lfarrow, FALSE }, /* OBM_OLD_LFARROW */ + { obm_old_rgarrow, FALSE }, /* OBM_OLD_RGARROW */ + { obm_old_dnarrow, FALSE }, /* OBM_OLD_DNARROW */ + { obm_old_uparrow, FALSE }, /* OBM_OLD_UPARROW */ + { obm_size, FALSE }, /* OBM_SIZE */ + { obm_old_close, FALSE }, /* OBM_OLD_CLOSE */ +}; + +#else /* USE_XPM */ + + /* Include OEM bitmaps */ +#include "bitmaps/check_boxes" +#include "bitmaps/check_mark" +#include "bitmaps/menu_arrow" + +static const struct +{ + WORD width, height; + char *data; +} OBM_Bitmaps_Data[OBM_LAST-OBM_FIRST+1] = +{ + { 0, 0, NULL }, /* OBM_LFARROWI */ + { 0, 0, NULL }, /* OBM_RGARROWI */ + { 0, 0, NULL }, /* OBM_DNARROWI */ + { 0, 0, NULL }, /* OBM_UPARROWI */ + { 0, 0, NULL }, /* OBM_COMBO */ + { menu_arrow_width, menu_arrow_height, menu_arrow_bits }, /* OBM_MNARROW */ + { 0, 0, NULL }, /* OBM_LFARROWD */ + { 0, 0, NULL }, /* OBM_RGARROWD */ + { 0, 0, NULL }, /* OBM_DNARROWD */ + { 0, 0, NULL }, /* OBM_UPARROWD */ + { 0, 0, NULL }, /* OBM_RESTORED */ + { 0, 0, NULL }, /* OBM_ZOOMD */ + { 0, 0, NULL }, /* OBM_REDUCED */ + { 0, 0, NULL }, /* OBM_RESTORE */ + { 0, 0, NULL }, /* OBM_ZOOM */ + { 0, 0, NULL }, /* OBM_REDUCE */ + { 0, 0, NULL }, /* OBM_LFARROW */ + { 0, 0, NULL }, /* OBM_RGARROW */ + { 0, 0, NULL }, /* OBM_DNARROW */ + { 0, 0, NULL }, /* OBM_UPARROW */ + { 0, 0, NULL }, /* OBM_CLOSE */ + { 0, 0, NULL }, /* OBM_OLD_RESTORE */ + { 0, 0, NULL }, /* OBM_OLD_ZOOM */ + { 0, 0, NULL }, /* OBM_OLD_REDUCE */ + { 0, 0, NULL }, /* OBM_BTNCORNERS */ + { check_boxes_width, check_boxes_height, + check_boxes_bits }, /* OBM_CHECKBOXES */ + { check_mark_width, check_mark_height, check_mark_bits }, /* OBM_CHECK */ + { 0, 0, NULL }, /* OBM_BTSIZE */ + { 0, 0, NULL }, /* OBM_OLD_LFARROW */ + { 0, 0, NULL }, /* OBM_OLD_RGARROW */ + { 0, 0, NULL }, /* OBM_OLD_DNARROW */ + { 0, 0, NULL }, /* OBM_OLD_UPARROW */ + { 0, 0, NULL }, /* OBM_SIZE */ + { 0, 0, NULL }, /* OBM_OLD_CLOSE */ +}; + +#endif /* USE_XPM */ + + +extern Colormap COLOR_WinColormap; + + +/*********************************************************************** + * OBM_LoadOEMBitmap + */ +HBITMAP OBM_LoadOEMBitmap( WORD id ) +{ + BITMAPOBJ * bmpObjPtr; + HBITMAP hbitmap; + WORD width, height, bpp; + Pixmap pixmap; + + if ((id < OBM_FIRST) || (id > OBM_LAST)) return 0; + id -= OBM_FIRST; +#ifdef USE_XPM + if (!OBM_Pixmaps_Data[id].data) return 0; + { + XpmAttributes attrs; + + attrs.valuemask = XpmColormap | XpmDepth; + attrs.colormap = COLOR_WinColormap; + if (OBM_Pixmaps_Data[id].color) attrs.depth = bpp = screenDepth; + else attrs.depth = bpp = 1; + + if (XpmCreatePixmapFromData( display, rootWindow, + OBM_Pixmaps_Data[id].data, + &pixmap, NULL, &attrs ) != XpmSuccess) + { + fprintf( stderr, "Error creating pixmap\n" ); + pixmap = 0; + } + else + { + width = attrs.width; + height = attrs.height; + } + } +#else + if (!OBM_Bitmaps_Data[id].data) return 0; + bpp = 1; + width = OBM_Bitmaps_Data[id].width; + height = OBM_Bitmaps_Data[id].height; + pixmap = XCreateBitmapFromData( display, rootWindow, + OBM_Bitmaps_Data[id].data, width, height ); +#endif /* USE_XPM */ + + if (!pixmap) return 0; + + /* Create the BITMAPOBJ */ + if (!(hbitmap = GDI_AllocObject( sizeof(BITMAPOBJ), BITMAP_MAGIC ))) + { + XFreePixmap( display, pixmap ); + return 0; + } + bmpObjPtr = (BITMAPOBJ *) GDI_HEAP_ADDR( hbitmap ); + bmpObjPtr->size.cx = 0; + bmpObjPtr->size.cy = 0; + bmpObjPtr->pixmap = pixmap; + bmpObjPtr->bitmap.bmType = 0; + bmpObjPtr->bitmap.bmWidth = width; + bmpObjPtr->bitmap.bmHeight = height; + bmpObjPtr->bitmap.bmWidthBytes = (width + 15) / 16 * 2; + bmpObjPtr->bitmap.bmPlanes = 1; + bmpObjPtr->bitmap.bmBitsPixel = bpp; + bmpObjPtr->bitmap.bmBits = NULL; + return hbitmap; +} + + diff --git a/rc/Imakefile b/rc/Imakefile index 74c70641a92..73836edb1b8 100644 --- a/rc/Imakefile +++ b/rc/Imakefile @@ -1,15 +1,21 @@ #include "../Wine.tmpl" +MODULE = rc + .SUFFIXES: .rc .rc.c: echo "#include \"windows.h\"" >$*.rct echo WINDOWS_H_ENDS_HERE >>$*.rct cat $< >>$*.rct - gcc -E -x c $(CFLAGS) $*.rct | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | winerc -v -p $* >$@ + gcc -E -x c $(CFLAGS) $*.rct | sed -e '1,/^WINDOWS_H_ENDS_HERE/d' | ./winerc -o $* -v -p $* $(RM) $*.rct -AllTarget(sysres.c) +RCSRCS = sysres.rc sysresbm.rc + +RCOBJS = $(RCSRCS:.rc=.o) + +WineRelocatableTarget($(TOP)/$(MODULE),,$(RCOBJS)) sysres.c: winerc $(TOP)/include/windows.h @@ -28,6 +34,8 @@ SRCS = \ OBJS = $(SRCS:.c=.o) +LOCAL_LIBRARIES = -lfl + depend:: rc.tab.c rc.tab.h lex.yy.c clean:: diff --git a/rc/rc.h b/rc/rc.h index d080882148a..5064c6037dd 100644 --- a/rc/rc.h +++ b/rc/rc.h @@ -89,6 +89,7 @@ gen_res *make_menu(gen_res*); gen_res *add_resource(gen_res*,gen_res*); void create_output(gen_res*); +void set_out_file(char*); #define CT_BUTTON 0x80 #define CT_EDIT 0x81 diff --git a/rc/rc.y b/rc/rc.y index bfdaafcf7ce..ee7fccfa87b 100644 --- a/rc/rc.y +++ b/rc/rc.y @@ -35,7 +35,7 @@ static char Copyright[] = "Copyright Martin von Loewis, 1994"; %type